@useloops/design-system 1.4.645 → 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.
- package/dist/esm/systems/WebCore/CheckboxGroup/CheckboxGroup.js +1 -1
- package/dist/esm/systems/WebCore/FormGenerator/components/InputWrapper/InputWrapper.js +1 -1
- package/dist/esm/systems/WebCore/FormGenerator/components/InputWrapper/components/InputWrapperHelperText/InputWrapperHelperText.js +1 -1
- package/dist/esm/systems/WebCore/InputLabelHelp/InputLabelHelp.js +1 -1
- package/dist/systems/WebCore/CheckboxGroup/CheckboxGroup.js +1 -1
- package/dist/systems/WebCore/FormGenerator/components/InputWrapper/InputWrapper.js +1 -1
- package/dist/systems/WebCore/FormGenerator/components/InputWrapper/components/InputWrapperHelperText/InputWrapperHelperText.js +1 -1
- package/dist/systems/WebCore/InputLabelHelp/InputLabelHelp.d.ts +1 -0
- package/dist/systems/WebCore/InputLabelHelp/InputLabelHelp.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as l,Fragment as t}from"react/jsx-runtime";import{FormGroup as o,Box as i}from"@mui/material";import{useMemo as n}from"react";import r from"../FormControlLabel/FormControlLabel.js";import a from"../Checkbox/StyledCheckbox.js";import
|
|
1
|
+
import{jsx as e,jsxs as l,Fragment as t}from"react/jsx-runtime";import{FormGroup as o,Box as i}from"@mui/material";import{useMemo as n}from"react";import r from"../FormControlLabel/FormControlLabel.js";import a from"../Checkbox/StyledCheckbox.js";import c from"../TextField/TextField.js";const s=({sizing:s,options:u,other:d,internalChange:h,value:m,inputRef:f,onChange:p,maxSelections:b,noneOfTheseOption:g})=>{const x=d?.name||"other-option",C=g?.value||"none-of-these-option",v=`${x}-value-`,k=e=>`${v}${e}`,M=d?.enabled,F=m?.includes(x)&&M,j=m?.find(e=>e.includes(v)),y=n(()=>m?m.filter(e=>!e.startsWith(v)).length:0,[m,v]),z=!!b&&y>=b;if(!m)return e("div",{});const S=(e,l)=>{const t=m.includes(e);if(!t&&z&&!l)return;let o;t?o=m.filter(l=>l!==e):l?o=[e]:(o=[...new Set(m),e],o=o.filter(e=>!u.find(l=>l?.exclusive&&e===l.value)),g&&(o=o.filter(e=>e!==C))),d?.enabled&&(l?o=o.filter(e=>e!==x&&!e.includes(v)):e===x&&t&&(o=o.filter(e=>!e.includes(v)))),p(o),h&&h()},T=(e,l)=>!l&&(z&&!m.includes(e));return l(t,{children:[l(o,{sx:{display:"flex",gap:e=>e.custom.margin.sm,label:{"&:last-child":{mb:0},"&:not(.Mui-disabled):hover":{"& .MuiCheckbox-root":{backgroundColor:e=>e.custom.palette.interaction.hover,"&.Mui-checked":{backgroundColor:e=>e.custom.palette.purple[500]}}}}},children:[u?.map(l=>{const t=l.value,o=T(t,l.exclusive);return e(r,{sx:{"& .MuiButtonBase-root.MuiCheckbox-root":{alignSelf:"baseline"},"& .MuiTypography-root":{mt:"default"!==s?.5:0}},onChange:()=>S(t,l.exclusive),checked:m.includes(t),disabled:o,control:e(a,{sizing:s,disabled:o}),label:l.label},t)}),M&&e(r,{inputRef:f,onChange:()=>S(x),label:d?.label||"Other",checked:m.includes(x),disabled:T(x),control:e(a,{sizing:s})},x),g&&e(r,{onChange:()=>S(C,!0),checked:m.includes(C),control:e(a,{sizing:s}),label:g.label},C)]}),F&&e(i,{sx:{mt:1},children:e(c,{fullWidth:!0,autoFocus:!0,defaultValue:j?j.replace(v,""):"",placeholder:d?.placeholder,onChange:e=>{const l=m.find(e=>e.includes(v)),t=(l?m.map(l=>l.includes(v)?k(e.target.value):l):[...m,k(e.target.value)]).filter(e=>e!==v);p(t),h&&h()},required:!0})})]})};export{s as default};
|
|
@@ -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
|
|
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,...
|
|
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{
|
|
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"),l=require("@mui/material"),i=require("react"),
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),l=require("@mui/material"),i=require("react"),t=require("../FormControlLabel/FormControlLabel.js"),n=require("../Checkbox/StyledCheckbox.js"),r=require("../TextField/TextField.js");module.exports=({sizing:o,options:s,other:a,internalChange:u,value:c,inputRef:d,onChange:h,maxSelections:x,noneOfTheseOption:b})=>{const f=a?.name||"other-option",m=b?.value||"none-of-these-option",p=`${f}-value-`,g=e=>`${p}${e}`,j=a?.enabled,v=c?.includes(f)&&j,C=c?.find(e=>e.includes(p)),k=i.useMemo(()=>c?c.filter(e=>!e.startsWith(p)).length:0,[c,p]),q=!!x&&k>=x;if(!c)return e.jsx("div",{});const F=(e,l)=>{const i=c.includes(e);if(!i&&q&&!l)return;let t;i?t=c.filter(l=>l!==e):l?t=[e]:(t=[...new Set(c),e],t=t.filter(e=>!s.find(l=>l?.exclusive&&e===l.value)),b&&(t=t.filter(e=>e!==m))),a?.enabled&&(l?t=t.filter(e=>e!==f&&!e.includes(p)):e===f&&i&&(t=t.filter(e=>!e.includes(p)))),h(t),u&&u()},M=(e,l)=>!l&&(q&&!c.includes(e));return e.jsxs(e.Fragment,{children:[e.jsxs(l.FormGroup,{sx:{display:"flex",gap:e=>e.custom.margin.sm,label:{"&:last-child":{mb:0},"&:not(.Mui-disabled):hover":{"& .MuiCheckbox-root":{backgroundColor:e=>e.custom.palette.interaction.hover,"&.Mui-checked":{backgroundColor:e=>e.custom.palette.purple[500]}}}}},children:[s?.map(l=>{const i=l.value,r=M(i,l.exclusive);return e.jsx(t,{sx:{"& .MuiButtonBase-root.MuiCheckbox-root":{alignSelf:"baseline"},"& .MuiTypography-root":{mt:"default"!==o?.5:0}},onChange:()=>F(i,l.exclusive),checked:c.includes(i),disabled:r,control:e.jsx(n,{sizing:o,disabled:r}),label:l.label},i)}),j&&e.jsx(t,{inputRef:d,onChange:()=>F(f),label:a?.label||"Other",checked:c.includes(f),disabled:M(f),control:e.jsx(n,{sizing:o})},f),b&&e.jsx(t,{onChange:()=>F(m,!0),checked:c.includes(m),control:e.jsx(n,{sizing:o}),label:b.label},m)]}),v&&e.jsx(l.Box,{sx:{mt:1},children:e.jsx(r,{fullWidth:!0,autoFocus:!0,defaultValue:C?C.replace(p,""):"",placeholder:a?.placeholder,onChange:e=>{const l=c.find(e=>e.includes(p)),i=(l?c.map(l=>l.includes(p)?g(e.target.value):l):[...c,g(e.target.value)]).filter(e=>e!==p);h(i),u&&u()},required:!0})})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),
|
|
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,...
|
|
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};
|
|
@@ -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=
|
|
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}}})]})};
|