@foodpilot/foods 2.17.1 → 2.17.3
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/assets/unchecked.svg.js +1 -1
- package/dist/components/Checkbox/BaseCheckbox.js +2 -2
- package/dist/components/Checkbox/PrimaryCheckbox.js +2 -2
- package/dist/components/Checkbox/StyledCheckbox.d.ts +4 -0
- package/dist/components/Checkbox/StyledCheckbox.js +1 -0
- package/dist/components/Number/ScoreValue.d.ts +6 -4
- package/dist/components/Number/ScoreValue.js +1 -1
- package/dist/themes/common/custom.d.ts +6 -0
- package/dist/themes/common/custom.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";const t=t=>/* @__PURE__ */e.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},/* @__PURE__ */e.createElement("rect",{x:1,y:1,width:18,height:18,rx:3,fill:"white"}),/* @__PURE__ */e.createElement("rect",{x:1,y:1,width:18,height:18,rx:3,stroke:"
|
|
1
|
+
import*as e from"react";const t=t=>/* @__PURE__ */e.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},/* @__PURE__ */e.createElement("rect",{x:1,y:1,width:18,height:18,rx:3,fill:"white"}),/* @__PURE__ */e.createElement("rect",{x:1,y:1,width:18,height:18,rx:3,stroke:"currentColor",strokeWidth:2}));export{t as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{FormGroup as o,FormControlLabel as r
|
|
2
|
-
return e(o,{...p,children:h.map(([o,
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{FormGroup as o,FormControlLabel as r}from"@mui/material";import s from"../../assets/unchecked.svg.js";import t from"../../assets/checked.svg.js";import{StyledCheckbox as c}from"./StyledCheckbox.js";const n=n=>{const{values:a,onChange:m,FormGroupProps:p,FormControlLabelProps:i,CheckboxProps:l}=n,h=Object.entries(a);/* @__PURE__ */
|
|
2
|
+
return e(o,{...p,children:h.map(([o,n],p)=>/* @__PURE__ */e(r,{sx:e=>({gap:e.spacing(2)}),checked:n.state,...i,label:n.name,control:/* @__PURE__ */e(c,{checkedIcon:/* @__PURE__ */e(t,{}),icon:/* @__PURE__ */e(s,{}),disableRipple:!0,...l,onChange:(e,r)=>{const s={...a};s[o]={...s[o],name:n.name,state:r},m(s)}})},`${o}-${p}`))})};export{n as BaseCheckbox};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{FormGroup as
|
|
2
|
-
return e(
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{FormGroup as t,FormControlLabel as s}from"@mui/material";import o from"../../assets/checked.svg.js";import c from"../../assets/unchecked.svg.js";import{StyledCheckbox as n}from"./StyledCheckbox.js";const r=r=>{const{values:a,...m}=r,{onChange:i,...p}=m,l=Object.entries(a);/* @__PURE__ */
|
|
2
|
+
return e(t,{children:l.map(([t,r],a)=>/* @__PURE__ */e(s,{control:/* @__PURE__ */e(n,{...p,checkedIcon:/* @__PURE__ */e(o,{}),icon:/* @__PURE__ */e(c,{}),disableRipple:!0,onChange:(e,s)=>{const o={};o[t]={name:r.name,state:s},i(o)}}),sx:e=>({gap:e.spacing(2)}),label:r.name,checked:r.state},`${t}-${a}`))})};export{r as PrimaryCheckbox};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{styled as o,Checkbox as r}from"@mui/material";const e=o(r)(({theme:o})=>({color:o.custom.grey[1600],":hover":{background:o.custom.grey[400]}}));export{e as StyledCheckbox};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
type
|
|
2
|
-
value: number | string;
|
|
1
|
+
type ScoreValueBaseProps = {
|
|
3
2
|
unit: string;
|
|
3
|
+
preserveUnitLineBreaks?: boolean;
|
|
4
|
+
};
|
|
5
|
+
type FilledScoreValueProps = ScoreValueBaseProps & {
|
|
6
|
+
value: number | string;
|
|
4
7
|
emptyLabel?: never;
|
|
5
8
|
};
|
|
6
|
-
type EmptyScoreValueProps = {
|
|
9
|
+
type EmptyScoreValueProps = ScoreValueBaseProps & {
|
|
7
10
|
value: null;
|
|
8
|
-
unit: string;
|
|
9
11
|
emptyLabel: string;
|
|
10
12
|
};
|
|
11
13
|
export type ScoreValueProps = FilledScoreValueProps | EmptyScoreValueProps;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useTheme as i,Stack as o,Box as t,Typography as n}from"@mui/material";import{FoodsIcon as c}from"../Icons/FoodsIcon.js";const a=a=>{const l=i();/* @__PURE__ */
|
|
2
2
|
return e(o,{direction:"row",sx:{alignItems:"flex-end",color:l.custom.grey[100],display:"inline-flex",gap:l.spacing(1),whiteSpace:"nowrap",width:"fit-content",wordBreak:"break-word"},children:[null===a.value?/* @__PURE__ */r(t,{role:"img","aria-label":a.emptyLabel,sx:{alignItems:"center",backgroundColor:l.custom.grey[400],borderRadius:l.spacing(.5),color:l.custom.grey[1400],display:"flex",flexShrink:0,height:l.custom.scoreValue.emptyIndicator.size,justifyContent:"center",width:l.custom.scoreValue.emptyIndicator.size},children:/* @__PURE__ */r(c,{icon:"empty",size:l.custom.scoreValue.emptyIndicator.iconSize})}):/* @__PURE__ */r(n,{variant:"number-big",color:"inherit",children:a.value}),
|
|
3
|
-
/* @__PURE__ */r(n,{variant:"big-regular",color:"inherit",children:a.unit})]})};export{a as ScoreValue};
|
|
3
|
+
/* @__PURE__ */r(n,{variant:"big-regular",color:"inherit",sx:{whiteSpace:a.preserveUnitLineBreaks?"pre-line":"inherit"},children:a.unit})]})};export{a as ScoreValue};
|
|
@@ -33,10 +33,16 @@ export declare const status: {
|
|
|
33
33
|
* Shared score card colors.
|
|
34
34
|
* Figma provenance: Product empty score card `12819:67604`, empty guidance
|
|
35
35
|
* `13621:101305`, and filled score card `13154:221913`.
|
|
36
|
+
* Loading provenance: established Product score-card behavior preserved during
|
|
37
|
+
* the Product V2 migration and approved on 2026-08-20.
|
|
36
38
|
*/
|
|
37
39
|
export declare const scoreCard: {
|
|
38
40
|
readonly surface: "#025155";
|
|
39
41
|
readonly emptyGuidanceForeground: "#EDF9FA";
|
|
42
|
+
readonly loading: {
|
|
43
|
+
readonly opacity: 0.7;
|
|
44
|
+
readonly transition: "opacity 120ms ease-out";
|
|
45
|
+
};
|
|
40
46
|
};
|
|
41
47
|
/**
|
|
42
48
|
* Shared Score value geometry.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import i from"i18next";import{greyTheme as o,shadows as e,redTheme as r,allMainColors as t,allColors as d,extraColors as a,dataVisualizationColors as n,coralTheme as p,blueTheme as x,yellowTheme as c,orangeTheme as h,greenTheme as l}from"./colors.js";const g={containerDivider:{color:o[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={emptyIndicator:{size:"44px",iconSize:{width:26,height:26}},inline:{width:"70px"}},w={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"}},y={compact:{width:"100px",optionWidth:"130px"}},v={compact:{size:110}},f={size:"40px",iconSize:{width:20,height:20},borderRadius:"44px",default:{background:`linear-gradient(180deg, ${o[100]} 0%, ${o[300]} 154.5%)`,borderColor:r[500],color:r[500]},hovered:{background:r[400],borderColor:r[500],color:o[100]},pressed:{background:r[600],borderColor:r[600],color:o[100]}},z=`inset 0 0 0 ${g.containerDivider.width} ${g.containerDivider.color}`,$={gap:"4px",separatorIconSize:{width:16,height:16},pageLink:{height:"26px",paddingBlock:"2px",paddingInline:"8px",borderRadius:"8px",maxWidth:"226px",stroke:{default:z,hover:`inset 0 0 0 ${g.containerDivider.width} ${o[2800]}`},collapsed:{width:"24px",height:"16px",paddingInline:"4px",borderRadius:"4px"}},overflowMenu:{offset:"4px",padding:"16px",gap:"8px",borderRadius:"12px",boxShadow:`${z}, ${e.popover}`}},S=`${g.containerDivider.width} ${g.containerDivider.style} ${o[500]}`,F=`${g.containerDivider.width} ${g.containerDivider.style} ${g.containerDivider.color}`,k={contentAlignment:"center",default:{maxCharacters:100,width:"202px",maxWidth:"unset",padding:"12px 16px 12px 16px",borderRadius:"0.5rem",border:S,backgroundColor:o[100],boxShadow:`0px 4px 20px 0px ${o[500]}`,color:o[2800],margin:"8px",typographyVariant:"body-medium",arrow:{color:o[100],border:S}},simple:{width:"300px",maxWidth:"300px",contentMinHeight:"53px",paddingBlock:"2px",paddingInline:"8px",borderRadius:"8px",border:F,backgroundColor:o[100],boxShadow:e.popover,color:o[2500],margin:"8px",typographyVariant:"body-medium",arrow:{width:"16px",height:"8px",color:o[100],border:F}}},D={grey:o,red:r,green:l,orange:h,yellow:c,blue:x,coral:p,shadows:e,dataviz:{colors:n,extra:a,colorsWithExtra:d,onlyMainFromAll:t},doughnutCard:s,strokes:g,status:u,scoreCard:m,scoreValue:b,numberWithUnit:w,formField:y,mediaUpload:v,deleteButton:f,breadcrumb:$,tooltip:k,searchBox:{borderRadius:"24px",border:i=>"1px solid "+i.custom.grey[500],background:"white",boxShadow:i=>"0px 2px 8px 0px "+i.custom.grey[500]},rowMenuElement:{marginLeft:"12px",paddingRight:"8px",fontSize:"12px",fontWeight:"600",lineHeight:"20px"}},C={valueFormatterFn:(o,e=void 0)=>{const r=Number(o);return Number.isNaN(r)?"":e?r.toLocaleString(i.language,{maximumFractionDigits:e}):r.toLocaleString(i.language)}};export{$ as breadcrumb,D as custom,f as deleteButton,s as doughnutCard,y as formField,v as mediaUpload,w as numberWithUnit,C as numbers,m as scoreCard,b as scoreValue,u as status,g as strokes,k as tooltip};
|