@foodpilot/foods 2.12.1 → 2.12.2

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,7 +1,7 @@
1
- import{jsxs as r,jsx as o}from"react/jsx-runtime";import{useTheme as e,Stack as a,Typography as n,styled as l,TextareaAutosize as i}from"@mui/material";import{redTheme as t,greyTheme as s}from"../../themes/common/colors.js";const d=l=>{const i=e(),{value:d,onChange:u,onBlur:h,onFocus:p,placeholder:m,variant:g="primary",disabled:b=!1,error:x=!1,errorMessage:v,maxLength:C,minRows:w,maxRows:f=14,content:y}=l,E=void 0!==d,$=E?d.length:0,k=void 0!==C&&$>C,R=x||k,j=void 0!==C||void 0!==v,F=E?{value:d,onChange:r=>u?.(r.currentTarget.value)}:{defaultValue:y};/* @__PURE__ */
2
- return r(a,{gap:i.spacing(.5),width:"100%",children:[c(g,b,{...F,onBlur:h,onFocus:p,placeholder:m,disabled:b,minRows:w,maxRows:f,maxLength:C,$hasError:R}),j&&/* @__PURE__ */r(a,{flexDirection:"row",justifyContent:"space-between",gap:i.spacing(1),px:i.spacing(2.5),children:[
3
- /* @__PURE__ */o(n,{variant:"small-regular",color:R?t[600]:"transparent",sx:{minHeight:"1em"},children:R&&v?v:" "}),void 0!==C&&/* @__PURE__ */r(n,{variant:"small-regular",color:k?t[600]:s[1500],children:[$," / ",C]})]})]})},c=(r,e,a)=>{if(e)/* @__PURE__ */return o(g,{...a});switch(r){case"secondary":/* @__PURE__ */
1
+ import{jsxs as r,jsx as o}from"react/jsx-runtime";import{useTheme as e,Stack as a,Typography as n,styled as l,TextareaAutosize as t}from"@mui/material";import{redTheme as i,greyTheme as s}from"../../themes/common/colors.js";const d=l=>{const t=e(),{value:d,onChange:u,onBlur:h,onFocus:p,placeholder:m,variant:g="primary",disabled:b=!1,error:x=!1,errorMessage:v,maxLength:f,minRows:y,maxRows:C=14,content:w}=l,E=void 0!==d,$=E?d.length:0,k=void 0!==f&&$>f,F=x||k,R=void 0!==f||void 0!==v,j=E?{value:d,onChange:r=>u?.(r.currentTarget.value)}:{defaultValue:w};/* @__PURE__ */
2
+ return r(a,{gap:t.spacing(.5),width:"100%",children:[c(g,b,{...j,onBlur:h,onFocus:p,placeholder:m,disabled:b,minRows:y,maxRows:C,maxLength:f,$hasError:F}),R&&/* @__PURE__ */r(a,{flexDirection:"row",justifyContent:"space-between",gap:t.spacing(1),px:t.spacing(2.5),children:[
3
+ /* @__PURE__ */o(n,{variant:"small-regular",color:F?i[600]:"transparent",sx:{minHeight:"1em"},children:F&&v?v:" "}),void 0!==f&&/* @__PURE__ */r(n,{variant:"small-regular",color:k?i[600]:s[1500],children:[$," / ",f]})]})]})},c=(r,e,a)=>{if(e)/* @__PURE__ */return o(g,{...a});switch(r){case"secondary":/* @__PURE__ */
4
4
  return o(p,{...a});case"tertiary":/* @__PURE__ */
5
5
  return o(m,{...a});case"disabled":/* @__PURE__ */
6
6
  return o(g,{...a});default:/* @__PURE__ */
7
- return o(h,{...a})}},u=l(i,{shouldForwardProp:r=>"$hasError"!==r})(({theme:r,$hasError:o})=>({width:"100%",lineHeight:"22px",padding:"20px 24px 60px 24px",borderRadius:"12px",resize:"none",...r.typography.body,color:s[2800],borderColor:o?t[600]:s[500],"&:focus-visible":{outline:"0",borderColor:o?t[600]:s[2800]},...o&&{backgroundColor:t[100],color:t[600]}})),h=l(u)(({$hasError:r})=>({backgroundColor:r?t[100]:s[100]})),p=l(u)(({$hasError:r})=>({backgroundColor:r?t[100]:s[300]})),m=l(u)(({$hasError:r})=>({borderColor:r?t[600]:s[2800],backgroundColor:r?t[100]:s[100]})),g=l(u)({color:s[2e3],backgroundColor:s[500]});export{d as Textarea};
7
+ return o(h,{...a})}},u=l(t,{shouldForwardProp:r=>"$hasError"!==r})(({theme:r,$hasError:o})=>({width:"100%",lineHeight:"22px",padding:"20px 24px 60px 24px",borderRadius:"12px",resize:"none",...r.typography.body,fontFamily:r.typography.fontFamily,color:s[2800],borderColor:o?i[600]:s[500],"&:focus-visible":{outline:"0",borderColor:o?i[600]:s[2800]},...o&&{backgroundColor:i[100],color:i[600]}})),h=l(u)(({$hasError:r})=>({backgroundColor:r?i[100]:s[100]})),p=l(u)(({$hasError:r})=>({backgroundColor:r?i[100]:s[300]})),m=l(u)(({$hasError:r})=>({borderColor:r?i[600]:s[2800],backgroundColor:r?i[100]:s[100]})),g=l(u)({color:s[2e3],backgroundColor:s[500]});export{d as Textarea};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@foodpilot/foods",
3
3
  "private": false,
4
- "version": "2.12.1",
4
+ "version": "2.12.2",
5
5
  "type": "module",
6
6
  "main": "./dist/main.js",
7
7
  "module": "./dist/main.js",