@foodpilot/foods 2.21.1 → 2.22.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.
- package/dist/components/Cards/ScoreOverviewCard/ScoreOverviewCard.js +1 -1
- package/dist/components/Chart/HorizontalGauge/components/GaugeStatistics.js +4 -4
- package/dist/components/Form/UnitConverterPopover.js +19 -9
- package/dist/components/Popover/BigPopoverLayout.js +2 -2
- package/dist/components/Select/FoodsSelect/FoodsSelect.d.ts +8 -0
- package/dist/components/Select/FoodsSelect/FoodsSelect.js +5 -5
- package/dist/components/Select/FoodsSelect/Options/Line/OptionLine.js +2 -2
- package/dist/components/Select/FoodsSelect/Options/SelectOptions.d.ts +3 -0
- package/dist/components/Select/FoodsSelect/Options/SelectOptions.js +8 -6
- package/dist/components/Select/FoodsSelect/Select.d.ts +3 -0
- package/dist/components/Select/FoodsSelect/Select.js +5 -5
- package/dist/components/Tags/FoodsTags.js +3 -3
- package/dist/themes/common/MUIComponents/buttons.d.ts +1 -1
- package/dist/themes/common/MUIComponents/tagsStyles.d.ts +8 -0
- package/dist/themes/common/MUIComponents/tagsStyles.js +1 -0
- package/dist/themes/common/components.js +1 -1
- package/package.json +2 -2
|
@@ -9,5 +9,5 @@ return e(r,{sx:{backgroundColor:p.selected?u.palette.primary[800]:u.custom.grey[
|
|
|
9
9
|
/* @__PURE__ */i(a,{component:"h3",noWrap:!0,title:p.title,variant:"big-semibold",sx:{color:m},children:p.title}),
|
|
10
10
|
/* @__PURE__ */e(r,{direction:"row",alignItems:"center",sx:{gap:u.spacing(.5),minWidth:0},children:[
|
|
11
11
|
/* @__PURE__ */i(a,{noWrap:!0,title:p.variationLabel,variant:"body-regular",sx:{color:h,minWidth:0},children:p.variationLabel}),p.variationAction&&/* @__PURE__ */i(l,{size:"xs",icon:"arrowDownShort",buttonProps:{"aria-controls":p.variationAction.open?p.variationAction.controls:void 0,"aria-expanded":p.variationAction.open,"aria-haspopup":"menu","aria-label":p.variationAction.ariaLabel,disabled:p.disabled,onClick:p.variationAction.onOpen,sx:{color:h,pointerEvents:"auto",position:"relative",zIndex:3}}})]})]})]}),
|
|
12
|
-
/* @__PURE__ */e(r,{direction:"row",alignItems:"baseline",sx:{gap:u.spacing(1),minWidth:0},children:[p.isLoading?/* @__PURE__ */i(s,{color:"inherit",size:u.spacing(3)}):null===p.value?/* @__PURE__ */i(n,{role:"img","aria-label":p.emptyLabel,sx:{alignItems:"center",backgroundColor:u.custom.grey[400],borderRadius:u.spacing(.5),color:u.custom.grey[1400],display:"flex",flexShrink:0,height:u.custom.scoreValue.emptyIndicator.size,justifyContent:"center",width:u.custom.scoreValue.emptyIndicator.size},children:/* @__PURE__ */i(c,{icon:"empty",size:u.custom.scoreValue.emptyIndicator.iconSize})}):/* @__PURE__ */i(a,{variant:"number-big",sx:{color:m},children:p.value}),
|
|
12
|
+
/* @__PURE__ */e(r,{direction:"row",alignItems:"baseline",sx:{gap:u.spacing(1),minWidth:0},children:[p.isLoading?/* @__PURE__ */i(s,{color:"inherit",size:u.spacing(3),sx:{color:m}}):null===p.value?/* @__PURE__ */i(n,{role:"img","aria-label":p.emptyLabel,sx:{alignItems:"center",backgroundColor:u.custom.grey[400],borderRadius:u.spacing(.5),color:u.custom.grey[1400],display:"flex",flexShrink:0,height:u.custom.scoreValue.emptyIndicator.size,justifyContent:"center",width:u.custom.scoreValue.emptyIndicator.size},children:/* @__PURE__ */i(c,{icon:"empty",size:u.custom.scoreValue.emptyIndicator.iconSize})}):/* @__PURE__ */i(a,{variant:"number-big",sx:{color:m},children:p.value}),
|
|
13
13
|
/* @__PURE__ */i(a,{variant:"big-regular",noWrap:!0,sx:{color:b},children:p.unit}),p.valueAdornment]})]}),!1===p.selected&&/* @__PURE__ */i(n,{"aria-hidden":!0,sx:{borderColor:v.color,borderRadius:"inherit",borderStyle:v.style,borderWidth:v.width,boxSizing:"border-box",inset:0,pointerEvents:"none",position:"absolute",zIndex:4}})]})};export{p as ScoreOverviewCard};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,Fragment as a,jsxs as t}from"react/jsx-runtime";import{useRef as n,useState as r,useMemo as i,useCallback as o,useLayoutEffect as m}from"react";import{useTheme as s,Typography as l,Box as
|
|
2
|
-
/* @__PURE__ */e(
|
|
3
|
-
/* @__PURE__ */e(h,{variant:"tags-grey",label:B[a],sx:{backgroundColor:G.custom.grey[500],borderColor:G.custom.grey[600],
|
|
4
|
-
return e(
|
|
1
|
+
import{jsx as e,Fragment as a,jsxs as t}from"react/jsx-runtime";import{useRef as n,useState as r,useMemo as i,useCallback as o,useLayoutEffect as m}from"react";import{useTheme as s,Typography as l,Box as c,Stack as u}from"@mui/material";import{GAUGE_CONSTANTS as d}from"../constants.js";import{formatValue as p}from"../utils/formatters.js";import{INITIAL_STATISTIC_LAYOUT as T,getFittingAnchor as x,assignStatisticLanes as g}from"../utils/statisticLayout.js";import{FoodsTags as h}from"../../../Tags/FoodsTags.js";const b=b=>{const{minValue:I,medianValue:S,maxValue:f,labelMinimum:A,labelMedian:_,labelMaximum:C,labelPositions:v,showMedian:y,height:L,animated:E,precision:O=0,valueFormatter:N,onLaneCountChange:U,onMedianLaneChange:w}=b,G=s(),j=n({minimum:null,median:null,maximum:null}),[F,$]=r(T),z=Number.parseFloat(G.spacing(d.LAYOUT.STATISTIC_LANE_SPACING_UNITS)),M=Number.parseFloat(G.spacing(d.LAYOUT.STATISTIC_COLLISION_GAP_UNITS)),R=v.min.x,Y=v.max.x,P=R+(Y-R)/2,V=i(()=>({minimum:N?N(I,O):p(I,O),median:N?N(S,O):p(S,O),maximum:N?N(f,O):p(f,O)}),[f,S,I,O,N]),B=i(()=>({minimum:A,median:_,maximum:C}),[C,_,A]),X=i(()=>({minimum:v.min,median:v.median,maximum:v.max}),[v.max,v.median,v.min]),k=i(()=>y?["minimum","median","maximum"]:["minimum","maximum"],[y]),D=o(()=>{const e=k.map(e=>{const a=j.current[e]?.getBoundingClientRect().width??0,t="median"===e?x(X[e],a,R,Y):X[e].anchor;return{id:e,x:X[e].x,width:a,anchor:t}}),a=g(e,M),t=k.reduce((t,n)=>(t[n]={anchor:e.find(e=>e.id===n)?.anchor??X[n].anchor,lane:a[n]},t),{...T}),n=Math.max(...Object.values(a))+1;$(e=>k.every(a=>e[a].anchor===t[a].anchor&&e[a].lane===t[a].lane)?e:t),U(n),w(y?a.median:0)},[M,Y,R,U,w,X,y,k]);return m(()=>{if(D(),"undefined"==typeof ResizeObserver)return;const e=new ResizeObserver(D);return Object.values(j.current).forEach(a=>a&&e.observe(a)),()=>e.disconnect()},[D]),/* @__PURE__ */e(a,{children:k.map(a=>{const n=X[a].x>P,r=/* @__PURE__ */e(l,{variant:"small-bold",color:G.custom.grey[2800],sx:{..."minimum"===a&&{mr:"-0.5px",transform:"translateX(-0.5px)"},..."maximum"===a&&{ml:"-0.5px",transform:"translateX(0.5px)"}},children:V[a]},"value"),i=Boolean(B[a].trim())&&/* @__PURE__ */t(c,{component:"span",sx:{display:"inline-flex",position:"relative"},children:[
|
|
2
|
+
/* @__PURE__ */e(c,{component:"span","aria-hidden":"true","data-testid":`horizontal-gauge-statistic-${a}-caret`,sx:{backgroundColor:G.custom.grey[500],borderBottom:n?0:`1px solid ${G.custom.grey[600]}`,borderLeft:n?0:`1px solid ${G.custom.grey[600]}`,borderRight:n?`1px solid ${G.custom.grey[600]}`:0,borderTop:n?`1px solid ${G.custom.grey[600]}`:0,boxSizing:"border-box",height:G.spacing(d.LAYOUT.STATISTIC_TAG_CARET_SIZE_UNITS),left:n?"auto":0,pointerEvents:"none",position:"absolute",right:n?0:"auto",top:"50%",transform:n?"translate(50%, -50%) rotate(45deg)":"translate(-50%, -50%) rotate(45deg)",width:G.spacing(d.LAYOUT.STATISTIC_TAG_CARET_SIZE_UNITS),zIndex:1}}),
|
|
3
|
+
/* @__PURE__ */e(h,{variant:"tags-grey",label:B[a],sx:{backgroundColor:G.custom.grey[500],borderColor:G.custom.grey[600],px:.625,pointerEvents:"none"}})]},"tag");/* @__PURE__ */
|
|
4
|
+
return e(u,{ref:e=>{j.current[a]=e},"data-testid":`horizontal-gauge-statistic-${a}`,"data-anchor":F[a].anchor,"data-lane":F[a].lane,sx:{alignItems:"center",flexDirection:"row",position:"absolute",left:X[a].x,top:L-d.LEGEND_HEIGHT+Number.parseFloat(G.spacing(d.LAYOUT.STATISTIC_TOP_OFFSET_UNITS))+F[a].lane*z,transform:`translateX(${o=F[a].anchor,"start"===o?"0":"end"===o?"-100%":"-50%"})`,gap:G.spacing(d.LAYOUT.STATISTIC_VALUE_TAG_GAP_UNITS),opacity:1,transition:E?G.transitions.create(["transform","opacity"]):"none",whiteSpace:"nowrap",pointerEvents:"none"},children:n?[i,r]:[r,i]},a);var o})})};export{b as GaugeStatistics};
|
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
2
|
-
return e(
|
|
3
|
-
/* @__PURE__ */
|
|
4
|
-
/* @__PURE__ */
|
|
5
|
-
/* @__PURE__ */e(
|
|
6
|
-
/* @__PURE__ */e(
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */e(
|
|
9
|
-
/* @__PURE__ */e(
|
|
1
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{useTheme as r,Stack as i,Typography as n,Box as t,Divider as a,Button as c}from"@mui/material";import{useMemo as l}from"react";import{AnchoredPopover as s}from"../Popover/AnchoredPopover.js";import{FoodsTextInput as d}from"./FoodsFormFields/FoodsTextInput.js";import{FoodsSelect as m}from"../Select/FoodsSelect/FoodsSelect.js";const p=p=>{const{open:u,anchor:g,onClose:h,targetAbbreviation:b,options:v,selectedOptionId:x,onSelectedOptionIdChange:f,sourceValue:y,onSourceValueChange:C,labels:w,onApply:I,disabled:S=!1}=p,F=r(),P=l(()=>v.find(e=>e.id===x)??null,[v,x]),O=l(()=>{const e=Number(y.replace(",","."));return!P||Number.isNaN(e)?null:e*P.factor},[y,P]);/* @__PURE__ */
|
|
2
|
+
return e(s,{variant:"themed",open:u,anchor:g,onClose:h,anchorPosition:"rightside",children:/* @__PURE__ */o(i,{gap:F.spacing(2),sx:{minWidth:F.spacing(44)},children:[
|
|
3
|
+
/* @__PURE__ */o(i,{direction:"row",gap:F.spacing(1.5),alignItems:"flex-end",children:[
|
|
4
|
+
/* @__PURE__ */o(i,{gap:F.spacing(1),flex:1,minWidth:0,children:[
|
|
5
|
+
/* @__PURE__ */e(n,{variant:"small-medium",color:F.custom.grey[2200],children:w.sourceValue}),
|
|
6
|
+
/* @__PURE__ */e(d,{value:y,onChange:C,disabled:S,ExtraInputProps:{type:"number"},StackProps:{sx:{width:"100%"}}})]}),
|
|
7
|
+
/* @__PURE__ */o(i,{gap:F.spacing(1),sx:{width:F.custom.formField.compact.optionWidth},children:[
|
|
8
|
+
/* @__PURE__ */e(n,{variant:"small-medium",color:F.custom.grey[2200],children:w.sourceUnit}),
|
|
9
|
+
/* @__PURE__ */e(m,{options:v,selectedOption:P,onChange:e=>{e&&f(e.id)},getId:e=>e.id,getName:e=>e.abbreviation,disabled:S||0===v.length,disableSearch:!0,closeOnSelect:!0,textOptions:{placeholder:w.sourceUnit,searchPlaceholder:w.sourceUnit,emptyOptionsText:w.sourceUnit,noResult:w.sourceUnit},BoxProps:{width:"100%"}})]})]}),null!==O&&P&&/* @__PURE__ */o(t,{sx:{backgroundColor:F.custom.grey[300],border:`1px solid ${F.custom.grey[500]}`,borderRadius:F.spacing(1),padding:F.spacing(1.5,2)},children:[
|
|
10
|
+
/* @__PURE__ */e(n,{variant:"small-medium",color:F.custom.grey[2200],children:w.preview}),
|
|
11
|
+
/* @__PURE__ */o(i,{direction:"row",alignItems:"baseline",gap:F.spacing(1),mt:F.spacing(.5),flexWrap:"wrap",children:[
|
|
12
|
+
/* @__PURE__ */o(n,{variant:"body-medium",children:[y," ",P.abbreviation]}),
|
|
13
|
+
/* @__PURE__ */e(n,{variant:"body-regular",color:F.custom.grey[2e3],children:"→"}),
|
|
14
|
+
/* @__PURE__ */o(n,{variant:"body-medium",children:[O," ",b]})]}),
|
|
15
|
+
/* @__PURE__ */o(n,{variant:"small-medium",color:F.custom.grey[2e3],mt:F.spacing(1),children:[w.factorHint,": ",P.factor," → ",b,P.source?` (${P.source})`:""]})]}),
|
|
16
|
+
/* @__PURE__ */e(a,{}),
|
|
17
|
+
/* @__PURE__ */o(i,{direction:"row",gap:F.spacing(1),justifyContent:"flex-end",alignItems:"center",children:[
|
|
18
|
+
/* @__PURE__ */e(c,{variant:"text",onClick:h,disabled:S,children:w.cancel}),
|
|
19
|
+
/* @__PURE__ */e(c,{variant:"primary",onClick:I,disabled:S||null===O||null===P,children:w.apply})]})]})})};export{p as UnitConverterPopover};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{DragIndicator as a,Close as i}from"@mui/icons-material";import{Box as o,Stack as l,Typography as r,IconButton as d,Divider as c}from"@mui/material";import{FlexibleButton as p}from"../../innerComponents/FlexibleButton.js";import{useTranslation as x}from"react-i18next";const s=t=>/* @__PURE__ */e(o,{component:"div",sx:{background:"white",width:t.width??"376px",borderRadius:"12px",border:"1px solid #E7E6E4",boxShadow:"0px 4px 20px 0px rgba(81, 78, 78, 0.12)"},children:[
|
|
2
|
-
/* @__PURE__ */e(l,{direction:"row",useFlexGap:!0,alignItems:"center",justifyContent:"space-between",sx:{padding:"18px 16px"},children:[t.headerIcon??/* @__PURE__ */n(a,{}),
|
|
3
|
-
/* @__PURE__ */n(r,{variant:"h4",sx:{
|
|
2
|
+
/* @__PURE__ */e(l,{direction:"row",useFlexGap:!0,gap:1,alignItems:"center",justifyContent:"space-between",sx:{padding:"18px 16px"},children:[t.headerIcon??/* @__PURE__ */n(a,{}),
|
|
3
|
+
/* @__PURE__ */n(r,{variant:"h4",sx:{flex:1,textAlign:"center"},children:t.headerText}),
|
|
4
4
|
/* @__PURE__ */n(d,{sx:{padding:"0"},onClick:t.onClose,children:/* @__PURE__ */n(i,{})})]}),
|
|
5
5
|
/* @__PURE__ */n(c,{}),
|
|
6
6
|
/* @__PURE__ */n(o,{sx:{padding:"24px",height:"420px",overflow:"auto"},children:t.children}),t.bottomActions&&/* @__PURE__ */n(m,{onCancel:t.onCancel,onValidate:t.onValidate,validateLabel:t.validateLabel,cancelLabel:t.cancelLabel})]}),m=a=>{const{t:i}=x();/* @__PURE__ */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SxProps } from '@mui/material';
|
|
2
2
|
import { ExtraSelectOptions, SearchOptions } from './Context/Provider';
|
|
3
3
|
export type FoodsSelectProps<T> = {
|
|
4
|
+
id?: string;
|
|
4
5
|
selectedOption: T | null;
|
|
5
6
|
options: T[];
|
|
6
7
|
onChange: (selectedValue: T | null) => void;
|
|
@@ -11,6 +12,13 @@ export type FoodsSelectProps<T> = {
|
|
|
11
12
|
BoxProps?: SxProps;
|
|
12
13
|
BoxOptionsProps?: SxProps;
|
|
13
14
|
unit?: string;
|
|
15
|
+
infiniteScroll?: FoodsSelectInfiniteScrollOptions;
|
|
16
|
+
};
|
|
17
|
+
export type FoodsSelectInfiniteScrollOptions = {
|
|
18
|
+
hasNextPage: boolean;
|
|
19
|
+
isFetchingNextPage: boolean;
|
|
20
|
+
onLoadMore: () => void;
|
|
21
|
+
loadingText?: string;
|
|
14
22
|
};
|
|
15
23
|
export type SelectWrapperProps<T> = FoodsSelectProps<T> & ExtraSelectOptions;
|
|
16
24
|
export declare const FoodsSelect: <T>(props: SelectWrapperProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Box as o,Typography as
|
|
2
|
-
return t(o,{sx:{width:"300px",...
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Box as o,Typography as i,IconButton as n}from"@mui/material";import s from"../../../assets/undo.svg.js";import{Select as r}from"./Select.js";import{FoodsSelectContextProvider as l}from"./Context/Provider.js";import{useFoodsSelectContext as a}from"./Context/useSelect.js";import{useState as c}from"react";const d=l=>{const{options:c,id:d,selectedOption:p,originalValue:m,onChange:h,getId:u,getName:x,getIcon:O,unit:S,BoxProps:g={},BoxOptionsProps:b={},infiniteScroll:f}=l,{disabled:C,textOptions:y}=a(),V=((e,t)=>!0!==e&&0!==t.length)(C,c);/* @__PURE__ */
|
|
2
|
+
return t(o,{sx:{width:"300px",...g},children:[
|
|
3
3
|
/* @__PURE__ */t(o,{sx:{display:"flex",alignItems:"center",direction:"row",gap:"8px"},children:[
|
|
4
|
-
/* @__PURE__ */e(r,{options:c,getId:
|
|
5
|
-
return e(
|
|
6
|
-
return e(
|
|
4
|
+
/* @__PURE__ */e(r,{id:d,options:c,getId:u,getName:x,onChange:h,getIcon:O,selectedOption:p,BoxOptionsProps:b,infiniteScroll:f}),S&&/* @__PURE__ */e(i,{variant:"body",children:S}),V&&m&&/* @__PURE__ */e(n,{onClick:()=>h(m),children:/* @__PURE__ */e(s,{})})]}),V&&m&&/* @__PURE__ */e(i,{variant:"small-medium",children:`${y.defaultValueText} : ${x(m)}`})]})},p=t=>{const{textOptions:o,noValue:i,disabled:n,closeOnSelect:s,disableSearch:r,disableOnEmpty:a=!1,...p}=t,[m,h]=c("");/* @__PURE__ */
|
|
5
|
+
return e(l,{textOptions:o,noValue:i,disabled:n,closeOnSelect:s,disableSearch:r,search:m,setSearch:h,isSearchFound:e=>""===m||e.toLowerCase().includes(m.toLowerCase()),disableOnEmpty:a,children:/* @__PURE__ */e(d,{...p})})},m=t=>{const{textOptions:o,noValue:i,disabled:n,closeOnSelect:s,search:r,setSearch:a,isSearchFound:c,disableOnEmpty:p=!1,...m}=t;/* @__PURE__ */
|
|
6
|
+
return e(l,{textOptions:o,noValue:i,disabled:n,closeOnSelect:s,search:r,setSearch:a,isSearchFound:c,disableOnEmpty:p,children:/* @__PURE__ */e(d,{...m})})};export{p as FoodsSelect,m as FoodsSelectServerPagination};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useTheme as
|
|
2
|
-
return e(
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useTheme as t,Box as o}from"@mui/material";import{DefaultLine as r}from"./Default.js";import{SelectedLine as i}from"./Selected.js";const n=n=>{const{isSelected:l,icon:a,displayText:p,onClick:c}=n,s=t();/* @__PURE__ */
|
|
2
|
+
return e(o,{role:"option","aria-selected":l,tabIndex:0,sx:{display:"flex",alignItems:"center",gap:"10px",paddingBlock:"4px",":hover":{backgroundColor:s.custom.grey[300]}},onClick:()=>c&&c(),onKeyDown:e=>{!c||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),c())},children:/* @__PURE__ */e(o,{sx:{display:"flex",alignItems:"center",gap:"10px",position:"relative",width:"90%",left:"5%",cursor:"pointer"},children:/* @__PURE__ */e(!1===l?r:i,{displayText:p,icon:a})})})};export{n as OptionLine};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FoodsSelectInfiniteScrollOptions } from '../FoodsSelect';
|
|
1
2
|
export type SelectOptionsProps<T> = {
|
|
2
3
|
selectedOption: T | null;
|
|
3
4
|
options: T[];
|
|
@@ -5,5 +6,7 @@ export type SelectOptionsProps<T> = {
|
|
|
5
6
|
getName: (item: T) => string;
|
|
6
7
|
getIcon?: (item: T) => React.JSX.Element;
|
|
7
8
|
onChange: (selectedValue: T | null) => void;
|
|
9
|
+
infiniteScroll?: FoodsSelectInfiniteScrollOptions;
|
|
10
|
+
onScroll?: React.UIEventHandler<HTMLDivElement>;
|
|
8
11
|
};
|
|
9
12
|
export declare const SelectOptions: <T>(props: SelectOptionsProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useTheme as o,Box as n,Typography as r}from"@mui/material";import{Fragment as
|
|
2
|
-
return e(n,{sx:{marginBlock:"8px",display:"flex",flexDirection:"column"},children:[
|
|
3
|
-
/* @__PURE__ */t(s,{selectedOption:
|
|
4
|
-
/* @__PURE__ */t(
|
|
5
|
-
/* @__PURE__ */t(
|
|
6
|
-
return t(
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useTheme as o,Box as n,Typography as i,CircularProgress as r}from"@mui/material";import{Fragment as l}from"react";import{OptionLine as a}from"./Line/OptionLine.js";import{OptionsHeader as s}from"./Header/OptionHeader.js";import{useFoodsSelectContext as c}from"../Context/useSelect.js";import{FoodsBadge as d}from"../../../Badge/FoodsBadge.js";const p=p=>{const m=o(),{selectedOption:g,options:x,getId:u,getName:f,onChange:h,getIcon:y,infiniteScroll:b,onScroll:j}=p,{isSearchFound:C,textOptions:S}=c(),k=x.filter(e=>C(f(e)));/* @__PURE__ */
|
|
2
|
+
return e(n,{role:"listbox","aria-label":S.placeholder,onScroll:j,sx:{marginBlock:"8px",display:"flex",flexDirection:"column",...b?{height:"280px",overflowY:"auto"}:{}},children:[
|
|
3
|
+
/* @__PURE__ */t(s,{selectedOption:g,getName:f,getIcon:y,onChange:h}),0===k.length&&/* @__PURE__ */e(n,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"8px",marginBlock:"4px"},children:[
|
|
4
|
+
/* @__PURE__ */t(d,{icon:"questionMark",size:3,boxProps:{sx:{backgroundColor:m.palette.primary[50],borderRadius:"32px"}}}),
|
|
5
|
+
/* @__PURE__ */t(i,{variant:"body-medium",children:S.noResult})]}),k.map((e,o)=>{const n=f(e),i=null!==g&&u(e)===u(g);if(!0===i)return null;const r=y?y(e):null;/* @__PURE__ */
|
|
6
|
+
return t(l,{children:/* @__PURE__ */t(a,{isSelected:i,icon:r,displayText:n,onClick:()=>h(e)})},`select-${o}`)}),!0===b?.isFetchingNextPage&&/* @__PURE__ */e(n,{role:"status","aria-label":b.loadingText??"Loading…",sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:1,padding:1},children:[
|
|
7
|
+
/* @__PURE__ */t(r,{size:18}),
|
|
8
|
+
/* @__PURE__ */t(i,{variant:"small",children:b.loadingText??"Loading…"})]})]})};export{p as SelectOptions};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { SxProps } from '@mui/material';
|
|
2
|
+
import { FoodsSelectInfiniteScrollOptions } from './FoodsSelect';
|
|
2
3
|
export type SelectProps<T> = {
|
|
4
|
+
id?: string;
|
|
3
5
|
options: T[];
|
|
4
6
|
getId: (item: T) => number | string;
|
|
5
7
|
getName: (item: T) => string;
|
|
@@ -7,5 +9,6 @@ export type SelectProps<T> = {
|
|
|
7
9
|
onChange: (selectedValue: T | null) => void;
|
|
8
10
|
selectedOption: T | null;
|
|
9
11
|
BoxOptionsProps: SxProps;
|
|
12
|
+
infiniteScroll?: FoodsSelectInfiniteScrollOptions;
|
|
10
13
|
};
|
|
11
14
|
export declare const Select: <T>(props: SelectProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{jsxs as e,jsx as
|
|
2
|
-
return e(
|
|
3
|
-
/* @__PURE__ */e(
|
|
4
|
-
/* @__PURE__ */
|
|
5
|
-
/* @__PURE__ */
|
|
1
|
+
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useTheme as t,Button as i,Typography as r}from"@mui/material";import{useState as n,Fragment as l}from"react";import p from"@mui/icons-material/KeyboardArrowDown";import s from"@mui/icons-material/KeyboardArrowUp";import{SelectOptions as a}from"./Options/SelectOptions.js";import{useFoodsSelectContext as c}from"./Context/useSelect.js";import{AnchoredPopover as d}from"../../Popover/AnchoredPopover.js";const m=m=>{const{textOptions:x,disabled:g,closeOnSelect:h,setSearch:u,disableOnEmpty:f}=c(),w=t(),[b,O]=n(null),v=()=>O(null),y=null!==b,{selectedOption:S,infiniteScroll:I}=m,P=/* @__PURE__ */o(y?s:p,{}),C=y?{border:`2px solid ${w.custom.grey[2800]}`}:{},j=((e,o,t,i,r)=>0===e.length?null!==t?i(t):o:null===t?r:i(t))(m.options,x.emptyOptionsText,S,m.getName,x.placeholder),N=f&&0===m.options.length;/* @__PURE__ */
|
|
2
|
+
return e(l,{children:[
|
|
3
|
+
/* @__PURE__ */e(i,{variant:"select",id:m.id,onClick:e=>y?v():O(e.currentTarget),sx:{...C,width:"100%",height:"40px",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0px 12px 0px 12px"},disabled:g||N,children:[m.getIcon&&S&&m.getIcon(S),
|
|
4
|
+
/* @__PURE__ */o(r,{variant:"body-medium",sx:{width:"100%",textAlign:"left",marginLeft:"8px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:j}),P]}),
|
|
5
|
+
/* @__PURE__ */o(d,{sx:{top:"5px"},paperProps:{width:"280px",maxHeight:"300px",...I?{overflow:"hidden"}:{},border:`1px solid ${w.custom.grey[500]}`,borderRadius:"12px",boxShadow:"0px 4px 20px 0px #514E4E1F",...m.BoxOptionsProps},variant:"headless",anchor:b,open:y,onClose:()=>{v(),u("")},anchorPosition:"rightside",children:/* @__PURE__ */o(a,{selectedOption:m.selectedOption,options:m.options,getId:m.getId,getName:m.getName,getIcon:m.getIcon,onChange:e=>{m.onChange(e),u(""),!0===h&&v()},infiniteScroll:I,onScroll:I?e=>{if(!0!==I?.hasNextPage||I.isFetchingNextPage)return;const o=e.currentTarget;o.scrollHeight-o.scrollTop-o.clientHeight<=32&&I.onLoadMore()}:void 0})})]})};export{m as Select};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{jsx as o,jsxs as
|
|
2
|
-
return o(
|
|
3
|
-
/* @__PURE__ */o(
|
|
1
|
+
import{jsx as o,jsxs as n}from"react/jsx-runtime";import{useTheme as r,Button as a,Stack as i,Typography as c}from"@mui/material";import{FoodsIcon as d}from"../Icons/FoodsIcon.js";const t=t=>{const{variant:e="tags-grey",label:s,detail:l,size:g="compact",colors:p,startIcon:u,endIcon:b,onClick:m,disabled:h,sx:k}=t,I=r(),v="display"===g,x=p?.foreground??"inherit",y=Array.isArray(k)?k:[k],f=n=>/* @__PURE__ */o(c,{sx:{color:x},variant:"small-bold",children:/* @__PURE__ */o(d,{size:1,icon:n})});/* @__PURE__ */
|
|
2
|
+
return o(a,{"aria-label":v?[s,l].filter(Boolean).join(" "):void 0,startIcon:u&&f(u),endIcon:b&&f(b),variant:e,onClick:m,disabled:h,sx:[{borderColor:"transparent",...p&&{background:p.background,backgroundColor:p.background,color:p.foreground,"&:hover, &:active":{background:p.background,backgroundColor:p.background}},...v&&{borderRadius:I.spacing(.5),gap:I.spacing(.25),height:I.custom.tags.display.height,paddingBlock:I.spacing(.25),paddingInlineStart:I.spacing(1),paddingInlineEnd:b?I.spacing(.25):I.spacing(1),"& .MuiButton-endIcon, & .MuiButton-startIcon":{color:x,margin:I.spacing(0),padding:I.spacing(.5)}}},...y],children:v?/* @__PURE__ */n(i,{component:"span",direction:"row",alignItems:"center",sx:{gap:I.spacing(.5)},children:[
|
|
3
|
+
/* @__PURE__ */o(c,{component:"span",sx:{color:x},variant:"body-semibold",children:s}),l&&/* @__PURE__ */o(c,{component:"span",sx:{color:x},variant:"body-regular",children:l})]}):/* @__PURE__ */o(c,{sx:{color:x},variant:"small-bold",children:s})})};export{t as FoodsTags};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DatavizVariant } from '../../../components/Icons/illustrationProps';
|
|
2
2
|
export type IconButtonVariants = "icon-xs-nobackground" | "icon-s-nobackground" | "icon-m-nobackground" | "icon-xs-withbackground" | "icon-s-withbackground" | "icon-m-withbackground";
|
|
3
|
-
export type TagsButtonVariants = "tags-grey" | "tags-black" | "tags-white" | "tags-red" | "tags-green" | "tags-blue" | "tags-coral";
|
|
3
|
+
export type TagsButtonVariants = "tags-grey" | "tags-black" | "tags-white" | "tags-red" | "tags-green" | "tags-blue" | "tags-coral" | "tags-brand";
|
|
4
4
|
export type customButtonVariants = "primary" | "secondary" | "ternary" | "text" | "black-text" | "selected-menu" | "selected-submenu" | "default-menu" | "black-filled" | "white-filled" | "white-filled-no-shadow" | "select" | "validate" | "error" | "delete" | "delete-outline" | IconButtonVariants | TagsButtonVariants | DatavizVariant;
|
|
5
5
|
type ButtonNewVariants = Record<customButtonVariants, React.CSSProperties>;
|
|
6
6
|
type ButtonPropsNewVariants = Record<customButtonVariants, true>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CSSObject, Theme } from '@mui/material';
|
|
2
|
+
import { TagsButtonVariants } from './buttons';
|
|
3
|
+
type TagsOwnerState = {
|
|
4
|
+
onClick?: unknown;
|
|
5
|
+
};
|
|
6
|
+
export declare const getTagStyle: (variant: TagsButtonVariants, theme: Theme, ownerState: TagsOwnerState) => CSSObject;
|
|
7
|
+
export declare const isTagVariant: (variant: string | undefined) => variant is TagsButtonVariants;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o={"tags-grey":(o,r)=>({padding:o.spacing(0,1),border:`1px solid ${o.custom.grey[400]}`,borderRadius:"4px",backgroundColor:o.custom.grey[400],color:o.custom.grey[2800],height:"24px",minWidth:"auto",...void 0!==r.onClick?{cursor:"pointer",":hover":{border:`1px solid ${o.custom.grey[500]}`,backgroundColor:o.custom.grey[300]},":active":{border:`1px solid ${o.custom.grey[500]}`,backgroundColor:o.custom.grey[500]},":disabled":{border:`1px solid ${o.custom.grey[500]}`,backgroundColor:o.custom.grey[100],color:o.custom.grey[1400]}}:{cursor:"default",":hover":{cursor:"default"},"&.Mui-disabled":{color:o.custom.grey[2800]}}}),"tags-black":(o,r)=>({padding:o.spacing(0,1),border:`1px solid ${o.custom.grey[400]}`,borderRadius:"4px",background:"linear-gradient(180deg, #484945 0%, #2A2B27 100%)",color:o.custom.grey[100],height:"24px",minWidth:"auto",...void 0!==r.onClick?{cursor:"pointer",":hover":{border:`1px solid ${o.custom.grey[500]}`,backgroundColor:o.custom.grey[300]},":active":{border:`1px solid ${o.custom.grey[500]}`,backgroundColor:o.custom.grey[500]},":disabled":{border:`1px solid ${o.custom.grey[500]}`,background:o.custom.grey[100],backgroundColor:o.custom.grey[100],color:o.custom.grey[1400]}}:{cursor:"default",":hover":{cursor:"default"},"&.Mui-disabled":{color:o.custom.grey[100]}}}),"tags-white":(o,r)=>({padding:o.spacing(0,1),border:`1px solid ${o.custom.grey[400]} !important`,borderRadius:"4px",backgroundColor:o.custom.grey[100],color:o.custom.grey[2800],height:"24px",minWidth:"auto",cursor:"default",...void 0!==r.onClick&&{cursor:"pointer",":hover":{border:`1px solid ${o.custom.grey[500]}`,backgroundColor:o.custom.grey[300]},":active":{border:`1px solid ${o.custom.grey[500]}`,backgroundColor:o.custom.grey[500]},":disabled":{border:`1px solid ${o.custom.grey[500]}`,backgroundColor:o.custom.grey[100],color:o.custom.grey[1400]}},...void 0===r.onClick&&{"&.Mui-disabled":{color:o.custom.grey[2800]}}}),"tags-red":(o,r)=>({padding:o.spacing(0,1),border:`1px solid ${o.custom.red[100]}`,borderRadius:"4px",backgroundColor:o.custom.red[100],color:o.custom.red[600],height:"24px",minWidth:"auto",...void 0!==r.onClick?{cursor:"pointer",":hover":{border:`1px solid ${o.custom.grey[500]}`,backgroundColor:o.custom.grey[300]},":active":{border:`1px solid ${o.custom.grey[500]}`,backgroundColor:o.custom.grey[500]},":disabled":{border:`1px solid ${o.custom.grey[500]}`,backgroundColor:o.custom.grey[100],color:o.custom.grey[1400]}}:{cursor:"default",":hover":{cursor:"default"},"&.Mui-disabled":{color:o.custom.red[600]}}}),"tags-green":(o,r)=>({padding:o.spacing(0,1),borderRadius:"4px",height:"24px",minWidth:"auto",border:`1px solid ${o.custom.grey[400]}`,backgroundColor:o.custom.green[100],color:o.custom.green[600],...void 0!==r.onClick?{cursor:"pointer",":hover":{border:`1px solid ${o.custom.grey[400]}`,backgroundColor:o.custom.green[100],color:o.custom.green[600]},":active":{border:`1px solid ${o.custom.grey[500]}`,backgroundColor:o.custom.grey[500]},":disabled":{border:`1px solid ${o.custom.grey[500]}`,backgroundColor:o.custom.grey[100],color:o.custom.grey[1400]}}:{cursor:"default",":hover":{cursor:"default"},"&.Mui-disabled":{color:o.custom.green[600]}}}),"tags-blue":(o,r)=>({padding:o.spacing(0,1),borderRadius:"4px",height:"24px",minWidth:"auto",border:`1px solid ${o.custom.blue[100]}`,backgroundColor:o.custom.blue[100],color:o.custom.blue[700],...void 0!==r.onClick?{cursor:"pointer",":hover":{border:`1px solid ${o.custom.blue[200]}`,backgroundColor:o.custom.blue[50],color:o.custom.blue[700]},":active":{border:`1px solid ${o.custom.blue[300]}`,backgroundColor:o.custom.blue[200]},":disabled":{border:`1px solid ${o.custom.grey[500]}`,backgroundColor:o.custom.grey[100],color:o.custom.grey[1400]}}:{cursor:"default",":hover":{cursor:"default"},"&.Mui-disabled":{color:o.custom.blue[700]}}}),"tags-coral":(o,r)=>({padding:o.spacing(0,1),borderRadius:"4px",height:"24px",minWidth:"auto",border:`1px solid ${o.custom.coral[100]}`,backgroundColor:o.custom.coral[100],color:o.custom.coral[700],...void 0!==r.onClick?{cursor:"pointer",":hover":{border:`1px solid ${o.custom.coral[200]}`,backgroundColor:o.custom.coral[50],color:o.custom.coral[700]},":active":{border:`1px solid ${o.custom.coral[300]}`,backgroundColor:o.custom.coral[200]},":disabled":{border:`1px solid ${o.custom.grey[500]}`,backgroundColor:o.custom.grey[100],color:o.custom.grey[1400]}}:{cursor:"default",":hover":{cursor:"default"},"&.Mui-disabled":{color:o.custom.coral[700]}}}),"tags-brand":(o,r)=>({padding:o.spacing(0,1),borderRadius:"4px",height:"24px",minWidth:"auto",border:`1px solid ${o.palette.primary[100]}`,backgroundColor:o.palette.primary[100],color:o.palette.primary[800],...void 0!==r.onClick?{cursor:"pointer",":hover":{border:`1px solid ${o.palette.primary[200]}`,backgroundColor:o.palette.primary[50],color:o.palette.primary[800]},":active":{border:`1px solid ${o.palette.primary[300]}`,backgroundColor:o.palette.primary[200],color:o.palette.primary[900]},":disabled":{border:`1px solid ${o.custom.grey[500]}`,backgroundColor:o.custom.grey[100],color:o.custom.grey[1400]}}:{cursor:"default",":hover":{cursor:"default"},"&.Mui-disabled":{color:o.palette.primary[800]}}})},r=(r,e,c)=>o[r](e,c),e=["tags-grey","tags-black","tags-white","tags-red","tags-green","tags-blue","tags-coral","tags-brand"],c=o=>e.includes(o);export{r as getTagStyle,c as isTagVariant};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{alpha as o}from"@mui/material";const r={MuiDialog:{styleOverrides:{paper:{borderRadius:"1rem"}}},MuiAutocomplete:{styleOverrides:{root:()=>({})}},MuiAvatar:{defaultProps:{children:[]},styleOverrides:{root:({theme:o,ownerState:{alt:r=""}})=>{const e=r.split(" ").map(o=>o.charAt(0).toUpperCase()).join("");return{background:o.palette.primary[100],color:o.palette.primary[700],fontWeight:600,".MuiAvatar-img":{zIndex:1},":empty::before":{content:`"${e}"`}}}},variants:[{props:{variant:"small"},style:{width:"24px",height:"24px",fontSize:"10px"}},{props:{variant:"medium"},style:{width:"36px",height:"36px",fontSize:"13px"}},{props:{variant:"big"},style:{width:"40px",height:"40px",fontSize:"16px"}}]},MuiAvatarGroup:{defaultProps:{variant:"small",spacing:6,sx:{justifyContent:"flex-end"},slotProps:{additionalAvatar:{sx:{color:o=>o.custom.grey[2800],background:o=>o.custom.grey[400]}}}},styleOverrides:{root:({ownerState:{max:o=0}})=>({...[...Array(o)].reduce((r,e,t)=>({...r,[`& > .MuiAvatar-root:nth-of-type(${t+1})`]:{zIndex:o-t}}),{})})}},MuiButtonGroup:{defaultProps:{disableRipple:!0}},MuiButton:{defaultProps:{disableRipple:!0},styleOverrides:{root:({theme:r,ownerState:e})=>{const t=e.variant,d=e.variant?.startsWith("dataviz");if(d){const o=parseInt((t??"").split("-")[1]),e=r.custom.dataviz.colorsWithExtra[o];if(void 0!==e)return{textTransform:"none",fontSize:"0.9rem",lineHeight:"1rem",borderRadius:r.spacing(1),height:"40px",fontWeight:700,transition:"none",color:r.custom.grey[100],boxShadow:"0px 4px 8px 0px #2A2B2714",background:e.main,":hover":{background:e.variant[700]},":disabled":{background:e.variant[100]},":active":{background:e.variant[700]}}}return{textTransform:"none",fontSize:"0.9rem",lineHeight:"1rem",borderRadius:r.spacing(1),height:"40px",fontWeight:700,..."primary"===t&&{transition:"none",background:`linear-gradient(${r.palette.primary[400]}, ${r.palette.primary[600]})`,color:r.custom.grey[100],boxShadow:"0px 4px 8px 0px #2A2B2714"},..."secondary"===t&&{border:`1px solid ${r.custom.grey[500]}`,background:`linear-gradient(${r.custom.grey[100]}}, ${r.custom.grey[300]})`},..."ternary"===t&&{border:`1px solid ${r.custom.grey[500]}`,background:r.custom.grey.gradientLight},..."text"===t&&{transition:"none",paddingInline:"0",color:r.palette.primary[700],fontWeight:"700"},..."selected-menu"===t&&{color:"white",background:`linear-gradient(${r.palette.primary[400]}, ${r.palette.primary[600]})`,borderRadius:"8px",padding:0},..."selected-submenu"===t&&{color:"white",backgroundColor:r.custom.grey[2300],background:r.custom.grey[2300],borderRadius:"8px",padding:0},..."default-menu"===t&&{color:r.custom.grey[100],background:"inherit",borderRadius:"8px",padding:0},..."black-text"===t&&{color:r.custom.grey[2800],background:"none",fontWeight:"600"},..."black-filled"===t&&{borderRadius:"8px",background:`linear-gradient(180deg, ${r.custom.grey[2600]} 0%, ${r.custom.grey[3e3]} 100%)`,boxShadow:"0px 4px 8px 0px rgba(42, 43, 39, 0.08)",color:r.custom.grey[100]},..."white-filled"===t&&{borderRadius:"8px",border:"1px solid "+r.custom.grey[500],background:`linear-gradient(180deg, ${r.custom.grey[100]} 0%, ${r.custom.grey[200]} 100%)`,boxShadow:" 0px 2px 8px 0px rgba(42, 43, 39, 0.04)"},..."white-filled-no-shadow"===t&&{borderRadius:"44px",border:`1px solid ${r.custom.grey[500]}`,background:`linear-gradient(180deg, ${r.custom.grey[100]} 0%, ${r.custom.grey[200]} 100%)`},..."select"===t&&{backgroundColor:r.custom.grey[100],borderRadius:r.spacing(1),border:`1px solid ${r.custom.grey[500]}`},..."validate"===t&&{color:"#FFFFFF",transition:"none",background:`linear-gradient(180deg, ${r.custom.green[500]} 0%, ${r.custom.green[700]} 100%)`},..."delete"===t&&{color:"#FFFFFF",transition:"none",background:`${r.custom.red[600]}`},..."error"===t&&{transition:"none",paddingInline:"0",color:r.custom.red[600],fontWeight:"600"},..."delete-outline"===t&&{color:r.custom.red[600],transition:"none",background:"transparent",border:`1px solid ${r.custom.red[600]}`},":hover":{..."primary"===t&&{background:r.palette.primary[600]},..."secondary"===t&&{background:r.custom.grey[400]},..."ternary"===t&&{border:`1px solid ${r.custom.grey[500]}`,background:r.custom.grey[400]},..."text"===t&&{background:"none",textDecoration:"underline"},..."select"===t&&{backgroundColor:r.custom.grey[300]},..."default-menu"===t&&{backgroundColor:r.custom.grey[2500],borderRadius:"8px"},..."selected-menu"===t&&{borderRadius:"8px"},..."selected-submenu"===t&&{borderRadius:"8px"},..."validate"===t&&{background:r.custom.green[600]},..."delete"===t&&{background:r.custom.red[700]},..."error"===t&&{color:r.custom.red[900]},..."delete-outline"===t&&{background:r.custom.red[100],borderColor:r.custom.red[700],color:r.custom.red[700]}},":disabled":{..."primary"===t&&{color:r.custom.grey[100],background:o(r.palette.primary[600]??"",.36)},..."secondary"===t&&{color:o(r.custom.grey[2800],.36),border:`1px solid ${o(r.custom.grey[500],.36)}`,background:r.custom.grey[100]},..."ternary"===t&&{border:`1px solid ${r.custom.grey[100]}`,background:r.custom.grey[500]},..."select"===t&&{backgroundColor:r.custom.grey[500]},..."default-menu"===t&&{color:r.custom.grey[2300],borderRadius:"8px"},..."selected-menu"===t&&{color:r.custom.grey[2300],borderRadius:"8px"},..."selected-submenu"===t&&{color:r.custom.grey[2300],borderRadius:"8px"},..."validate"===t&&{background:o(r.custom.green[500],.36),color:"#FFFFFF"},..."delete"===t&&{background:r.custom.red[100],color:o(r.custom.red[600],.36)},..."error"===t&&{color:o(r.custom.red[700],.36)},..."delete-outline"===t&&{color:o(r.custom.red[600],.36),borderColor:o(r.custom.red[600],.36),background:"transparent"}},":active":{..."primary"===t&&{background:r.palette.primary[800]},..."secondary"===t&&{background:r.custom.grey[400]},..."secondary"===t&&{background:r.custom.grey[600]},..."default-menu"===t&&{backgroundColor:r.custom.grey[2e3],borderRadius:"8px"},..."selected-menu"===t&&{backgroundColor:r.custom.grey[2700],borderRadius:"8px"},..."selected-submenu"===t&&{borderRadius:"8px"},..."validate"===t&&{background:r.custom.green[800]},..."delete"===t&&{background:r.custom.red[800]},..."delete-outline"===t&&{background:r.custom.red[100],borderColor:r.custom.red[800]}},..."tags-grey"===t&&{padding:r.spacing(0,1),border:`1px solid ${r.custom.grey[400]}`,borderRadius:"4px",backgroundColor:r.custom.grey[400],color:r.custom.grey[2800],height:"24px",...void 0!==e.onClick?{cursor:"pointer",":hover":{border:`1px solid ${r.custom.grey[500]}`,backgroundColor:r.custom.grey[300]},":active":{border:`1px solid ${r.custom.grey[500]}`,backgroundColor:r.custom.grey[500]},":disabled":{border:`1px solid ${r.custom.grey[500]}`,backgroundColor:r.custom.grey[100],color:r.custom.grey[1400]}}:{cursor:"default",":hover":{cursor:"default"}}},..."tags-black"===t&&{padding:r.spacing(0,1),border:`1px solid ${r.custom.grey[400]}`,borderRadius:"4px",background:"linear-gradient(180deg, #484945 0%, #2A2B27 100%)",color:r.custom.grey[100],height:"24px",...void 0!==e.onClick?{cursor:"pointer",":hover":{border:`1px solid ${r.custom.grey[500]}`,backgroundColor:r.custom.grey[300]},":active":{border:`1px solid ${r.custom.grey[500]}`,backgroundColor:r.custom.grey[500]},":disabled":{border:`1px solid ${r.custom.grey[500]}`,backgroundColor:r.custom.grey[100],color:r.custom.grey[1400]}}:{cursor:"default",":hover":{cursor:"default"}}},..."tags-white"===t&&{padding:r.spacing(0,1),border:`1px solid ${r.custom.grey[400]} !important`,borderRadius:"4px",backgroundColor:r.custom.grey[100],color:r.custom.grey[2800],height:"24px",cursor:"default",...void 0!==e.onClick&&{cursor:"pointer",":hover":{border:`1px solid ${r.custom.grey[500]}`,backgroundColor:r.custom.grey[300]},":active":{border:`1px solid ${r.custom.grey[500]}`,backgroundColor:r.custom.grey[500]},":disabled":{border:`1px solid ${r.custom.grey[500]}`,backgroundColor:r.custom.grey[100],color:r.custom.grey[1400]}}},..."tags-red"===t&&{padding:r.spacing(0,1),border:`1px solid ${r.custom.red[100]}`,borderRadius:"4px",backgroundColor:r.custom.red[100],color:r.custom.red[600],height:"24px",...void 0!==e.onClick?{cursor:"pointer",":hover":{border:`1px solid ${r.custom.grey[500]}`,backgroundColor:r.custom.grey[300]},":active":{border:`1px solid ${r.custom.grey[500]}`,backgroundColor:r.custom.grey[500]},":disabled":{border:`1px solid ${r.custom.grey[500]}`,backgroundColor:r.custom.grey[100],color:r.custom.grey[1400]}}:{cursor:"default",":hover":{cursor:"default"}}},..."tags-green"===t&&{padding:r.spacing(0,1),borderRadius:"4px",height:"24px",border:`1px solid ${r.custom.grey[400]}`,backgroundColor:r.custom.green[100],color:r.custom.green[600],...void 0!==e.onClick?{cursor:"pointer",":hover":{border:`1px solid ${r.custom.grey[400]}`,backgroundColor:r.custom.green[100],color:r.custom.green[600]},":active":{border:`1px solid ${r.custom.grey[500]}`,backgroundColor:r.custom.grey[500]},":disabled":{border:`1px solid ${r.custom.grey[500]}`,backgroundColor:r.custom.grey[100],color:r.custom.grey[1400]}}:{cursor:"default",":hover":{cursor:"default"}}},..."tags-blue"===t&&{padding:r.spacing(0,1),borderRadius:"4px",height:"24px",border:`1px solid ${r.custom.blue[100]}`,backgroundColor:r.custom.blue[100],color:r.custom.blue[700],...void 0!==e.onClick?{cursor:"pointer",":hover":{border:`1px solid ${r.custom.blue[200]}`,backgroundColor:r.custom.blue[50],color:r.custom.blue[700]},":active":{border:`1px solid ${r.custom.blue[300]}`,backgroundColor:r.custom.blue[200]},":disabled":{border:`1px solid ${r.custom.grey[500]}`,backgroundColor:r.custom.grey[100],color:r.custom.grey[1400]}}:{cursor:"default",":hover":{cursor:"default"}}},..."tags-coral"===t&&{padding:r.spacing(0,1),borderRadius:"4px",height:"24px",border:`1px solid ${r.custom.coral[100]}`,backgroundColor:r.custom.coral[100],color:r.custom.coral[700],...void 0!==e.onClick?{cursor:"pointer",":hover":{border:`1px solid ${r.custom.coral[200]}`,backgroundColor:r.custom.coral[50],color:r.custom.coral[700]},":active":{border:`1px solid ${r.custom.coral[300]}`,backgroundColor:r.custom.coral[200]},":disabled":{border:`1px solid ${r.custom.grey[500]}`,backgroundColor:r.custom.grey[100],color:r.custom.grey[1400]}}:{cursor:"default",":hover":{cursor:"default"}}},..."icon-xs-nobackground"===t&&{padding:r.spacing(.5),minWidth:"auto",width:"24px",height:"24px",color:r.custom.grey[2800],backgroundColor:"inherit",borderRadius:"32px",":hover":{backgroundColor:r.custom.grey[600]},":active":{backgroundColor:r.custom.grey[1e3]},":disabled":{backgroundColor:"inherit",color:r.custom.grey[1400]}},..."icon-s-nobackground"===t&&{padding:r.spacing(1),minWidth:"auto",width:"36px",height:"36px",color:r.custom.grey[2800],backgroundColor:"inherit",borderRadius:"32px",":hover":{backgroundColor:r.custom.grey[600]},":active":{backgroundColor:r.custom.grey[1e3]},":disabled":{backgroundColor:"inherit",color:r.custom.grey[1400]}},..."icon-m-nobackground"===t&&{padding:r.spacing(1),minWidth:"auto",width:"44px",height:"44px",color:r.custom.grey[2800],backgroundColor:"inherit",borderRadius:"32px",":hover":{backgroundColor:r.custom.grey[600]},":active":{backgroundColor:r.custom.grey[1e3]},":disabled":{backgroundColor:"inherit",color:r.custom.grey[1400]}},..."icon-xs-withbackground"===t&&{padding:r.spacing(.5),minWidth:"auto",width:"24px",height:"24px",color:r.custom.grey[2800],background:"linear-gradient(180deg, #FFFFFF 0%, #F6F5F3 154.5%)",border:`1px solid ${r.custom.grey[500]}`,borderRadius:"32px",":hover":{background:"none",backgroundColor:r.custom.grey[400]},":active":{background:"none",backgroundColor:r.custom.grey[600],border:"none"},":disabled":{background:"none",backgroundColor:r.custom.grey[100],color:r.custom.grey[1400]}},..."icon-s-withbackground"===t&&{padding:r.spacing(1),minWidth:"auto",width:"36px",height:"36px",color:r.custom.grey[2800],background:"linear-gradient(180deg, #FFFFFF 0%, #F6F5F3 154.5%)",border:`1px solid ${r.custom.grey[500]}`,borderRadius:"32px",":hover":{background:"none",backgroundColor:r.custom.grey[400]},":active":{background:"none",backgroundColor:r.custom.grey[600],border:"none"},":disabled":{background:"none",backgroundColor:r.custom.grey[100],color:r.custom.grey[1400]}},..."icon-m-withbackground"===t&&{padding:r.spacing(1),minWidth:"auto",width:"44px",height:"44px",color:r.custom.grey[2800],background:"linear-gradient(180deg, #FFFFFF 0%, #F6F5F3 154.5%)",border:`1px solid ${r.custom.grey[500]}`,borderRadius:"32px",":hover":{background:"none",backgroundColor:r.custom.grey[400]},":active":{background:"none",backgroundColor:r.custom.grey[600],border:"none"},":disabled":{background:"none",backgroundColor:r.custom.grey[100],color:r.custom.grey[1400]}}}}}},MuiButtonBase:{styleOverrides:{root:{borderRadius:"15px"}}},MuiCircularProgress:{styleOverrides:{root:({theme:o})=>({color:o.custom.grey[800]})}},MuiIconButton:{styleOverrides:{root:({theme:o})=>({height:"44px",width:"44px",color:o.custom.grey[2800],backgroundColor:"inherit",":hover":{backgroundColor:o.custom.grey[600]},":focus":{backgroundColor:o.custom.grey[1e3]},":disabled":{backgroundColor:"inherit",color:o.custom.grey[1400]}})}},MuiChip:{styleOverrides:{root:({theme:o,ownerState:r})=>({paddingTop:o.spacing(.5),paddingRight:o.spacing(.5),paddingBottom:o.spacing(.5),paddingLeft:o.spacing(1),..."brand"===r.variant&&{backgroundColor:o.palette.primary[50]},..."neutral"===r.variant&&{backgroundColor:o.custom.grey[300]}})}}};export{r as components};
|
|
1
|
+
import{alpha as o}from"@mui/material";import{isTagVariant as r,getTagStyle as e}from"./MUIComponents/tagsStyles.js";const t={MuiDialog:{styleOverrides:{paper:{borderRadius:"1rem"}}},MuiAutocomplete:{styleOverrides:{root:()=>({})}},MuiAvatar:{defaultProps:{children:[]},styleOverrides:{root:({theme:o,ownerState:{alt:r=""}})=>{const e=r.split(" ").map(o=>o.charAt(0).toUpperCase()).join("");return{background:o.palette.primary[100],color:o.palette.primary[700],fontWeight:600,".MuiAvatar-img":{zIndex:1},":empty::before":{content:`"${e}"`}}}},variants:[{props:{variant:"small"},style:{width:"24px",height:"24px",fontSize:"10px"}},{props:{variant:"medium"},style:{width:"36px",height:"36px",fontSize:"13px"}},{props:{variant:"big"},style:{width:"40px",height:"40px",fontSize:"16px"}}]},MuiAvatarGroup:{defaultProps:{variant:"small",spacing:6,sx:{justifyContent:"flex-end"},slotProps:{additionalAvatar:{sx:{color:o=>o.custom.grey[2800],background:o=>o.custom.grey[400]}}}},styleOverrides:{root:({ownerState:{max:o=0}})=>({...[...Array(o)].reduce((r,e,t)=>({...r,[`& > .MuiAvatar-root:nth-of-type(${t+1})`]:{zIndex:o-t}}),{})})}},MuiButtonGroup:{defaultProps:{disableRipple:!0}},MuiButton:{defaultProps:{disableRipple:!0,loadingPosition:"start"},styleOverrides:{root:({theme:t,ownerState:n})=>{const a=n.variant,d=n.variant?.startsWith("dataviz");if(d){const o=parseInt((a??"").split("-")[1]),r=t.custom.dataviz.colorsWithExtra[o];if(void 0!==r)return{textTransform:"none",fontSize:"0.9rem",lineHeight:"1rem",borderRadius:t.spacing(1),height:"40px",fontWeight:700,transition:"none",color:t.custom.grey[100],boxShadow:"0px 4px 8px 0px #2A2B2714",background:r.main,":hover":{background:r.variant[700]},":disabled":!0===n.loading?{color:"center"===n.loadingPosition?"transparent":t.custom.grey[100],background:r.main}:{background:r.variant[100]},":active":{background:r.variant[700]}}}const i={..."primary"===a&&{transition:"none",background:`linear-gradient(${t.palette.primary[400]}, ${t.palette.primary[600]})`,color:t.custom.grey[100],boxShadow:"0px 4px 8px 0px #2A2B2714"},..."secondary"===a&&{border:`1px solid ${t.custom.grey[500]}`,background:`linear-gradient(${t.custom.grey[100]}}, ${t.custom.grey[300]})`},..."ternary"===a&&{border:`1px solid ${t.custom.grey[500]}`,background:t.custom.grey.gradientLight},..."text"===a&&{transition:"none",paddingInline:"0",color:t.palette.primary[700],fontWeight:"700"},..."selected-menu"===a&&{color:"white",background:`linear-gradient(${t.palette.primary[400]}, ${t.palette.primary[600]})`,borderRadius:"8px",padding:0},..."selected-submenu"===a&&{color:"white",backgroundColor:t.custom.grey[2300],background:t.custom.grey[2300],borderRadius:"8px",padding:0},..."default-menu"===a&&{color:t.custom.grey[100],background:"inherit",borderRadius:"8px",padding:0},..."black-text"===a&&{color:t.custom.grey[2800],background:"none",fontWeight:"600"},..."black-filled"===a&&{borderRadius:"8px",background:`linear-gradient(180deg, ${t.custom.grey[2600]} 0%, ${t.custom.grey[3e3]} 100%)`,boxShadow:"0px 4px 8px 0px rgba(42, 43, 39, 0.08)",color:t.custom.grey[100]},..."white-filled"===a&&{borderRadius:"8px",border:"1px solid "+t.custom.grey[500],background:`linear-gradient(180deg, ${t.custom.grey[100]} 0%, ${t.custom.grey[200]} 100%)`,boxShadow:" 0px 2px 8px 0px rgba(42, 43, 39, 0.04)"},..."white-filled-no-shadow"===a&&{borderRadius:"44px",border:`1px solid ${t.custom.grey[500]}`,background:`linear-gradient(180deg, ${t.custom.grey[100]} 0%, ${t.custom.grey[200]} 100%)`},..."select"===a&&{backgroundColor:t.custom.grey[100],borderRadius:t.spacing(1),border:`1px solid ${t.custom.grey[500]}`},..."validate"===a&&{color:"#FFFFFF",transition:"none",background:`linear-gradient(180deg, ${t.custom.green[500]} 0%, ${t.custom.green[700]} 100%)`},..."delete"===a&&{color:"#FFFFFF",transition:"none",background:`${t.custom.red[600]}`},..."error"===a&&{transition:"none",paddingInline:"0",color:t.custom.red[600],fontWeight:"600"},..."delete-outline"===a&&{color:t.custom.red[600],transition:"none",background:"transparent",border:`1px solid ${t.custom.red[600]}`}};return{textTransform:"none",fontSize:"0.9rem",lineHeight:"1rem",borderRadius:t.spacing(1),height:"40px",fontWeight:700,...i,...!0===n.loading&&("text"===a||"error"===a)&&{"& .MuiButton-loadingIndicator":{left:0}},":hover":{..."primary"===a&&{background:t.palette.primary[600]},..."secondary"===a&&{background:t.custom.grey[400]},..."ternary"===a&&{border:`1px solid ${t.custom.grey[500]}`,background:t.custom.grey[400]},..."text"===a&&{background:"none",textDecoration:"underline"},..."select"===a&&{backgroundColor:t.custom.grey[300]},..."default-menu"===a&&{backgroundColor:t.custom.grey[2500],borderRadius:"8px"},..."selected-menu"===a&&{borderRadius:"8px"},..."selected-submenu"===a&&{borderRadius:"8px"},..."validate"===a&&{background:t.custom.green[600]},..."delete"===a&&{background:t.custom.red[700]},..."error"===a&&{color:t.custom.red[900]},..."delete-outline"===a&&{background:t.custom.red[100],borderColor:t.custom.red[700],color:t.custom.red[700]}},":disabled":!0===n.loading?{color:"inherit",...i,..."center"===n.loadingPosition&&{color:"transparent"}}:{..."primary"===a&&{color:t.custom.grey[100],background:o(t.palette.primary[600]??"",.36)},..."secondary"===a&&{color:o(t.custom.grey[2800],.36),border:`1px solid ${o(t.custom.grey[500],.36)}`,background:t.custom.grey[100]},..."ternary"===a&&{border:`1px solid ${t.custom.grey[100]}`,background:t.custom.grey[500]},..."select"===a&&{backgroundColor:t.custom.grey[500]},..."default-menu"===a&&{color:t.custom.grey[2300],borderRadius:"8px"},..."selected-menu"===a&&{color:t.custom.grey[2300],borderRadius:"8px"},..."selected-submenu"===a&&{color:t.custom.grey[2300],borderRadius:"8px"},..."validate"===a&&{background:o(t.custom.green[500],.36),color:"#FFFFFF"},..."delete"===a&&{background:t.custom.red[100],color:o(t.custom.red[600],.36)},..."error"===a&&{color:o(t.custom.red[700],.36)},..."delete-outline"===a&&{color:o(t.custom.red[600],.36),borderColor:o(t.custom.red[600],.36),background:"transparent"}},":active":{..."primary"===a&&{background:t.palette.primary[800]},..."secondary"===a&&{background:t.custom.grey[400]},..."secondary"===a&&{background:t.custom.grey[600]},..."default-menu"===a&&{backgroundColor:t.custom.grey[2e3],borderRadius:"8px"},..."selected-menu"===a&&{backgroundColor:t.custom.grey[2700],borderRadius:"8px"},..."selected-submenu"===a&&{borderRadius:"8px"},..."validate"===a&&{background:t.custom.green[800]},..."delete"===a&&{background:t.custom.red[800]},..."delete-outline"===a&&{background:t.custom.red[100],borderColor:t.custom.red[800]}},...r(a)&&e(a,t,n),..."icon-xs-nobackground"===a&&{padding:t.spacing(.5),minWidth:"auto",width:"24px",height:"24px",color:t.custom.grey[2800],backgroundColor:"inherit",borderRadius:"32px",":hover":{backgroundColor:t.custom.grey[600]},":active":{backgroundColor:t.custom.grey[1e3]},":disabled":{backgroundColor:"inherit",color:t.custom.grey[1400]}},..."icon-s-nobackground"===a&&{padding:t.spacing(1),minWidth:"auto",width:"36px",height:"36px",color:t.custom.grey[2800],backgroundColor:"inherit",borderRadius:"32px",":hover":{backgroundColor:t.custom.grey[600]},":active":{backgroundColor:t.custom.grey[1e3]},":disabled":{backgroundColor:"inherit",color:t.custom.grey[1400]}},..."icon-m-nobackground"===a&&{padding:t.spacing(1),minWidth:"auto",width:"44px",height:"44px",color:t.custom.grey[2800],backgroundColor:"inherit",borderRadius:"32px",":hover":{backgroundColor:t.custom.grey[600]},":active":{backgroundColor:t.custom.grey[1e3]},":disabled":{backgroundColor:"inherit",color:t.custom.grey[1400]}},..."icon-xs-withbackground"===a&&{padding:t.spacing(.5),minWidth:"auto",width:"24px",height:"24px",color:t.custom.grey[2800],background:"linear-gradient(180deg, #FFFFFF 0%, #F6F5F3 154.5%)",border:`1px solid ${t.custom.grey[500]}`,borderRadius:"32px",":hover":{background:"none",backgroundColor:t.custom.grey[400]},":active":{background:"none",backgroundColor:t.custom.grey[600],border:"none"},":disabled":{background:"none",backgroundColor:t.custom.grey[100],color:t.custom.grey[1400]}},..."icon-s-withbackground"===a&&{padding:t.spacing(1),minWidth:"auto",width:"36px",height:"36px",color:t.custom.grey[2800],background:"linear-gradient(180deg, #FFFFFF 0%, #F6F5F3 154.5%)",border:`1px solid ${t.custom.grey[500]}`,borderRadius:"32px",":hover":{background:"none",backgroundColor:t.custom.grey[400]},":active":{background:"none",backgroundColor:t.custom.grey[600],border:"none"},":disabled":{background:"none",backgroundColor:t.custom.grey[100],color:t.custom.grey[1400]}},..."icon-m-withbackground"===a&&{padding:t.spacing(1),minWidth:"auto",width:"44px",height:"44px",color:t.custom.grey[2800],background:"linear-gradient(180deg, #FFFFFF 0%, #F6F5F3 154.5%)",border:`1px solid ${t.custom.grey[500]}`,borderRadius:"32px",":hover":{background:"none",backgroundColor:t.custom.grey[400]},":active":{background:"none",backgroundColor:t.custom.grey[600],border:"none"},":disabled":{background:"none",backgroundColor:t.custom.grey[100],color:t.custom.grey[1400]}}}}}},MuiButtonBase:{styleOverrides:{root:{borderRadius:"15px"}}},MuiCircularProgress:{styleOverrides:{root:({theme:o,ownerState:r})=>({..."inherit"!==r.color&&{color:o.custom.grey[800]}})}},MuiIconButton:{styleOverrides:{root:({theme:o})=>({height:"44px",width:"44px",color:o.custom.grey[2800],backgroundColor:"inherit",":hover":{backgroundColor:o.custom.grey[600]},":focus":{backgroundColor:o.custom.grey[1e3]},":disabled":{backgroundColor:"inherit",color:o.custom.grey[1400]}})}},MuiChip:{styleOverrides:{root:({theme:o,ownerState:r})=>({paddingTop:o.spacing(.5),paddingRight:o.spacing(.5),paddingBottom:o.spacing(.5),paddingLeft:o.spacing(1),..."brand"===r.variant&&{backgroundColor:o.palette.primary[50]},..."neutral"===r.variant&&{backgroundColor:o.custom.grey[300]}})}}};export{t as components};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foodpilot/foods",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.22.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/main.js",
|
|
7
7
|
"module": "./dist/main.js",
|
|
@@ -213,7 +213,7 @@
|
|
|
213
213
|
"@emotion/styled": "^11.14.0",
|
|
214
214
|
"@mui/icons-material": "^6.0.0",
|
|
215
215
|
"@mui/lab": "^6.0.0-beta.0",
|
|
216
|
-
"@mui/material": "^6.
|
|
216
|
+
"@mui/material": "^6.4.0",
|
|
217
217
|
"@mui/x-data-grid": "^7.0.0",
|
|
218
218
|
"@mui/x-date-pickers": "^7.0.0",
|
|
219
219
|
"@mui/x-tree-view": "^7.0.0",
|