@useloops/design-system 1.4.646 → 1.4.647

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.
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useTheme as r,Stack as i}from"@mui/material";import{mergeSx as n}from"merge-sx";import{useState as s,useEffect as a}from"react";import{Controller as l}from"react-hook-form";import{isValidPhoneNumber as m}from"react-phone-number-input";import c from"../../../AutocompleteField/AutocompleteField.js";import p from"../../../Checkbox/Checkbox.js";import"../../../Checkbox/StyledCheckbox.js";import f from"../../../CheckboxGroup/CheckboxGroup.js";import h from"../../../CreatableAutocomplete/CreatableAutocomplete.js";import u from"../../../CustomField/CustomField.js";import d from"../../../Differential/Differential.js";import x from"../../../Html/Html.js";import g from"../../../InputLabel/InputLabel.js";import j from"../../../Likert/Likert.js";import b from"../../../NumberField/NumberField.js";import S from"../../../RadioGroup/RadioGroup.js";import k from"../../../Rank/Rank.js";import v from"../../../RichTextField/RichTextField.js";import"../../../SelectItem/SelectItem.js";import T from"../../../Select/Select.js";import C from"../../../Slider/Slider.js";import y from"../../../StarRating/StarRating.js";import I from"../../../Switch/Switch.js";import R from"../../../Textarea/Textarea.js";import w from"../../../TextField/TextField.js";import F from"../StengthIndicator/StrengthIndicator.js";import A from"./components/InputWrapperHelperText/InputWrapperHelperText.js";const B={textfield:w,numberfield:b,textarea:R,creatableautocomplete:h,select:T,autocomplete:c,checkbox:p,checkboxGroup:f,switch:I,slider:C,starRating:y,differential:d,likert:j,radioGroup:S,ranking:k,richTextfield:v,customfield:u},G=(e,t)=>e.filter(e=>{if(e.includes("-value-")){const t=e.split("-value-")[1];return t&&t.length>0}return e!==t}).length,_=({fieldRef:c,name:p,fieldType:f,label:h,control:u,errors:d,labelProps:j,helperText:b,helpTextProps:S,validation:k,content:v,styleOverrides:T,defaultValue:C,onChange:y,watch:I,trigger:R,strengthIndicator:w,..._})=>{const{custom:H}=r(),L=void 0!==d&&Object.keys(d).length>0,[N,O]=s(0);a(()=>{w&&N>0&&R(p)},[N]);const $=k?.match?.field,D=I($);return a(()=>{$&&R(p)},[D,$,R,p]),e(i,{sx:n(T?.sxInputStack,_?.hidden&&{display:"none!important"}),gap:H.margin.sm,children:["switch"!==f?h&&t(g,{...j,children:h}):null,"html"===f&&v?t(x,{children:v}):e(o,{children:[t(l,{name:p,control:u,render:e=>function({field:{ref:e,...o}}){const r=B[f],i=e=>(e.name||e.value||"").replace(/-/g,"_").includes("none_of_these");let n=_;if(_.other?.enabled&&Array.isArray(_.options)){const e=_.options.findIndex(i);-1!==e&&(n={..._,options:_.options.filter((t,o)=>o!==e),noneOfTheseOption:_.options[e]})}return t(r,{...n,...o,inputRef:t=>{e(t),c&&(c.current=t)},..."switch"===f?{label:h}:{},..."autocomplete"===f?{onChange:(e,t)=>o.onChange(t)}:{}})}(e),rules:{...k,validate:e=>{if(k&&"phone"in k)return m(`+${I("extension")}${e}`)||k.phone.message;if(k&&"score"in k)return N<=k.score.value?k.score.message:void 0;if(k&&"white_space"in k)return!e.match(/^\s*$/g)||k.white_space.message;if(k&&"match"in k&&k?.match?.field)switch(k?.match?.comparison){case"not_eq":return e!=I(k.match.field)||k.match.message;case"gt":return e>I(k.match.field)||k.match.message;case"lt":return e<I(k.match.field)||k.match.message;default:return e===I(k.match.field)||k.match.message}if(k&&"minSelections"in k){const t=e;if(!(k.selectionsBypass&&t.includes(k.selectionsBypass))){const e=_.other?.enabled?_.other?.name||"other-option":void 0;if(G(t,e)<k.minSelections.value)return k.minSelections.message}}if(k&&"maxSelections"in k){const t=e;if(!(k.selectionsBypass&&t.includes(k.selectionsBypass))){const e=_.other?.enabled?_.other?.name||"other-option":void 0;if(G(t,e)>k.maxSelections.value)return k.maxSelections.message}}}}}),w&&t(F,{value:I(p),onChange:O})]}),e(o,{children:[Boolean(L)?t(A,{helperText:void 0,inputName:p,errors:d,showicon:!0}):null,Boolean(b)?t(A,{helperText:b,inputName:p,errors:void 0,...S}):null]})]})};export{_ as default};
1
+ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useTheme as r,Stack as i}from"@mui/material";import{mergeSx as n}from"merge-sx";import{useState as s,useEffect as a}from"react";import{Controller as l}from"react-hook-form";import{isValidPhoneNumber as m}from"react-phone-number-input";import c from"../../../AutocompleteField/AutocompleteField.js";import p from"../../../Checkbox/Checkbox.js";import"../../../Checkbox/StyledCheckbox.js";import f from"../../../CheckboxGroup/CheckboxGroup.js";import d from"../../../CreatableAutocomplete/CreatableAutocomplete.js";import h from"../../../CustomField/CustomField.js";import u from"../../../Differential/Differential.js";import x from"../../../Html/Html.js";import g from"../../../InputLabel/InputLabel.js";import b from"../../../Likert/Likert.js";import j from"../../../NumberField/NumberField.js";import S from"../../../RadioGroup/RadioGroup.js";import k from"../../../Rank/Rank.js";import v from"../../../RichTextField/RichTextField.js";import"../../../SelectItem/SelectItem.js";import T from"../../../Select/Select.js";import C from"../../../Slider/Slider.js";import y from"../../../StarRating/StarRating.js";import I from"../../../Switch/Switch.js";import R from"../../../Textarea/Textarea.js";import w from"../../../TextField/TextField.js";import F from"../StengthIndicator/StrengthIndicator.js";import A from"./components/InputWrapperHelperText/InputWrapperHelperText.js";const B={textfield:w,numberfield:j,textarea:R,creatableautocomplete:d,select:T,autocomplete:c,checkbox:p,checkboxGroup:f,switch:I,slider:C,starRating:y,differential:u,likert:b,radioGroup:S,ranking:k,richTextfield:v,customfield:h},G=(e,t)=>e.filter(e=>{if(e.includes("-value-")){const t=e.split("-value-")[1];return t&&t.length>0}return e!==t}).length,L=({fieldRef:c,name:p,fieldType:f,label:d,control:h,errors:u,labelProps:b,helperText:j,helpTextProps:S,validation:k,content:v,styleOverrides:T,defaultValue:C,onChange:y,watch:I,trigger:R,strengthIndicator:w,...L})=>{const{custom:_}=r(),H=void 0!==u&&Object.keys(u).length>0,N="checkbox"===f?"lg"===L.sizing?"48px":"40px":void 0,[O,$]=s(0);a(()=>{w&&O>0&&R(p)},[O]);const D=k?.match?.field,P=I(D);return a(()=>{D&&R(p)},[P,D,R,p]),e(i,{sx:n(T?.sxInputStack,L?.hidden&&{display:"none!important"}),gap:_.margin.sm,children:["switch"!==f?d&&t(g,{...b,children:d}):null,"html"===f&&v?t(x,{children:v}):e(o,{children:[t(l,{name:p,control:h,render:e=>function({field:{ref:e,...o}}){const r=B[f],i=e=>(e.name||e.value||"").replace(/-/g,"_").includes("none_of_these");let n=L;if(L.other?.enabled&&Array.isArray(L.options)){const e=L.options.findIndex(i);-1!==e&&(n={...L,options:L.options.filter((t,o)=>o!==e),noneOfTheseOption:L.options[e]})}return t(r,{...n,...o,inputRef:t=>{e(t),c&&(c.current=t)},..."switch"===f?{label:d}:{},..."autocomplete"===f?{onChange:(e,t)=>o.onChange(t)}:{}})}(e),rules:{...k,validate:e=>{if(k&&"phone"in k)return m(`+${I("extension")}${e}`)||k.phone.message;if(k&&"score"in k)return O<=k.score.value?k.score.message:void 0;if(k&&"white_space"in k)return!e.match(/^\s*$/g)||k.white_space.message;if(k&&"match"in k&&k?.match?.field)switch(k?.match?.comparison){case"not_eq":return e!=I(k.match.field)||k.match.message;case"gt":return e>I(k.match.field)||k.match.message;case"lt":return e<I(k.match.field)||k.match.message;default:return e===I(k.match.field)||k.match.message}if(k&&"minSelections"in k){const t=e;if(!(k.selectionsBypass&&t.includes(k.selectionsBypass))){const e=L.other?.enabled?L.other?.name||"other-option":void 0;if(G(t,e)<k.minSelections.value)return k.minSelections.message}}if(k&&"maxSelections"in k){const t=e;if(!(k.selectionsBypass&&t.includes(k.selectionsBypass))){const e=L.other?.enabled?L.other?.name||"other-option":void 0;if(G(t,e)>k.maxSelections.value)return k.maxSelections.message}}}}}),w&&t(F,{value:I(p),onChange:$})]}),e(o,{children:[Boolean(H)?t(A,{helperText:void 0,inputName:p,errors:u,showicon:!0,paddingLeft:N}):null,Boolean(j)?t(A,{helperText:j,inputName:p,errors:void 0,paddingLeft:N,...S}):null]})]})};export{L as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{ErrorMessage as r}from"@hookform/error-message";import t from"../../../../../InputLabelHelp/InputLabelHelp.js";const o=({helperText:o,inputName:n,errors:a,...s})=>{const l=Boolean(a&&a[n]);return l?e(r,{errors:a,name:n,render:({message:r})=>e(t,{showicon:!!r,state:"negative",children:r})}):o&&!l?e(t,{state:"default",...s,children:o}):null};export{o as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{ErrorMessage as r}from"@hookform/error-message";import t from"../../../../../InputLabelHelp/InputLabelHelp.js";const o=({helperText:o,inputName:n,errors:a,paddingLeft:s,...p})=>{const i=Boolean(a&&a[n]);return i?e(r,{errors:a,name:n,render:({message:r})=>e(t,{showicon:!!r,state:"negative",paddingLeft:s,children:r})}):o&&!i?e(t,{state:"default",paddingLeft:s,...p,children:o}):null};export{o as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{Info as s,ErrorOutline as i,Check as r}from"@mui/icons-material";import{useTheme as l,Box as a}from"@mui/material";import{iconSizeMap as n}from"../../BrandCore/Icon/Icon.js";import o from"../InputLabelBase/InputLabelBase.js";import{typographyVariantMap as m}from"../utils/typography.util.js";const c=c=>{const{icon:d=null,state:u="default",disabled:p,showicon:x=!0}=c,f=l();return e(a,{sx:{display:"inline-flex",alignItems:"center",color:p?f.custom.palette.text.disabled:(()=>{switch(u){case"disabled":return f.custom.palette.text.disabled;case"positive":return f.custom.palette.text.positive;case"negative":return f.custom.palette.text.negative;default:return f.custom.palette.text.secondary}})(),"& svg":{marginRight:f.spacing(f.custom.margin.xs),width:n.xs,height:n.xs,color:"inherit"}},children:[(()=>{if(!x)return null;if(d)return d;switch(u){case"disabled":default:return t(a,{sx:{height:20,display:"flex",alignItems:"center",alignSelf:"flex-start"},children:t(s,{})});case"positive":return t(a,{sx:{height:20,display:"flex",alignItems:"center",alignSelf:"flex-start"},children:t(r,{})});case"negative":return t(a,{sx:{height:20,display:"flex",alignItems:"center",alignSelf:"flex-start"},children:t(i,{})})}})(),t(o,{...c,sx:{fontSize:{xs:m.sm.body.sm,sm:m.sm.body.sm,md:m.sm.body.sm,lg:m.lg.body.sm,xl:m.lg.body.sm}}})]})};export{c as default};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{InfoOutlined as s,ErrorOutline as i,Check as r}from"@mui/icons-material";import{useTheme as a,Box as l}from"@mui/material";import{iconSizeMap as n}from"../../BrandCore/Icon/Icon.js";import o from"../InputLabelBase/InputLabelBase.js";import{typographyVariantMap as m}from"../utils/typography.util.js";const d=d=>{const{icon:c=null,state:u="default",disabled:p,showicon:f=!0,paddingLeft:g}=d,x=a();return e(l,{sx:{display:"inline-flex",alignItems:"center",paddingLeft:g,color:p?x.custom.palette.text.disabled:(()=>{switch(u){case"disabled":return x.custom.palette.text.disabled;case"positive":return x.custom.palette.text.positive;case"negative":return x.custom.palette.text.negative;default:return x.custom.palette.text.secondary}})(),"& svg":{marginRight:x.spacing(x.custom.margin.xs),width:n.xs,height:n.xs,color:"inherit"}},children:[(()=>{if(!f)return null;if(c)return c;switch(u){case"disabled":default:return t(l,{sx:{height:20,display:"flex",alignItems:"center",alignSelf:"flex-start"},children:t(s,{})});case"positive":return t(l,{sx:{height:20,display:"flex",alignItems:"center",alignSelf:"flex-start"},children:t(r,{})});case"negative":return t(l,{sx:{height:20,display:"flex",alignItems:"center",alignSelf:"flex-start"},children:t(i,{})})}})(),t(o,{...d,sx:{fontSize:{xs:m.sm.body.sm,sm:m.sm.body.sm,md:m.sm.body.sm,lg:m.lg.body.sm,xl:m.lg.body.sm}}})]})};export{d as default};
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("@mui/material"),t=require("merge-sx"),i=require("react"),s=require("react-hook-form"),n=require("react-phone-number-input"),o=require("../../../AutocompleteField/AutocompleteField.js"),a=require("../../../Checkbox/Checkbox.js");require("../../../Checkbox/StyledCheckbox.js");var l=require("../../../CheckboxGroup/CheckboxGroup.js"),c=require("../../../CreatableAutocomplete/CreatableAutocomplete.js"),u=require("../../../CustomField/CustomField.js"),m=require("../../../Differential/Differential.js"),h=require("../../../Html/Html.js"),d=require("../../../InputLabel/InputLabel.js"),p=require("../../../Likert/Likert.js"),f=require("../../../NumberField/NumberField.js"),x=require("../../../RadioGroup/RadioGroup.js"),j=require("../../../Rank/Rank.js"),g=require("../../../RichTextField/RichTextField.js");require("../../../SelectItem/SelectItem.js");var q=require("../../../Select/Select.js"),b=require("../../../Slider/Slider.js"),S=require("../../../StarRating/StarRating.js"),v=require("../../../Switch/Switch.js"),k=require("../../../Textarea/Textarea.js"),T=require("../../../TextField/TextField.js"),C=require("../StengthIndicator/StrengthIndicator.js"),F=require("./components/InputWrapperHelperText/InputWrapperHelperText.js");const y={textfield:T,numberfield:f,textarea:k,creatableautocomplete:c,select:q,autocomplete:o,checkbox:a,checkboxGroup:l,switch:v,slider:b,starRating:S,differential:m,likert:p,radioGroup:x,ranking:j,richTextfield:g,customfield:u},I=(e,r)=>e.filter(e=>{if(e.includes("-value-")){const r=e.split("-value-")[1];return r&&r.length>0}return e!==r}).length;module.exports=({fieldRef:o,name:a,fieldType:l,label:c,control:u,errors:m,labelProps:p,helperText:f,helpTextProps:x,validation:j,content:g,styleOverrides:q,defaultValue:b,onChange:S,watch:v,trigger:k,strengthIndicator:T,...R})=>{const{custom:w}=r.useTheme(),A=void 0!==m&&Object.keys(m).length>0,[B,G]=i.useState(0);i.useEffect(()=>{T&&B>0&&k(a)},[B]);const _=j?.match?.field,N=v(_);return i.useEffect(()=>{_&&k(a)},[N,_,k,a]),e.jsxs(r.Stack,{sx:t.mergeSx(q?.sxInputStack,R?.hidden&&{display:"none!important"}),gap:w.margin.sm,children:["switch"!==l?c&&e.jsx(d,{...p,children:c}):null,"html"===l&&g?e.jsx(h,{children:g}):e.jsxs(e.Fragment,{children:[e.jsx(s.Controller,{name:a,control:u,render:r=>function({field:{ref:r,...t}}){const i=y[l],s=e=>(e.name||e.value||"").replace(/-/g,"_").includes("none_of_these");let n=R;if(R.other?.enabled&&Array.isArray(R.options)){const e=R.options.findIndex(s);-1!==e&&(n={...R,options:R.options.filter((r,t)=>t!==e),noneOfTheseOption:R.options[e]})}return e.jsx(i,{...n,...t,inputRef:e=>{r(e),o&&(o.current=e)},..."switch"===l?{label:c}:{},..."autocomplete"===l?{onChange:(e,r)=>t.onChange(r)}:{}})}(r),rules:{...j,validate:e=>{if(j&&"phone"in j)return n.isValidPhoneNumber(`+${v("extension")}${e}`)||j.phone.message;if(j&&"score"in j)return B<=j.score.value?j.score.message:void 0;if(j&&"white_space"in j)return!e.match(/^\s*$/g)||j.white_space.message;if(j&&"match"in j&&j?.match?.field)switch(j?.match?.comparison){case"not_eq":return e!=v(j.match.field)||j.match.message;case"gt":return e>v(j.match.field)||j.match.message;case"lt":return e<v(j.match.field)||j.match.message;default:return e===v(j.match.field)||j.match.message}if(j&&"minSelections"in j){const r=e;if(!(j.selectionsBypass&&r.includes(j.selectionsBypass))){const e=R.other?.enabled?R.other?.name||"other-option":void 0;if(I(r,e)<j.minSelections.value)return j.minSelections.message}}if(j&&"maxSelections"in j){const r=e;if(!(j.selectionsBypass&&r.includes(j.selectionsBypass))){const e=R.other?.enabled?R.other?.name||"other-option":void 0;if(I(r,e)>j.maxSelections.value)return j.maxSelections.message}}}}}),T&&e.jsx(C,{value:v(a),onChange:G})]}),e.jsxs(e.Fragment,{children:[Boolean(A)?e.jsx(F,{helperText:void 0,inputName:a,errors:m,showicon:!0}):null,Boolean(f)?e.jsx(F,{helperText:f,inputName:a,errors:void 0,...x}):null]})]})};
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("@mui/material"),r=require("merge-sx"),i=require("react"),n=require("react-hook-form"),s=require("react-phone-number-input"),o=require("../../../AutocompleteField/AutocompleteField.js"),a=require("../../../Checkbox/Checkbox.js");require("../../../Checkbox/StyledCheckbox.js");var l=require("../../../CheckboxGroup/CheckboxGroup.js"),c=require("../../../CreatableAutocomplete/CreatableAutocomplete.js"),u=require("../../../CustomField/CustomField.js"),h=require("../../../Differential/Differential.js"),m=require("../../../Html/Html.js"),d=require("../../../InputLabel/InputLabel.js"),p=require("../../../Likert/Likert.js"),f=require("../../../NumberField/NumberField.js"),x=require("../../../RadioGroup/RadioGroup.js"),g=require("../../../Rank/Rank.js"),j=require("../../../RichTextField/RichTextField.js");require("../../../SelectItem/SelectItem.js");var q=require("../../../Select/Select.js"),b=require("../../../Slider/Slider.js"),S=require("../../../StarRating/StarRating.js"),v=require("../../../Switch/Switch.js"),k=require("../../../Textarea/Textarea.js"),T=require("../../../TextField/TextField.js"),C=require("../StengthIndicator/StrengthIndicator.js"),F=require("./components/InputWrapperHelperText/InputWrapperHelperText.js");const y={textfield:T,numberfield:f,textarea:k,creatableautocomplete:c,select:q,autocomplete:o,checkbox:a,checkboxGroup:l,switch:v,slider:b,starRating:S,differential:h,likert:p,radioGroup:x,ranking:g,richTextfield:j,customfield:u},I=(e,t)=>e.filter(e=>{if(e.includes("-value-")){const t=e.split("-value-")[1];return t&&t.length>0}return e!==t}).length;module.exports=({fieldRef:o,name:a,fieldType:l,label:c,control:u,errors:h,labelProps:p,helperText:f,helpTextProps:x,validation:g,content:j,styleOverrides:q,defaultValue:b,onChange:S,watch:v,trigger:k,strengthIndicator:T,...R})=>{const{custom:w}=t.useTheme(),A=void 0!==h&&Object.keys(h).length>0,B="checkbox"===l?"lg"===R.sizing?"48px":"40px":void 0,[G,L]=i.useState(0);i.useEffect(()=>{T&&G>0&&k(a)},[G]);const _=g?.match?.field,N=v(_);return i.useEffect(()=>{_&&k(a)},[N,_,k,a]),e.jsxs(t.Stack,{sx:r.mergeSx(q?.sxInputStack,R?.hidden&&{display:"none!important"}),gap:w.margin.sm,children:["switch"!==l?c&&e.jsx(d,{...p,children:c}):null,"html"===l&&j?e.jsx(m,{children:j}):e.jsxs(e.Fragment,{children:[e.jsx(n.Controller,{name:a,control:u,render:t=>function({field:{ref:t,...r}}){const i=y[l],n=e=>(e.name||e.value||"").replace(/-/g,"_").includes("none_of_these");let s=R;if(R.other?.enabled&&Array.isArray(R.options)){const e=R.options.findIndex(n);-1!==e&&(s={...R,options:R.options.filter((t,r)=>r!==e),noneOfTheseOption:R.options[e]})}return e.jsx(i,{...s,...r,inputRef:e=>{t(e),o&&(o.current=e)},..."switch"===l?{label:c}:{},..."autocomplete"===l?{onChange:(e,t)=>r.onChange(t)}:{}})}(t),rules:{...g,validate:e=>{if(g&&"phone"in g)return s.isValidPhoneNumber(`+${v("extension")}${e}`)||g.phone.message;if(g&&"score"in g)return G<=g.score.value?g.score.message:void 0;if(g&&"white_space"in g)return!e.match(/^\s*$/g)||g.white_space.message;if(g&&"match"in g&&g?.match?.field)switch(g?.match?.comparison){case"not_eq":return e!=v(g.match.field)||g.match.message;case"gt":return e>v(g.match.field)||g.match.message;case"lt":return e<v(g.match.field)||g.match.message;default:return e===v(g.match.field)||g.match.message}if(g&&"minSelections"in g){const t=e;if(!(g.selectionsBypass&&t.includes(g.selectionsBypass))){const e=R.other?.enabled?R.other?.name||"other-option":void 0;if(I(t,e)<g.minSelections.value)return g.minSelections.message}}if(g&&"maxSelections"in g){const t=e;if(!(g.selectionsBypass&&t.includes(g.selectionsBypass))){const e=R.other?.enabled?R.other?.name||"other-option":void 0;if(I(t,e)>g.maxSelections.value)return g.maxSelections.message}}}}}),T&&e.jsx(C,{value:v(a),onChange:L})]}),e.jsxs(e.Fragment,{children:[Boolean(A)?e.jsx(F,{helperText:void 0,inputName:a,errors:h,showicon:!0,paddingLeft:B}):null,Boolean(f)?e.jsx(F,{helperText:f,inputName:a,errors:void 0,paddingLeft:B,...x}):null]})]})};
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("@hookform/error-message"),s=require("../../../../../InputLabelHelp/InputLabelHelp.js");module.exports=({helperText:t,inputName:a,errors:n,...o})=>{const l=Boolean(n&&n[a]);return l?e.jsx(r.ErrorMessage,{errors:n,name:a,render:({message:r})=>e.jsx(s,{showicon:!!r,state:"negative",children:r})}):t&&!l?e.jsx(s,{state:"default",...o,children:t}):null};
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("@hookform/error-message"),s=require("../../../../../InputLabelHelp/InputLabelHelp.js");module.exports=({helperText:t,inputName:a,errors:n,paddingLeft:o,...i})=>{const l=Boolean(n&&n[a]);return l?e.jsx(r.ErrorMessage,{errors:n,name:a,render:({message:r})=>e.jsx(s,{showicon:!!r,state:"negative",paddingLeft:o,children:r})}):t&&!l?e.jsx(s,{state:"default",paddingLeft:o,...i,children:t}):null};
@@ -8,6 +8,7 @@ interface InputLabelHelpProps {
8
8
  children?: ReactNode;
9
9
  disabled?: boolean;
10
10
  required?: boolean;
11
+ paddingLeft?: string | number;
11
12
  }
12
13
  declare const InputLabelHelp: FunctionComponent<InputLabelHelpProps>;
13
14
 
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("@mui/icons-material"),s=require("@mui/material"),a=require("../../BrandCore/Icon/Icon.js"),i=require("../InputLabelBase/InputLabelBase.js"),r=require("../utils/typography.util.js");module.exports=l=>{const{icon:n=null,state:o="default",disabled:u,showicon:c=!0}=l,x=s.useTheme();return e.jsxs(s.Box,{sx:{display:"inline-flex",alignItems:"center",color:u?x.custom.palette.text.disabled:(()=>{switch(o){case"disabled":return x.custom.palette.text.disabled;case"positive":return x.custom.palette.text.positive;case"negative":return x.custom.palette.text.negative;default:return x.custom.palette.text.secondary}})(),"& svg":{marginRight:x.spacing(x.custom.margin.xs),width:a.iconSizeMap.xs,height:a.iconSizeMap.xs,color:"inherit"}},children:[(()=>{if(!c)return null;if(n)return n;switch(o){case"disabled":default:return e.jsx(s.Box,{sx:{height:20,display:"flex",alignItems:"center",alignSelf:"flex-start"},children:e.jsx(t.Info,{})});case"positive":return e.jsx(s.Box,{sx:{height:20,display:"flex",alignItems:"center",alignSelf:"flex-start"},children:e.jsx(t.Check,{})});case"negative":return e.jsx(s.Box,{sx:{height:20,display:"flex",alignItems:"center",alignSelf:"flex-start"},children:e.jsx(t.ErrorOutline,{})})}})(),e.jsx(i,{...l,sx:{fontSize:{xs:r.typographyVariantMap.sm.body.sm,sm:r.typographyVariantMap.sm.body.sm,md:r.typographyVariantMap.sm.body.sm,lg:r.typographyVariantMap.lg.body.sm,xl:r.typographyVariantMap.lg.body.sm}}})]})};
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("@mui/icons-material"),s=require("@mui/material"),a=require("../../BrandCore/Icon/Icon.js"),i=require("../InputLabelBase/InputLabelBase.js"),r=require("../utils/typography.util.js");module.exports=n=>{const{icon:l=null,state:o="default",disabled:u,showicon:c=!0,paddingLeft:p}=n,d=s.useTheme();return e.jsxs(s.Box,{sx:{display:"inline-flex",alignItems:"center",paddingLeft:p,color:u?d.custom.palette.text.disabled:(()=>{switch(o){case"disabled":return d.custom.palette.text.disabled;case"positive":return d.custom.palette.text.positive;case"negative":return d.custom.palette.text.negative;default:return d.custom.palette.text.secondary}})(),"& svg":{marginRight:d.spacing(d.custom.margin.xs),width:a.iconSizeMap.xs,height:a.iconSizeMap.xs,color:"inherit"}},children:[(()=>{if(!c)return null;if(l)return l;switch(o){case"disabled":default:return e.jsx(s.Box,{sx:{height:20,display:"flex",alignItems:"center",alignSelf:"flex-start"},children:e.jsx(t.InfoOutlined,{})});case"positive":return e.jsx(s.Box,{sx:{height:20,display:"flex",alignItems:"center",alignSelf:"flex-start"},children:e.jsx(t.Check,{})});case"negative":return e.jsx(s.Box,{sx:{height:20,display:"flex",alignItems:"center",alignSelf:"flex-start"},children:e.jsx(t.ErrorOutline,{})})}})(),e.jsx(i,{...n,sx:{fontSize:{xs:r.typographyVariantMap.sm.body.sm,sm:r.typographyVariantMap.sm.body.sm,md:r.typographyVariantMap.sm.body.sm,lg:r.typographyVariantMap.lg.body.sm,xl:r.typographyVariantMap.lg.body.sm}}})]})};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useloops/design-system",
3
- "version": "1.4.646",
3
+ "version": "1.4.647",
4
4
  "description": "The official React based Loops design system",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/esm/index.js",