@foodpilot/foods 2.18.3 → 2.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Chart/DoughnutChart/DoughnutTooltip.js +2 -2
- package/dist/components/Chart/PolymorphicChart/PolymorphicChartTooltip.js +3 -3
- package/dist/components/Chart/ScatterPlot/ScatterPlot.d.ts +1 -0
- package/dist/components/Chart/ScatterPlot/ScatterPlotCore.d.ts +1 -0
- package/dist/components/Chart/ScatterPlot/ScatterPlotHoverOverlay.js +10 -9
- package/dist/components/Chart/ScatterPlot/ScatterPlotTooltip.d.ts +1 -0
- package/dist/components/Chart/ScatterPlot/ScatterPlotTooltip.js +12 -12
- package/dist/components/Chart/ScoreDistribution/ScoreDistributionRow.js +11 -11
- package/dist/components/Form/FoodsFormBase/FoodsFormBase.d.ts +2 -1
- package/dist/components/Form/FoodsFormBase/FormTopBar/ActionButtons.js +7 -5
- package/dist/components/Form/FoodsFormBase/FormTopBar/FormTopBar.js +7 -8
- package/dist/components/Tabs/CountTabs/CountTabs.d.ts +3 -1
- package/dist/components/Tabs/CountTabs/CountTabs.js +5 -5
- package/dist/themes/common/custom.d.ts +5 -0
- package/dist/themes/common/custom.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{jsxs as i,jsx as t}from"react/jsx-runtime";import{useTheme as e,Stack as n,Box as o,Typography as r}from"@mui/material";import{calculateTooltipPosition as a,getTooltipContainerStyles as l}from"../shared/tooltipPositioning.js";import{FoodsTooltip as d}from"../../Tooltip/FoodsTooltip.js";const c=c=>{const{active:
|
|
1
|
+
import{jsxs as i,jsx as t}from"react/jsx-runtime";import{useTheme as e,Stack as n,Box as o,Typography as r}from"@mui/material";import{calculateTooltipPosition as a,getTooltipContainerStyles as l}from"../shared/tooltipPositioning.js";import{FoodsTooltip as d}from"../../Tooltip/FoodsTooltip.js";const c=c=>{const{active:s,payload:p,formatter:m,unit:h,coordinate:x,icons:g}=c,u=e();if(!(s&&p&&p.length&&x))return null;const f=p[0],y=m?m(f.value):u.numbers.valueFormatterFn(f.value),v=/* @__PURE__ */i(n,{direction:"column",alignItems:"flex-start",justifyContent:"center",spacing:u.spacing(1),children:[
|
|
2
2
|
/* @__PURE__ */i(n,{direction:"row",alignItems:"center",spacing:u.spacing(1),children:[g&&f.payload&&void 0!==f.payload.index&&g[f.payload.index]?/* @__PURE__ */t(o,{minWidth:"24px",width:"24px",height:"24px",sx:{background:f.payload.color||"#ccc",padding:"4px",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"3px"},children:g[f.payload.index]}):/* @__PURE__ */t(o,{sx:{width:"12px",height:"12px",borderRadius:"3px",backgroundColor:f.payload.color}}),
|
|
3
3
|
/* @__PURE__ */t(r,{variant:"h6",children:f.name})]}),
|
|
4
|
-
/* @__PURE__ */i(n,{direction:"row",alignItems:"
|
|
4
|
+
/* @__PURE__ */i(n,{direction:"row",alignItems:"baseline",spacing:.5,children:[
|
|
5
5
|
/* @__PURE__ */t(r,{variant:"number-inter",sx:{p:0,m:0,lineHeight:u.spacing(4)},children:y}),
|
|
6
6
|
/* @__PURE__ */t(r,{variant:"small-bold",color:u.custom.grey[1400],children:h})]})]}),b=(i=>{if(void 0===i)return"top";const t=(i%360+360)%360;return t>=315||t<45?"right":t>=45&&t<135?"top":t>=135&&t<225?"left":"bottom"})(x.angle),w=a({coordinate:{x:x.x,y:x.y},placement:b});return f.name&&/* @__PURE__ */t(o,{sx:w,children:/* @__PURE__ */t(d,{width:"max-content",title:v,placement:b,arrow:!0,open:!0,sx:l(),children:/* @__PURE__ */t("div",{style:{width:1,height:1,visibility:"hidden",pointerEvents:"none"}})})})};export{c as DoughnutTooltip};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{jsxs as e,jsx as n}from"react/jsx-runtime";import{useTheme as i,Stack as t,Box as r,Typography as o}from"@mui/material";import{calculateTooltipPosition as a,getTooltipContainerStyles as l}from"../shared/tooltipPositioning.js";import{FoodsTooltip as c}from"../../Tooltip/FoodsTooltip.js";const
|
|
1
|
+
import{jsxs as e,jsx as n}from"react/jsx-runtime";import{useTheme as i,Stack as t,Box as r,Typography as o}from"@mui/material";import{calculateTooltipPosition as a,getTooltipContainerStyles as l}from"../shared/tooltipPositioning.js";import{FoodsTooltip as c}from"../../Tooltip/FoodsTooltip.js";const s=s=>{const{active:d,hoveredIndex:p,data:m,coordinate:h,formatter:x,unit:u,icons:g}=s,v=i();if(!d||null===p||!h||!m[p])return null;const f=m[p],b=x?x(f.value,0):v.numbers.valueFormatterFn(f.value,0),y=/* @__PURE__ */e(t,{sx:{pointerEvents:"none"},direction:"column",alignItems:"flex-start",justifyContent:"center",spacing:v.spacing(1),children:[
|
|
2
2
|
/* @__PURE__ */e(t,{direction:"row",alignItems:"center",spacing:v.spacing(1),children:[g&&void 0!==p&&g[p]?/* @__PURE__ */n(r,{minWidth:"24px",width:"24px",height:"24px",sx:{background:f.color,padding:"4px",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"3px"},children:g[p]}):/* @__PURE__ */n(r,{sx:{width:"12px",height:"12px",borderRadius:"3px",backgroundColor:f.color}}),
|
|
3
3
|
/* @__PURE__ */n(o,{variant:"h6",children:f.name})]}),
|
|
4
|
-
/* @__PURE__ */e(t,{direction:"row",alignItems:"
|
|
4
|
+
/* @__PURE__ */e(t,{direction:"row",alignItems:"baseline",spacing:.5,children:[
|
|
5
5
|
/* @__PURE__ */n(o,{variant:"number-inter",sx:{p:0,m:0,lineHeight:v.spacing(4)},children:b}),u&&/* @__PURE__ */n(o,{variant:"small-bold",color:v.custom.grey[1400],children:u})]})]}),I=a({coordinate:{x:h.x,y:h.y},placement:"top"});/* @__PURE__ */
|
|
6
|
-
return n(r,{sx:{...I,zIndex:2e3,pointerEvents:"none"},children:/* @__PURE__ */n(c,{width:"max-content",title:y,disableInteractive:!0,placement:"top",arrow:!0,open:!0,popperZIndex:0,sx:l(),children:/* @__PURE__ */n("div",{style:{width:1,height:1,visibility:"hidden",pointerEvents:"none"}})})})};export{
|
|
6
|
+
return n(r,{sx:{...I,zIndex:2e3,pointerEvents:"none"},children:/* @__PURE__ */n(c,{width:"max-content",title:y,disableInteractive:!0,placement:"top",arrow:!0,open:!0,popperZIndex:0,sx:l(),children:/* @__PURE__ */n("div",{style:{width:1,height:1,visibility:"hidden",pointerEvents:"none"}})})})};export{s as PolymorphicChartTooltip};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as t,jsx as r}from"react/jsx-runtime";import{useTheme as
|
|
1
|
+
import{jsxs as e,Fragment as t,jsx as r}from"react/jsx-runtime";import{useTheme as n}from"@mui/material";import{usePlotArea as i,ReferenceLine as o,DefaultZIndexes as a,ZIndexLayer as l,Dot as d}from"recharts";import{POINT_RADIUS as s}from"./utils.js";const x=a.cursorLine,p=a.label+1,h=h=>{const c=n(),m=i(),{hover:y,valueFormatterFn:f=c.numbers.valueFormatterFn,precision:v,xDomain:g,yDomain:u,pointColor:k,isPointSelected:X=!1}=h;if(!y||!m)return null;const Y=e=>parseFloat(c.spacing(e)),z=Y(1),E=Y(2.5),F=Y(3.75),I=Y(0),W=c.shape.borderRadius??4,b=c.custom.grey[2800],w=c.palette.common.white,D=e=>f(e,v),S=e=>Math.max(F,Math.round(12*e.length*.6)+2*z),j=D(y.dataY),A=S(j),B=m.x-I-A-15,M=y.pixelY-E/2,C=B+A/2,L=M+E/2+1,P=D(y.dataX),R=S(P),q=y.pixelX-R/2,G=m.y+m.height+20,H=q+R/2,J=G+E/2+1;/* @__PURE__ */
|
|
2
2
|
return e(t,{children:[
|
|
3
|
-
/* @__PURE__ */r(o,{segment:[{x:g[0],y:y.dataY},{x:y.dataX,y:y.dataY}],stroke:
|
|
4
|
-
/* @__PURE__ */r(o,{segment:[{x:y.dataX,y:
|
|
3
|
+
/* @__PURE__ */r(o,{segment:[{x:g[0],y:y.dataY},{x:y.dataX,y:y.dataY}],stroke:c.palette.text.primary,style:{pointerEvents:"none"},zIndex:x}),
|
|
4
|
+
/* @__PURE__ */r(o,{segment:[{x:y.dataX,y:u[0]},{x:y.dataX,y:y.dataY}],stroke:c.palette.text.primary,style:{pointerEvents:"none"},zIndex:x}),
|
|
5
|
+
/* @__PURE__ */e(l,{zIndex:x,children:[
|
|
6
|
+
/* @__PURE__ */r("g",{"data-scatter-hover-marker-connector":"y",style:{pointerEvents:"none"},children:/* @__PURE__ */r("line",{x1:m.x,y1:y.pixelY,x2:m.x-15,y2:y.pixelY,stroke:c.palette.text.primary,strokeWidth:1})}),
|
|
7
|
+
/* @__PURE__ */r("g",{"data-scatter-hover-marker-connector":"x",style:{pointerEvents:"none"},children:/* @__PURE__ */r("line",{x1:y.pixelX,y1:G+E,x2:y.pixelX,y2:G-E,stroke:c.palette.text.primary,strokeWidth:1})})]}),k&&/* @__PURE__ */r(l,{zIndex:a.activeDot,children:/* @__PURE__ */r(d,{cx:y.pixelX,cy:y.pixelY,r:s,fill:k,"data-scatter-hovered-point":"true",style:{pointerEvents:"none",...X?{filter:"drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.5))",stroke:"#fff",strokeWidth:2}:{filter:"none"}}})}),
|
|
5
8
|
/* @__PURE__ */e(l,{zIndex:p,children:[
|
|
6
9
|
/* @__PURE__ */e("g",{"data-scatter-hover-marker":"y",style:{pointerEvents:"none"},children:[
|
|
7
|
-
/* @__PURE__ */r("
|
|
8
|
-
/* @__PURE__ */r("
|
|
9
|
-
/* @__PURE__ */r("text",{x:C,y:L,fill:I,fontSize:12,fontWeight:600,textAnchor:"middle",dominantBaseline:"middle",children:j})]}),
|
|
10
|
+
/* @__PURE__ */r("rect",{x:B,y:M,width:A,height:E,fill:b,rx:W}),
|
|
11
|
+
/* @__PURE__ */r("text",{x:C,y:L,fill:w,fontSize:12,fontWeight:600,textAnchor:"middle",dominantBaseline:"middle",children:j})]}),
|
|
10
12
|
/* @__PURE__ */e("g",{"data-scatter-hover-marker":"x",style:{pointerEvents:"none"},children:[
|
|
11
|
-
/* @__PURE__ */r("
|
|
12
|
-
/* @__PURE__ */r("
|
|
13
|
-
/* @__PURE__ */r("text",{x:H,y:J,fill:I,fontSize:12,fontWeight:600,textAnchor:"middle",dominantBaseline:"middle",children:P})]})]})]})};export{m as ScatterPlotHoverOverlay};
|
|
13
|
+
/* @__PURE__ */r("rect",{x:q,y:G,width:R,height:E,fill:b,rx:W}),
|
|
14
|
+
/* @__PURE__ */r("text",{x:H,y:J,fill:w,fontSize:12,fontWeight:600,textAnchor:"middle",dominantBaseline:"middle",children:P})]})]})]})};export{h as ScatterPlotHoverOverlay};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{jsxs as t,jsx as n}from"react/jsx-runtime";import{useTheme as i,Stack as
|
|
2
|
-
/* @__PURE__ */t(
|
|
3
|
-
/* @__PURE__ */n(
|
|
1
|
+
import{jsxs as t,jsx as n}from"react/jsx-runtime";import{useTheme as i,Stack as o,Typography as e,Box as r,Link as a,Button as s}from"@mui/material";import{calculateTooltipPosition as l,getTooltipContainerStyles as c}from"../shared/tooltipPositioning.js";import{forwardRef as p}from"react";import{FoodsIcon as d}from"../../Icons/FoodsIcon.js";import{FoodsTooltip as g}from"../../Tooltip/FoodsTooltip.js";const h={x:0,y:-5},u=p((p,u)=>{const m=i(),{point:b,coordinate:x,valueFormatterFn:f=m.numbers.valueFormatterFn,precision:y,unit:v,xUnit:C,yUnit:w,textOptions:I,showSeriesInTooltip:k=!0,tooltipOptions:j,onTooltipEnter:z,onTooltipLeave:F,handleDismissTooltip:H}=p,T=b.seriesName,E=w??v,P=C??v,$=I?.for??"for",L=I?.closeTooltip??"Close tooltip",M=()=>/* @__PURE__ */n(r,{component:"button",type:"button","aria-label":L,onClick:()=>H?.(),sx:{backgroundColor:"transparent",border:0,color:"inherit",cursor:"pointer",display:"flex",font:"inherit",alignItems:"center",justifyContent:"center",padding:m.spacing(.25),height:m.spacing(2.75),width:m.spacing(2.75),position:"absolute",top:m.spacing(-1),right:m.spacing(-1.5),borderRadius:"50%","&:hover":{color:m.palette.common.white,backgroundColor:"text.secondary",boxShadow:"0px 0px 4px rgba(0, 0, 0, 0.1)"},"&:focus-visible":{outline:`${m.spacing(.25)} solid ${m.palette.text.primary}`,outlineOffset:m.spacing(.25)}},children:/* @__PURE__ */n(r,{sx:{display:"flex",transform:"rotate(45deg)"},children:/* @__PURE__ */n(d,{icon:"plus",size:2})})}),O=/* @__PURE__ */t(o,{direction:"column",spacing:m.spacing(.5),pb:m.spacing(.25),onClick:t=>t.stopPropagation(),onMouseLeave:()=>F?.(),sx:{pointerEvents:"auto",position:"relative"},children:[
|
|
2
|
+
/* @__PURE__ */t(o,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:m.spacing(1),useFlexGap:!0,pr:m.spacing(2),children:[
|
|
3
|
+
/* @__PURE__ */n(e,{variant:"h4",lineHeight:m.spacing(2),children:b.label}),
|
|
4
4
|
/* @__PURE__ */n(M,{})]}),
|
|
5
|
-
/* @__PURE__ */t(
|
|
6
|
-
/* @__PURE__ */n(
|
|
7
|
-
/* @__PURE__ */n(
|
|
8
|
-
/* @__PURE__ */n(
|
|
9
|
-
/* @__PURE__ */n(
|
|
10
|
-
/* @__PURE__ */n(
|
|
11
|
-
/* @__PURE__ */n(r,{sx:{width:m.spacing(1.5),height:m.spacing(1.5),borderRadius:"50%",backgroundColor:
|
|
12
|
-
/* @__PURE__ */n(
|
|
13
|
-
return n(r,{ref:u,style:{position:"absolute",...R,zIndex:m.zIndex.tooltip,pointerEvents:"auto"},onMouseEnter:z,onMouseLeave:F,children:/* @__PURE__ */n(g,{width:"inherit",title:O,placement:"top",arrow:!0,open:!0,sx:{...
|
|
5
|
+
/* @__PURE__ */t(o,{pt:m.spacing(1),direction:"row",spacing:m.spacing(.5),alignItems:"center",flexWrap:"wrap",children:[
|
|
6
|
+
/* @__PURE__ */n(e,{variant:"number-small",lineHeight:m.spacing(2),color:"text.primary",children:f(b.y,y)}),
|
|
7
|
+
/* @__PURE__ */n(e,{variant:"body2",lineHeight:m.spacing(2),color:"text.secondary",children:E?` ${E}`:""}),
|
|
8
|
+
/* @__PURE__ */n(e,{variant:"body2",lineHeight:m.spacing(2),color:"text.primary",children:$}),
|
|
9
|
+
/* @__PURE__ */n(e,{variant:"number-small",lineHeight:m.spacing(2),color:"text.primary",children:f(b.x,y)}),
|
|
10
|
+
/* @__PURE__ */n(e,{variant:"body2",lineHeight:m.spacing(2),color:"text.secondary",children:P?` ${P}`:""})]}),b.additionalContent&&/* @__PURE__ */n(r,{sx:{pt:m.spacing(2)},children:b.additionalContent}),T&&k&&/* @__PURE__ */n(o,{direction:"row",alignItems:"flex-end",justifyContent:"flex-end",spacing:m.spacing(1),pt:m.spacing(2),children:/* @__PURE__ */t(o,{direction:"row",alignItems:"center",spacing:m.spacing(1),children:[
|
|
11
|
+
/* @__PURE__ */n(r,{sx:{width:m.spacing(1.5),height:m.spacing(1.5),borderRadius:"50%",backgroundColor:b.seriesColor}}),
|
|
12
|
+
/* @__PURE__ */n(e,{variant:"body2",lineHeight:m.spacing(2),color:"text.secondary",fontWeight:500,children:T})]})}),j?.button?j.button.href?/* @__PURE__ */n(a,{href:j.button.href,target:"_blank",rel:"noopener noreferrer",children:/* @__PURE__ */n(s,{sx:{color:m.palette.text.primary,mt:m.spacing(2)},variant:j?.button?.variant,size:j?.button?.size,startIcon:j?.button?.startIcon,onClick:t=>{t.stopPropagation(),j?.button?.onClick?.()},children:j.button.text})}):/* @__PURE__ */n(s,{sx:{mt:m.spacing(2)},variant:j?.button?.variant,size:j?.button?.size,startIcon:j?.button?.startIcon,onClick:t=>{t.stopPropagation(),j?.button?.onClick?.()},children:j?.button?.text}):null]}),R=l({coordinate:{x:x.xValue,y:x.yValue},placement:"top",offset:h});/* @__PURE__ */
|
|
13
|
+
return n(r,{ref:u,style:{position:"absolute",...R,zIndex:m.zIndex.tooltip,pointerEvents:"auto"},onMouseEnter:z,onMouseLeave:F,children:/* @__PURE__ */n(g,{width:"inherit",title:O,placement:"top",arrow:!0,open:!0,sx:{...c()},children:/* @__PURE__ */n("div",{style:{width:1,height:1,visibility:"hidden",pointerEvents:"none"}})})})});export{u as ScatterPlotTooltip};
|
|
@@ -1,11 +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=(
|
|
2
|
-
return i(a,{gap:
|
|
3
|
-
/* @__PURE__ */i(a,{direction:{xs:"column",md:"row"},alignItems:{xs:"stretch",md:"center"},flexWrap:"wrap",gap:
|
|
4
|
-
/* @__PURE__ */i(a,{direction:"row",alignItems:"center",gap:
|
|
5
|
-
/* @__PURE__ */t(r,{variant:"body-semibold",noWrap:0===
|
|
6
|
-
/* @__PURE__ */i(a,{direction:"row",alignItems:"center",gap:
|
|
7
|
-
/* @__PURE__ */i(a,{direction:"row",alignItems:"center",gap:
|
|
8
|
-
/* @__PURE__ */t(o,{role:"progressbar","aria-label":
|
|
9
|
-
/* @__PURE__ */i(a,{direction:"row",alignItems:"baseline",gap:
|
|
10
|
-
/* @__PURE__ */t(r,{variant:"body-semibold",children:
|
|
11
|
-
/* @__PURE__ */t(r,{variant:"body-regular",children:
|
|
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=({depth:m=0,getCollapseLabel:u,getExpandLabel:h,item:p,isLast:g,mode:b,scale:x})=>{const v=e(),[f,z]=n(!1),w=p.value??0,W=w<0,k=`${p.label} ${p.formattedValue}${"%"===p.unit?"":" "}${p.unit}`,y=p.children.length>0,I=x.range>0?Math.min(100,Math.abs(w)/x.range*100):0,S=W||0===w&&x.range>0&&!x.hasPositiveValue,B=((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}})(p.iconTone,v),C=((i,t)=>({lifecycle:t.custom.scoreDetail.lifecycleBreakdownWidth,subscores:t.custom.scoreDetail.subscoreBreakdownWidth,impacts:t.custom.scoreDetail.impactBreakdownWidth}[i]))(b,v),D=`calc(${C} - ${v.custom.scoreDetail.barWidth} - ${v.spacing(2)})`;/* @__PURE__ */
|
|
2
|
+
return i(a,{gap:f?v.spacing(0===m?2:1):0,sx:{paddingBottom:0!==m||g?0:v.spacing(2),position:"relative"},children:[
|
|
3
|
+
/* @__PURE__ */i(a,{direction:{xs:"column",md:"row"},alignItems:{xs:"stretch",md:"center"},flexWrap:"wrap",gap:v.spacing(2),children:[
|
|
4
|
+
/* @__PURE__ */i(a,{direction:"row",alignItems:"center",gap:v.spacing(1.5),minWidth:0,sx:{boxSizing:"border-box",flexBasis:{xs:"auto",md:v.custom.scoreDetail.summaryWidth},flexGrow:{xs:0,md:1},paddingInlineStart:m>0?v.spacing(4):0,width:{xs:"100%",md:"auto"}},children:[y?/* @__PURE__ */t(d,{size:"xs",icon:f?"arrowDownShort":"arrowRightShort",buttonProps:{"aria-expanded":f,"aria-label":f?u(p):h(p),onClick:()=>z(i=>!i)}}):"lifecycle"===b&&p.icon?/* @__PURE__ */t(o,{"aria-hidden":!0,sx:{flexShrink:0,height:v.spacing(3),width:v.spacing(3)}}):null,p.icon&&/* @__PURE__ */t(o,{sx:{alignItems:"center",backgroundColor:B?.variant[100],borderRadius:v.spacing(.5),color:B?.main,display:"flex",flexShrink:0,height:v.spacing(3),justifyContent:"center",width:v.spacing(3)},children:/* @__PURE__ */t(s,{icon:p.icon,size:1})}),
|
|
5
|
+
/* @__PURE__ */t(r,{variant:"body-semibold",noWrap:0===m||"lifecycle"!==b,children:p.label})]}),
|
|
6
|
+
/* @__PURE__ */i(a,{direction:"row",alignItems:"center",gap:p.information?v.spacing(2):0,flexShrink:0,minWidth:0,sx:{maxWidth:"100%"},children:[
|
|
7
|
+
/* @__PURE__ */i(a,{direction:"row",alignItems:"center",gap:v.spacing(2),flexShrink:1,minWidth:0,sx:{maxWidth:"100%",width:C},children:[
|
|
8
|
+
/* @__PURE__ */t(o,{role:"progressbar","aria-label":k,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":I,sx:{backgroundColor:"inherit",borderRadius:0,flexShrink:1,height:v.spacing(2),maxWidth:"100%",position:"relative",width:v.custom.scoreDetail.barWidth},children:/* @__PURE__ */t(o,{"aria-hidden":!0,sx:{backgroundColor:W?v.custom.green[600]:v.palette.primary[600],borderBottomLeftRadius:W?v.spacing(.5):0,borderBottomRightRadius:W?0:v.spacing(.5),borderTopLeftRadius:W?v.spacing(.5):0,borderTopRightRadius:W?0:v.spacing(.5),height:"100%",insetInlineEnd:S?100-x.zeroPosition+"%":void 0,insetInlineStart:S?void 0:`${x.zeroPosition}%`,maxWidth:"100%",minWidth:v.custom.barChart.zeroValueWidth,position:"absolute",width:0===w?v.custom.barChart.zeroValueWidth:`${I}%`}})}),
|
|
9
|
+
/* @__PURE__ */i(a,{"data-testid":`score-distribution-value-${p.id}`,direction:"row",alignItems:"baseline",gap:v.spacing(.5),justifyContent:"flex-end",sx:{color:W?v.custom.green[700]:v.custom.grey[2800],flexShrink:0,minWidth:"max-content",width:D},children:[
|
|
10
|
+
/* @__PURE__ */t(r,{variant:"body-semibold",children:p.formattedValue}),
|
|
11
|
+
/* @__PURE__ */t(r,{variant:"body-regular",children:p.unit})]})]}),p.information&&/* @__PURE__ */t(d,{size:"xs",icon:"information",buttonProps:{"aria-label":p.information.label},tooltip:{text:p.information.tooltip,props:{describeChild:!0}}})]})]}),f&&/* @__PURE__ */t(a,{gap:v.spacing(1),children:p.children.map((i,e)=>/* @__PURE__ */t(l,{depth:m+1,getCollapseLabel:u,getExpandLabel:h,item:i,isLast:e===p.children.length-1,mode:b,scale:c(p.children)},i.id))}),0===m&&!g&&/* @__PURE__ */t(o,{"aria-hidden":!0,sx:{borderBottomColor:v.custom.strokes.containerDivider.color,borderBottomStyle:v.custom.strokes.containerDivider.style,borderBottomWidth:v.custom.strokes.containerDivider.width,bottom:0,insetInline:0,pointerEvents:"none",position:"absolute"}})]})};export{l as ScoreDistributionRow};
|
|
@@ -30,13 +30,14 @@ export type ConfirmOptions = {
|
|
|
30
30
|
confirmExit: true;
|
|
31
31
|
confirmOptions: ConfirmOptionsType;
|
|
32
32
|
};
|
|
33
|
+
export type FoodsFormValidationResult = boolean | void;
|
|
33
34
|
export type FoodsFormBaseProps = ConfirmOptions & {
|
|
34
35
|
pages: FoodsPage[];
|
|
35
36
|
children?: ReactNode;
|
|
36
37
|
textOptions: DisplayTextOptions;
|
|
37
38
|
startingPage?: number;
|
|
38
39
|
onClose?: () => void;
|
|
39
|
-
onValidate?: () =>
|
|
40
|
+
onValidate?: () => FoodsFormValidationResult | Promise<FoodsFormValidationResult>;
|
|
40
41
|
onPageChange?: (newPageIndex: number, previousPageIndex: number) => void;
|
|
41
42
|
showSync?: boolean;
|
|
42
43
|
isLoading?: boolean;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{useTheme as
|
|
2
|
-
/* @__PURE__ */e(a,{variant:"body-bold",children:
|
|
1
|
+
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{useTheme as n,useMediaQuery as o,Button as r,Box as t,Typography as a,Stack as s}from"@mui/material";import{CloseOutlined as d}from"@mui/icons-material";import{useFormBaseContext as c}from"../FormBaseContext.js";import{SavingCloudStatus as p}from"./SavingCloudStatus.js";import{FoodsIcon as m}from"../../../Icons/FoodsIcon.js";import{WhitePopover as g}from"../../../Popover/WhitePopover.js";const l=()=>{const{confirmExit:l,selectedPageIndex:x,setPage:h,maxPage:f,forwardLock:u,previousLock:w,textOptions:v,onClose:y,onValidate:k,onPageChange:P,showSync:b,setFormSaved:C,setIsConfirmOpen:I,isLoading:L,selectedPageIndex:j}=c(),S=n(),z=o(S.breakpoints.down("md")),W=x===f-1&&v.finalPage?v.finalPage:v.nextPage,F=/* @__PURE__ */e(r,{variant:"primary",disabled:u.isLocked||L,endIcon:/* @__PURE__ */e(m,{icon:"arrowTrajectory",size:2}),onClick:()=>{if(x!==f-1)return C(!1),P?.(x+1,x),h(x+1);(async()=>{C(!1);try{const e=await(k?.());C(!1!==e)}catch{C(!1)}})()},sx:z?{minWidth:"80px",fontSize:"0.875rem",padding:"8px 12px"}:{},children:W}),T=v.previousPage&&/* @__PURE__ */e(r,{sx:z?{minWidth:"80px",fontSize:"0.875rem",padding:"8px 12px"}:{minWidth:"90px"},variant:"text",disabled:0===j||w.isLocked||L,startIcon:0===j||w.isLocked||L?null:/* @__PURE__ */e(m,{icon:"arrowLeft",size:2}),onClick:()=>{if(C(!1),0!==x)return P?.(x-1,x),h(x-1);P?.(x,x)},children:v.previousPage}),O=/* @__PURE__ */i(t,{padding:"12px 16px",children:[
|
|
2
|
+
/* @__PURE__ */e(a,{variant:"body-bold",children:v.warningText?v.warningText:""}),
|
|
3
3
|
/* @__PURE__ */e("br",{}),
|
|
4
|
-
/* @__PURE__ */e(a,{variant:"body",children:
|
|
5
|
-
|
|
6
|
-
/* @__PURE__ */i(
|
|
4
|
+
/* @__PURE__ */e(a,{variant:"body",children:u.isLocked&&u.message||""})]}),R=u.isLocked&&W?/* @__PURE__ */e(g,{icon:F,body:O,size:"260px",leftPosition:130}):W&&F,B=y&&/* @__PURE__ */e(r,{variant:"white-filled",onClick:()=>l?I(!0):y(),sx:{minWidth:0,aspectRatio:1,borderRadius:"100%",padding:0,...z&&{width:S.spacing(5),height:S.spacing(5)},"&:hover":{background:S.custom.grey[400]},"&:active":{background:S.custom.grey[600]}},children:/* @__PURE__ */e(d,{sx:{width:S.spacing(2.5),color:S.custom.grey[2800]}})});/* @__PURE__ */
|
|
5
|
+
return i(s,z?{direction:"row",alignItems:"center",gap:S.spacing(1),width:"100%",children:[
|
|
6
|
+
/* @__PURE__ */i(s,{direction:"row",gap:S.spacing(1),alignItems:"center",justifyContent:"space-between",flexGrow:1,children:[T,R]}),B]}:{direction:"row",alignItems:"center",justifyContent:"end",gap:"28px",children:[
|
|
7
|
+
/* @__PURE__ */e(t,{sx:{">*":{display:"flex"}},children:b&&/* @__PURE__ */e(p,{})}),
|
|
8
|
+
/* @__PURE__ */i(s,{direction:"row",gap:"20px",children:[T,R]}),B]})};export{l as ActionButtons};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import{jsx as i,jsxs as r}from"react/jsx-runtime";import{IconThread as e}from"./IconThread.js";import{useTheme as
|
|
2
|
-
/* @__PURE__ */
|
|
3
|
-
/* @__PURE__ */i(
|
|
4
|
-
/* @__PURE__ */i(l,{})]}),
|
|
5
|
-
/* @__PURE__ */i(
|
|
6
|
-
/* @__PURE__ */i(
|
|
7
|
-
/* @__PURE__ */i(
|
|
8
|
-
/* @__PURE__ */i(o,{sx:{gridColumn:"3 / 3",gridRow:" 1 / 1",display:"flex",justifyContent:"right"},children:/* @__PURE__ */i(l,{})})]})};export{p as FormTopBar};
|
|
1
|
+
import{jsx as i,jsxs as r}from"react/jsx-runtime";import{IconThread as e}from"./IconThread.js";import{useTheme as o,useMediaQuery as t,Box as n,Stack as d}from"@mui/material";import{BarTitle as s}from"./BarTitle.js";import{ActionButtons as l}from"./ActionButtons.js";const p=()=>{const p=o();return t(p.breakpoints.down("md"))?/* @__PURE__ */i(n,{sx:{zIndex:1e3,minHeight:"auto",top:"28px",border:"1px solid #E7E6E4",borderRadius:"28px",backgroundColor:"#FFFFFF",padding:"20px 24px"},children:/* @__PURE__ */r(d,{direction:"column",spacing:1,alignItems:"center",children:[
|
|
2
|
+
/* @__PURE__ */i(n,{sx:{width:"100%"},children:/* @__PURE__ */i(s,{})}),
|
|
3
|
+
/* @__PURE__ */i(n,{sx:{display:"flex",justifyContent:"center"},children:/* @__PURE__ */i(e,{})}),
|
|
4
|
+
/* @__PURE__ */i(n,{sx:{width:"100%"},children:/* @__PURE__ */i(l,{})})]})}):/* @__PURE__ */r(n,{sx:{zIndex:1e3,minHeight:"96px",position:"sticky",top:"28px",border:"1px solid #E7E6E4",borderRadius:"52px",backgroundColor:"#FFFFFF",padding:"20px 28px",display:"grid",gridTemplateColumns:"1fr 50% 1fr",gridTemplateRows:"1fr",alignItems:"center"},children:[
|
|
5
|
+
/* @__PURE__ */i(n,{sx:{gridColumn:"1 / 3",gridRow:" 1 / 1",display:"flex",justifyContent:"left"},children:/* @__PURE__ */i(s,{})}),
|
|
6
|
+
/* @__PURE__ */i(n,{sx:{gridColumn:"2 / 3",gridRow:" 1 / 1",display:"flex",justifyContent:"center"},children:/* @__PURE__ */i(e,{})}),
|
|
7
|
+
/* @__PURE__ */i(n,{sx:{gridColumn:"3 / 3",gridRow:" 1 / 1",display:"flex",justifyContent:"right"},children:/* @__PURE__ */i(l,{})})]})};export{p as FormTopBar};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { TabProps } from '@mui/material';
|
|
1
2
|
export type CountTab<Id extends string = string> = {
|
|
2
3
|
id: Id;
|
|
3
4
|
label: string;
|
|
4
5
|
count: number;
|
|
6
|
+
tabProps?: Pick<TabProps, "id" | "aria-controls">;
|
|
5
7
|
};
|
|
6
8
|
export type CountTabsProps<Id extends string = string> = {
|
|
7
9
|
tabs: CountTab<Id>[];
|
|
8
10
|
activeId: Id;
|
|
9
11
|
onChange: (id: Id) => void;
|
|
10
12
|
isLoading?: boolean;
|
|
11
|
-
ariaLabel
|
|
13
|
+
ariaLabel: string;
|
|
12
14
|
};
|
|
13
15
|
export declare const CountTabs: <Id extends string = string>(props: CountTabsProps<Id>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{jsx as
|
|
2
|
-
return
|
|
3
|
-
return
|
|
4
|
-
/* @__PURE__ */
|
|
5
|
-
/* @__PURE__ */
|
|
1
|
+
import{jsx as o,jsxs as e}from"react/jsx-runtime";import{useTheme as r,Stack as i,ButtonBase as t,Typography as n,Skeleton as a,alpha as l}from"@mui/material";import{useRef as d}from"react";const c=c=>{const{tabs:s,activeId:b,onChange:u,isLoading:g=!1,ariaLabel:p}=c,h=r(),m=d([]),f=h.custom.countTabs;/* @__PURE__ */
|
|
2
|
+
return o(i,{role:"tablist","aria-label":p,"aria-busy":g,direction:"row",flexWrap:"wrap",gap:f.gap,children:s.map((r,i)=>{const d=r.id===b,c=d?f.selected:f.default;/* @__PURE__ */
|
|
3
|
+
return e(t,{action:o=>{m.current[i]=o},role:"tab",id:r.tabProps?.id,"aria-controls":r.tabProps?.["aria-controls"],"aria-label":g?r.label:`${r.label} - ${r.count}`,"aria-selected":d,tabIndex:d?0:-1,onKeyDown:o=>((o,e)=>{let r;"ArrowRight"===o.key&&(r=(e+1)%s.length),"ArrowLeft"===o.key&&(r=(e-1+s.length)%s.length),"Home"===o.key&&(r=0),"End"===o.key&&(r=s.length-1),void 0!==r&&(o.preventDefault(),m.current[r]?.focusVisible())})(o,i),onClick:()=>u(r.id),sx:{alignItems:"center",background:c.background,border:`${h.custom.strokes.containerDivider.width} ${h.custom.strokes.containerDivider.style} ${c.borderColor}`,borderRadius:f.borderRadius,boxShadow:c.boxShadow,color:c.color,display:"inline-flex",fontFamily:h.typography.fontFamily,minHeight:f.minHeight,padding:f.padding,"&:hover":{background:c.hoverBackground},"&.Mui-focusVisible":{outline:`${f.focusRing.width} solid ${f.focusRing.color}`,outlineOffset:f.focusRing.offset}},children:[
|
|
4
|
+
/* @__PURE__ */o(n,{component:"span",variant:"body-bold",color:"inherit",children:r.label}),
|
|
5
|
+
/* @__PURE__ */o(n,{component:"span",variant:"body-bold",color:"inherit",sx:{px:f.separatorPaddingInline},children:"-"}),g?/* @__PURE__ */o(a,{variant:"text",width:f.loadingWidth,sx:{bgcolor:d?l(h.custom.grey[100],f.loadingSelectedOpacity):void 0}}):/* @__PURE__ */o(n,{component:"span",variant:"body-bold",color:"inherit",children:r.count})]},r.id)})})};export{c as CountTabs};
|
|
@@ -239,6 +239,11 @@ export declare const countTabs: {
|
|
|
239
239
|
readonly minHeight: "36px";
|
|
240
240
|
readonly padding: "8px 12px";
|
|
241
241
|
readonly borderRadius: "8px";
|
|
242
|
+
readonly focusRing: {
|
|
243
|
+
readonly color: "#393A36";
|
|
244
|
+
readonly width: "2px";
|
|
245
|
+
readonly offset: "2px";
|
|
246
|
+
};
|
|
242
247
|
readonly separatorPaddingInline: "4px";
|
|
243
248
|
readonly loadingWidth: 24;
|
|
244
249
|
readonly loadingSelectedOpacity: 0.3;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"i18next";import{greyTheme as i,shadows as r,redTheme as o,allMainColors as t,allColors as d,extraColors as a,dataVisualizationColors as n,coralTheme as p,blueTheme as h,yellowTheme as x,orangeTheme as c,greenTheme as l}from"./colors.js";const g={containerDivider:{color:i[600],style:"solid",width:"1px"}},s={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:{...g.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:g.containerDivider,emptyCopy:{typographyVariant:"body-regular",lineHeight:1.3}},compact:{size:110,contentInset:"6px",stroke:{...g.containerDivider,style:"dashed"},boxShadow:r.grey,emptyCopy:{width:"76px",typographyVariant:"small-regular"}},thumbnail:{size:70,contentInset:"4px",stroke:g.containerDivider,boxShadow:r.grey}},f={display:{height:"26px"}},$={gap:"8px",minHeight:"36px",padding:"8px 12px",borderRadius:"8px",separatorPaddingInline:"4px",loadingWidth:24,loadingSelectedOpacity:.3,default:{background:`linear-gradient(180deg, ${i[100]} 0%, ${i[300]} 154.5%)`,hoverBackground:`linear-gradient(180deg, ${i[100]} 0%, ${i[400]} 154.5%)`,borderColor:i[500],boxShadow:r.grey,color:i[2800]},selected:{background:`linear-gradient(180deg, ${i[2600]} 0%, ${i[3e3]} 100%)`,hoverBackground:i[2800],borderColor:i[2800],boxShadow:r.hard,color:i[100]}},B={primary:{height:"60px"},secondary:{height:"60px"}},C={summaryWidth:"250px",barWidth:"250px",lifecycleBreakdownWidth:"364px",subscoreBreakdownWidth:"346px",impactBreakdownWidth:"318px",impactZeroBreakdownWidth:"292px",impactBenefitBreakdownWidth:"551px"},W={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]}},R=`inset 0 0 0 ${g.containerDivider.width} ${g.containerDivider.color}`,I={gap:"4px",separatorIconSize:{width:16,height:16},pageLink:{height:"26px",paddingBlock:"2px",paddingInline:"8px",borderRadius:"8px",maxWidth:"226px",stroke:{default:R,hover:`inset 0 0 0 ${g.containerDivider.width} ${i[2800]}`},collapsed:{width:"24px",height:"16px",paddingInline:"4px",borderRadius:"4px"}},overflowMenu:{offset:"4px",padding:"16px",gap:"8px",borderRadius:"12px",boxShadow:`${R}, ${r.popover}`}},F=`${g.containerDivider.width} ${g.containerDivider.style} ${i[500]}`,E=`${g.containerDivider.width} ${g.containerDivider.style} ${g.containerDivider.color}`,V={contentAlignment:"center",default:{maxCharacters:100,width:"202px",maxWidth:"unset",padding:"12px 16px 12px 16px",borderRadius:"0.5rem",border:F,backgroundColor:i[100],boxShadow:`0px 4px 20px 0px ${i[500]}`,color:i[2800],margin:"8px",typographyVariant:"body-medium",arrow:{color:i[100],border:F}},simple:{width:"300px",maxWidth:"300px",contentMinHeight:"53px",paddingBlock:"2px",paddingInline:"8px",borderRadius:"8px",border:E,backgroundColor:i[100],boxShadow:r.popover,color:i[2500],margin:"8px",typographyVariant:"body-medium",arrow:{width:"16px",height:"8px",color:i[100],border:E}}},H={grey:i,red:o,green:l,orange:c,yellow:x,blue:h,coral:p,shadows:r,dataviz:{colors:n,extra:a,colorsWithExtra:d,onlyMainFromAll:t},doughnutCard:s,strokes:g,status:u,scoreCard:m,scoreOverviewCard:b,ingredientCard:w,scoreValue:y,numberWithUnit:k,formField:v,barChart:z,mediaUpload:S,tags:f,countTabs:$,tabs:B,scoreDetail:C,toggleSwitch:W,deleteButton:D,breadcrumb:I,tooltip:V,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,I as breadcrumb,$ as countTabs,H as custom,D as deleteButton,s as doughnutCard,v as formField,w as ingredientCard,S as mediaUpload,k as numberWithUnit,M as numbers,m as scoreCard,C as scoreDetail,b as scoreOverviewCard,y as scoreValue,u as status,g as strokes,B as tabs,f as tags,W as toggleSwitch,V as tooltip};
|
|
1
|
+
import e from"i18next";import{greyTheme as i,shadows as r,redTheme as o,allMainColors as t,allColors as d,extraColors as a,dataVisualizationColors as n,coralTheme as p,blueTheme as h,yellowTheme as x,orangeTheme as c,greenTheme as l}from"./colors.js";const g={containerDivider:{color:i[600],style:"solid",width:"1px"}},s={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:{...g.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:g.containerDivider,emptyCopy:{typographyVariant:"body-regular",lineHeight:1.3}},compact:{size:110,contentInset:"6px",stroke:{...g.containerDivider,style:"dashed"},boxShadow:r.grey,emptyCopy:{width:"76px",typographyVariant:"small-regular"}},thumbnail:{size:70,contentInset:"4px",stroke:g.containerDivider,boxShadow:r.grey}},f={display:{height:"26px"}},$={gap:"8px",minHeight:"36px",padding:"8px 12px",borderRadius:"8px",focusRing:{color:i[2800],width:"2px",offset:"2px"},separatorPaddingInline:"4px",loadingWidth:24,loadingSelectedOpacity:.3,default:{background:`linear-gradient(180deg, ${i[100]} 0%, ${i[300]} 154.5%)`,hoverBackground:`linear-gradient(180deg, ${i[100]} 0%, ${i[400]} 154.5%)`,borderColor:i[500],boxShadow:r.grey,color:i[2800]},selected:{background:`linear-gradient(180deg, ${i[2600]} 0%, ${i[3e3]} 100%)`,hoverBackground:i[2800],borderColor:i[2800],boxShadow:r.hard,color:i[100]}},B={primary:{height:"60px"},secondary:{height:"60px"}},C={summaryWidth:"250px",barWidth:"250px",lifecycleBreakdownWidth:"364px",subscoreBreakdownWidth:"346px",impactBreakdownWidth:"318px",impactZeroBreakdownWidth:"292px",impactBenefitBreakdownWidth:"551px"},W={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]}},R=`inset 0 0 0 ${g.containerDivider.width} ${g.containerDivider.color}`,I={gap:"4px",separatorIconSize:{width:16,height:16},pageLink:{height:"26px",paddingBlock:"2px",paddingInline:"8px",borderRadius:"8px",maxWidth:"226px",stroke:{default:R,hover:`inset 0 0 0 ${g.containerDivider.width} ${i[2800]}`},collapsed:{width:"24px",height:"16px",paddingInline:"4px",borderRadius:"4px"}},overflowMenu:{offset:"4px",padding:"16px",gap:"8px",borderRadius:"12px",boxShadow:`${R}, ${r.popover}`}},F=`${g.containerDivider.width} ${g.containerDivider.style} ${i[500]}`,E=`${g.containerDivider.width} ${g.containerDivider.style} ${g.containerDivider.color}`,V={contentAlignment:"center",default:{maxCharacters:100,width:"202px",maxWidth:"unset",padding:"12px 16px 12px 16px",borderRadius:"0.5rem",border:F,backgroundColor:i[100],boxShadow:`0px 4px 20px 0px ${i[500]}`,color:i[2800],margin:"8px",typographyVariant:"body-medium",arrow:{color:i[100],border:F}},simple:{width:"300px",maxWidth:"300px",contentMinHeight:"53px",paddingBlock:"2px",paddingInline:"8px",borderRadius:"8px",border:E,backgroundColor:i[100],boxShadow:r.popover,color:i[2500],margin:"8px",typographyVariant:"body-medium",arrow:{width:"16px",height:"8px",color:i[100],border:E}}},H={grey:i,red:o,green:l,orange:c,yellow:x,blue:h,coral:p,shadows:r,dataviz:{colors:n,extra:a,colorsWithExtra:d,onlyMainFromAll:t},doughnutCard:s,strokes:g,status:u,scoreCard:m,scoreOverviewCard:b,ingredientCard:w,scoreValue:y,numberWithUnit:k,formField:v,barChart:z,mediaUpload:S,tags:f,countTabs:$,tabs:B,scoreDetail:C,toggleSwitch:W,deleteButton:D,breadcrumb:I,tooltip:V,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,I as breadcrumb,$ as countTabs,H as custom,D as deleteButton,s as doughnutCard,v as formField,w as ingredientCard,S as mediaUpload,k as numberWithUnit,M as numbers,m as scoreCard,C as scoreDetail,b as scoreOverviewCard,y as scoreValue,u as status,g as strokes,B as tabs,f as tags,W as toggleSwitch,V as tooltip};
|