@foodpilot/foods 2.17.10 → 2.18.1

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.
Files changed (22) hide show
  1. package/dist/components/Cards/ScoreOverviewCard/ScoreOverviewCard.d.ts +1 -1
  2. package/dist/components/Cards/ScoreOverviewCard/ScoreOverviewCard.js +2 -3
  3. package/dist/components/Chart/ScatterPlot/ScatterPlot.d.ts +4 -0
  4. package/dist/components/Chart/ScatterPlot/ScatterPlot.js +14 -14
  5. package/dist/components/Chart/ScatterPlot/ScatterPlotCore.js +6 -7
  6. package/dist/components/Chart/ScatterPlot/ScatterPlotPoints.js +4 -4
  7. package/dist/components/Chart/ScatterPlot/useScatterPlotInteraction.js +1 -1
  8. package/dist/components/Chart/ScoreDistribution/ScoreDistribution.d.ts +10 -0
  9. package/dist/components/Chart/ScoreDistribution/ScoreDistribution.js +8 -0
  10. package/dist/components/Chart/ScoreDistribution/ScoreDistribution.types.d.ts +42 -0
  11. package/dist/components/Chart/ScoreDistribution/ScoreDistributionRow.d.ts +13 -0
  12. package/dist/components/Chart/ScoreDistribution/ScoreDistributionRow.js +11 -0
  13. package/dist/components/Chart/ScoreDistribution/ScoreDistributionSummary.d.ts +6 -0
  14. package/dist/components/Chart/ScoreDistribution/ScoreDistributionSummary.js +3 -0
  15. package/dist/components/Chart/ScoreDistribution/index.d.ts +2 -0
  16. package/dist/components/Chart/ScoreDistribution/scoreDistributionScale.d.ts +7 -0
  17. package/dist/components/Chart/ScoreDistribution/scoreDistributionScale.js +1 -0
  18. package/dist/components/Chart/index.d.ts +1 -0
  19. package/dist/main.js +1 -1
  20. package/dist/themes/common/custom.d.ts +7 -0
  21. package/dist/themes/common/custom.js +1 -1
  22. package/package.json +1 -1
@@ -18,7 +18,7 @@ export type ScoreOverviewCardVariationAction = {
18
18
  type ScoreOverviewCardBaseProps = {
19
19
  disabled?: boolean;
20
20
  icon: keyof IconMapping;
21
- level: ScoreOverviewCardLevel;
21
+ level?: ScoreOverviewCardLevel;
22
22
  onSelect: NonNullable<ButtonBaseProps["onClick"]>;
23
23
  selected: boolean;
24
24
  selectionLabel: string;
@@ -1,11 +1,10 @@
1
1
  import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useTheme as o,Stack as r,ButtonBase as t,Box as n,Typography as a,CircularProgress as s}from"@mui/material";import{FoodsIcon as c}from"../../Icons/FoodsIcon.js";import{FoodsTags as d}from"../../Tags/FoodsTags.js";import{FoodsIconButton as l}from"../../Button/FoodsIconButton.js";const p=p=>{const u=o(),g=u.custom.grey[100],m=p.selected?g:u.custom.grey[2800],h=p.selected?g:u.custom.grey[2500],b=p.selected?u.palette.primary[50]:u.custom.grey[2e3],v=u.custom.strokes.containerDivider;/* @__PURE__ */
2
2
  return e(r,{sx:{backgroundColor:p.selected?u.palette.primary[800]:u.custom.grey[100],borderBottomLeftRadius:u.spacing(1.5),borderBottomRightRadius:u.spacing(1.5),borderTopLeftRadius:u.spacing(1.5),borderTopRightRadius:u.spacing(1.5),boxShadow:p.selected?u.custom.shadows.hard:u.custom.shadows.grey,boxSizing:"border-box",flexShrink:0,height:p.selected?u.custom.scoreOverviewCard.heights.selected:u.custom.scoreOverviewCard.heights.inactive,isolation:"isolate",overflow:"hidden",position:"relative",width:u.custom.scoreOverviewCard.width},children:[
3
3
  /* @__PURE__ */i(t,{"aria-label":p.selectionLabel,"aria-pressed":p.selected,disabled:p.disabled,onClick:p.onSelect,sx:{backgroundColor:"transparent",borderRadius:"inherit",inset:0,position:"absolute",zIndex:2,"&.Mui-focusVisible":{outline:"auto"}}}),
4
- /* @__PURE__ */e(r,{sx:{boxSizing:"border-box",gap:u.spacing(3),height:"100%",padding:u.spacing(3),pointerEvents:"none",position:"relative",width:"100%",zIndex:1},children:[
4
+ /* @__PURE__ */e(r,{sx:{boxSizing:"border-box",gap:u.spacing(3),height:"100%",padding:u.spacing(3),pointerEvents:"none",position:"relative",width:"100%",zIndex:"auto"},children:[
5
5
  /* @__PURE__ */e(r,{sx:{gap:u.spacing(1),minWidth:0},children:[
6
6
  /* @__PURE__ */e(r,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",children:[
7
- /* @__PURE__ */i(n,{"aria-hidden":!0,sx:{alignItems:"center",backgroundColor:u.palette.primary[50],borderRadius:u.spacing(1.5),color:u.palette.primary[600],display:"flex",height:u.custom.scoreOverviewCard.icon.containerSize,justifyContent:"center",padding:u.spacing(.5),width:u.custom.scoreOverviewCard.icon.containerSize},children:/* @__PURE__ */i(c,{icon:p.icon,size:u.custom.scoreOverviewCard.icon.glyphSize})}),
8
- /* @__PURE__ */i(d,{size:"display",label:p.level.label,endIcon:"information",colors:p.level.colors,sx:{"& .MuiButton-endIcon":{padding:0},borderWidth:0,paddingInlineEnd:u.spacing(.5),pointerEvents:"auto",position:"relative",zIndex:3}})]}),
7
+ /* @__PURE__ */i(n,{"aria-hidden":!0,sx:{alignItems:"center",backgroundColor:u.palette.primary[50],borderRadius:u.spacing(1.5),color:u.palette.primary[600],display:"flex",height:u.custom.scoreOverviewCard.icon.containerSize,justifyContent:"center",padding:u.spacing(.5),width:u.custom.scoreOverviewCard.icon.containerSize},children:/* @__PURE__ */i(c,{icon:p.icon,size:u.custom.scoreOverviewCard.icon.glyphSize})}),p.level&&/* @__PURE__ */i(d,{size:"display",label:p.level.label,endIcon:"information",colors:p.level.colors,sx:{"& .MuiButton-endIcon":{padding:0},borderWidth:0,paddingInlineEnd:u.spacing(.5),pointerEvents:"auto",position:"relative",zIndex:3}})]}),
9
8
  /* @__PURE__ */e(r,{sx:{minWidth:0},children:[
10
9
  /* @__PURE__ */i(a,{component:"h3",noWrap:!0,title:p.title,variant:"big-semibold",sx:{color:m},children:p.title}),
11
10
  /* @__PURE__ */e(r,{direction:"row",alignItems:"center",sx:{gap:u.spacing(.5),minWidth:0},children:[
@@ -39,6 +39,10 @@ export type ScatterPlotProps = {
39
39
  unit?: string;
40
40
  xUnit?: string;
41
41
  yUnit?: string;
42
+ /** Controls the component-owned surface. Embedded plots keep the same axes and engine. */
43
+ surface?: "default" | "embedded";
44
+ /** Keeps the existing legend by default; consumers may hide it when the surrounding design already names the data. */
45
+ showLegend?: boolean;
42
46
  textOptions?: {
43
47
  for: string;
44
48
  };
@@ -1,15 +1,15 @@
1
- import{jsxs as e,Fragment as t,jsx as n}from"react/jsx-runtime";import{useState as i,useMemo as a}from"react";import{useTheme as r,Stack as o,Box as l,Typography as s}from"@mui/material";import{ScatterPlotCore as c}from"./ScatterPlotCore.js";const d=d=>{const{values:p,xMin:h,xMax:x,yMin:g,yMax:m,xLabel:u,yLabel:y,width:f="100%",height:v="800px",valueFormatterFn:b,precision:w,language:M,unit:C,xUnit:j,yUnit:k,textOptions:S,onLegendHover:O,tooltipOptions:z}=d,E=r(),[F,I]=i(/* @__PURE__ */new Set),L=a(()=>p.length<=1?p:p.map((e,t)=>({...e,data:F.has(t)?[]:e.data})).filter(e=>e.data.length>0),[p,F]);/* @__PURE__ */
1
+ import{jsxs as e,Fragment as t,jsx as i}from"react/jsx-runtime";import{useState as n,useMemo as r}from"react";import{useTheme as a,Stack as o,Box as s,Typography as l}from"@mui/material";import{ScatterPlotCore as c}from"./ScatterPlotCore.js";const d=d=>{const{values:p,xMin:h,xMax:g,yMin:x,yMax:m,xLabel:u,yLabel:y,width:f="100%",height:v="800px",valueFormatterFn:b,precision:w,language:k,unit:M,xUnit:C,yUnit:j,surface:S="default",showLegend:L=!0,textOptions:O,onLegendHover:$,tooltipOptions:z}=d,D=a(),E="embedded"===S,[F,I]=n(/* @__PURE__ */new Set),U=r(()=>p.length<=1?p:p.map((e,t)=>({...e,data:F.has(t)?[]:e.data})).filter(e=>e.data.length>0),[p,F]);/* @__PURE__ */
2
2
  return e(t,{children:[
3
- /* @__PURE__ */n(o,{direction:"column",position:"relative",width:f,minHeight:E.spacing(50),height:v,justifyContent:"stretch",sx:{"& *":{outline:"none"}},children:/* @__PURE__ */e(l,{sx:{border:`1px solid ${E.palette.divider}`,backgroundColor:E.palette.background.paper,borderRadius:E.spacing(1),width:"100%",height:v,padding:E.spacing(3),display:"flex",flexDirection:"column"},children:[
4
- /* @__PURE__ */n(l,{sx:{mb:E.spacing(2),pointerEvents:"none"},children:/* @__PURE__ */e(l,{sx:{display:"flex",alignItems:"center",gap:".5rem"},children:[
5
- /* @__PURE__ */n(s,{variant:"h4",children:y}),
6
- /* @__PURE__ */n(s,{variant:"body",children:"-"}),
7
- /* @__PURE__ */n(s,{variant:"body",children:k})]})}),
8
- /* @__PURE__ */n(l,{sx:{position:"relative",width:"100%",flex:1},children:/* @__PURE__ */n(c,{values:L,xMin:h,xMax:x,yMin:g,yMax:m,valueFormatterFn:b,precision:w,language:M,unit:C,xUnit:j,yUnit:k,textOptions:S,onLegendHover:O,tooltipOptions:z,showSeriesInTooltip:p.length>1})}),
9
- /* @__PURE__ */n(l,{sx:{mt:E.spacing(2),display:"flex",justifyContent:"flex-end",pointerEvents:"none"},children:/* @__PURE__ */e(l,{sx:{display:"flex",alignItems:"center",gap:".5rem"},children:[
10
- /* @__PURE__ */n(s,{variant:"h4",children:u}),
11
- /* @__PURE__ */n(s,{variant:"body",children:"-"}),
12
- /* @__PURE__ */n(s,{variant:"body",children:j})]})})]})}),p&&p.length>0&&/* @__PURE__ */n(l,{sx:{mt:E.spacing(4),pb:E.spacing(4)},children:/* @__PURE__ */n(l,{sx:{display:"flex",justifyContent:"flex-start",flexWrap:"wrap",gap:`${E.spacing(2)} ${E.spacing(6)}`},children:p.map((t,i)=>{const a=(i+1)%Object.keys(E.custom.dataviz.colorsWithExtra).length+1,r=t.color||E.custom.dataviz.colorsWithExtra[a].main;/* @__PURE__ */
13
- return e(l,{sx:{display:"flex",alignItems:"center",gap:E.spacing(1),cursor:p.length>1?"pointer":"default",opacity:F.has(i)?.4:1},onClick:()=>{p.length>1&&(e=>{p.length<=1||I(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.size<p.length-1&&n.add(e),n})})(i),O?.(i)},children:[
14
- /* @__PURE__ */n(l,{sx:{width:E.spacing(1.5),height:E.spacing(1.5),borderRadius:"50%",backgroundColor:r,flexShrink:0}}),
15
- /* @__PURE__ */n(s,{variant:"body2",fontWeight:500,sx:{fontSize:"14px",color:E.palette.text.primary},children:t.name})]},t.name)})})})]})};export{d as ScatterPlot};
3
+ /* @__PURE__ */i(o,{direction:"column",position:"relative",width:f,minHeight:E?0:D.spacing(50),height:v,justifyContent:"stretch",sx:{"& *":{outline:"none"}},children:/* @__PURE__ */e(s,{sx:{border:`${D.custom.strokes.containerDivider.width} ${D.custom.strokes.containerDivider.style} ${E?D.custom.strokes.containerDivider.color:D.palette.divider}`,backgroundColor:E?D.custom.grey[200]:D.palette.background.paper,borderRadius:E?D.spacing(1.5):D.spacing(1),width:"100%",height:v,padding:D.spacing(3),display:"flex",flexDirection:"column"},children:[
4
+ /* @__PURE__ */i(s,{sx:{mb:D.spacing(2),pointerEvents:"none"},children:/* @__PURE__ */e(s,{sx:{display:"flex",alignItems:"center",gap:".5rem"},children:[
5
+ /* @__PURE__ */i(l,{variant:"h4",children:y}),
6
+ /* @__PURE__ */i(l,{variant:"body",children:"-"}),
7
+ /* @__PURE__ */i(l,{variant:"body",children:j})]})}),
8
+ /* @__PURE__ */i(s,{sx:{position:"relative",width:"100%",flex:1},children:/* @__PURE__ */i(c,{values:U,xMin:h,xMax:g,yMin:x,yMax:m,valueFormatterFn:b,precision:w,language:k,unit:M,xUnit:C,yUnit:j,textOptions:O,onLegendHover:$,tooltipOptions:z,showSeriesInTooltip:p.length>1})}),
9
+ /* @__PURE__ */i(s,{sx:{mt:D.spacing(2),display:"flex",justifyContent:"flex-end",pointerEvents:"none"},children:/* @__PURE__ */e(s,{sx:{display:"flex",alignItems:"center",gap:".5rem"},children:[
10
+ /* @__PURE__ */i(l,{variant:"h4",children:u}),
11
+ /* @__PURE__ */i(l,{variant:"body",children:"-"}),
12
+ /* @__PURE__ */i(l,{variant:"body",children:C})]})})]})}),L&&p&&p.length>0&&/* @__PURE__ */i(s,{sx:{mt:D.spacing(4),pb:D.spacing(4)},children:/* @__PURE__ */i(s,{sx:{display:"flex",justifyContent:"flex-start",flexWrap:"wrap",gap:`${D.spacing(2)} ${D.spacing(6)}`},children:p.map((t,n)=>{const r=(n+1)%Object.keys(D.custom.dataviz.colorsWithExtra).length+1,a=t.color||D.custom.dataviz.colorsWithExtra[r].main;/* @__PURE__ */
13
+ return e(s,{sx:{display:"flex",alignItems:"center",gap:D.spacing(1),cursor:p.length>1?"pointer":"default",opacity:F.has(n)?.4:1},onClick:()=>{p.length>1&&(e=>{p.length<=1||I(t=>{const i=new Set(t);return i.has(e)?i.delete(e):i.size<p.length-1&&i.add(e),i})})(n),$?.(n)},children:[
14
+ /* @__PURE__ */i(s,{sx:{width:D.spacing(1.5),height:D.spacing(1.5),borderRadius:"50%",backgroundColor:a,flexShrink:0}}),
15
+ /* @__PURE__ */i(l,{variant:"body2",fontWeight:500,sx:{fontSize:"14px",color:D.palette.text.primary},children:t.name})]},t.name)})})})]})};export{d as ScatterPlot};
@@ -1,7 +1,6 @@
1
- import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useMemo as i,useState as e,useRef as n,useCallback as r,useEffect as a}from"react";import{useTheme as s,Box as l}from"@mui/material";import{ResponsiveContainer as m,ScatterChart as c,CartesianGrid as d,XAxis as p,YAxis as h}from"recharts";import{useScatterPlotInteraction as u}from"./useScatterPlotInteraction.js";import{ScatterPlotHoverOverlay as v}from"./ScatterPlotHoverOverlay.js";import{ScatterPlotTooltip as x}from"./ScatterPlotTooltip.js";import{ScatterPlotPoints as f}from"./ScatterPlotPoints.js";import{processScatterPlotData as y,createGroupedData as g,ANIMATION_DURATION as M,CHART_MARGIN_BOTTOM as P,CHART_MARGIN_LEFT as D,CHART_MARGIN_RIGHT as k,CHART_MARGIN_TOP as F}from"./utils.js";import L from"i18next";const T=T=>{const E=s(),{values:S,xMin:b,xMax:w,yMin:z,yMax:I,valueFormatterFn:j=E.numbers.valueFormatterFn,precision:O,language:W,unit:U,xUnit:A,yUnit:C,textOptions:H,showSeriesInTooltip:K=!0,tooltipOptions:$}=T,{hoveredIndex:R,hover:X,pinnedIndex:Y,pinnedHover:q,isPinned:B,handlePointEnter:G,handlePointClick:J,handlePointLeave:N,handleTooltipEnter:Q,handleTooltipLeave:V,handleDismissTooltip:Z}=u(),{allPoints:_,shouldShowLabels:tt}=i(()=>y(S,E.custom.dataviz.colorsWithExtra),[S,E.custom.dataviz.colorsWithExtra]),ot=i(()=>g(S,E.custom.dataviz.colorsWithExtra,_),[S,E.custom.dataviz.colorsWithExtra,_]),{xDomain:it,yDomain:et}=i(()=>{const t=S.flatMap(t=>t.data);if(0===t.length)return{xDomain:void 0!==b&&void 0!==w?[b,w]:[0,100],yDomain:void 0!==z&&void 0!==I?[z,I]:[0,100]};const o=t.map(t=>t.x),i=t.map(t=>t.y),e=Math.min(...o),n=Math.max(...o),r=Math.min(...i),a=Math.max(...i);return{xDomain:void 0!==b&&void 0!==w?[b,w]:[Math.max(0,e),n],yDomain:void 0!==z&&void 0!==I?[z,I]:[Math.max(0,r),a]}},[S,b,w,z,I]),[nt,rt]=e(!0),at=n(null),st=n(null),[lt,mt]=e(0),ct=W??L.language,dt="number"==typeof O?Math.min(100,Math.max(0,O)):void 0,pt=r(t=>j(t,dt),[j,dt]);return a(()=>{const t=setTimeout(()=>{rt(!1)},M);return()=>clearTimeout(t)},[]),a(()=>{const t=at.current;if(!t)return;const o=()=>mt(t.clientWidth);o();const i=new ResizeObserver(o);return i.observe(t),()=>i.disconnect()},[]),/* @__PURE__ */t(l,{onClick:t=>{const o=t.target;if(o.classList.contains("recharts-dot"))return;const i=st.current;i&&i.contains(o)||Z()},onMouseLeave:()=>Z(),ref:at,sx:{position:"relative",width:"100%",height:"100%"},children:[
2
- /* @__PURE__ */o(m,{width:"100%",height:"100%",children:/* @__PURE__ */t(c,{margin:{top:F,right:k,left:D,bottom:P},children:[
3
- /* @__PURE__ */o(d,{strokeDasharray:"4 4",stroke:E.palette.divider}),
4
- /* @__PURE__ */o(p,{type:"number",dataKey:"x",domain:it,tickLine:!1,axisLine:{stroke:E.palette.divider},tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateY(${E.spacing(2)})`}},tickFormatter:pt,allowDecimals:!0}),
5
- /* @__PURE__ */o(h,{type:"number",dataKey:"y",domain:et,tickLine:!1,axisLine:{stroke:E.palette.divider},tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateX(-${E.spacing(2)})`,pointerEvents:"none"}},tickFormatter:pt,allowDecimals:!0,style:{pointerEvents:"none"}}),
6
- /* @__PURE__ */o(v,{hover:X,valueFormatterFn:j,precision:dt,language:ct,xDomain:it,yDomain:et}),
7
- /* @__PURE__ */o(f,{groupedData:ot,allPoints:_,hoveredIndex:R,pinnedIndex:Y,isTooltipActive:!!(B&&null!==Y&&q&&_[Y]),isAnimationActive:nt,shouldShowLabels:tt,containerWidth:lt,onPointEnter:G,onPointLeave:N,onPointClick:(t,o,i,e)=>{e.stopPropagation(),J(t,o,i)}})]})}),!!(B&&null!==Y&&q&&_[Y])&&/* @__PURE__ */o(x,{ref:st,point:_[Y],coordinate:q,series:S,valueFormatterFn:j,precision:O,unit:U,xUnit:A,yUnit:C,textOptions:H,showSeriesInTooltip:K,handleDismissTooltip:Z,tooltipOptions:$,onTooltipEnter:Q,onTooltipLeave:V})]})};export{T as ScatterPlotCore};
1
+ import{jsxs as t,jsx as i}from"react/jsx-runtime";import{useMemo as e,useState as o,useRef as n,useCallback as a,useEffect as r}from"react";import{useTheme as s,Box as l}from"@mui/material";import{ResponsiveContainer as m,ScatterChart as h,CartesianGrid as c,XAxis as d,YAxis as p}from"recharts";import{useScatterPlotInteraction as u}from"./useScatterPlotInteraction.js";import{ScatterPlotHoverOverlay as v}from"./ScatterPlotHoverOverlay.js";import{ScatterPlotTooltip as x}from"./ScatterPlotTooltip.js";import{ScatterPlotPoints as f}from"./ScatterPlotPoints.js";import{processScatterPlotData as g,createGroupedData as y,ANIMATION_DURATION as M,CHART_MARGIN_BOTTOM as w,CHART_MARGIN_LEFT as D,CHART_MARGIN_RIGHT as P,CHART_MARGIN_TOP as k}from"./utils.js";import L from"i18next";const F=F=>{const T=s(),{values:E,xMin:S,xMax:b,yMin:z,yMax:I,valueFormatterFn:j=T.numbers.valueFormatterFn,precision:O,language:C,unit:W,xUnit:R,yUnit:U,textOptions:A,showSeriesInTooltip:H=!0,tooltipOptions:K}=F,{hoveredIndex:$,hover:B,pinnedIndex:X,pinnedHover:Y,isPinned:q,handlePointEnter:G,handlePointClick:J,handlePointLeave:N,handleTooltipEnter:Q,handleTooltipLeave:V,handleChartMouseLeave:Z,handleDismissTooltip:_}=u(),{allPoints:tt,shouldShowLabels:it}=e(()=>g(E,T.custom.dataviz.colorsWithExtra),[E,T.custom.dataviz.colorsWithExtra]),et=e(()=>y(E,T.custom.dataviz.colorsWithExtra,tt),[E,T.custom.dataviz.colorsWithExtra,tt]),{xDomain:ot,yDomain:nt}=e(()=>{const t=E.flatMap(t=>t.data);if(0===t.length)return{xDomain:void 0!==S&&void 0!==b?[S,b]:[0,100],yDomain:void 0!==z&&void 0!==I?[z,I]:[0,100]};const i=t.map(t=>t.x),e=t.map(t=>t.y),o=Math.min(...i),n=Math.max(...i),a=Math.min(...e),r=Math.max(...e);return{xDomain:void 0!==S&&void 0!==b?[S,b]:[Math.max(0,o),n],yDomain:void 0!==z&&void 0!==I?[z,I]:[Math.max(0,a),r]}},[E,S,b,z,I]),[at,rt]=o(!0),st=n(null),lt=n(null),[mt,ht]=o({height:0,width:0}),ct=C??L.language,dt="number"==typeof O?Math.min(100,Math.max(0,O)):void 0,pt=a(t=>j(t,dt),[j,dt]);return r(()=>{const t=setTimeout(()=>{rt(!1)},M);return()=>clearTimeout(t)},[]),r(()=>{const t=st.current;if(!t)return;const i=(t,i)=>{ht(e=>e.width===t&&e.height===i?e:{width:t,height:i})},e=t.getBoundingClientRect();i(e.width,e.height);const o=new ResizeObserver(([t])=>{t&&i(t.contentRect.width,t.contentRect.height)});return o.observe(t),()=>o.disconnect()},[]),/* @__PURE__ */t(l,{onClick:t=>{const i=t.target;if(i.classList.contains("recharts-dot"))return;const e=lt.current;e&&e.contains(i)||_()},onMouseLeave:Z,ref:st,sx:{position:"relative",width:"100%",height:"100%"},children:[mt.width>0&&mt.height>0&&/* @__PURE__ */i(m,{width:"100%",height:"100%",initialDimension:mt,children:/* @__PURE__ */t(h,{margin:{top:k,right:P,left:D,bottom:w},children:[
2
+ /* @__PURE__ */i(c,{strokeDasharray:"4 4",stroke:T.palette.divider}),
3
+ /* @__PURE__ */i(d,{type:"number",dataKey:"x",domain:ot,tickLine:!1,axisLine:{stroke:T.palette.divider},tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateY(${T.spacing(2)})`}},tickFormatter:pt,allowDecimals:!0}),
4
+ /* @__PURE__ */i(p,{type:"number",dataKey:"y",domain:nt,tickLine:!1,axisLine:{stroke:T.palette.divider},tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateX(-${T.spacing(2)})`,pointerEvents:"none"}},tickFormatter:pt,allowDecimals:!0,style:{pointerEvents:"none"}}),
5
+ /* @__PURE__ */i(v,{hover:B,valueFormatterFn:j,precision:dt,language:ct,xDomain:ot,yDomain:nt}),
6
+ /* @__PURE__ */i(f,{groupedData:et,allPoints:tt,hoveredIndex:$,pinnedIndex:X,isTooltipActive:!!(q&&null!==X&&Y&&tt[X]),isAnimationActive:at,shouldShowLabels:it,containerWidth:mt.width,onPointEnter:G,onPointLeave:N,onPointClick:(t,i,e,o)=>{o.stopPropagation(),J(t,i,e)}})]})}),!!(q&&null!==X&&Y&&tt[X])&&/* @__PURE__ */i(x,{ref:lt,point:tt[X],coordinate:Y,series:E,valueFormatterFn:j,precision:O,unit:W,xUnit:R,yUnit:U,textOptions:A,showSeriesInTooltip:H,handleDismissTooltip:_,tooltipOptions:K,onTooltipEnter:Q,onTooltipLeave:V})]})};export{F as ScatterPlotCore};
@@ -1,4 +1,4 @@
1
- import{jsx as t,Fragment as e}from"react/jsx-runtime";import{Scatter as n,LabelList as o,Dot as i}from"recharts";import{useTheme as r}from"@mui/material";import{ANIMATION_DURATION as l,DISABLE_ANIMATIONS_THRESHOLD_POINTS as a,POINT_RADIUS as s,calculateLabelPosition as c,LABEL_FONT_SIZE as p}from"./utils.js";const f=f=>{const{groupedData:d,allPoints:m,hoveredIndex:u,pinnedIndex:y,isTooltipActive:x,isAnimationActive:h,shouldShowLabels:b,containerWidth:v,onPointEnter:g,onPointLeave:A,onPointClick:I}=f,P=r(),k=e=>{const{x:n,y:o,cx:i,cy:r,value:l,payload:a}=e,s=a?.label,f=s||("number"==typeof l?String(l):(l??"").toString());if(!f)return null;const d="number"==typeof i?i:"number"==typeof n?n:void 0,m="number"==typeof r?r:"number"==typeof o?o:void 0;if(void 0===d||void 0===m)return null;const{x:u,y:y,anchor:x}=c(d,m,f,v);/* @__PURE__ */
2
- return t("g",{style:{pointerEvents:"none"},children:/* @__PURE__ */t("text",{x:u,y:y+1,fill:P.palette.text.primary,fontSize:p,fontWeight:600,textAnchor:x,dominantBaseline:"middle",children:f})})};/* @__PURE__ */
3
- return t(e,{children:d.map(e=>/* @__PURE__ */t(n,{isAnimationActive:!1,fill:e.color,data:e.points.map(t=>{const n=null!==u&&t.pointIndex!==u;return{...t,label:t.label,fill:e.color,opacity:n?.4:1,r:s}}),shape:e=>{const{cx:n,cy:o,r:r,fill:s}=e,c=e.pointIndex,p=null!==u&&c!==u,f={cursor:"pointer",...void 0!==c&&c===y&&x?{filter:"drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.5))",stroke:"#fff",strokeWidth:2}:{filter:"none"}};/* @__PURE__ */
4
- return t(i,{cx:n,cy:o,r:r,fill:s,"data-scatter-point":"true",style:a<=m.length?f:{...f,transform:`scale(${h?0:1})`,transformOrigin:"50% 50%",opacity:p?.4:1,transition:`all ${l}ms cubic-bezier(0.86, 0, 0.07, 1)`},onMouseEnter:()=>{if("number"==typeof c){const t=m[c];t&&g(t,c,{x:n,y:o})}},onMouseLeave:()=>{A()},onClick:()=>{if("number"==typeof c){const t=m[c];if(t){const e={stopPropagation:()=>{}};I?.(t,c,{x:n,y:o},e)}}}})},children:b&&/* @__PURE__ */t(o,{dataKey:"label",content:k})},e.seriesId))})};export{f as ScatterPlotPoints};
1
+ import{jsx as t,Fragment as e}from"react/jsx-runtime";import{Scatter as n,LabelList as o,DefaultZIndexes as i,Dot as r}from"recharts";import{useTheme as l}from"@mui/material";import{ANIMATION_DURATION as a,DISABLE_ANIMATIONS_THRESHOLD_POINTS as c,POINT_RADIUS as s,calculateLabelPosition as p,LABEL_FONT_SIZE as d}from"./utils.js";const f=f=>{const{groupedData:m,allPoints:u,hoveredIndex:y,pinnedIndex:x,isTooltipActive:h,isAnimationActive:b,shouldShowLabels:v,containerWidth:g,onPointEnter:I,onPointLeave:A,onPointClick:k}=f,P=l(),S=e=>{const{x:n,y:o,cx:i,cy:r,value:l,payload:a}=e,c=a?.label,s=c||("number"==typeof l?String(l):(l??"").toString());if(!s)return null;const f="number"==typeof i?i:"number"==typeof n?n:void 0,m="number"==typeof r?r:"number"==typeof o?o:void 0;if(void 0===f||void 0===m)return null;const{x:u,y:y,anchor:x}=p(f,m,s,g);/* @__PURE__ */
2
+ return t("g",{style:{pointerEvents:"none"},children:/* @__PURE__ */t("text",{x:u,y:y+1,fill:P.palette.text.primary,fontSize:d,fontWeight:600,textAnchor:x,dominantBaseline:"middle",children:s})})};/* @__PURE__ */
3
+ return t(e,{children:m.map(e=>/* @__PURE__ */t(n,{isAnimationActive:!1,fill:e.color,data:e.points.map(t=>{const n=null!==y&&t.pointIndex!==y;return{...t,label:t.label,fill:e.color,opacity:n?.4:1,r:s}}),shape:e=>{const{cx:n,cy:o,r:i,fill:l}=e,{pointIndex:s,payload:p}=e,d=p?.pointIndex??s,f=null!==y&&d!==y,m={cursor:"pointer",...void 0!==d&&d===x&&h?{filter:"drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.5))",stroke:"#fff",strokeWidth:2}:{filter:"none"}};/* @__PURE__ */
4
+ return t(r,{cx:n,cy:o,r:i,fill:l,"data-scatter-point":"true",style:c<=u.length?m:{...m,transform:`scale(${b?0:1})`,transformOrigin:"50% 50%",opacity:f?.4:1,transition:`all ${a}ms cubic-bezier(0.86, 0, 0.07, 1)`},onMouseEnter:()=>{if("number"==typeof d){const t=u[d];t&&I(t,d,{x:n,y:o})}},onMouseLeave:()=>{A()},onClick:(t,e)=>{if("number"==typeof d){const t=u[d];t&&k(t,d,{x:n,y:o},e)}}})},children:v&&/* @__PURE__ */t(o,{dataKey:"label",content:S,zIndex:i.line})},e.seriesId))})};export{f as ScatterPlotPoints};
@@ -1 +1 @@
1
- import{useState as l,useRef as e,useEffect as n,useCallback as t}from"react";const u=()=>{const[u,r]=l(null),[a,o]=l(null),[i,x]=l(null),[d,c]=l(null),[y,p]=l(!1),h=e(null),s=e(!1);n(()=>{s.current=y},[y]);const v=t(()=>{h.current&&(clearTimeout(h.current),h.current=null)},[]),m=t((l,e,n)=>{v(),p(!1),r(e),o({xValue:n?.x??l.x,yValue:n?.y??l.y,dataX:l.x,dataY:l.y,pixelX:n?.x??l.x,pixelY:n?.y??l.y})},[v]),T=t((l,e,n)=>{v(),x(e),c({xValue:n?.x??l.x,yValue:n?.y??l.y,dataX:l.x,dataY:l.y,pixelX:n?.x??l.x,pixelY:n?.y??l.y}),p(!0)},[v]),P=t(()=>{v(),s.current||(r(null),o(null))},[v]),V=t(()=>{v()},[v]),X=t(()=>{v(),s.current||(h.current=setTimeout(()=>{r(null),o(null)},1e3))},[v]),Y=t(()=>{s.current||(v(),r(null),o(null))},[v]),L=t(()=>{v(),x(null),c(null),o(null),p(!1)},[v]);return{hoveredIndex:u,hover:a,pinnedIndex:i,pinnedHover:d,isPinned:y,handlePointEnter:m,handlePointClick:T,handlePointLeave:P,handleTooltipEnter:V,handleTooltipLeave:X,handleChartMouseLeave:Y,handleDismissTooltip:L}};export{u as useScatterPlotInteraction};
1
+ import{useState as l,useRef as e,useEffect as n,useCallback as a}from"react";const t=()=>{const[t,u]=l(null),[r,x]=l(null),[i,o]=l(null),[d,c]=l(null),[p,y]=l(!1),h=e(null),s=e(!1);n(()=>{s.current=p},[p]);const V=a(()=>{h.current&&(clearTimeout(h.current),h.current=null)},[]),X=a((l,e,n)=>{V(),y(!1),u(e);const a={xValue:n?.x??l.x,yValue:n?.y??l.y,dataX:l.x,dataY:l.y,pixelX:n?.x??l.x,pixelY:n?.y??l.y};x(l=>l&&l.xValue===a.xValue&&l.yValue===a.yValue&&l.dataX===a.dataX&&l.dataY===a.dataY&&l.pixelX===a.pixelX&&l.pixelY===a.pixelY?l:a)},[V]),Y=a((l,e,n)=>{V(),o(e),c({xValue:n?.x??l.x,yValue:n?.y??l.y,dataX:l.x,dataY:l.y,pixelX:n?.x??l.x,pixelY:n?.y??l.y}),y(!0)},[V]),v=a(()=>{V(),s.current||(u(null),x(null))},[V]),m=a(()=>{V()},[V]),T=a(()=>{V(),s.current||(h.current=setTimeout(()=>{u(null),x(null)},1e3))},[V]),P=a(()=>{s.current||(V(),u(null),x(null))},[V]),L=a(()=>{V(),o(null),c(null),x(null),y(!1)},[V]);return{hoveredIndex:t,hover:r,pinnedIndex:i,pinnedHover:d,isPinned:p,handlePointEnter:X,handlePointClick:Y,handlePointLeave:v,handleTooltipEnter:m,handleTooltipLeave:T,handleChartMouseLeave:P,handleDismissTooltip:L}};export{t as useScatterPlotInteraction};
@@ -0,0 +1,10 @@
1
+ import { ScoreDistributionProps } from './ScoreDistribution.types';
2
+ /**
3
+ * Controlled score breakdown for lifecycle, sub-score, and impact views.
4
+ *
5
+ * Figma provenance: Product score details lifecycle `13140:99648`,
6
+ * sub-scores `13140:100217`, impacts closed `13140:100596`, and impacts
7
+ * open `13154:68496`. Consumers own data adaptation, localization, loading,
8
+ * and navigation; Foods owns the complete visual and interaction contract.
9
+ */
10
+ export declare const ScoreDistribution: ({ displayByLabel, emptyLabel, getCollapseLabel, getExpandLabel, items, modes, onModeChange, selectedMode, showSummary, summary, }: ScoreDistributionProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useTheme as r,Stack as o,Typography as a,Button as t,Box as s}from"@mui/material";import{ScoreDistributionRow as n}from"./ScoreDistributionRow.js";import{ScoreDistributionSummary as d}from"./ScoreDistributionSummary.js";import{getScoreDistributionScale as l}from"./scoreDistributionScale.js";const c=({displayByLabel:c,emptyLabel:m,getCollapseLabel:p,getExpandLabel:g,items:b,modes:u,onModeChange:h,selectedMode:x,showSummary:y=!0,summary:f})=>{const w=r(),v=l(b);/* @__PURE__ */
2
+ return e(o,{"data-testid":"score-distribution",gap:w.spacing(3),children:[
3
+ /* @__PURE__ */e(o,{direction:"row",alignItems:"center",flexWrap:"wrap",gap:w.spacing(2),children:[
4
+ /* @__PURE__ */i(a,{variant:"body-semibold",children:c}),
5
+ /* @__PURE__ */i(o,{direction:"row",flexWrap:"wrap",gap:w.spacing(2),children:u.map(e=>/* @__PURE__ */i(t,{variant:x===e.id?"black-filled":"white-filled","aria-pressed":x===e.id,onClick:()=>h(e.id),children:e.label},e.id))})]}),
6
+ /* @__PURE__ */e(s,{sx:{alignItems:"flex-start",display:"flex",flexWrap:"wrap",gap:w.spacing(3)},children:[y&&/* @__PURE__ */i(d,{summary:f}),
7
+ /* @__PURE__ */e(o,{"data-testid":"score-distribution-breakdown",gap:w.spacing(2),sx:{backgroundColor:w.custom.grey[100],borderRadius:w.spacing(1.5),boxShadow:w.custom.shadows.grey,isolation:"isolate",flex:`1 1 ${w.custom.scoreDetail.summaryWidth}`,minWidth:0,padding:w.spacing(2),position:"relative"},children:[b.length>0?b.map((e,r)=>/* @__PURE__ */i(n,{getCollapseLabel:p,getExpandLabel:g,item:e,isLast:r===b.length-1,mode:x,scale:v},`${x}:${e.id}`)):/* @__PURE__ */i(a,{variant:"body-regular",color:w.custom.grey[2500],children:m}),
8
+ /* @__PURE__ */i(s,{"aria-hidden":!0,sx:{borderColor:w.custom.strokes.containerDivider.color,borderRadius:w.spacing(1.5),borderStyle:w.custom.strokes.containerDivider.style,borderWidth:w.custom.strokes.containerDivider.width,boxSizing:"border-box",inset:0,pointerEvents:"none",position:"absolute"}})]})]})]})};export{c as ScoreDistribution};
@@ -0,0 +1,42 @@
1
+ import { IconMapping } from '../../Icons';
2
+ import { NumberWithUnitValue } from '../../Number/NumberWithUnit';
3
+ import { ReactNode } from 'react';
4
+ export type ScoreDistributionMode = "lifecycle" | "subscores" | "impacts";
5
+ export type ScoreDistributionIconTone = "dataviz-1" | "dataviz-2" | "dataviz-3" | "dataviz-4" | "dataviz-5" | "dataviz-6" | "dataviz-7" | "dataviz-9" | "dataviz-13" | "green";
6
+ export type ScoreDistributionInformation = {
7
+ label: string;
8
+ tooltip: ReactNode;
9
+ };
10
+ export type ScoreDistributionItem = {
11
+ children: readonly ScoreDistributionItem[];
12
+ formattedValue: string;
13
+ id: string;
14
+ label: string;
15
+ unit: string;
16
+ value: number | null;
17
+ icon?: keyof IconMapping;
18
+ iconTone?: ScoreDistributionIconTone;
19
+ information?: ScoreDistributionInformation;
20
+ };
21
+ export type ScoreDistributionModeOption = {
22
+ id: ScoreDistributionMode;
23
+ label: string;
24
+ };
25
+ export type ScoreDistributionSummary = {
26
+ emptyLabel: string;
27
+ unit: string;
28
+ value: NumberWithUnitValue;
29
+ specificityLabel?: string;
30
+ };
31
+ export type ScoreDistributionProps = {
32
+ displayByLabel: string;
33
+ emptyLabel: string;
34
+ getCollapseLabel: (item: ScoreDistributionItem) => string;
35
+ getExpandLabel: (item: ScoreDistributionItem) => string;
36
+ items: readonly ScoreDistributionItem[];
37
+ modes: readonly ScoreDistributionModeOption[];
38
+ onModeChange: (mode: ScoreDistributionMode) => void;
39
+ selectedMode: ScoreDistributionMode;
40
+ showSummary?: boolean;
41
+ summary: ScoreDistributionSummary;
42
+ };
@@ -0,0 +1,13 @@
1
+ import { ScoreDistributionItem, ScoreDistributionMode } from './ScoreDistribution.types';
2
+ import { ScoreDistributionScale } from './scoreDistributionScale';
3
+ type ScoreDistributionRowProps = {
4
+ getCollapseLabel: (item: ScoreDistributionItem) => string;
5
+ getExpandLabel: (item: ScoreDistributionItem) => string;
6
+ item: ScoreDistributionItem;
7
+ isLast: boolean;
8
+ mode: ScoreDistributionMode;
9
+ scale: ScoreDistributionScale;
10
+ depth?: number;
11
+ };
12
+ export declare const ScoreDistributionRow: ({ depth, getCollapseLabel, getExpandLabel, item, isLast, mode, scale, }: ScoreDistributionRowProps) => import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,11 @@
1
+ import{jsxs as i,jsx as t}from"react/jsx-runtime";import{useTheme as e,Stack as a,Box as o,Typography as r}from"@mui/material";import{useState as n}from"react";import{FoodsIcon as s}from"../../Icons/FoodsIcon.js";import{getScoreDistributionScale as c}from"./scoreDistributionScale.js";import{FoodsIconButton as d}from"../../Button/FoodsIconButton.js";const l=(i,t)=>({lifecycle:t.custom.scoreDetail.lifecycleBreakdownWidth,subscores:t.custom.scoreDetail.subscoreBreakdownWidth,impacts:t.custom.scoreDetail.impactBreakdownWidth}[i]),m=({depth:u=0,getCollapseLabel:h,getExpandLabel:p,item:g,isLast:b,mode:x,scale:v})=>{const f=e(),[z,w]=n(!1),W=g.value??0,k=W<0,y=`${g.label} ${g.formattedValue}${"%"===g.unit?"":" "}${g.unit}`,I=g.children.length>0,B=v.range>0?Math.min(100,Math.abs(W)/v.range*100):0,S=k||0===W&&v.range>0&&!v.hasPositiveValue,C=((i,t)=>{switch(i){case"dataviz-1":return t.custom.dataviz.colors[1];case"dataviz-2":return t.custom.dataviz.colors[2];case"dataviz-3":return t.custom.dataviz.colors[3];case"dataviz-4":return t.custom.dataviz.colors[4];case"dataviz-5":return t.custom.dataviz.colors[5];case"dataviz-6":return t.custom.dataviz.colors[6];case"dataviz-7":return t.custom.dataviz.colors[7];case"dataviz-9":return t.custom.dataviz.extra[9];case"dataviz-13":return t.custom.dataviz.extra[13];case"green":return{main:t.custom.green[600],variant:{100:t.custom.status.green.surface}};default:return null}})(g.iconTone,f);/* @__PURE__ */
2
+ return i(a,{gap:z?f.spacing(0===u?2:1):0,sx:{paddingBottom:0!==u||b?0:f.spacing(2),position:"relative"},children:[
3
+ /* @__PURE__ */i(a,{direction:{xs:"column",md:"row"},alignItems:{xs:"stretch",md:"center"},flexWrap:"wrap",gap:f.spacing(2),children:[
4
+ /* @__PURE__ */i(a,{direction:"row",alignItems:"center",gap:f.spacing(1.5),minWidth:0,sx:{boxSizing:"border-box",flexBasis:{xs:"auto",md:f.custom.scoreDetail.summaryWidth},flexGrow:{xs:0,md:1},paddingInlineStart:u>0?f.spacing(4):0,width:{xs:"100%",md:"auto"}},children:[I?/* @__PURE__ */t(d,{size:"xs",icon:z?"arrowDownShort":"arrowRightShort",buttonProps:{"aria-expanded":z,"aria-label":z?h(g):p(g),onClick:()=>w(i=>!i)}}):"lifecycle"===x&&g.icon?/* @__PURE__ */t(o,{"aria-hidden":!0,sx:{flexShrink:0,height:f.spacing(3),width:f.spacing(3)}}):null,g.icon&&/* @__PURE__ */t(o,{sx:{alignItems:"center",backgroundColor:C?.variant[100],borderRadius:f.spacing(.5),color:C?.main,display:"flex",flexShrink:0,height:f.spacing(3),justifyContent:"center",width:f.spacing(3)},children:/* @__PURE__ */t(s,{icon:g.icon,size:1})}),
5
+ /* @__PURE__ */t(r,{variant:"body-semibold",noWrap:0===u||"lifecycle"!==x,children:g.label})]}),
6
+ /* @__PURE__ */i(a,{direction:"row",alignItems:"center",gap:g.information?f.spacing(2):0,flexShrink:0,minWidth:0,sx:{maxWidth:"100%"},children:[
7
+ /* @__PURE__ */i(a,{direction:"row",alignItems:"center",gap:f.spacing(2),flexShrink:1,minWidth:0,sx:{maxWidth:"100%",width:l(x,f)},children:[
8
+ /* @__PURE__ */t(o,{role:"progressbar","aria-label":y,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":B,sx:{backgroundColor:"inherit",borderRadius:0,flexShrink:1,height:f.spacing(2),maxWidth:"100%",position:"relative",width:f.custom.scoreDetail.barWidth},children:/* @__PURE__ */t(o,{"aria-hidden":!0,sx:{backgroundColor:k?f.custom.green[600]:f.palette.primary[600],borderBottomLeftRadius:k?f.spacing(.5):0,borderBottomRightRadius:k?0:f.spacing(.5),borderTopLeftRadius:k?f.spacing(.5):0,borderTopRightRadius:k?0:f.spacing(.5),height:"100%",insetInlineEnd:S?100-v.zeroPosition+"%":void 0,insetInlineStart:S?void 0:`${v.zeroPosition}%`,maxWidth:"100%",minWidth:f.custom.barChart.zeroValueWidth,position:"absolute",width:0===W?f.custom.barChart.zeroValueWidth:`${B}%`}})}),
9
+ /* @__PURE__ */i(a,{direction:"row",alignItems:"baseline",gap:f.spacing(.5),sx:{color:k?f.custom.green[700]:f.custom.grey[2800],minWidth:"max-content"},children:[
10
+ /* @__PURE__ */t(r,{variant:"body-semibold",children:g.formattedValue}),
11
+ /* @__PURE__ */t(r,{variant:"body-regular",children:g.unit})]})]}),g.information&&/* @__PURE__ */t(d,{size:"xs",icon:"information",buttonProps:{"aria-label":g.information.label},tooltip:{text:g.information.tooltip,props:{describeChild:!0}}})]})]}),z&&/* @__PURE__ */t(a,{gap:f.spacing(1),children:g.children.map((i,e)=>/* @__PURE__ */t(m,{depth:u+1,getCollapseLabel:h,getExpandLabel:p,item:i,isLast:e===g.children.length-1,mode:x,scale:c(g.children)},i.id))}),0===u&&!b&&/* @__PURE__ */t(o,{"aria-hidden":!0,sx:{borderBottomColor:f.custom.strokes.containerDivider.color,borderBottomStyle:f.custom.strokes.containerDivider.style,borderBottomWidth:f.custom.strokes.containerDivider.width,bottom:0,insetInline:0,pointerEvents:"none",position:"absolute"}})]})};export{m as ScoreDistributionRow};
@@ -0,0 +1,6 @@
1
+ import { ScoreDistributionSummary as ScoreDistributionSummaryValue } from './ScoreDistribution.types';
2
+ type ScoreDistributionSummaryProps = {
3
+ summary: ScoreDistributionSummaryValue;
4
+ };
5
+ export declare const ScoreDistributionSummary: ({ summary }: ScoreDistributionSummaryProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,3 @@
1
+ import{jsxs as i,jsx as r}from"react/jsx-runtime";import{useTheme as t,Stack as o}from"@mui/material";import{NumberWithUnit as e}from"../../Number/NumberWithUnit.js";import{FoodsTags as a}from"../../Tags/FoodsTags.js";const s=({summary:s})=>{const n=t();/* @__PURE__ */
2
+ return i(o,{"data-testid":"score-distribution-summary",gap:n.spacing(1),sx:{alignSelf:"start",backgroundColor:n.custom.grey[300],borderRadius:n.spacing(1.5),boxSizing:"border-box",maxWidth:"100%",padding:n.spacing(2),width:{xs:"100%",lg:n.custom.scoreDetail.summaryWidth}},children:[
3
+ /* @__PURE__ */r(e,{value:s.value,unit:s.unit,size:"big",unitVariant:"big-regular",hideUnitOnNull:!0,emptyLabel:s.emptyLabel}),s.specificityLabel&&/* @__PURE__ */r(a,{size:"display",label:s.specificityLabel,endIcon:"information",colors:{background:n.custom.grey[100],foreground:n.custom.grey[2800]},sx:{alignSelf:"flex-start",borderColor:n.custom.strokes.containerDivider.color,borderStyle:n.custom.strokes.containerDivider.style,borderWidth:n.custom.strokes.containerDivider.width,maxWidth:"100%",paddingInlineStart:n.spacing(.5),"& .MuiStack-root > .MuiTypography-root":{...n.typography["small-semibold"],whiteSpace:"nowrap"}}})]})};export{s as ScoreDistributionSummary};
@@ -0,0 +1,2 @@
1
+ export { ScoreDistribution } from './ScoreDistribution';
2
+ export type { ScoreDistributionIconTone, ScoreDistributionInformation, ScoreDistributionItem, ScoreDistributionMode, ScoreDistributionModeOption, ScoreDistributionProps, ScoreDistributionSummary, } from './ScoreDistribution.types';
@@ -0,0 +1,7 @@
1
+ import { ScoreDistributionItem } from './ScoreDistribution.types';
2
+ export type ScoreDistributionScale = {
3
+ hasPositiveValue: boolean;
4
+ range: number;
5
+ zeroPosition: number;
6
+ };
7
+ export declare const getScoreDistributionScale: (items: readonly ScoreDistributionItem[]) => ScoreDistributionScale;
@@ -0,0 +1 @@
1
+ const a=a=>{const t=a.map(({value:a})=>a??0),e=Math.min(0,...t),o=Math.max(0,...t),n=o-e;return{hasPositiveValue:o>0,range:n,zeroPosition:n>0?Math.abs(e)/n*100:0}};export{a as getScoreDistributionScale};
@@ -7,3 +7,4 @@ export * from './TrajectoryChart/TrajectoryChart';
7
7
  export * from './HistogramComparisonChart';
8
8
  export * from './PolymorphicChart';
9
9
  export * from './BreakdownTable/BreakdownTable';
10
+ export * from './ScoreDistribution';
package/dist/main.js CHANGED
@@ -1 +1 @@
1
- import{getThemeLogo as o,isTheme as r,themeLogos as t,themeOptions as m,themes as s}from"./themes/index.js";import{Button as n,Typography as e}from"@mui/material";import{AccordionProduct as p}from"./components/Accordion/ProductAccordion.js";import{AdditionalContentBox as i}from"./components/Box/AdditionalContentBox.js";import{AnchoredPopover as c,HeadlessPopover as a,ThemedPopover as f}from"./components/Popover/AnchoredPopover.js";import{Article as j}from"./components/CMS/ArticleBlock/Article.js";import{ArticlesBox as l}from"./components/CMS/ArticleBlock/ArticlesBox.js";import{Badge as d}from"./components/Badge/Badge.js";import{Banner as B}from"./components/Banner/Banner.js";import{BigPopoverLayout as C}from"./components/Popover/BigPopoverLayout.js";import{BlockItemContainer as u}from"./components/Layout/BlockList/Blocks/Container/BlockItemContainer.js";import{BlockItemInner as h}from"./components/Layout/BlockList/Blocks/Container/BlockItemInner.js";import{BlockListContainer as g}from"./components/Layout/BlockList/BlockListContainer.js";import{BottomSheetDialog as F}from"./components/Dialog/BottomSheetDialog.js";import{BoxStyled as T,SecondaryTabs as k}from"./components/Tabs/SecondaryTabs.js";import{BreadcrumbItem as S}from"./components/Navigation/Breadcrumbs/BreadcrumbItem.js";import{Breadcrumbs as x}from"./components/Navigation/Breadcrumbs/Breadcrumbs.js";import{BreakdownTable as P}from"./components/Chart/BreakdownTable/BreakdownTable.js";import{ButtonTabs as v}from"./components/Tabs/ButtonTabs.js";import{CardImage as I}from"./components/CardImage.js";import{CategoryBox as y}from"./components/Box/CategoryBox.js";import{CheckboxBlock as L}from"./components/Layout/BlockList/Blocks/InnerInputBlocks/CheckboxBlock.js";import{CollectiveTheme as b,CollectiveThemeOptions as N}from"./themes/themes/CollectiveTheme.js";import{ComingSoonBadge as A}from"./components/Badge/ComingSoonBadge.js";import{ComparisonArrow as H}from"./components/ComparisonBlock/ComparisonArrow.js";import{ComparisonBlock as R}from"./components/ComparisonBlock/ComparisonBlock.js";import{ComparisonLabel as D}from"./components/Chart/HistogramComparisonChart/ComparisonLabel.js";import{ConfirmDialog as w}from"./components/Form/FoodsFormBase/ConfirmDialog.js";import{ContextualContentBox as G}from"./components/Box/ContextualContentBox.js";import{CoordinatePopover as U}from"./components/Popover/CoordinatePopover.js";import{CountTabs as M}from"./components/Tabs/CountTabs/CountTabs.js";import{CustomRender as W}from"./components/Navigation/FoodsNavBar/Sections/UserButtons/Button/CustomRender.js";import{CustomToggleButton as E,TertiaryToggleButton as V}from"./components/Button/TertiaryToggleButton.js";import{CustomToggleButtonNodeTitle as O,TertiaryToggleButtonNodeTitle as z}from"./components/Button/TertiaryToggleButtonNodeTitle.js";import{CustomTypography as Q}from"./components/CustomTypography/CustomTypography.js";import{CustomizedAxisTick as q}from"./components/Chart/HistogramComparisonChart/CustomizedAxisTick.js";import{DefaultUserAction as J}from"./components/Navigation/FoodsNavBar/Plugin/DefaultUserAction.js";import{DottedBox as K}from"./components/Box/DottedBox.js";import{DoughnutCard as X}from"./components/Cards/DoughnutCard/DoughnutCard.js";import{DoughnutChart as Y}from"./components/Chart/DoughnutChart/DoughnutChart.js";import{DrawerAction as Z}from"./components/Navigation/FoodsNavBar/Sections/UserButtons/Button/DrawerAction.js";import{EcoScoreCell as $}from"./components/Grid/Cell/EcoScoreCell.js";import{EditHeader as _}from"./components/Layout/BlockList/Headers/EditHeader.js";import{EllipsisItem as oo}from"./components/Pagination/PageItems/EllipsisItem.js";import{EmptyForm as ro}from"./components/Layout/BlockList/Blocks/InnerInfoBlocks/EmptyForm.js";import{EvolutionChart as to}from"./components/Chart/EvolutionChart/EvolutionChart.js";import{FixedMultiValueFilter as mo}from"./components/Filter/FixedMultiValueFilter.js";import{FoodPilotTheme as so,FoodpilotThemeOptions as no}from"./themes/themes/FoodPilotTheme.js";import{FoodsBadge as eo}from"./components/Badge/FoodsBadge.js";import{FoodsCheckbox as po}from"./components/Checkbox/FoodsCheckbox.js";import{FoodsDeleteButton as io}from"./components/Button/FoodsDeleteButton.js";import{FoodsFormBase as co}from"./components/Form/FoodsFormBase/FoodsFormBase.js";import{FoodsIcon as ao}from"./components/Icons/FoodsIcon.js";import{FoodsIconButton as fo}from"./components/Button/FoodsIconButton.js";import{FoodsIllustrations as jo}from"./components/Icons/FoodsIllustrations.js";import{FoodsNavbar as lo}from"./components/Navigation/FoodsNavBar/FoodsNavbar.js";import{FoodsPagination as Bo}from"./components/Pagination/FoodsPagination.js";import{FoodsPaginationItem as Co}from"./components/Pagination/FoodsPaginationItem.js";import{FoodsRadioList as uo}from"./components/Radio/FoodsRadioList.js";import{FoodsSearch as ho}from"./components/Search/FoodsSearch.js";import{FoodsSelect as go,FoodsSelectServerPagination as Fo}from"./components/Select/FoodsSelect/FoodsSelect.js";import{FoodsTabs as To,SpecialTabs as ko}from"./components/Tabs/FoodsTabs/FoodsTabs.js";import{FoodsTags as So}from"./components/Tags/FoodsTags.js";import{FoodsTextInput as xo}from"./components/Form/FoodsFormFields/FoodsTextInput.js";import{FoodsThemeOptionsProvider as Po,FoodsThemeProvider as vo}from"./themes/FoodsThemeProvider.js";import{FoodsToggleButton as Io}from"./components/Button/FoodsToggleButton.js";import{FoodsTooltip as yo}from"./components/Tooltip/FoodsTooltip.js";import{FoodsTreeview as Lo}from"./components/Treeview/Treeview.js";import{FoodsUserTags as bo}from"./components/Tags/FoodsUserTags.js";import{FormAccordion as No}from"./components/Accordion/FormAccordion.js";import{FormBase as Ao}from"./components/Form/FormBase.js";import{FormBaseContextProvider as Ho,useFormBaseContext as Ro}from"./components/Form/FoodsFormBase/FormBaseContext.js";import{FormBox as Do}from"./components/Form/FormBox.js";import{FormPropertyBox as wo}from"./components/Form/FormPropertyBox.js";import{FormTopBar as Go}from"./components/Form/FoodsFormBase/FormTopBar/FormTopBar.js";import{FormUnit as Uo}from"./components/Form/FormUnit.js";import{GenericAccordion as Mo}from"./components/Accordion/GenericAccordion.js";import{GreyTextCell as Wo}from"./components/Grid/Cell/GreyCell.js";import{HeaderNav as Eo,NavBarLink as Vo,Navbar as Oo,SubMenu as zo,UserNav as Qo}from"./components/Navigation/Navbar.js";import{HelperBox as qo}from"./components/Box/HelperBox.js";import{HeroBlock as Jo}from"./components/CMS/HeroBlock/HeroBlock.js";import{HistogramComparisonChart as Ko}from"./components/Chart/HistogramComparisonChart/HistogramComparisonChart.js";import{HorizontalGaugeChart as Xo}from"./components/Chart/HorizontalGauge/HorizontalGaugeChart.js";import{IconThread as Yo}from"./components/Navigation/IconThread.js";import{IndicatorBlock as Zo}from"./components/CMS/IndicatorBlock/IndicatorBlock.js";import{InfoBox as $o}from"./components/Box/InfoBox.js";import{InfoHeaderWithIllustration as _o}from"./components/Layout/InfoHeaderWithIllustration.js";import{InitHeader as or}from"./components/Layout/BlockList/Headers/InitHeader.js";import{LeftComparisonPart as rr}from"./components/Layout/BlockList/Blocks/Common/LeftComparisonPart.js";import{LightIndicatorBlock as tr}from"./components/CMS/IndicatorBlock/LightIndicatorBlock.js";import{LineGroupBox as mr}from"./components/Box/LineGroupBox.js";import{LinearProgress as sr}from"./components/LinearProgress.js";import{LinkAction as nr}from"./components/Navigation/FoodsNavBar/Sections/UserButtons/Button/LinkAction.js";import{ListHeader as er}from"./components/Layout/BlockList/Headers/ListHeader.js";import{MRTGrid as pr}from"./components/Grid/MRTGrid.js";import{MultiValueFilter as ir}from"./components/Filter/MultiValueFilter.js";import{NumberField as cr}from"./components/Field/NumberField.js";import{NumberWithUnit as ar}from"./components/Number/NumberWithUnit.js";import{OptionsPopover as fr}from"./components/Popover/OptionsPopover.js";import{PageItem as jr}from"./components/Pagination/PageItems/PageItem.js";import{PageUpAndDownItem as lr}from"./components/Pagination/PageItems/PageUpAndDownItem.js";import{FoodsPills as dr}from"./components/Input/Pills/Pills.js";import{PointsCell as Br}from"./components/Grid/Cell/PointsCell.js";import{PolymorphicChart as Cr}from"./components/Chart/PolymorphicChart/PolymorphicChart.js";import{PolymorphicChartRenderer as ur}from"./components/Chart/PolymorphicChart/PolymorphicChartRenderer.js";import{PrimaryCheckbox as hr}from"./components/Checkbox/PrimaryCheckbox.js";import{PrimaryDialog as gr}from"./components/Dialog/PrimaryDialog.js";import{Progress as Fr}from"./components/Progress/Progress.js";import{ProgressCard as Tr}from"./components/ProgressCard/ProgressCard.js";import{QuoteBox as kr}from"./components/Box/QuoteBox.js";import{RadioBlock as Sr}from"./components/Layout/BlockList/Blocks/InnerInputBlocks/RadioBlock.js";import{RadioBoolean as xr}from"./components/Radio/RadioBoolean.js";import{RadioList as Pr}from"./components/Radio/RadioList.js";import{RichTextEditor as vr}from"./components/RichTextEditor/RichTextEditor.js";import{RoundInput as Ir}from"./components/Input/RoundInput.js";import{RoundNumberInput as yr}from"./components/Input/RoundNumberInput.js";import{ScatterPlot as Lr}from"./components/Chart/ScatterPlot/ScatterPlot.js";import{Score as br}from"./components/Number/Score.js";import{ScoreCard as Nr}from"./components/Cards/ScoreCard/ScoreCard.js";import{ScoreCardHeader as Ar}from"./components/Cards/ScoreCard/Header/ScoreCardHeader.js";import{ScoreContainer as Hr}from"./components/Badge/ScoreContainer.js";import{ScoreOverviewCard as Rr}from"./components/Cards/ScoreOverviewCard/ScoreOverviewCard.js";import{ScoreSelect as Dr}from"./components/Select/ScoreSelect/ScoreSelect.js";import{ScoreValue as wr}from"./components/Number/ScoreValue.js";import{SearchBox as Gr}from"./components/Input/SearchBox.js";import{SectionBox as Ur}from"./components/Box/SectionBox.js";import{SectionTabs as Mr}from"./components/Tabs/SectionTabs/SectionTabs.js";import{SeeMoreCard as Wr}from"./components/Cards/SeeMoreCard/SeeMoreCard.js";import{SelectBlock as Er}from"./components/Layout/BlockList/Blocks/InnerInputBlocks/SelectBlock.js";import{SelectionCard as Vr}from"./components/Cards/SelectionCard/SelectionCard.js";import{SelectionCardGroup as Or}from"./components/Cards/SelectionCard/SelectionCardGroup.js";import{Separator as zr}from"./components/Navigation/FoodsNavBar/Sections/UserButtons/Button/Separator.js";import{SolidGreyBox as Qr}from"./components/Box/SolidGreyBox.js";import{SpecialTab as qr}from"./components/Tabs/FoodsTabs/FoodsTabTemplate.js";import{SuggestionBlock as Jr}from"./components/Layout/BlockList/Blocks/InnerInfoBlocks/SuggestionBlock.js";import{TextArrowList as Kr}from"./components/Text/TextArrowList.js";import{TextField as Xr}from"./components/Field/TextField.js";import{TextTitle as Yr}from"./components/Text/TextTitle.js";import{TextTitleGreyIcon as Zr}from"./components/Text/TextTitleGreyIcon.js";import{Textarea as $r}from"./components/Textarea/Textarea.js";import{ToggleSwitch as _r}from"./components/ToggleSwitch/ToggleSwitch.js";import{TopLinkAction as ot}from"./components/Navigation/FoodsNavBar/Sections/UserButtons/Button/TopLinkAction.js";import{TrajectoryCards as rt}from"./components/Cards/TrajectoryCards/TrajectoryCards.js";import{TrajectoryChart as tt}from"./components/Chart/TrajectoryChart/TrajectoryChart.js";import{TypographyList as mt}from"./components/CustomTypography/TypographyList.js";import{UnitConverterPopover as st}from"./components/Form/UnitConverterPopover.js";import{ValueDisplay as nt}from"./components/Layout/BlockList/Blocks/Common/ValueDisplay.js";import{ValueLabel as et}from"./components/Chart/HistogramComparisonChart/ValueLabel.js";import{ValueSwitcher as pt}from"./components/Cards/ScoreCard/Header/ValueSwitcher/ValueSwitcher.js";import{WarningBox as it}from"./components/Box/WarningBox.js";import{WaterfallChart as ct}from"./components/Chart/WaterfallChart/WaterfallChart.js";import{WhiteBox as at}from"./components/Box/WhiteBox.js";import{WhiteGrid as ft}from"./components/Box/WhiteGrid.js";import{WhitePopover as jt}from"./components/Popover/WhitePopover.js";import{WhitePopoverOnIcon as lt}from"./components/Popover/WhitePopoverOnIcon.js";import{WinePilotTheme as dt,WinepilotThemeOptions as Bt}from"./themes/themes/WinePilotTheme.js";import{allColors as Ct,allMainColors as ut,blueTheme as ht,coralTheme as gt,dataVisualizationColors as Ft,extraColors as Tt,greenTheme as kt,greyTheme as St,orangeTheme as xt,redTheme as Pt,shadows as vt,yellowTheme as It}from"./themes/common/colors.js";import{allTypographyVariants as yt,deprecatedVariants as Lt,typographyConfig as bt}from"./themes/common/MUIComponents/typography.js";import{anyToCheckbox as Nt,checkboxToAny as At}from"./components/Checkbox/helperFunctions.js";import{barChart as Ht,breadcrumb as Rt,custom as Dt,deleteButton as wt,doughnutCard as Gt,formField as Ut,ingredientCard as Mt,mediaUpload as Wt,numberWithUnit as Et,numbers as Vt,scoreCard as Ot,scoreDetail as zt,scoreOverviewCard as Qt,scoreValue as qt,status as Jt,strokes as Kt,tabs as Xt,tags as Yt,toggleSwitch as Zt,tooltip as $t}from"./themes/common/custom.js";import{components as _t}from"./themes/common/components.js";import{computeSize as om,iconMapping as rm}from"./components/Icons/iconConfig.js";import{illustationsMapping as tm}from"./components/Icons/illustrationsConfig.js";import{spacing as mm}from"./themes/common/spacing.js";import{useResponsiveBreakpoints as sm}from"./themes/responsive/useResponsiveBreakpoints.js";import{useResponsivePadding as nm}from"./themes/responsive/useResponsivePadding.js";export{p as AccordionProduct,i as AdditionalContentBox,c as AnchoredPopover,j as Article,l as ArticlesBox,d as Badge,B as Banner,C as BigPopoverLayout,u as BlockItemContainer,h as BlockItemInner,g as BlockListContainer,F as BottomSheetDialog,T as BoxStyled,S as BreadcrumbItem,x as Breadcrumbs,P as BreakdownTable,n as Button,v as ButtonTabs,I as CardImage,y as CategoryBox,L as CheckboxBlock,b as CollectiveTheme,N as CollectiveThemeOptions,A as ComingSoonBadge,H as ComparisonArrow,R as ComparisonBlock,D as ComparisonLabel,w as ConfirmDialog,G as ContextualContentBox,U as CoordinatePopover,M as CountTabs,W as CustomRender,E as CustomToggleButton,O as CustomToggleButtonNodeTitle,Q as CustomTypography,q as CustomizedAxisTick,J as DefaultUserAction,K as DottedBox,X as DoughnutCard,Y as DoughnutChart,Z as DrawerAction,$ as EcoScoreCell,_ as EditHeader,oo as EllipsisItem,ro as EmptyForm,to as EvolutionChart,mo as FixedMultiValueFilter,so as FoodPilotTheme,no as FoodpilotThemeOptions,eo as FoodsBadge,po as FoodsCheckbox,io as FoodsDeleteButton,co as FoodsFormBase,ao as FoodsIcon,fo as FoodsIconButton,jo as FoodsIllustrations,lo as FoodsNavbar,Bo as FoodsPagination,Co as FoodsPaginationItem,uo as FoodsRadioList,ho as FoodsSearch,go as FoodsSelect,Fo as FoodsSelectServerPagination,To as FoodsTabs,So as FoodsTags,xo as FoodsTextInput,Po as FoodsThemeOptionsProvider,vo as FoodsThemeProvider,Io as FoodsToggleButton,yo as FoodsTooltip,Lo as FoodsTreeview,bo as FoodsUserTags,No as FormAccordion,Ao as FormBase,Ho as FormBaseContextProvider,Do as FormBox,wo as FormPropertyBox,Go as FormTopBar,Uo as FormUnit,Mo as GenericAccordion,Wo as GreyTextCell,Eo as HeaderNav,a as HeadlessPopover,qo as HelperBox,Jo as HeroBlock,Ko as HistogramComparisonChart,Xo as HorizontalGaugeChart,Yo as IconThread,Zo as IndicatorBlock,$o as InfoBox,_o as InfoHeaderWithIllustration,or as InitHeader,rr as LeftComparisonPart,tr as LightIndicatorBlock,mr as LineGroupBox,sr as LinearProgress,nr as LinkAction,er as ListHeader,pr as MRTGrid,ir as MultiValueFilter,Vo as NavBarLink,Oo as Navbar,cr as NumberField,ar as NumberWithUnit,fr as OptionsPopover,jr as PageItem,lr as PageUpAndDownItem,dr as Pills,Br as PointsCell,Cr as PolymorphicChart,ur as PolymorphicChartRenderer,hr as PrimaryCheckbox,gr as PrimaryDialog,Fr as Progress,Tr as ProgressCard,kr as QuoteBox,Sr as RadioBlock,xr as RadioBoolean,Pr as RadioList,vr as RichTextEditor,Ir as RoundInput,yr as RoundNumberInput,Lr as ScatterPlot,br as Score,Nr as ScoreCard,Ar as ScoreCardHeader,Hr as ScoreContainer,Rr as ScoreOverviewCard,Dr as ScoreSelect,wr as ScoreValue,Gr as SearchBox,k as SecondaryTabs,Ur as SectionBox,Mr as SectionTabs,Wr as SeeMoreCard,Er as SelectBlock,Vr as SelectionCard,Or as SelectionCardGroup,zr as Separator,Qr as SolidGreyBox,qr as SpecialTab,ko as SpecialTabs,zo as SubMenu,Jr as SuggestionBlock,V as TertiaryToggleButton,z as TertiaryToggleButtonNodeTitle,Kr as TextArrowList,Xr as TextField,Yr as TextTitle,Zr as TextTitleGreyIcon,$r as Textarea,f as ThemedPopover,_r as ToggleSwitch,ot as TopLinkAction,rt as TrajectoryCards,tt as TrajectoryChart,e as Typography,mt as TypographyList,st as UnitConverterPopover,Qo as UserNav,nt as ValueDisplay,et as ValueLabel,pt as ValueSwitcher,it as WarningBox,ct as WaterfallChart,at as WhiteBox,ft as WhiteGrid,jt as WhitePopover,lt as WhitePopoverOnIcon,dt as WinePilotTheme,Bt as WinepilotThemeOptions,Ct as allColors,ut as allMainColors,yt as allTypographyVariants,Nt as anyToCheckbox,Ht as barChart,ht as blueTheme,Rt as breadcrumb,At as checkboxToAny,_t as components,om as computeSize,gt as coralTheme,Dt as custom,Ft as dataVisualizationColors,wt as deleteButton,Lt as deprecatedVariants,Gt as doughnutCard,Tt as extraColors,Ut as formField,o as getThemeLogo,kt as greenTheme,St as greyTheme,rm as iconMapping,tm as illustationsMapping,Mt as ingredientCard,r as isTheme,Wt as mediaUpload,Et as numberWithUnit,Vt as numbers,xt as orangeTheme,Pt as redTheme,Ot as scoreCard,zt as scoreDetail,Qt as scoreOverviewCard,qt as scoreValue,vt as shadows,mm as spacing,Jt as status,Kt as strokes,Xt as tabs,Yt as tags,t as themeLogos,m as themeOptions,s as themes,Zt as toggleSwitch,$t as tooltip,bt as typographyConfig,Ro as useFormBaseContext,sm as useResponsiveBreakpoints,nm as useResponsivePadding,It as yellowTheme};
1
+ import{getThemeLogo as o,isTheme as r,themeLogos as t,themeOptions as m,themes as s}from"./themes/index.js";import{Button as n,Typography as e}from"@mui/material";import{AccordionProduct as i}from"./components/Accordion/ProductAccordion.js";import{AdditionalContentBox as p}from"./components/Box/AdditionalContentBox.js";import{AnchoredPopover as c,HeadlessPopover as a,ThemedPopover as f}from"./components/Popover/AnchoredPopover.js";import{Article as j}from"./components/CMS/ArticleBlock/Article.js";import{ArticlesBox as l}from"./components/CMS/ArticleBlock/ArticlesBox.js";import{Badge as d}from"./components/Badge/Badge.js";import{Banner as B}from"./components/Banner/Banner.js";import{BigPopoverLayout as C}from"./components/Popover/BigPopoverLayout.js";import{BlockItemContainer as u}from"./components/Layout/BlockList/Blocks/Container/BlockItemContainer.js";import{BlockItemInner as h}from"./components/Layout/BlockList/Blocks/Container/BlockItemInner.js";import{BlockListContainer as g}from"./components/Layout/BlockList/BlockListContainer.js";import{BottomSheetDialog as F}from"./components/Dialog/BottomSheetDialog.js";import{BoxStyled as T,SecondaryTabs as k}from"./components/Tabs/SecondaryTabs.js";import{BreadcrumbItem as S}from"./components/Navigation/Breadcrumbs/BreadcrumbItem.js";import{Breadcrumbs as x}from"./components/Navigation/Breadcrumbs/Breadcrumbs.js";import{BreakdownTable as P}from"./components/Chart/BreakdownTable/BreakdownTable.js";import{ButtonTabs as v}from"./components/Tabs/ButtonTabs.js";import{CardImage as I}from"./components/CardImage.js";import{CategoryBox as y}from"./components/Box/CategoryBox.js";import{CheckboxBlock as L}from"./components/Layout/BlockList/Blocks/InnerInputBlocks/CheckboxBlock.js";import{CollectiveTheme as b,CollectiveThemeOptions as N}from"./themes/themes/CollectiveTheme.js";import{ComingSoonBadge as A}from"./components/Badge/ComingSoonBadge.js";import{ComparisonArrow as H}from"./components/ComparisonBlock/ComparisonArrow.js";import{ComparisonBlock as D}from"./components/ComparisonBlock/ComparisonBlock.js";import{ComparisonLabel as R}from"./components/Chart/HistogramComparisonChart/ComparisonLabel.js";import{ConfirmDialog as w}from"./components/Form/FoodsFormBase/ConfirmDialog.js";import{ContextualContentBox as G}from"./components/Box/ContextualContentBox.js";import{CoordinatePopover as U}from"./components/Popover/CoordinatePopover.js";import{CountTabs as M}from"./components/Tabs/CountTabs/CountTabs.js";import{CustomRender as W}from"./components/Navigation/FoodsNavBar/Sections/UserButtons/Button/CustomRender.js";import{CustomToggleButton as E,TertiaryToggleButton as V}from"./components/Button/TertiaryToggleButton.js";import{CustomToggleButtonNodeTitle as O,TertiaryToggleButtonNodeTitle as z}from"./components/Button/TertiaryToggleButtonNodeTitle.js";import{CustomTypography as Q}from"./components/CustomTypography/CustomTypography.js";import{CustomizedAxisTick as q}from"./components/Chart/HistogramComparisonChart/CustomizedAxisTick.js";import{DefaultUserAction as J}from"./components/Navigation/FoodsNavBar/Plugin/DefaultUserAction.js";import{DottedBox as K}from"./components/Box/DottedBox.js";import{DoughnutCard as X}from"./components/Cards/DoughnutCard/DoughnutCard.js";import{DoughnutChart as Y}from"./components/Chart/DoughnutChart/DoughnutChart.js";import{DrawerAction as Z}from"./components/Navigation/FoodsNavBar/Sections/UserButtons/Button/DrawerAction.js";import{EcoScoreCell as $}from"./components/Grid/Cell/EcoScoreCell.js";import{EditHeader as _}from"./components/Layout/BlockList/Headers/EditHeader.js";import{EllipsisItem as oo}from"./components/Pagination/PageItems/EllipsisItem.js";import{EmptyForm as ro}from"./components/Layout/BlockList/Blocks/InnerInfoBlocks/EmptyForm.js";import{EvolutionChart as to}from"./components/Chart/EvolutionChart/EvolutionChart.js";import{FixedMultiValueFilter as mo}from"./components/Filter/FixedMultiValueFilter.js";import{FoodPilotTheme as so,FoodpilotThemeOptions as no}from"./themes/themes/FoodPilotTheme.js";import{FoodsBadge as eo}from"./components/Badge/FoodsBadge.js";import{FoodsCheckbox as io}from"./components/Checkbox/FoodsCheckbox.js";import{FoodsDeleteButton as po}from"./components/Button/FoodsDeleteButton.js";import{FoodsFormBase as co}from"./components/Form/FoodsFormBase/FoodsFormBase.js";import{FoodsIcon as ao}from"./components/Icons/FoodsIcon.js";import{FoodsIconButton as fo}from"./components/Button/FoodsIconButton.js";import{FoodsIllustrations as jo}from"./components/Icons/FoodsIllustrations.js";import{FoodsNavbar as lo}from"./components/Navigation/FoodsNavBar/FoodsNavbar.js";import{FoodsPagination as Bo}from"./components/Pagination/FoodsPagination.js";import{FoodsPaginationItem as Co}from"./components/Pagination/FoodsPaginationItem.js";import{FoodsRadioList as uo}from"./components/Radio/FoodsRadioList.js";import{FoodsSearch as ho}from"./components/Search/FoodsSearch.js";import{FoodsSelect as go,FoodsSelectServerPagination as Fo}from"./components/Select/FoodsSelect/FoodsSelect.js";import{FoodsTabs as To,SpecialTabs as ko}from"./components/Tabs/FoodsTabs/FoodsTabs.js";import{FoodsTags as So}from"./components/Tags/FoodsTags.js";import{FoodsTextInput as xo}from"./components/Form/FoodsFormFields/FoodsTextInput.js";import{FoodsThemeOptionsProvider as Po,FoodsThemeProvider as vo}from"./themes/FoodsThemeProvider.js";import{FoodsToggleButton as Io}from"./components/Button/FoodsToggleButton.js";import{FoodsTooltip as yo}from"./components/Tooltip/FoodsTooltip.js";import{FoodsTreeview as Lo}from"./components/Treeview/Treeview.js";import{FoodsUserTags as bo}from"./components/Tags/FoodsUserTags.js";import{FormAccordion as No}from"./components/Accordion/FormAccordion.js";import{FormBase as Ao}from"./components/Form/FormBase.js";import{FormBaseContextProvider as Ho,useFormBaseContext as Do}from"./components/Form/FoodsFormBase/FormBaseContext.js";import{FormBox as Ro}from"./components/Form/FormBox.js";import{FormPropertyBox as wo}from"./components/Form/FormPropertyBox.js";import{FormTopBar as Go}from"./components/Form/FoodsFormBase/FormTopBar/FormTopBar.js";import{FormUnit as Uo}from"./components/Form/FormUnit.js";import{GenericAccordion as Mo}from"./components/Accordion/GenericAccordion.js";import{GreyTextCell as Wo}from"./components/Grid/Cell/GreyCell.js";import{HeaderNav as Eo,NavBarLink as Vo,Navbar as Oo,SubMenu as zo,UserNav as Qo}from"./components/Navigation/Navbar.js";import{HelperBox as qo}from"./components/Box/HelperBox.js";import{HeroBlock as Jo}from"./components/CMS/HeroBlock/HeroBlock.js";import{HistogramComparisonChart as Ko}from"./components/Chart/HistogramComparisonChart/HistogramComparisonChart.js";import{HorizontalGaugeChart as Xo}from"./components/Chart/HorizontalGauge/HorizontalGaugeChart.js";import{IconThread as Yo}from"./components/Navigation/IconThread.js";import{IndicatorBlock as Zo}from"./components/CMS/IndicatorBlock/IndicatorBlock.js";import{InfoBox as $o}from"./components/Box/InfoBox.js";import{InfoHeaderWithIllustration as _o}from"./components/Layout/InfoHeaderWithIllustration.js";import{InitHeader as or}from"./components/Layout/BlockList/Headers/InitHeader.js";import{LeftComparisonPart as rr}from"./components/Layout/BlockList/Blocks/Common/LeftComparisonPart.js";import{LightIndicatorBlock as tr}from"./components/CMS/IndicatorBlock/LightIndicatorBlock.js";import{LineGroupBox as mr}from"./components/Box/LineGroupBox.js";import{LinearProgress as sr}from"./components/LinearProgress.js";import{LinkAction as nr}from"./components/Navigation/FoodsNavBar/Sections/UserButtons/Button/LinkAction.js";import{ListHeader as er}from"./components/Layout/BlockList/Headers/ListHeader.js";import{MRTGrid as ir}from"./components/Grid/MRTGrid.js";import{MultiValueFilter as pr}from"./components/Filter/MultiValueFilter.js";import{NumberField as cr}from"./components/Field/NumberField.js";import{NumberWithUnit as ar}from"./components/Number/NumberWithUnit.js";import{OptionsPopover as fr}from"./components/Popover/OptionsPopover.js";import{PageItem as jr}from"./components/Pagination/PageItems/PageItem.js";import{PageUpAndDownItem as lr}from"./components/Pagination/PageItems/PageUpAndDownItem.js";import{FoodsPills as dr}from"./components/Input/Pills/Pills.js";import{PointsCell as Br}from"./components/Grid/Cell/PointsCell.js";import{PolymorphicChart as Cr}from"./components/Chart/PolymorphicChart/PolymorphicChart.js";import{PolymorphicChartRenderer as ur}from"./components/Chart/PolymorphicChart/PolymorphicChartRenderer.js";import{PrimaryCheckbox as hr}from"./components/Checkbox/PrimaryCheckbox.js";import{PrimaryDialog as gr}from"./components/Dialog/PrimaryDialog.js";import{Progress as Fr}from"./components/Progress/Progress.js";import{ProgressCard as Tr}from"./components/ProgressCard/ProgressCard.js";import{QuoteBox as kr}from"./components/Box/QuoteBox.js";import{RadioBlock as Sr}from"./components/Layout/BlockList/Blocks/InnerInputBlocks/RadioBlock.js";import{RadioBoolean as xr}from"./components/Radio/RadioBoolean.js";import{RadioList as Pr}from"./components/Radio/RadioList.js";import{RichTextEditor as vr}from"./components/RichTextEditor/RichTextEditor.js";import{RoundInput as Ir}from"./components/Input/RoundInput.js";import{RoundNumberInput as yr}from"./components/Input/RoundNumberInput.js";import{ScatterPlot as Lr}from"./components/Chart/ScatterPlot/ScatterPlot.js";import{Score as br}from"./components/Number/Score.js";import{ScoreCard as Nr}from"./components/Cards/ScoreCard/ScoreCard.js";import{ScoreCardHeader as Ar}from"./components/Cards/ScoreCard/Header/ScoreCardHeader.js";import{ScoreContainer as Hr}from"./components/Badge/ScoreContainer.js";import{ScoreDistribution as Dr}from"./components/Chart/ScoreDistribution/ScoreDistribution.js";import{ScoreOverviewCard as Rr}from"./components/Cards/ScoreOverviewCard/ScoreOverviewCard.js";import{ScoreSelect as wr}from"./components/Select/ScoreSelect/ScoreSelect.js";import{ScoreValue as Gr}from"./components/Number/ScoreValue.js";import{SearchBox as Ur}from"./components/Input/SearchBox.js";import{SectionBox as Mr}from"./components/Box/SectionBox.js";import{SectionTabs as Wr}from"./components/Tabs/SectionTabs/SectionTabs.js";import{SeeMoreCard as Er}from"./components/Cards/SeeMoreCard/SeeMoreCard.js";import{SelectBlock as Vr}from"./components/Layout/BlockList/Blocks/InnerInputBlocks/SelectBlock.js";import{SelectionCard as Or}from"./components/Cards/SelectionCard/SelectionCard.js";import{SelectionCardGroup as zr}from"./components/Cards/SelectionCard/SelectionCardGroup.js";import{Separator as Qr}from"./components/Navigation/FoodsNavBar/Sections/UserButtons/Button/Separator.js";import{SolidGreyBox as qr}from"./components/Box/SolidGreyBox.js";import{SpecialTab as Jr}from"./components/Tabs/FoodsTabs/FoodsTabTemplate.js";import{SuggestionBlock as Kr}from"./components/Layout/BlockList/Blocks/InnerInfoBlocks/SuggestionBlock.js";import{TextArrowList as Xr}from"./components/Text/TextArrowList.js";import{TextField as Yr}from"./components/Field/TextField.js";import{TextTitle as Zr}from"./components/Text/TextTitle.js";import{TextTitleGreyIcon as $r}from"./components/Text/TextTitleGreyIcon.js";import{Textarea as _r}from"./components/Textarea/Textarea.js";import{ToggleSwitch as ot}from"./components/ToggleSwitch/ToggleSwitch.js";import{TopLinkAction as rt}from"./components/Navigation/FoodsNavBar/Sections/UserButtons/Button/TopLinkAction.js";import{TrajectoryCards as tt}from"./components/Cards/TrajectoryCards/TrajectoryCards.js";import{TrajectoryChart as mt}from"./components/Chart/TrajectoryChart/TrajectoryChart.js";import{TypographyList as st}from"./components/CustomTypography/TypographyList.js";import{UnitConverterPopover as nt}from"./components/Form/UnitConverterPopover.js";import{ValueDisplay as et}from"./components/Layout/BlockList/Blocks/Common/ValueDisplay.js";import{ValueLabel as it}from"./components/Chart/HistogramComparisonChart/ValueLabel.js";import{ValueSwitcher as pt}from"./components/Cards/ScoreCard/Header/ValueSwitcher/ValueSwitcher.js";import{WarningBox as ct}from"./components/Box/WarningBox.js";import{WaterfallChart as at}from"./components/Chart/WaterfallChart/WaterfallChart.js";import{WhiteBox as ft}from"./components/Box/WhiteBox.js";import{WhiteGrid as jt}from"./components/Box/WhiteGrid.js";import{WhitePopover as lt}from"./components/Popover/WhitePopover.js";import{WhitePopoverOnIcon as dt}from"./components/Popover/WhitePopoverOnIcon.js";import{WinePilotTheme as Bt,WinepilotThemeOptions as Ct}from"./themes/themes/WinePilotTheme.js";import{allColors as ut,allMainColors as ht,blueTheme as gt,coralTheme as Ft,dataVisualizationColors as Tt,extraColors as kt,greenTheme as St,greyTheme as xt,orangeTheme as Pt,redTheme as vt,shadows as It,yellowTheme as yt}from"./themes/common/colors.js";import{allTypographyVariants as Lt,deprecatedVariants as bt,typographyConfig as Nt}from"./themes/common/MUIComponents/typography.js";import{anyToCheckbox as At,checkboxToAny as Ht}from"./components/Checkbox/helperFunctions.js";import{barChart as Dt,breadcrumb as Rt,custom as wt,deleteButton as Gt,doughnutCard as Ut,formField as Mt,ingredientCard as Wt,mediaUpload as Et,numberWithUnit as Vt,numbers as Ot,scoreCard as zt,scoreDetail as Qt,scoreOverviewCard as qt,scoreValue as Jt,status as Kt,strokes as Xt,tabs as Yt,tags as Zt,toggleSwitch as $t,tooltip as _t}from"./themes/common/custom.js";import{components as om}from"./themes/common/components.js";import{computeSize as rm,iconMapping as tm}from"./components/Icons/iconConfig.js";import{illustationsMapping as mm}from"./components/Icons/illustrationsConfig.js";import{spacing as sm}from"./themes/common/spacing.js";import{useResponsiveBreakpoints as nm}from"./themes/responsive/useResponsiveBreakpoints.js";import{useResponsivePadding as em}from"./themes/responsive/useResponsivePadding.js";export{i as AccordionProduct,p as AdditionalContentBox,c as AnchoredPopover,j as Article,l as ArticlesBox,d as Badge,B as Banner,C as BigPopoverLayout,u as BlockItemContainer,h as BlockItemInner,g as BlockListContainer,F as BottomSheetDialog,T as BoxStyled,S as BreadcrumbItem,x as Breadcrumbs,P as BreakdownTable,n as Button,v as ButtonTabs,I as CardImage,y as CategoryBox,L as CheckboxBlock,b as CollectiveTheme,N as CollectiveThemeOptions,A as ComingSoonBadge,H as ComparisonArrow,D as ComparisonBlock,R as ComparisonLabel,w as ConfirmDialog,G as ContextualContentBox,U as CoordinatePopover,M as CountTabs,W as CustomRender,E as CustomToggleButton,O as CustomToggleButtonNodeTitle,Q as CustomTypography,q as CustomizedAxisTick,J as DefaultUserAction,K as DottedBox,X as DoughnutCard,Y as DoughnutChart,Z as DrawerAction,$ as EcoScoreCell,_ as EditHeader,oo as EllipsisItem,ro as EmptyForm,to as EvolutionChart,mo as FixedMultiValueFilter,so as FoodPilotTheme,no as FoodpilotThemeOptions,eo as FoodsBadge,io as FoodsCheckbox,po as FoodsDeleteButton,co as FoodsFormBase,ao as FoodsIcon,fo as FoodsIconButton,jo as FoodsIllustrations,lo as FoodsNavbar,Bo as FoodsPagination,Co as FoodsPaginationItem,uo as FoodsRadioList,ho as FoodsSearch,go as FoodsSelect,Fo as FoodsSelectServerPagination,To as FoodsTabs,So as FoodsTags,xo as FoodsTextInput,Po as FoodsThemeOptionsProvider,vo as FoodsThemeProvider,Io as FoodsToggleButton,yo as FoodsTooltip,Lo as FoodsTreeview,bo as FoodsUserTags,No as FormAccordion,Ao as FormBase,Ho as FormBaseContextProvider,Ro as FormBox,wo as FormPropertyBox,Go as FormTopBar,Uo as FormUnit,Mo as GenericAccordion,Wo as GreyTextCell,Eo as HeaderNav,a as HeadlessPopover,qo as HelperBox,Jo as HeroBlock,Ko as HistogramComparisonChart,Xo as HorizontalGaugeChart,Yo as IconThread,Zo as IndicatorBlock,$o as InfoBox,_o as InfoHeaderWithIllustration,or as InitHeader,rr as LeftComparisonPart,tr as LightIndicatorBlock,mr as LineGroupBox,sr as LinearProgress,nr as LinkAction,er as ListHeader,ir as MRTGrid,pr as MultiValueFilter,Vo as NavBarLink,Oo as Navbar,cr as NumberField,ar as NumberWithUnit,fr as OptionsPopover,jr as PageItem,lr as PageUpAndDownItem,dr as Pills,Br as PointsCell,Cr as PolymorphicChart,ur as PolymorphicChartRenderer,hr as PrimaryCheckbox,gr as PrimaryDialog,Fr as Progress,Tr as ProgressCard,kr as QuoteBox,Sr as RadioBlock,xr as RadioBoolean,Pr as RadioList,vr as RichTextEditor,Ir as RoundInput,yr as RoundNumberInput,Lr as ScatterPlot,br as Score,Nr as ScoreCard,Ar as ScoreCardHeader,Hr as ScoreContainer,Dr as ScoreDistribution,Rr as ScoreOverviewCard,wr as ScoreSelect,Gr as ScoreValue,Ur as SearchBox,k as SecondaryTabs,Mr as SectionBox,Wr as SectionTabs,Er as SeeMoreCard,Vr as SelectBlock,Or as SelectionCard,zr as SelectionCardGroup,Qr as Separator,qr as SolidGreyBox,Jr as SpecialTab,ko as SpecialTabs,zo as SubMenu,Kr as SuggestionBlock,V as TertiaryToggleButton,z as TertiaryToggleButtonNodeTitle,Xr as TextArrowList,Yr as TextField,Zr as TextTitle,$r as TextTitleGreyIcon,_r as Textarea,f as ThemedPopover,ot as ToggleSwitch,rt as TopLinkAction,tt as TrajectoryCards,mt as TrajectoryChart,e as Typography,st as TypographyList,nt as UnitConverterPopover,Qo as UserNav,et as ValueDisplay,it as ValueLabel,pt as ValueSwitcher,ct as WarningBox,at as WaterfallChart,ft as WhiteBox,jt as WhiteGrid,lt as WhitePopover,dt as WhitePopoverOnIcon,Bt as WinePilotTheme,Ct as WinepilotThemeOptions,ut as allColors,ht as allMainColors,Lt as allTypographyVariants,At as anyToCheckbox,Dt as barChart,gt as blueTheme,Rt as breadcrumb,Ht as checkboxToAny,om as components,rm as computeSize,Ft as coralTheme,wt as custom,Tt as dataVisualizationColors,Gt as deleteButton,bt as deprecatedVariants,Ut as doughnutCard,kt as extraColors,Mt as formField,o as getThemeLogo,St as greenTheme,xt as greyTheme,tm as iconMapping,mm as illustationsMapping,Wt as ingredientCard,r as isTheme,Et as mediaUpload,Vt as numberWithUnit,Ot as numbers,Pt as orangeTheme,vt as redTheme,zt as scoreCard,Qt as scoreDetail,qt as scoreOverviewCard,Jt as scoreValue,It as shadows,sm as spacing,Kt as status,Xt as strokes,Yt as tabs,Zt as tags,t as themeLogos,m as themeOptions,s as themes,$t as toggleSwitch,_t as tooltip,Nt as typographyConfig,Do as useFormBaseContext,nm as useResponsiveBreakpoints,em as useResponsivePadding,yt as yellowTheme};
@@ -65,6 +65,13 @@ export declare const scoreOverviewCard: {
65
65
  readonly carouselControl: {
66
66
  readonly inlineEndOffset: "-5px";
67
67
  };
68
+ /**
69
+ * Embedded score-overview chart geometry.
70
+ * Figma provenance: Product score overview graph `14219:66850`.
71
+ */
72
+ readonly details: {
73
+ readonly chartHeight: "481px";
74
+ };
68
75
  };
69
76
  /**
70
77
  * Shared Ingredient card surface stroke.
@@ -1 +1 @@
1
- import e from"i18next";import{greyTheme as i,shadows as r,redTheme as o,allMainColors as t,allColors as a,extraColors as d,dataVisualizationColors as n,coralTheme as p,blueTheme as h,yellowTheme as x,orangeTheme as c,greenTheme as l}from"./colors.js";const s={containerDivider:{color:i[600],style:"solid",width:"1px"}},g={width:"300px"},u={green:{surface:"#F2FFF9"}},m={surface:"#025155",emptyGuidanceForeground:"#EDF9FA",loading:{opacity:.7,transition:"opacity 120ms ease-out"}},b={width:"300px",heights:{inactive:"215px",selected:"231px"},icon:{containerSize:"48px",glyphSize:{width:40,height:40}},carouselControl:{inlineEndOffset:"-5px"}},w={stroke:{...s.containerDivider,color:"#E5E3E0"}},y={emptyIndicator:{size:"44px",iconSize:{width:26,height:26}},inline:{width:"70px"}},k={emptyIndicator:{micro:{size:"20px",iconSize:{width:11,height:11}},small:{size:"24px",iconSize:{width:13,height:13}},inter:{size:"30px",iconSize:{width:20,height:20}},big:{size:"38px",iconSize:{width:28,height:28}}},unitOffset:{compact:"-1px",regular:"-2px"}},v={compact:{width:"100px",optionWidth:"130px"}},z={zeroValueWidth:"1px"},S={borderRadius:"8px",loadingIndicatorSize:28,errorMaxWidth:"260px",default:{size:120,stroke:s.containerDivider,emptyCopy:{typographyVariant:"body-regular",lineHeight:1.3}},compact:{size:110,contentInset:"6px",stroke:{...s.containerDivider,style:"dashed"},boxShadow:r.grey,emptyCopy:{width:"76px",typographyVariant:"small-regular"}},thumbnail:{size:70,contentInset:"4px",stroke:s.containerDivider,boxShadow:r.grey}},f={display:{height:"26px"}},B={primary:{height:"60px"},secondary:{height:"60px"}},$={summaryWidth:"250px",barWidth:"250px",lifecycleBreakdownWidth:"364px",subscoreBreakdownWidth:"346px",impactBreakdownWidth:"318px",impactZeroBreakdownWidth:"292px",impactBenefitBreakdownWidth:"551px"},C={handleBorderRadius:"50%",legacyTrackBackground:"rgba(0,0,0,.25)",sizes:{default:{width:"52px",height:"28px",thumbSize:"20px",thumbInset:"4px",thumbTravel:"24px",trackBorderRadius:"16px"},medium:{width:"44px",height:"24px",thumbSize:"16px",thumbInset:"4px",thumbTravel:"20px",trackBorderRadius:"14px"},small:{width:"36px",height:"20px",thumbSize:"12px",thumbInset:"4px",thumbTravel:"16px",trackBorderRadius:"10px"}},status:{uncheckedColor:i[1400],uncheckedIconColor:i[2e3],handleBackground:`linear-gradient(180deg, ${i[100]} 0%, ${i[300]} 100%)`,iconSize:{width:14,height:14},trackBorderRadius:"20px"}},D={size:"40px",iconSize:{width:20,height:20},borderRadius:"44px",default:{background:`linear-gradient(180deg, ${i[100]} 0%, ${i[300]} 154.5%)`,borderColor:o[500],color:o[500]},hovered:{background:o[400],borderColor:o[500],color:i[100]},pressed:{background:o[600],borderColor:o[600],color:i[100]}},W=`inset 0 0 0 ${s.containerDivider.width} ${s.containerDivider.color}`,R={gap:"4px",separatorIconSize:{width:16,height:16},pageLink:{height:"26px",paddingBlock:"2px",paddingInline:"8px",borderRadius:"8px",maxWidth:"226px",stroke:{default:W,hover:`inset 0 0 0 ${s.containerDivider.width} ${i[2800]}`},collapsed:{width:"24px",height:"16px",paddingInline:"4px",borderRadius:"4px"}},overflowMenu:{offset:"4px",padding:"16px",gap:"8px",borderRadius:"12px",boxShadow:`${W}, ${r.popover}`}},I=`${s.containerDivider.width} ${s.containerDivider.style} ${i[500]}`,F=`${s.containerDivider.width} ${s.containerDivider.style} ${s.containerDivider.color}`,E={contentAlignment:"center",default:{maxCharacters:100,width:"202px",maxWidth:"unset",padding:"12px 16px 12px 16px",borderRadius:"0.5rem",border:I,backgroundColor:i[100],boxShadow:`0px 4px 20px 0px ${i[500]}`,color:i[2800],margin:"8px",typographyVariant:"body-medium",arrow:{color:i[100],border:I}},simple:{width:"300px",maxWidth:"300px",contentMinHeight:"53px",paddingBlock:"2px",paddingInline:"8px",borderRadius:"8px",border:F,backgroundColor:i[100],boxShadow:r.popover,color:i[2500],margin:"8px",typographyVariant:"body-medium",arrow:{width:"16px",height:"8px",color:i[100],border:F}}},V={grey:i,red:o,green:l,orange:c,yellow:x,blue:h,coral:p,shadows:r,dataviz:{colors:n,extra:d,colorsWithExtra:a,onlyMainFromAll:t},doughnutCard:g,strokes:s,status:u,scoreCard:m,scoreOverviewCard:b,ingredientCard:w,scoreValue:y,numberWithUnit:k,formField:v,barChart:z,mediaUpload:S,tags:f,tabs:B,scoreDetail:$,toggleSwitch:C,deleteButton:D,breadcrumb:R,tooltip:E,searchBox:{borderRadius:"24px",border:e=>"1px solid "+e.custom.grey[500],background:"white",boxShadow:e=>"0px 2px 8px 0px "+e.custom.grey[500]},rowMenuElement:{marginLeft:"12px",paddingRight:"8px",fontSize:"12px",fontWeight:"600",lineHeight:"20px"}},M={valueFormatterFn:(i,r=void 0)=>{const o=Number(i);return Number.isNaN(o)?"":r?o.toLocaleString(e.language,{maximumFractionDigits:r}):o.toLocaleString(e.language)}};export{z as barChart,R as breadcrumb,V as custom,D as deleteButton,g as doughnutCard,v as formField,w as ingredientCard,S as mediaUpload,k as numberWithUnit,M as numbers,m as scoreCard,$ as scoreDetail,b as scoreOverviewCard,y as scoreValue,u as status,s as strokes,B as tabs,f as tags,C as toggleSwitch,E as tooltip};
1
+ import e from"i18next";import{greyTheme as i,shadows as r,redTheme as t,allMainColors as o,allColors as a,extraColors as d,dataVisualizationColors as n,coralTheme as p,blueTheme as h,yellowTheme as x,orangeTheme as c,greenTheme as l}from"./colors.js";const s={containerDivider:{color:i[600],style:"solid",width:"1px"}},g={width:"300px"},u={green:{surface:"#F2FFF9"}},m={surface:"#025155",emptyGuidanceForeground:"#EDF9FA",loading:{opacity:.7,transition:"opacity 120ms ease-out"}},b={width:"300px",heights:{inactive:"215px",selected:"231px"},icon:{containerSize:"48px",glyphSize:{width:40,height:40}},carouselControl:{inlineEndOffset:"-5px"},details:{chartHeight:"481px"}},w={stroke:{...s.containerDivider,color:"#E5E3E0"}},y={emptyIndicator:{size:"44px",iconSize:{width:26,height:26}},inline:{width:"70px"}},k={emptyIndicator:{micro:{size:"20px",iconSize:{width:11,height:11}},small:{size:"24px",iconSize:{width:13,height:13}},inter:{size:"30px",iconSize:{width:20,height:20}},big:{size:"38px",iconSize:{width:28,height:28}}},unitOffset:{compact:"-1px",regular:"-2px"}},v={compact:{width:"100px",optionWidth:"130px"}},z={zeroValueWidth:"1px"},S={borderRadius:"8px",loadingIndicatorSize:28,errorMaxWidth:"260px",default:{size:120,stroke:s.containerDivider,emptyCopy:{typographyVariant:"body-regular",lineHeight:1.3}},compact:{size:110,contentInset:"6px",stroke:{...s.containerDivider,style:"dashed"},boxShadow:r.grey,emptyCopy:{width:"76px",typographyVariant:"small-regular"}},thumbnail:{size:70,contentInset:"4px",stroke:s.containerDivider,boxShadow:r.grey}},f={display:{height:"26px"}},B={primary:{height:"60px"},secondary:{height:"60px"}},$={summaryWidth:"250px",barWidth:"250px",lifecycleBreakdownWidth:"364px",subscoreBreakdownWidth:"346px",impactBreakdownWidth:"318px",impactZeroBreakdownWidth:"292px",impactBenefitBreakdownWidth:"551px"},C={handleBorderRadius:"50%",legacyTrackBackground:"rgba(0,0,0,.25)",sizes:{default:{width:"52px",height:"28px",thumbSize:"20px",thumbInset:"4px",thumbTravel:"24px",trackBorderRadius:"16px"},medium:{width:"44px",height:"24px",thumbSize:"16px",thumbInset:"4px",thumbTravel:"20px",trackBorderRadius:"14px"},small:{width:"36px",height:"20px",thumbSize:"12px",thumbInset:"4px",thumbTravel:"16px",trackBorderRadius:"10px"}},status:{uncheckedColor:i[1400],uncheckedIconColor:i[2e3],handleBackground:`linear-gradient(180deg, ${i[100]} 0%, ${i[300]} 100%)`,iconSize:{width:14,height:14},trackBorderRadius:"20px"}},D={size:"40px",iconSize:{width:20,height:20},borderRadius:"44px",default:{background:`linear-gradient(180deg, ${i[100]} 0%, ${i[300]} 154.5%)`,borderColor:t[500],color:t[500]},hovered:{background:t[400],borderColor:t[500],color:i[100]},pressed:{background:t[600],borderColor:t[600],color:i[100]}},W=`inset 0 0 0 ${s.containerDivider.width} ${s.containerDivider.color}`,R={gap:"4px",separatorIconSize:{width:16,height:16},pageLink:{height:"26px",paddingBlock:"2px",paddingInline:"8px",borderRadius:"8px",maxWidth:"226px",stroke:{default:W,hover:`inset 0 0 0 ${s.containerDivider.width} ${i[2800]}`},collapsed:{width:"24px",height:"16px",paddingInline:"4px",borderRadius:"4px"}},overflowMenu:{offset:"4px",padding:"16px",gap:"8px",borderRadius:"12px",boxShadow:`${W}, ${r.popover}`}},I=`${s.containerDivider.width} ${s.containerDivider.style} ${i[500]}`,F=`${s.containerDivider.width} ${s.containerDivider.style} ${s.containerDivider.color}`,E={contentAlignment:"center",default:{maxCharacters:100,width:"202px",maxWidth:"unset",padding:"12px 16px 12px 16px",borderRadius:"0.5rem",border:I,backgroundColor:i[100],boxShadow:`0px 4px 20px 0px ${i[500]}`,color:i[2800],margin:"8px",typographyVariant:"body-medium",arrow:{color:i[100],border:I}},simple:{width:"300px",maxWidth:"300px",contentMinHeight:"53px",paddingBlock:"2px",paddingInline:"8px",borderRadius:"8px",border:F,backgroundColor:i[100],boxShadow:r.popover,color:i[2500],margin:"8px",typographyVariant:"body-medium",arrow:{width:"16px",height:"8px",color:i[100],border:F}}},V={grey:i,red:t,green:l,orange:c,yellow:x,blue:h,coral:p,shadows:r,dataviz:{colors:n,extra:d,colorsWithExtra:a,onlyMainFromAll:o},doughnutCard:g,strokes:s,status:u,scoreCard:m,scoreOverviewCard:b,ingredientCard:w,scoreValue:y,numberWithUnit:k,formField:v,barChart:z,mediaUpload:S,tags:f,tabs:B,scoreDetail:$,toggleSwitch:C,deleteButton:D,breadcrumb:R,tooltip:E,searchBox:{borderRadius:"24px",border:e=>"1px solid "+e.custom.grey[500],background:"white",boxShadow:e=>"0px 2px 8px 0px "+e.custom.grey[500]},rowMenuElement:{marginLeft:"12px",paddingRight:"8px",fontSize:"12px",fontWeight:"600",lineHeight:"20px"}},M={valueFormatterFn:(i,r=void 0)=>{const t=Number(i);return Number.isNaN(t)?"":r?t.toLocaleString(e.language,{maximumFractionDigits:r}):t.toLocaleString(e.language)}};export{z as barChart,R as breadcrumb,V as custom,D as deleteButton,g as doughnutCard,v as formField,w as ingredientCard,S as mediaUpload,k as numberWithUnit,M as numbers,m as scoreCard,$ as scoreDetail,b as scoreOverviewCard,y as scoreValue,u as status,s as strokes,B as tabs,f as tags,C as toggleSwitch,E as tooltip};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@foodpilot/foods",
3
3
  "private": false,
4
- "version": "2.17.10",
4
+ "version": "2.18.1",
5
5
  "type": "module",
6
6
  "main": "./dist/main.js",
7
7
  "module": "./dist/main.js",