@foodpilot/foods 2.25.0 → 2.25.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.
- package/dist/components/ActionPlan/ActionPlanIndicatorBreakdownPopover.js +12 -11
- package/dist/components/ActionPlan/ActionPlanNetImpactBody.js +6 -6
- package/dist/components/Number/NumberWithUnit.js +1 -1
- package/dist/components/Select/FoodsSelect/Options/SelectOptions.js +6 -6
- package/dist/components/Select/FoodsSelect/Select.js +3 -3
- package/package.json +1 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import{jsxs as
|
|
2
|
-
return
|
|
3
|
-
/* @__PURE__ */
|
|
4
|
-
/* @__PURE__ */
|
|
5
|
-
/* @__PURE__ */
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */
|
|
9
|
-
/* @__PURE__ */
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
/* @__PURE__ */
|
|
1
|
+
import{jsxs as r,Fragment as e,jsx as o}from"react/jsx-runtime";import{useTheme as a,IconButton as i,Popover as l,Box as t,Typography as n,Stack as c}from"@mui/material";import s from"@mui/icons-material/InfoOutlined";import{useState as d}from"react";const m=m=>{const{title:p,lines:u,totalLabel:g,totalFormattedValue:x,totalUnit:b,totalColor:f,ariaLabel:h}=m,y=a(),[z,v]=d(null),S=null!==z;/* @__PURE__ */
|
|
2
|
+
return r(e,{children:[
|
|
3
|
+
/* @__PURE__ */o(i,{size:"small",onClick:r=>{v(S?null:r.currentTarget)},"aria-label":h,"aria-expanded":S,sx:{padding:0,marginLeft:y.spacing(.5)},children:/* @__PURE__ */o(s,{fontSize:"small"})}),
|
|
4
|
+
/* @__PURE__ */o(l,{open:S,anchorEl:z,onClose:()=>v(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},slotProps:{paper:{sx:{padding:y.spacing(1),borderRadius:y.spacing(1),border:`1px solid ${y.custom.grey[600]}`,boxShadow:"0px 4px 20px 0px rgba(81, 78, 78, 0.12)"}}},children:/* @__PURE__ */r(t,{sx:{display:"flex",flexDirection:"column",gap:y.spacing(.5)},children:[
|
|
5
|
+
/* @__PURE__ */o(n,{variant:"small-regular",sx:{color:y.custom.grey[2e3]},children:p}),
|
|
6
|
+
/* @__PURE__ */o(c,{gap:y.spacing(.5),children:u.map(e=>/* @__PURE__ */r(c,{direction:"row",justifyContent:"space-between",gap:1,children:[
|
|
7
|
+
/* @__PURE__ */o(n,{variant:"body-regular",sx:{fontSize:"0.75rem",color:y.custom.grey[2500]},children:e.label}),
|
|
8
|
+
/* @__PURE__ */o(n,{variant:"body-medium",sx:{fontSize:"0.75rem",color:e.color},children:e.formattedValue})]},e.label))}),
|
|
9
|
+
/* @__PURE__ */o(t,{sx:{borderTop:`1px solid ${y.custom.grey[600]}`}}),
|
|
10
|
+
/* @__PURE__ */r(c,{direction:"row",justifyContent:"space-between",gap:1,children:[
|
|
11
|
+
/* @__PURE__ */o(n,{variant:"body-regular",sx:{fontSize:"0.75rem"},children:g}),
|
|
12
|
+
/* @__PURE__ */r(n,{variant:"body-medium",sx:{fontSize:"0.75rem",color:f},children:[x," ",b]})]})]})})]})};export{m as ActionPlanIndicatorBreakdownPopover};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{jsxs as e,jsx as
|
|
2
|
-
return e(
|
|
3
|
-
/* @__PURE__ */
|
|
4
|
-
/* @__PURE__ */e(a,{sx:{display:"flex",alignItems:"
|
|
5
|
-
/* @__PURE__ */
|
|
6
|
-
/* @__PURE__ */
|
|
1
|
+
import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useTheme as t,Stack as i,Typography as n,Box as a}from"@mui/material";const l=l=>{const{message:c,formattedValue:o,unit:s,valueColor:m}=l,g=t();/* @__PURE__ */
|
|
2
|
+
return e(i,{alignItems:"center",justifyContent:"center",sx:{flex:1,minHeight:g.spacing(20),textAlign:"center",padding:g.spacing(2),gap:g.spacing(1)},children:[
|
|
3
|
+
/* @__PURE__ */r(n,{variant:"small-bold",color:"text.primary",children:c}),
|
|
4
|
+
/* @__PURE__ */e(a,{sx:{display:"flex",alignItems:"flex-end",gap:g.spacing(1)},children:[
|
|
5
|
+
/* @__PURE__ */r(n,{variant:"number-big",sx:{color:m??g.palette.text.primary},children:o??"—"}),
|
|
6
|
+
/* @__PURE__ */r(n,{variant:"big-regular",sx:{color:g.custom.grey[2e3]},children:s})]})]})};export{l as ActionPlanNetImpactBody};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useTheme as t,Stack as n,Box as r,Typography as o}from"@mui/material";import{FoodsIcon as l}from"../Icons/FoodsIcon.js";const a=a=>{const s=t(),{withPlus:m=!1,value:u,unit:c,size:d="small",position:p="default-side",colorOverride:f,hideUnitOnNull:g=!1,emptyLabel:h,unitVariant:b}=a,y=`number-${d}`,x="micro"===d||"small"===d,v=x?s.custom.numberWithUnit.unitOffset.compact:s.custom.numberWithUnit.unitOffset.regular,z=s.custom.numberWithUnit.emptyIndicator[d],I=null===u&&g,w="string"==typeof u||null===u?u:s.numbers.valueFormatterFn(u),O=b??(x?"small-medium":"body-medium"),U="default-side"===p?null===u?"flex-end":"baseline":"below-center-aligned"===p?"center":"flex-start";/* @__PURE__ */
|
|
2
|
-
return e(n,{display:"inline-flex",direction:"default-side"===p?"row":"column",gap:x?s.spacing(.5):s.spacing(1),alignItems:U,children:[null===u?/* @__PURE__ */i(r,{role:void 0===h?void 0:"img","aria-label":h,"aria-hidden":void 0===h,sx:{alignItems:"center",backgroundColor:s.custom.grey[400],borderRadius:s.spacing(.5),color:s.custom.grey[1400],display:"flex",flexShrink:0,height:z.size,justifyContent:"center",width:z.size},children:/* @__PURE__ */i(l,{icon:"empty",size:z.iconSize})}):/* @__PURE__ */e(o,{variant:y,color:f,children:[m&&Number(u)>0?"+":"",w]}),!1===I&&/* @__PURE__ */i(o,{sx:{marginTop:`${v} !important`},variant:O,color:s.custom.grey[
|
|
2
|
+
return e(n,{display:"inline-flex",direction:"default-side"===p?"row":"column",gap:x?s.spacing(.5):s.spacing(1),alignItems:U,children:[null===u?/* @__PURE__ */i(r,{role:void 0===h?void 0:"img","aria-label":h,"aria-hidden":void 0===h,sx:{alignItems:"center",backgroundColor:s.custom.grey[400],borderRadius:s.spacing(.5),color:s.custom.grey[1400],display:"flex",flexShrink:0,height:z.size,justifyContent:"center",width:z.size},children:/* @__PURE__ */i(l,{icon:"empty",size:z.iconSize})}):/* @__PURE__ */e(o,{variant:y,color:f,children:[m&&Number(u)>0?"+":"",w]}),!1===I&&/* @__PURE__ */i(o,{sx:{marginTop:`${v} !important`},variant:O,color:s.custom.grey[2500],children:c})]})};export{a as NumberWithUnit};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useTheme as
|
|
2
|
-
return e(
|
|
3
|
-
/* @__PURE__ */o(c,{selectedOption:x,getName:h,getIcon:y,onChange:b}),0===S.length&&/* @__PURE__ */e(
|
|
1
|
+
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useTheme as i,Box as t,Typography as n,Divider as r,CircularProgress as l}from"@mui/material";import{Fragment as a}from"react";import{OptionLine as s}from"./Line/OptionLine.js";import{OptionsHeader as c}from"./Header/OptionHeader.js";import{useFoodsSelectContext as d}from"../Context/useSelect.js";import{FoodsBadge as p}from"../../../Badge/FoodsBadge.js";const m=m=>{const g=i(),{selectedOption:x,options:u,getId:f,getName:h,onChange:b,getIcon:y,getGroupName:j,infiniteScroll:C,onScroll:k}=m,{isSearchFound:B,textOptions:I}=d(),S=u.filter(e=>B(h(e))),v=S.filter(e=>null===x||f(e)!==f(x));/* @__PURE__ */
|
|
2
|
+
return e(t,{role:"listbox","aria-label":I.placeholder,onScroll:k,sx:{marginBlock:"8px",display:"flex",flexDirection:"column",...C?{minHeight:0,overflowY:"auto"}:{}},children:[
|
|
3
|
+
/* @__PURE__ */o(c,{selectedOption:x,getName:h,getIcon:y,onChange:b}),0===S.length&&/* @__PURE__ */e(t,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"8px",marginBlock:"4px"},children:[
|
|
4
4
|
/* @__PURE__ */o(p,{icon:"questionMark",size:3,boxProps:{sx:{backgroundColor:g.palette.primary[50],borderRadius:"32px"}}}),
|
|
5
|
-
/* @__PURE__ */o(n,{variant:"body-medium",children:I.noResult})]}),v.map((
|
|
6
|
-
return e(a,{children:[d&&/* @__PURE__ */e(
|
|
5
|
+
/* @__PURE__ */o(n,{variant:"body-medium",children:I.noResult})]}),v.map((i,l)=>{const c=j?.(i),d=void 0!==c&&(0===l||j?.(v[l-1])!==c);/* @__PURE__ */
|
|
6
|
+
return e(a,{children:[d&&/* @__PURE__ */e(t,{role:"presentation",sx:{paddingInline:"5%",paddingBlock:"8px 4px"},children:[l>0&&/* @__PURE__ */o(r,{sx:{marginBottom:"12px"}}),
|
|
7
7
|
/* @__PURE__ */o(n,{variant:"body-bold",children:c})]}),
|
|
8
|
-
/* @__PURE__ */o(s,{isSelected:!1,icon:y?y(
|
|
8
|
+
/* @__PURE__ */o(s,{isSelected:!1,icon:y?y(i):null,displayText:h(i),onClick:()=>b(i)})]},`select-${l}`)}),!0===C?.isFetchingNextPage&&/* @__PURE__ */e(t,{role:"status","aria-label":C.loadingText??"Loading…",sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:1,padding:1},children:[
|
|
9
9
|
/* @__PURE__ */o(l,{size:18}),
|
|
10
10
|
/* @__PURE__ */o(n,{variant:"small",children:C.loadingText??"Loading…"})]})]})};export{m as SelectOptions};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useTheme as t,Button as i,Typography as r}from"@mui/material";import{useState as n,Fragment as l}from"react";import p from"@mui/icons-material/KeyboardArrowDown";import s from"@mui/icons-material/KeyboardArrowUp";import{SelectOptions as a}from"./Options/SelectOptions.js";import{useFoodsSelectContext as c}from"./Context/useSelect.js";import{AnchoredPopover as d}from"../../Popover/AnchoredPopover.js";const m=m=>{const{textOptions:x,disabled:g,closeOnSelect:h,setSearch:u,disableOnEmpty:f}=c(),w=t(),[b,O]=n(null),
|
|
1
|
+
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useTheme as t,Button as i,Typography as r}from"@mui/material";import{useState as n,Fragment as l}from"react";import p from"@mui/icons-material/KeyboardArrowDown";import s from"@mui/icons-material/KeyboardArrowUp";import{SelectOptions as a}from"./Options/SelectOptions.js";import{useFoodsSelectContext as c}from"./Context/useSelect.js";import{AnchoredPopover as d}from"../../Popover/AnchoredPopover.js";const m=m=>{const{textOptions:x,disabled:g,closeOnSelect:h,setSearch:u,disableOnEmpty:f}=c(),w=t(),[b,O]=n(null),y=()=>O(null),v=null!==b,{selectedOption:S,infiniteScroll:I}=m,N=/* @__PURE__ */o(v?s:p,{}),P=v?{border:`2px solid ${w.custom.grey[2800]}`}:{},C=((e,o,t,i,r)=>0===e.length?null!==t?i(t):o:null===t?r:i(t))(m.options,x.emptyOptionsText,S,m.getName,x.placeholder),j=f&&0===m.options.length;/* @__PURE__ */
|
|
2
2
|
return e(l,{children:[
|
|
3
|
-
/* @__PURE__ */e(i,{variant:"select",id:m.id,onClick:e=>y
|
|
3
|
+
/* @__PURE__ */e(i,{variant:"select",id:m.id,onClick:e=>v?y():O(e.currentTarget),sx:{...P,width:"100%",height:"40px",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0px 12px 0px 12px"},disabled:g||j,children:[m.getIcon&&S&&m.getIcon(S),
|
|
4
4
|
/* @__PURE__ */o(r,{variant:"body-medium",sx:{width:"100%",textAlign:"left",marginLeft:"8px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:C}),N]}),
|
|
5
|
-
/* @__PURE__ */o(d,{sx:{top:"5px"},paperProps:{width:"280px",maxHeight:"
|
|
5
|
+
/* @__PURE__ */o(d,{sx:{top:"5px"},paperProps:{width:"280px",maxHeight:"min(480px, calc(100% - 32px))",...I?{overflow:"hidden",display:"flex",flexDirection:"column"}:{},border:`1px solid ${w.custom.grey[500]}`,borderRadius:"12px",boxShadow:"0px 4px 20px 0px #514E4E1F",...m.BoxOptionsProps},variant:"headless",anchor:b,open:v,onClose:()=>{y(),u("")},anchorPosition:"rightside",children:/* @__PURE__ */o(a,{selectedOption:m.selectedOption,options:m.options,getId:m.getId,getName:m.getName,getIcon:m.getIcon,getGroupName:m.getGroupName,onChange:e=>{m.onChange(e),u(""),!0===h&&y()},infiniteScroll:I,onScroll:I?e=>{if(!0!==I?.hasNextPage||I.isFetchingNextPage)return;const o=e.currentTarget;o.scrollHeight-o.scrollTop-o.clientHeight<=32&&I.onLoadMore()}:void 0})})]})};export{m as Select};
|