@foodpilot/foods 2.11.43 → 2.11.45

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,5 +1,5 @@
1
1
  import{jsx as r,Fragment as o,jsxs as e}from"react/jsx-runtime";import{Stack as i,useTheme as t,Box as n,Typography as a}from"@mui/material";import{useColorAndArrowIcon as d}from"./useColorAndArrow.js";const s=e=>{const{value:t,comparedTo:n,improvement:a,arrowDirection:s}=e,p=Number(n),g=Number(t),c=p>0?Math.abs(100-g/p*100):1/0,u=d({currentValue:g,previousValue:p,improvement:a,layout:{size:"M",direction:"horizontal"}});if(isNaN(c)||c===1/0||c===-1/0)/* @__PURE__ */
2
- return r(o,{});const b=0===c?"=":c>=0?"+":"-";/* @__PURE__ */
2
+ return r(o,{});const b=g===p?"=":g>p?"+":"-";/* @__PURE__ */
3
3
  return r(i,{width:"60px",children:/* @__PURE__ */r(l,{position:s,value:c,color:u.color,sign:b})})},l=o=>{const{value:d,position:s="right"}=o,l=t(),p=o.color.secondaryColor,g=o.color.primaryColor,c="right"===s;/* @__PURE__ */
4
4
  return e(n,{sx:{display:"inline-flex",position:"relative",alignItems:"center",justifyContent:"center",backgroundColor:p,border:`2px solid ${g}`,borderRight:c?"none":void 0,borderRadius:l.spacing(.75),padding:l.spacing(.25,.75),paddingRight:l.spacing(1),height:"26px",zIndex:2},children:[/* @__PURE__ */r(n,c?{sx:{background:`linear-gradient(45deg, transparent 0%, transparent 55%, ${p} 55%, ${p} 100%)`,position:"absolute",border:`2px solid ${g}`,borderLeft:"none",borderBottom:"none",borderRadius:l.spacing(.75),borderTopRightRadius:l.spacing(.5),borderBottomRightRadius:l.spacing(.25),borderTopLeftRadius:l.spacing(.25),height:"18px",width:"18px",right:-7,top:2,transform:"rotate(45deg)",zIndex:-2}}:{sx:{background:`linear-gradient(135deg, transparent 0%, transparent 45%, ${p} 45%, ${p} 100%)`,position:"absolute",border:`2px solid ${g}`,borderTop:"none",borderLeft:"none",borderRadius:"1.5px",height:"12px",width:"12px",bottom:-7,left:"50%",transform:"translateX(-50%) rotate(45deg)",zIndex:-2}}),
5
5
  /* @__PURE__ */e(i,{flexDirection:"row",gap:l.spacing(.5),sx:{lineHeight:1,position:"relative",zIndex:1},children:[
@@ -1,6 +1,6 @@
1
- import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import{useTheme as t,Box as i,Button as n,Avatar as l,Typography as a}from"@mui/material";import{useState as d}from"react";import{ButtonPopover as s}from"./ButtonPopover.js";import{NavbarTooltip as c}from"../../NavbarTooltip.js";import{NAVBAR_ACTION_BUTTON_PADDING_BLOCK as p,NAVBAR_ACTION_BUTTON_PADDING_INLINE as m,NAVBAR_ACTION_BUTTON_MIN_HEIGHT as h,NAVBAR_COLLAPSED_ACTION_BUTTON_PADDING as g,NAVBAR_COLLAPSED_ACTION_BUTTON_SIZE as x}from"../../constants.js";import{FoodsIcon as u}from"../../../../Icons/FoodsIcon.js";const f=f=>{const{isExtended:b,name:v,picture:w,popover:y,tooltipLabel:k}=f,j=t(),[C,I]=d(null),W=Boolean(C),B={closePopover:()=>I(null)},P=k??v,A=y?.renderPopover?y.renderPopover(B):y?.element;/* @__PURE__ */
2
- return e(r,{children:[
3
- /* @__PURE__ */o(i,{sx:{height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:b?"flex-start":"center"},children:/* @__PURE__ */o(c,{title:/* @__PURE__ */o(a,{variant:"body-bold",children:P}),placement:"right",disableHoverListener:b||W,children:/* @__PURE__ */e(n,{fullWidth:b,sx:{justifyContent:b?"space-between":"center",alignItems:"center",color:j.custom.grey[100],border:"1px solid transparent",borderRadius:"12px",...b?{minHeight:h,paddingInline:m,paddingBlock:p}:{width:x,minWidth:x,height:x,padding:g},textTransform:"none","&:hover":{borderColor:j.custom.grey[600],backgroundColor:j.custom.grey[2e3]},"&:active":{backgroundColor:j.custom.grey[2500]}},onClick:e=>{void 0!==y&&I(e.currentTarget)},children:[
4
- /* @__PURE__ */e(i,{lang:window.navigator.language,sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:j.spacing(2),hyphens:"auto",overflowWrap:"break-word",wordBreak:"break-word",maxWidth:"100%",flex:b?"1":"0"},children:[
5
- /* @__PURE__ */o(l,{alt:"app-logo",src:w||"",sx:{width:"40px",height:"40px"},children:w??v.charAt(0)}),b&&/* @__PURE__ */o(a,{variant:"body-bold",sx:{color:j.custom.grey[100],display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",textAlign:"left"},children:v})]}),b&&/* @__PURE__ */o(u,{size:2,icon:W?"arrowUpShort":"arrowDownShort"})]})})}),
6
- /* @__PURE__ */o(s,{anchor:C,setAnchor:I,paperOverrides:void 0,children:A})]})};export{f as Organization};
1
+ import{jsxs as e,jsx as r,Fragment as o}from"react/jsx-runtime";import{useTheme as t,Button as i,Box as n,Avatar as l,Typography as a}from"@mui/material";import{useState as d}from"react";import{ButtonPopover as s}from"./ButtonPopover.js";import{NavbarTooltip as c}from"../../NavbarTooltip.js";import{NAVBAR_ACTION_BUTTON_PADDING_BLOCK as p,NAVBAR_ACTION_BUTTON_PADDING_INLINE as m,NAVBAR_ACTION_BUTTON_MIN_HEIGHT as h,NAVBAR_COLLAPSED_ACTION_BUTTON_PADDING as g,NAVBAR_COLLAPSED_ACTION_BUTTON_SIZE as u}from"../../constants.js";import{FoodsIcon as x}from"../../../../Icons/FoodsIcon.js";const v=v=>{const{isExtended:f,name:b,picture:w,popover:y,tooltipLabel:k}=v,j=t(),[C,I]=d(null),W=Boolean(C),B={closePopover:()=>I(null)},P=k??b,A=y?.renderPopover?y.renderPopover(B):y?.element,L=void 0!==y,O=/* @__PURE__ */e(i,{fullWidth:f,sx:{justifyContent:f?"space-between":"center",alignItems:"center",color:j.custom.grey[100],border:"1px solid transparent",borderRadius:"12px",...f?{minHeight:h,paddingInline:m,paddingBlock:p}:{width:u,minWidth:u,height:u,padding:g},textTransform:"none",...L&&{"&:hover":{borderColor:j.custom.grey[600],backgroundColor:j.custom.grey[2e3]},"&:active":{backgroundColor:j.custom.grey[2500]},cursor:"pointer"},...!L&&{cursor:"default"}},onClick:e=>{void 0!==y&&I(e.currentTarget)},children:[
2
+ /* @__PURE__ */e(n,{lang:window.navigator.language,sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:j.spacing(2),hyphens:"auto",overflowWrap:"break-word",wordBreak:"break-word",maxWidth:"100%",flex:f?"1":"0"},children:[
3
+ /* @__PURE__ */r(l,{alt:"app-logo",src:w||"",sx:{width:"40px",height:"40px"},children:w??b.charAt(0)}),f&&/* @__PURE__ */r(a,{variant:"body-bold",sx:{color:j.custom.grey[100],display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",textAlign:"left"},children:b})]}),f&&void 0!==y&&/* @__PURE__ */r(x,{size:2,icon:W?"arrowUpShort":"arrowDownShort"})]});/* @__PURE__ */
4
+ return e(o,{children:[
5
+ /* @__PURE__ */r(n,{sx:{height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:f?"flex-start":"center"},children:void 0!==y?/* @__PURE__ */r(c,{title:/* @__PURE__ */r(a,{variant:"body-bold",children:P}),placement:"right",disableHoverListener:f||W,children:O}):O}),
6
+ /* @__PURE__ */r(s,{anchor:C,setAnchor:I,paperOverrides:void 0,children:A})]})};export{v as Organization};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@foodpilot/foods",
3
3
  "private": false,
4
- "version": "2.11.43",
4
+ "version": "2.11.45",
5
5
  "type": "module",
6
6
  "main": "./dist/main.js",
7
7
  "module": "./dist/main.js",
@@ -250,7 +250,7 @@
250
250
  "@mui/material": "^6.5.0",
251
251
  "@mui/x-date-pickers": "^8.27.2",
252
252
  "@size-limit/file": "^12.0.0",
253
- "@size-limit/preset-big-lib": "^11.0.0",
253
+ "@size-limit/preset-big-lib": "^11.2.0",
254
254
  "@storybook/react-vite": "^10.2.13",
255
255
  "@types/chroma-js": "^3.1.2",
256
256
  "@types/lodash": "^4.17.24",
@@ -259,7 +259,7 @@
259
259
  "@typescript-eslint/eslint-plugin": "^8.56.1",
260
260
  "@typescript-eslint/parser": "^8.56.1",
261
261
  "@vitejs/plugin-react": "^5.1.4",
262
- "dependency-cruiser": "^17.3.8",
262
+ "dependency-cruiser": "^17.3.10",
263
263
  "eslint": "^9.39.3",
264
264
  "eslint-config-prettier": "^10.1.8",
265
265
  "eslint-plugin-i18next": "^6.1.3",