@foodpilot/foods 2.29.0 → 2.30.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.
Files changed (68) hide show
  1. package/dist/assets/checkbox-check.svg.js +1 -0
  2. package/dist/assets/checkbox-minus.svg.js +1 -0
  3. package/dist/components/Cards/SelectionCard/SelectionCard.js +4 -4
  4. package/dist/components/Cards/TrajectoryCards/styles/index.d.ts +3 -3
  5. package/dist/components/Checkbox/BaseCheckbox.d.ts +3 -1
  6. package/dist/components/Checkbox/BaseCheckbox.js +2 -2
  7. package/dist/components/Checkbox/FoodsCheckbox.d.ts +3 -1
  8. package/dist/components/Checkbox/FoodsCheckbox.js +2 -2
  9. package/dist/components/Checkbox/FoodsCheckboxControl.d.ts +2 -0
  10. package/dist/components/Checkbox/FoodsCheckboxControl.js +1 -0
  11. package/dist/components/Input/SearchBox.d.ts +2 -0
  12. package/dist/components/Input/SearchBox.js +3 -2
  13. package/dist/components/NumberInput/FoodsNumberInput.d.ts +18 -0
  14. package/dist/components/NumberInput/FoodsNumberInput.js +9 -0
  15. package/dist/components/NumberInput/index.d.ts +1 -0
  16. package/dist/components/NumberInput/index.js +1 -0
  17. package/dist/components/Radio/BaseRadio.d.ts +5 -6
  18. package/dist/components/Radio/BaseRadio.js +2 -4
  19. package/dist/components/Radio/FoodsRadioList.d.ts +3 -0
  20. package/dist/components/Radio/FoodsRadioList.js +2 -2
  21. package/dist/components/Radio/RadioBoolean.d.ts +2 -0
  22. package/dist/components/Radio/RadioBoolean.js +2 -2
  23. package/dist/components/RichTextEditor/components/ColorInput/style/index.d.ts +2 -2
  24. package/dist/components/RichTextEditor/components/Toolbar/style/index.d.ts +1 -1
  25. package/dist/components/Search/FoodsSearch.js +2 -2
  26. package/dist/components/Select/FoodsMultiSelect/FoodsMultiSelect.d.ts +40 -0
  27. package/dist/components/Select/FoodsMultiSelect/FoodsMultiSelect.js +20 -0
  28. package/dist/components/Select/FoodsMultiSelect/index.d.ts +1 -0
  29. package/dist/components/Select/FoodsMultiSelect/index.js +1 -0
  30. package/dist/components/Select/FoodsSelect/Context/Provider.d.ts +4 -0
  31. package/dist/components/Select/FoodsSelect/Context/Provider.js +2 -2
  32. package/dist/components/Select/FoodsSelect/Context/useSelect.d.ts +1 -0
  33. package/dist/components/Select/FoodsSelect/FoodsSelect.d.ts +6 -1
  34. package/dist/components/Select/FoodsSelect/FoodsSelect.js +6 -6
  35. package/dist/components/Select/FoodsSelect/Options/Header/OptionHeader.d.ts +2 -1
  36. package/dist/components/Select/FoodsSelect/Options/Header/OptionHeader.js +4 -4
  37. package/dist/components/Select/FoodsSelect/Options/SelectOptions.js +13 -10
  38. package/dist/components/Select/FoodsSelect/Select.d.ts +1 -0
  39. package/dist/components/Select/FoodsSelect/Select.js +4 -4
  40. package/dist/components/Select/FoodsSelect/index.d.ts +1 -0
  41. package/dist/components/Select/FoodsSelect/search.d.ts +2 -0
  42. package/dist/components/Select/FoodsSelect/search.js +1 -0
  43. package/dist/components/Select/index.d.ts +1 -0
  44. package/dist/components/Select/index.js +1 -1
  45. package/dist/components/Tabs/CountTabs/CountTabs.js +4 -4
  46. package/dist/components/Textarea/Textarea.js +3 -3
  47. package/dist/components/UnitConverterPanel/UnitConverterPanel.js +10 -10
  48. package/dist/components/index.d.ts +1 -0
  49. package/dist/main.js +1 -1
  50. package/dist/node_modules/@csstools/color-helpers/dist/index.js +1 -0
  51. package/dist/themes/FoodsThemeProvider.d.ts +2 -2
  52. package/dist/themes/FoodsThemeProvider.js +2 -2
  53. package/dist/themes/common/colors.d.ts +1 -1
  54. package/dist/themes/common/components.js +1 -1
  55. package/dist/themes/common/custom.d.ts +51 -1
  56. package/dist/themes/common/custom.js +1 -1
  57. package/dist/themes/common/focusRing.d.ts +8 -0
  58. package/dist/themes/common/focusRing.js +1 -0
  59. package/dist/themes/common/index.d.ts +1 -0
  60. package/dist/themes/createFoodsTheme.d.ts +3 -0
  61. package/dist/themes/createFoodsTheme.js +1 -0
  62. package/dist/themes/index.js +1 -1
  63. package/dist/themes/responsive/useResponsiveBreakpoints.js +1 -1
  64. package/dist/themes/themes/CollectiveTheme.js +1 -1
  65. package/dist/themes/themes/FoodPilotTheme.js +1 -1
  66. package/dist/themes/themes/WinePilotTheme.js +1 -1
  67. package/dist/themes/themes/index.d.ts +1 -0
  68. package/package.json +12 -3
@@ -0,0 +1 @@
1
+ import*as e from"react";const t=t=>/* @__PURE__ */e.createElement("svg",{preserveAspectRatio:"none",overflow:"visible",style:{display:"block"},width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},/* @__PURE__ */e.createElement("g",{id:"Check"},/* @__PURE__ */e.createElement("path",{id:"Vector",d:"M6.32223 11.9333L2.56667 8.17777L3.36111 7.38332L6.32223 10.3444L12.6278 4.03887L13.4222 4.83332L6.32223 11.9333Z",fill:"white"})));export{t as default};
@@ -0,0 +1 @@
1
+ import*as e from"react";const t=t=>/* @__PURE__ */e.createElement("svg",{preserveAspectRatio:"none",overflow:"visible",style:{display:"block"},width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},/* @__PURE__ */e.createElement("g",{id:"Check"},/* @__PURE__ */e.createElement("path",{id:"Vector",d:"M3.33333 8.55555V7.44445H12.6667V8.55555H3.33333Z",fill:"white"})));export{t as default};
@@ -1,4 +1,4 @@
1
- import{jsxs as o,jsx as e}from"react/jsx-runtime";import{useTheme as i,Stack as r,Box as t,Typography as n}from"@mui/material";import{forwardRef as l}from"react";import{FoodsIcon as d}from"../../Icons/FoodsIcon.js";import{greyTheme as a}from"../../../themes/common/colors.js";const c=l((l,c)=>{const{title:s,description:p,icon:m,selected:x=!1,disabled:b=!1,fullWidth:h=!1,onClick:f,id:u,tabIndex:g,onKeyDown:y}=l,k=i(),C=k.palette.primary,w=k.palette.grey,I=w[100],j=C[50]??I,v=C[200]??C.main,S=C[600]??C.main,W=w[600],D=b?a[1400]:k.palette.text.primary,F=b?w[300]:x?C[100]??j:j;/* @__PURE__ */
2
- return o(r,{component:"button",ref:c,id:u,type:"button",role:"radio","aria-checked":x,"aria-disabled":b,disabled:b,tabIndex:g,onClick:()=>{b||f?.()},onKeyDown:y,direction:"row",alignItems:"center",gap:k.spacing(2),sx:{width:h?"100%":"306px",flex:h?1:"0 0 auto",minWidth:0,minHeight:"82px",padding:k.spacing(2),border:`1px solid ${b?W:x?S:v}`,borderRadius:"12px",backgroundColor:x?j:I,boxShadow:"0px 2px 8px 0px rgba(42, 43, 39, 0.04)",color:D,cursor:b?"not-allowed":"pointer",font:"inherit",textAlign:"left",transition:"background-color 150ms ease, border-color 150ms ease","&:hover":b?void 0:{backgroundColor:j,borderColor:S},"&:focus-visible":{outline:`2px solid ${S}`,outlineOffset:"2px"}},children:[m&&/* @__PURE__ */e(t,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,padding:k.spacing(1),borderRadius:"12px",backgroundColor:F,color:D},children:m}),
3
- /* @__PURE__ */o(r,{flex:1,justifyContent:"center",minWidth:0,children:[
4
- /* @__PURE__ */e(n,{variant:"body-semibold",color:"inherit",children:s}),p&&/* @__PURE__ */e(n,{variant:"small",color:"inherit",children:p})]}),x&&/* @__PURE__ */e(t,{flexShrink:0,color:S,children:/* @__PURE__ */e(d,{icon:"checkCircleFilled",size:2})})]})});c.displayName="SelectionCard";export{c as SelectionCard};
1
+ import{jsxs as o,jsx as e}from"react/jsx-runtime";import{useTheme as r,Stack as i,Box as t,Typography as n}from"@mui/material";import{forwardRef as l}from"react";import{FoodsIcon as a}from"../../Icons/FoodsIcon.js";import{greyTheme as d}from"../../../themes/common/colors.js";import{focusRingStyles as c}from"../../../themes/common/focusRing.js";const s=l((l,s)=>{const{title:m,description:p,icon:x,selected:h=!1,disabled:b=!1,fullWidth:f=!1,onClick:u,id:g,tabIndex:y,onKeyDown:k}=l,C=r(),j=C.palette.primary,w=C.palette.grey,I=w[100],v=j[50]??I,S=j[200]??j.main,R=j[600]??j.main,W=w[600],D=b?d[1400]:C.palette.text.primary,F=b?w[300]:h?j[100]??v:v;/* @__PURE__ */
2
+ return o(i,{component:"button",ref:s,id:g,type:"button",role:"radio","aria-checked":h,"aria-disabled":b,disabled:b,tabIndex:y,onClick:()=>{b||u?.()},onKeyDown:k,direction:"row",alignItems:"center",gap:C.spacing(2),sx:{width:f?"100%":"306px",flex:f?1:"0 0 auto",minWidth:0,minHeight:"82px",padding:C.spacing(2),border:`1px solid ${b?W:h?R:S}`,borderRadius:"12px",backgroundColor:h?v:I,boxShadow:"0px 2px 8px 0px rgba(42, 43, 39, 0.04)",color:D,cursor:b?"not-allowed":"pointer",font:"inherit",textAlign:"left",transition:"background-color 150ms ease, border-color 150ms ease","&:hover":b?void 0:{backgroundColor:v,borderColor:R},...c(C,"outer")},children:[x&&/* @__PURE__ */e(t,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,padding:C.spacing(1),borderRadius:"12px",backgroundColor:F,color:D},children:x}),
3
+ /* @__PURE__ */o(i,{flex:1,justifyContent:"center",minWidth:0,children:[
4
+ /* @__PURE__ */e(n,{variant:"body-semibold",color:"inherit",children:m}),p&&/* @__PURE__ */e(n,{variant:"small",color:"inherit",children:p})]}),h&&/* @__PURE__ */e(t,{flexShrink:0,color:R,children:/* @__PURE__ */e(a,{icon:"checkCircleFilled",size:2})})]})});s.displayName="SelectionCard";export{s as SelectionCard};
@@ -15,15 +15,15 @@ interface StepsProps {
15
15
  fullHeight?: boolean;
16
16
  valueFormatterFn?: (value: number) => string | number;
17
17
  }
18
- export declare const Container: StyledComponent< GridOwnProps & CommonProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "className" | "style" | "classes" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "direction" | "columns" | "container" | "children" | "spacing" | "sx" | "wrap" | "xs" | "sm" | "md" | "lg" | "xl" | "columnSpacing" | "item" | "rowSpacing" | "zeroMinWidth"> & MUIStyledCommonProps<Theme>, {}, {}>;
18
+ export declare const Container: StyledComponent< GridOwnProps & CommonProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "className" | "style" | "classes" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "direction" | "columns" | "container" | "children" | "spacing" | "sx" | "xs" | "sm" | "md" | "lg" | "xl" | "columnSpacing" | "item" | "rowSpacing" | "wrap" | "zeroMinWidth"> & MUIStyledCommonProps<Theme>, {}, {}>;
19
19
  export declare const StartToCurrentArrow: StyledComponent< BoxOwnProps<Theme> & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxOwnProps<Theme>> & MUIStyledCommonProps<Theme> & {
20
20
  orientation?: "horizontal" | "vertical";
21
21
  }, {}, {}>;
22
22
  export declare const CurrentToTargetArrow: StyledComponent< BoxOwnProps<Theme> & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxOwnProps<Theme>> & MUIStyledCommonProps<Theme> & {
23
23
  orientation?: "horizontal" | "vertical";
24
24
  }, {}, {}>;
25
- export declare const LeftColumn: StyledComponent< GridOwnProps & CommonProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "className" | "style" | "classes" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "direction" | "columns" | "container" | "children" | "spacing" | "sx" | "wrap" | "xs" | "sm" | "md" | "lg" | "xl" | "columnSpacing" | "item" | "rowSpacing" | "zeroMinWidth"> & MUIStyledCommonProps<Theme>, {}, {}>;
26
- export declare const RightColumn: StyledComponent< GridOwnProps & CommonProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "className" | "style" | "classes" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "direction" | "columns" | "container" | "children" | "spacing" | "sx" | "wrap" | "xs" | "sm" | "md" | "lg" | "xl" | "columnSpacing" | "item" | "rowSpacing" | "zeroMinWidth"> & MUIStyledCommonProps<Theme>, {}, {}>;
25
+ export declare const LeftColumn: StyledComponent< GridOwnProps & CommonProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "className" | "style" | "classes" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "direction" | "columns" | "container" | "children" | "spacing" | "sx" | "xs" | "sm" | "md" | "lg" | "xl" | "columnSpacing" | "item" | "rowSpacing" | "wrap" | "zeroMinWidth"> & MUIStyledCommonProps<Theme>, {}, {}>;
26
+ export declare const RightColumn: StyledComponent< GridOwnProps & CommonProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "className" | "style" | "classes" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "direction" | "columns" | "container" | "children" | "spacing" | "sx" | "xs" | "sm" | "md" | "lg" | "xl" | "columnSpacing" | "item" | "rowSpacing" | "wrap" | "zeroMinWidth"> & MUIStyledCommonProps<Theme>, {}, {}>;
27
27
  export declare const StyledStartStep: (props: StepsProps) => import("react/jsx-runtime").JSX.Element;
28
28
  export declare const StyledWithoutPlanStep: (props: StepsProps) => import("react/jsx-runtime").JSX.Element;
29
29
  export {};
@@ -4,8 +4,10 @@ export type CheckboxName = string | number;
4
4
  export type CheckboxProperties<T> = CheckboxPropertyValue<T>[];
5
5
  export type CheckboxPropertyValue<T> = {
6
6
  id: CheckboxId;
7
- name: CheckboxName;
7
+ name?: CheckboxName;
8
+ ariaLabel?: string;
8
9
  state: boolean;
10
+ indeterminate?: boolean;
9
11
  disabled?: boolean;
10
12
  rawData: T;
11
13
  };
@@ -1,2 +1,2 @@
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 a}from"./StyledCheckbox.js";const c=c=>{const{values:m,onChange:n,FormGroupProps:p,FormControlLabelProps:i,CheckboxProps:l}=c;/* @__PURE__ */
2
- return e(o,{...p,children:m.map((o,c)=>/* @__PURE__ */e(r,{sx:e=>({gap:e.spacing(2)}),checked:o.state,...i,label:o.name,control:/* @__PURE__ */e(a,{checkedIcon:/* @__PURE__ */e(t,{}),icon:/* @__PURE__ */e(s,{}),disableRipple:!0,...l,onChange:(e,o)=>{n(m.map((e,r)=>r===c?{...e,state:o}:e))}})},`${o.id}-${c}`))})};export{c as BaseCheckbox};
1
+ import{jsx as e}from"react/jsx-runtime";import{FormGroup as o,FormControlLabel as r}from"@mui/material";import{useResponsiveBreakpoints as a}from"../../themes/responsive/useResponsiveBreakpoints.js";import{FoodsCheckboxControl as i}from"./FoodsCheckboxControl.js";const t=t=>{const{values:n,onChange:s,FormGroupProps:l,FormControlLabelProps:m,CheckboxProps:c}=t,{isMobile:b}=a(),d=m?.sx,p=[...Array.isArray(d)?d:d?[d]:[],e=>({margin:0,minHeight:b?e.custom.checkbox.mobileRowHeight:e.custom.checkbox.targetSize,gap:e.custom.checkbox.labelGap,alignItems:"center","& .MuiFormControlLabel-label":{...e.typography[b?"big-regular":"body-regular"],fontSize:b?e.custom.checkbox.mobileLabelFontSize:e.typography["body-regular"].fontSize,color:e.custom.checkbox.labelColor,wordBreak:"break-word"}})];/* @__PURE__ */
2
+ return e(o,{...l,children:n.map((o,a)=>{const t=o.indeterminate??c?.indeterminate??!1,l=void 0!==o.name,b=/* @__PURE__ */e(i,{...c,checked:o.state,indeterminate:t,disabled:o.disabled??c?.disabled,inputProps:{...c?.inputProps,"aria-label":o.ariaLabel??c?.inputProps?.["aria-label"]??(l?void 0:String(o.id)),"aria-checked":t?"mixed":void 0},onChange:(e,o)=>{s(n.map((e,r)=>r===a?{...e,state:o,indeterminate:!1}:e))}});return l?/* @__PURE__ */e(r,{checked:o.state,...m,sx:p,label:o.name,control:b},`${o.id}-${a}`):/* @__PURE__ */e("span",{children:b},`${o.id}-${a}`)})})};export{t as BaseCheckbox};
@@ -1,9 +1,11 @@
1
1
  import { BaseCheckboxOverrides } from './BaseCheckbox';
2
2
  export type FoodsCheckboxProps<T> = BaseCheckboxOverrides & {
3
3
  selectedItems: T[] | undefined;
4
+ partiallySelectedItems?: T[];
4
5
  values: T[];
5
6
  onChange: (selectedValues: T[]) => void;
6
7
  getId?: (item: T) => string | number;
7
- getName?: (item: T) => string | number;
8
+ getName?: (item: T) => string | number | undefined;
9
+ getAriaLabel?: (item: T) => string;
8
10
  };
9
11
  export declare const FoodsCheckbox: <T>(props: FoodsCheckboxProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- import{jsx as e}from"react/jsx-runtime";import{BaseCheckbox as t}from"./BaseCheckbox.js";const a=a=>{const{values:n,selectedItems:r,onChange:s,getId:o=e=>e.id,getName:m=e=>e.name,...c}=a,i=r?.map(e=>o(e))??[],u=n.map(e=>{const t=o(e),a=i.includes(t),n=void 0!==r&&a;return{id:t,name:m(e),state:n,rawData:e}});/* @__PURE__ */
2
- return e(t,{values:u,onChange:e=>{const t=e.flatMap(e=>!1===e.state?[]:e.rawData);return s(t)},...c})};export{a as FoodsCheckbox};
1
+ import{jsx as e}from"react/jsx-runtime";import{BaseCheckbox as a}from"./BaseCheckbox.js";const t=t=>{const{values:r,selectedItems:n,partiallySelectedItems:s,onChange:m,getId:o=e=>e.id,getName:i=e=>e.name,getAriaLabel:l,...c}=t,d=n?.map(e=>o(e))??[],p=new Set(s?.map(o)??[]),u=r.map(e=>{const a=o(e),t=d.includes(a),r=void 0!==n&&t;return{id:a,name:i(e),ariaLabel:l?.(e),state:r,indeterminate:!r&&p.has(a),rawData:e}});/* @__PURE__ */
2
+ return e(a,{values:u,onChange:e=>{const a=e.flatMap(e=>!1===e.state?[]:e.rawData);return m(a)},...c})};export{t as FoodsCheckbox};
@@ -0,0 +1,2 @@
1
+ import { CheckboxProps } from '@mui/material';
2
+ export declare const FoodsCheckboxControl: (props: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as o,jsxs as e}from"react/jsx-runtime";import{styled as c,Checkbox as i}from"@mui/material";import s from"../../assets/checkbox-check.svg.js";import d from"../../assets/checkbox-minus.svg.js";import{focusRingStyles as r}from"../../themes/common/focusRing.js";const t=({selection:c})=>/* @__PURE__ */e("span",{className:`FoodsCheckbox-icon FoodsCheckbox-icon-${c}`,children:["checked"===c&&/* @__PURE__ */o(s,{"aria-hidden":"true"}),"partially"===c&&/* @__PURE__ */o(d,{"aria-hidden":"true"})]}),b=c(i)(({theme:o})=>({boxSizing:"border-box",width:o.custom.checkbox.targetSize,height:o.custom.checkbox.targetSize,padding:o.custom.checkbox.controlInset,flexShrink:0,backgroundColor:"transparent","&:hover":{backgroundColor:"transparent"},"& .FoodsCheckbox-icon":{boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center",width:o.custom.checkbox.boxSize,height:o.custom.checkbox.boxSize,borderRadius:o.custom.checkbox.borderRadius},"& .FoodsCheckbox-icon-unchecked":{border:`${o.custom.checkbox.borderWidth} solid ${o.custom.checkbox.uncheckedBorder}`,backgroundColor:o.custom.grey[100]},"& .FoodsCheckbox-icon-checked, & .FoodsCheckbox-icon-partially":{background:o.custom.checkbox.selectedBackground},"& .FoodsCheckbox-icon svg":{display:"block",width:o.custom.checkbox.markSize,height:o.custom.checkbox.markSize},"&:hover:not(.Mui-disabled) .FoodsCheckbox-icon-unchecked":{borderColor:o.custom.checkbox.hoverBorder},"&:hover:not(.Mui-disabled) .FoodsCheckbox-icon-checked, &:hover:not(.Mui-disabled) .FoodsCheckbox-icon-partially":{background:o.custom.checkbox.selectedHoverBackground},"&.Mui-focusVisible .FoodsCheckbox-icon, &:focus-visible .FoodsCheckbox-icon":r(o,"outer")["&:focus-visible, &.Mui-focusVisible"],"&.Mui-disabled .FoodsCheckbox-icon-unchecked":{borderColor:o.custom.checkbox.disabledBorder,backgroundColor:o.custom.checkbox.disabledBackground},"&.Mui-disabled .FoodsCheckbox-icon-checked, &.Mui-disabled .FoodsCheckbox-icon-partially":{background:o.custom.checkbox.selectedDisabledBackground}})),n=e=>/* @__PURE__ */o(b,{icon:/* @__PURE__ */o(t,{selection:"unchecked"}),checkedIcon:/* @__PURE__ */o(t,{selection:"checked"}),indeterminateIcon:/* @__PURE__ */o(t,{selection:"partially"}),disableRipple:!0,...e});export{n as FoodsCheckboxControl};
@@ -2,6 +2,8 @@ export interface ISearchBoxProps {
2
2
  placeholder?: string;
3
3
  value: string | null;
4
4
  onChange: (value: string) => void;
5
+ clearButtonLabel: string;
6
+ disabled?: boolean;
5
7
  variant?: "standalone";
6
8
  }
7
9
  export declare function SearchBox(props: ISearchBoxProps): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,3 @@
1
- import{jsx as o}from"react/jsx-runtime";import{FoodsIcon as r}from"../Icons/FoodsIcon.js";import{FoodsTextInput as e}from"../Form/FoodsFormFields/FoodsTextInput.js";function n(n){const t="standalone"===n.variant;/* @__PURE__ */
2
- return o(e,{value:n.value??"",onChange:o=>{n.onChange(o)},ExtraInputProps:{type:"search",placeholder:n.placeholder,endAdornment:/* @__PURE__ */o(r,{size:2,icon:"search"})},StackProps:t?{sx:{width:"100%"}}:void 0})}export{n as SearchBox};
1
+ import{jsx as o,jsxs as e}from"react/jsx-runtime";import{useTheme as t,Stack as n}from"@mui/material";import{useRef as r}from"react";import{FoodsIconButton as a}from"../Button/FoodsIconButton.js";import{FoodsIcon as i}from"../Icons/FoodsIcon.js";import{FoodsTextInput as s}from"../Form/FoodsFormFields/FoodsTextInput.js";function l(l){const c="standalone"===l.variant,d=r(null),p=t(),u=Boolean(l.value);/* @__PURE__ */
2
+ return o(s,{value:l.value??"",onChange:l.onChange,disabled:l.disabled,ExtraInputProps:{type:"search",placeholder:l.placeholder,inputRef:d,endAdornment:/* @__PURE__ */e(n,{direction:"row",alignItems:"center",gap:p.spacing(.5),flexShrink:0,color:l.disabled?p.custom.grey[1400]:void 0,children:[u&&!l.disabled&&/* @__PURE__ */o(a,{size:"xs",icon:"cancel",tooltip:{text:l.clearButtonLabel},buttonProps:{"aria-label":l.clearButtonLabel,onClick:()=>{l.onChange(""),d.current?.focus()}}}),
3
+ /* @__PURE__ */o(i,{size:2,icon:"search"})]}),sx:{"&.MuiInputBase-root":{paddingRight:p.spacing(1.5)},"& input::-webkit-search-cancel-button":{display:"none"}}},StackProps:c?{sx:{width:"100%"}}:void 0})}export{l as SearchBox};
@@ -0,0 +1,18 @@
1
+ import { FoodsTextInputProps } from '../Form/FoodsFormFields/FoodsTextInput';
2
+ type DefaultOption = {
3
+ label: string;
4
+ value: number;
5
+ extraAction?: (newValue: number) => void;
6
+ };
7
+ export type FoodsNumberInputProps = Omit<FoodsTextInputProps, "value" | "onChange" | "defaultOption"> & {
8
+ value: number | null;
9
+ onChange: (value: number | null) => void;
10
+ defaultOption?: DefaultOption;
11
+ min?: number;
12
+ max?: number;
13
+ step?: number;
14
+ incrementButtonLabel?: string;
15
+ decrementButtonLabel?: string;
16
+ };
17
+ export declare const FoodsNumberInput: ({ value, onChange, defaultOption, min, max, step, unit, unitAddon, error, errorMessage, resetButtonLabel, incrementButtonLabel, decrementButtonLabel, disabled, behaviour, ExtraInputProps, Tooltip, StackProps, }: FoodsNumberInputProps) => import("react/jsx-runtime").JSX.Element;
18
+ export {};
@@ -0,0 +1,9 @@
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useTheme as o,Stack as t,InputBase as i,Box as n,Typography as a,Button as s,styled as d,ButtonBase as l}from"@mui/material";import{useId as u,useState as c,useRef as m,useEffect as p}from"react";import{useTranslation as b}from"react-i18next";import{useResponsiveBreakpoints as g}from"../../themes/responsive/useResponsiveBreakpoints.js";import{FoodsIconButton as h}from"../Button/FoodsIconButton.js";import{FoodsIcon as x}from"../Icons/FoodsIcon.js";import{focusRingStyles as y}from"../../themes/common/focusRing.js";const f=/^-?(?:\d*(?:[.,]\d*)?)?$/,v=/^-?(?:\d+(?:[.,]\d*)?|[.,]\d+)$/,w=e=>{const[r,o]=String(e).split("e-");return(r.split(".")[1]?.length??0)+(o?Number(o):0)},_=d(n,{shouldForwardProp:e=>"hasError"!==e&&"isDisabled"!==e})(({theme:e,hasError:r,isDisabled:o})=>({position:"relative",display:"flex",alignItems:"center",height:e.custom.numberInput.height,minWidth:0,borderRadius:e.spacing(1),border:`1px solid ${r?e.custom.red[600]:e.custom.grey[600]}`,backgroundColor:o?e.custom.grey[500]:r?e.custom.red[100]:e.custom.grey[100],overflow:"visible",...!o&&{"&:hover":{backgroundColor:r?e.custom.red[200]:e.custom.grey[300]},"&:focus-within":{borderWidth:2,borderColor:r?e.custom.red[600]:e.custom.grey[2800],backgroundColor:e.custom.grey[100]}}})),k=d(l,{shouldForwardProp:e=>"direction"!==e&&"hasError"!==e})(({theme:e,direction:r,hasError:o})=>({boxSizing:"border-box",display:"flex",width:e.custom.numberInput.stepperWidth,height:e.custom.numberInput.stepperButtonHeight,minWidth:e.custom.numberInput.stepperWidth,padding:0,borderRadius:0,..."up"===r?{borderTopRightRadius:e.spacing(1)}:{borderBottomRightRadius:e.spacing(1)},borderLeft:`1px solid ${e.custom.grey[600]}`,borderRight:`1px solid ${o?e.custom.red[600]:e.custom.grey[600]}`,..."up"===r?{borderTop:`1px solid ${o?e.custom.red[600]:e.custom.grey[600]}`}:{borderTop:`1px solid ${e.custom.grey[600]}`,borderBottom:`1px solid ${o?e.custom.red[600]:e.custom.grey[600]}`},backgroundColor:e.custom.grey[200],color:e.custom.grey[2800],"&:hover:not(.Mui-disabled)":{backgroundColor:e.custom.grey[300]},"&:active:not(.Mui-disabled)":{backgroundColor:e.custom.grey[400]},"&.Mui-disabled":{backgroundColor:e.custom.grey[500],color:e.custom.grey[1400]},...y(e,"inner")})),I=({value:d,onChange:l,defaultOption:y,min:I,max:C,step:W=1,unit:R,unitAddon:$,error:B=!1,errorMessage:D,resetButtonLabel:E,incrementButtonLabel:P,decrementButtonLabel:S,disabled:M=!1,behaviour:z="dynamic",ExtraInputProps:V={},Tooltip:j={},StackProps:A={}})=>{const F=o(),{t:H}=b(),{isMobile:L}=g(),N=u(),T=V.id??N,O=`${T}-error`,[K,U]=c(null),[q,G]=c(!1),J=K&&Object.is(K.source,d)?K.text:null===d?"":String(d),Q=m(d);p(()=>{Q.current=d},[d]);const X=null!==d&&(void 0!==I&&d<I||void 0!==C&&d>C),Y=!M&&(B||X),Z=void 0!==I&&void 0!==C?H("number_input_range_error",{min:I,max:C,defaultValue:`Enter a value between ${I} and ${C}`}):void 0!==I?H("number_input_min_error",{min:I,defaultValue:`Enter a value of at least ${I}`}):void 0!==C?H("number_input_max_error",{max:C,defaultValue:`Enter a value of at most ${C}`}):void 0,ee=D??(X?Z:void 0),re=[V["aria-describedby"],V.inputProps?.["aria-describedby"],Y&&ee?O:void 0].filter(Boolean).join(" ")||void 0,oe=Number.isFinite(W)&&W>0?W:1,te=V.readOnly||V.inputProps?.readOnly,ie=e=>{Q.current=e,l(e)},ne=e=>{if(M||te)return;const r=((e,r,o,t,i)=>{const n=Math.min(15,Math.max(w(e),w(o))),a=Number((e+r*o).toFixed(n));return Math.min(i??1/0,Math.max(t??-1/0,a))})(Q.current??y?.value??0,e,oe,I,C);U({source:d,text:String(r)}),ie(r)},ae=()=>{y&&(U({source:d,text:String(y.value)}),ie(y.value),y.extraAction?.(y.value))};/* @__PURE__ */
2
+ return e(t,{gap:F.spacing(1),...A,children:[
3
+ /* @__PURE__ */e(t,{direction:"row",gap:F.spacing(1.5),alignItems:"center",minWidth:0,children:[
4
+ /* @__PURE__ */e(_,{hasError:Y,isDisabled:M,sx:{flex:"dynamic"===z?"1 1 0":"0 0 auto",width:"fixed"===z?{xs:F.custom.textInput.fixedWidth.mobile,md:F.custom.textInput.fixedWidth.desktop}:void 0,maxWidth:"100%"},children:[
5
+ /* @__PURE__ */r(i,{...V,id:T,type:"text",value:J,disabled:M,onChange:e=>{const r=e.currentTarget.value;if(f.test(r))if(""===r)U({source:null,text:r}),ie(null);else if(v.test(r)){const e=Number(r.replace(",","."));Number.isFinite(e)&&(U({source:e,text:r}),ie(e))}else U({source:d,text:r})},onKeyDown:e=>{V.onKeyDown?.(e),e.defaultPrevented||"ArrowUp"!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),ne("ArrowUp"===e.key?1:-1))},onBlur:e=>{V.onBlur?.(e),U(null)},inputProps:{...V.inputProps,role:"spinbutton",inputMode:"decimal","aria-valuenow":d??void 0,"aria-valuemin":I,"aria-valuemax":C,"aria-invalid":Y||void 0,"aria-describedby":re},sx:[{flex:1,minWidth:0,height:"100%",marginRight:F.custom.numberInput.stepperWidth,paddingLeft:F.spacing(2),color:M?F.custom.grey[1400]:F.custom.grey[2800],...F.typography["body-regular"],"& input::placeholder":{color:M?F.custom.grey[1400]:F.custom.grey[2e3],opacity:1}},...Array.isArray(V.sx)?V.sx:V.sx?[V.sx]:[]]}),
6
+ /* @__PURE__ */e(n,{sx:{position:"absolute",right:-1,top:-1,display:"flex",flexDirection:"column",width:F.custom.numberInput.stepperWidth},children:[
7
+ /* @__PURE__ */r(k,{direction:"up",hasError:Y,disableRipple:!0,disabled:M||!!te||void 0!==C&&null!==d&&d>=C,"aria-label":P??H("number_input_increment",{defaultValue:"Increase value"}),onClick:()=>ne(1),children:/* @__PURE__ */r(x,{icon:"arrowUpShort",size:{width:24,height:24}})}),
8
+ /* @__PURE__ */r(k,{direction:"down",hasError:Y,disableRipple:!0,disabled:M||!!te||void 0!==I&&null!==d&&d<=I,"aria-label":S??H("number_input_decrement",{defaultValue:"Decrease value"}),onClick:()=>ne(-1),children:/* @__PURE__ */r(x,{icon:"arrowDownShort",size:{width:24,height:24}})})]})]}),R&&/* @__PURE__ */e(t,{direction:"row",gap:F.spacing(.5),alignItems:"center",minWidth:0,children:[
9
+ /* @__PURE__ */r(a,{variant:"body-medium",noWrap:!0,sx:{color:F.custom.grey[2800]},children:R}),$]}),L&&j.text&&/* @__PURE__ */r(h,{size:"xs",icon:"information",tooltip:{text:j.text,props:{...j.props,open:q,onClose:()=>G(!1)}},buttonProps:{"aria-label":H("information",{defaultValue:"Information"}),"aria-expanded":q,disabled:M,onClick:()=>G(e=>!e),onBlur:()=>G(!1),onKeyDown:e=>{"Escape"===e.key&&G(!1)}}}),!L&&y&&/* @__PURE__ */r(h,{size:"s",icon:"reset",tooltip:j,buttonProps:{onClick:ae,disabled:M||!!te,"aria-label":E??H("reinitialiser_la_valeur_par_defaut",{defaultValue:"Reset default value"})}})]}),Y&&ee&&/* @__PURE__ */r(a,{id:O,variant:"body-medium",sx:{color:F.custom.red[600]},children:ee}),y&&/* @__PURE__ */r(a,{variant:"small-regular",sx:{color:F.custom.grey[2e3]},children:`${y.label} ${y.value}`}),L&&y&&/* @__PURE__ */r(s,{variant:"text",startIcon:/* @__PURE__ */r(x,{icon:"reset",size:2}),disabled:M||!!te,onClick:ae,sx:{alignSelf:"flex-start",minHeight:F.custom.textInput.mobileResetHeight,padding:0,textDecoration:"underline",fontSize:F.typography["body-bold"].fontSize,fontWeight:F.typography["body-bold"].fontWeight,lineHeight:F.typography["body-bold"].lineHeight,color:F.palette.primary[800]},children:E??H("reinitialiser_la_valeur_par_defaut",{defaultValue:"Reset default value"})})]})};export{I as FoodsNumberInput};
@@ -0,0 +1 @@
1
+ export * from './FoodsNumberInput';
@@ -0,0 +1 @@
1
+ import{FoodsNumberInput as o}from"./FoodsNumberInput.js";export{o as FoodsNumberInput};
@@ -1,5 +1,4 @@
1
- import { RadioProps, FormControlProps, FormControlLabelProps } from '@mui/material';
2
- import { CSSProperties } from 'react';
1
+ import { FormControlLabelProps, FormControlProps, RadioProps } from '@mui/material';
3
2
  export type RadioProperties<T> = RadioPropertyValue<T>[];
4
3
  export type RadioPropertyValue<T> = {
5
4
  id: string | number;
@@ -13,11 +12,11 @@ export type BaseRadioOverrides = {
13
12
  FormControlLabelProps?: Omit<FormControlLabelProps, "onChange" | "control" | "label" | "key">;
14
13
  RadioProps?: RadioProps;
15
14
  };
16
- type BaseRadioProps<T> = BaseRadioOverrides & {
15
+ export type BaseRadioProps<T> = BaseRadioOverrides & {
17
16
  values: RadioProperties<T>;
18
17
  onChange: (newRadio: RadioProperties<T>) => void;
19
- flexDirection?: CSSProperties["flexDirection"];
18
+ flexDirection?: "row" | "column";
19
+ showLabel?: boolean;
20
20
  variant?: "primary" | "secondary";
21
21
  };
22
- export declare const BaseRadio: <T>(props: BaseRadioProps<T>) => import("react/jsx-runtime").JSX.Element;
23
- export {};
22
+ export declare const BaseRadio: <T>({ values, onChange, variant, flexDirection, showLabel, FormControlProps, FormControlLabelProps, RadioProps, }: BaseRadioProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,2 @@
1
- import{jsx as o}from"react/jsx-runtime";import{createElement as r}from"react";import{FormControl as a,FormControlLabel as e,Radio as t,styled as n}from"@mui/material";import{greyTheme as i}from"../../themes/common/colors.js";const d=n=>{const{values:i,onChange:d,variant:l="primary",flexDirection:s="row",FormControlProps:b,FormControlLabelProps:m,RadioProps:h}=n;/* @__PURE__ */
2
- return o(a,{sx:{flexDirection:s},...b,children:i.map((a,n)=>/* @__PURE__ */r(e,{value:n,componentsProps:{typography:{variant:"body"}},...m,key:`${a.id}-${n}`,label:a.name,control:/* @__PURE__ */o(t,{id:`${a.id}-${n}`,checked:a.state,disabled:a.disabled,icon:/* @__PURE__ */o(p,{variant:l}),checkedIcon:/* @__PURE__ */o(c,{variant:l}),disableRipple:!0,...h}),onChange:(o,r)=>{d(i.map((o,a)=>({...o,state:a===n&&r})))}}))})},p=n(r=>{const{variant:a,...e}=r;/* @__PURE__ */
3
- return o("primary"===a?l:b,{...e})})({}),c=n(r=>{const{variant:a,...e}=r;/* @__PURE__ */
4
- return o("primary"===a?s:m,{...e})})({}),l=n("span")({borderRadius:"50%",width:20,height:20,boxShadow:`0 0 0 2px ${i[1600]}`,backgroundColor:i[100],"input:disabled ~ &":{boxShadow:`0 0 0 2px ${i[800]}`,background:i[100]}}),s=n(l)({backgroundColor:i[2800],boxShadow:`0 0 0 2px ${i[2800]}`,"&::before":{display:"block",width:20,height:20,backgroundImage:`radial-gradient(${i[100]},${i[100]} 28%,transparent 32%)`,content:'""'},"input:disabled ~ &":{boxShadow:`0 0 0 2px ${i[800]}`,background:i[800],"&::before":{display:"block",width:20,height:20,backgroundImage:`radial-gradient(${i[100]},${i[100]} 28%,transparent 32%)`,content:'""'}}}),b=n(l)({boxShadow:`0 0 0 2px ${i[2800]}`}),m=n(s)({boxShadow:`0 0 0 2px ${i[2e3]}`,backgroundColor:i[2e3]});export{d as BaseRadio};
1
+ import{jsx as o}from"react/jsx-runtime";import{useId as r,createElement as e}from"react";import{FormControl as i,RadioGroup as a,Radio as t,FormControlLabel as s,styled as l}from"@mui/material";import{focusRingStyles as d}from"../../themes/common/focusRing.js";const n=l("span",{shouldForwardProp:o=>"selected"!==o&&"variant"!==o})(({theme:o,selected:r,variant:e})=>{const i=o.custom.grey,a="secondary"===e?i[2e3]:i[2800];return{display:"block",boxSizing:"border-box",borderRadius:"50%",width:20,height:20,border:`2px solid ${r?a:i[1600]}`,backgroundColor:r?a:i[100],...r&&{"&::before":{content:'""',display:"block",width:8,height:8,margin:4,borderRadius:"50%",backgroundColor:i[100]}},".MuiRadio-root:hover:not(.Mui-disabled) &, .MuiRadio-root.Mui-hover:not(.Mui-disabled) &":{borderColor:r?i[2e3]:i[2800],...r&&{backgroundColor:i[2e3]}},".MuiRadio-root.Mui-focusVisible &":{borderColor:i[2800],boxShadow:d(o,"outer")["&:focus-visible, &.Mui-focusVisible"].boxShadow},".MuiRadio-root.Mui-disabled &":{borderColor:i[800],backgroundColor:r?i[800]:i[100]}}}),b=({values:l,onChange:d,variant:b="primary",flexDirection:c="column",showLabel:u=!0,FormControlProps:m,FormControlLabelProps:p,RadioProps:g})=>{const h=r(),x=String(l.find(o=>o.state)?.id??"");/* @__PURE__ */
2
+ return o(i,{...m,children:/* @__PURE__ */o(a,{"aria-label":m?.["aria-label"],value:x,onChange:(o,r)=>{const e=l.map(o=>({...o,state:String(o.id)===r}));d(e)},sx:{flexDirection:c,alignItems:"flex-start",gap:1},children:l.map(r=>{const i=String(r.id),a=String(r.name),l=/* @__PURE__ */o(t,{...g,id:`${h}-${i}`,value:i,disabled:r.disabled||g?.disabled,icon:/* @__PURE__ */o(n,{selected:!1,variant:b}),checkedIcon:/* @__PURE__ */o(n,{selected:!0,variant:b}),disableRipple:!0,inputProps:{...g?.inputProps,...!u&&{"aria-label":a}},sx:[{padding:"2px"},...Array.isArray(g?.sx)?g.sx:g?.sx?[g.sx]:[]]});return u?/* @__PURE__ */e(s,{...p,key:i,value:i,disabled:r.disabled||p?.disabled,control:l,label:a,sx:[{margin:0,gap:1.5,minHeight:24,"& .MuiFormControlLabel-label":{fontSize:14,lineHeight:1.6,color:o=>o.custom.grey[2500]}},...Array.isArray(p?.sx)?p.sx:p?.sx?[p.sx]:[]]}):/* @__PURE__ */o("span",{children:l},i)})})})};export{b as BaseRadio};
@@ -5,5 +5,8 @@ export type FoodsRadioListProps<T> = BaseRadioOverrides & {
5
5
  onChange: (newValue: T) => void;
6
6
  getId?: (item: T) => string | number;
7
7
  getName?: (item: T) => string | number;
8
+ getDisabled?: (item: T) => boolean;
9
+ flexDirection?: "row" | "column";
10
+ showLabel?: boolean;
8
11
  };
9
12
  export declare const FoodsRadioList: <T>(props: FoodsRadioListProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- import{jsx as t}from"react/jsx-runtime";import{BaseRadio as a}from"./BaseRadio.js";const e=e=>{const{values:r,selectedItem:n,onChange:o,getId:s=t=>t.id,getName:i=t=>t.name,...m}=e,d=r.map(t=>{const a=s(t),e=void 0!==n&&a===s(n);return{id:a,name:i(t),state:e,rawData:t}});/* @__PURE__ */
2
- return t(a,{values:d,onChange:t=>{const a=t.find(t=>!0===t.state);if(void 0!==a&&void 0!==a.rawData)return o(a.rawData)},...m})};export{e as FoodsRadioList};
1
+ import{jsx as e}from"react/jsx-runtime";import{BaseRadio as a}from"./BaseRadio.js";const t=t=>{const{values:r,selectedItem:n,onChange:o,getId:s=e=>e.id,getName:i=e=>e.name,getDisabled:d=()=>!1,...m}=t,c=r.map(e=>{const a=s(e),t=void 0!==n&&a===s(n);return{id:a,name:i(e),state:t,disabled:d(e),rawData:e}});/* @__PURE__ */
2
+ return e(a,{values:c,onChange:e=>{const a=e.find(e=>!0===e.state);if(void 0!==a&&void 0!==a.rawData)return o(a.rawData)},...m})};export{t as FoodsRadioList};
@@ -4,5 +4,7 @@ export type RadioBooleanProps = BaseRadioOverrides & {
4
4
  onChange: (value: boolean) => void;
5
5
  trueKeyName?: string;
6
6
  falseKeyName?: string;
7
+ flexDirection?: "row" | "column";
8
+ showLabel?: boolean;
7
9
  };
8
10
  export declare const RadioBoolean: (props: RadioBooleanProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- import{jsx as e}from"react/jsx-runtime";import{BaseRadio as t}from"./BaseRadio.js";const a=a=>{const{value:n,onChange:o,trueKeyName:i="Oui",falseKeyName:s="Non",...m}=a;/* @__PURE__ */
2
- return e(t,{values:[{id:"id1",name:i,state:!0===n},{id:"id2",name:s,state:!1===n}],onChange:e=>{const t=e.find(e=>!0===e.state);if(void 0!==t){const e=t.name===i;o(e)}},...m})};export{a as RadioBoolean};
1
+ import{jsx as e}from"react/jsx-runtime";import{BaseRadio as t}from"./BaseRadio.js";const a=a=>{const{value:i,onChange:n,trueKeyName:o="Oui",falseKeyName:s="Non",...d}=a;/* @__PURE__ */
2
+ return e(t,{values:[{id:"id1",name:o,state:!0===i},{id:"id2",name:s,state:!1===i}],onChange:e=>{const t=e.find(e=>e.state);"id1"===t?.id?n(!0):"id2"===t?.id&&n(!1)},...d})};export{a as RadioBoolean};
@@ -18,10 +18,10 @@ export declare const colorPickerStyles: {
18
18
  };
19
19
  };
20
20
  export declare const ColorInputContainer: StyledComponent< BoxOwnProps<Theme> & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxOwnProps<Theme>> & MUIStyledCommonProps<Theme>, {}, {}>;
21
- export declare const ColorButton: StyledComponent< ButtonOwnProps & Omit< ButtonBaseOwnProps, "classes"> & CommonProps & Omit< DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "className" | "style" | "classes" | "color" | "children" | "sx" | "tabIndex" | "variant" | "disabled" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "href" | "disableFocusRipple" | "loading" | "loadingIndicator" | "size" | "fullWidth" | "disableElevation" | "endIcon" | "loadingPosition" | "startIcon"> & MUIStyledCommonProps<Theme> & {
21
+ export declare const ColorButton: StyledComponent< ButtonOwnProps & Omit< ButtonBaseOwnProps, "classes"> & CommonProps & Omit< DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "className" | "style" | "classes" | "color" | "children" | "sx" | "tabIndex" | "variant" | "disabled" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "href" | "disableFocusRipple" | "loading" | "loadingIndicator" | "size" | "disableElevation" | "endIcon" | "fullWidth" | "loadingPosition" | "startIcon"> & MUIStyledCommonProps<Theme> & {
22
22
  currentColor?: string;
23
23
  }, {}, {}>;
24
- export declare const ColorButtonBackground: StyledComponent< ButtonOwnProps & Omit< ButtonBaseOwnProps, "classes"> & CommonProps & Omit< DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "className" | "style" | "classes" | "color" | "children" | "sx" | "tabIndex" | "variant" | "disabled" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "href" | "disableFocusRipple" | "loading" | "loadingIndicator" | "size" | "fullWidth" | "disableElevation" | "endIcon" | "loadingPosition" | "startIcon"> & MUIStyledCommonProps<Theme> & {
24
+ export declare const ColorButtonBackground: StyledComponent< ButtonOwnProps & Omit< ButtonBaseOwnProps, "classes"> & CommonProps & Omit< DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "className" | "style" | "classes" | "color" | "children" | "sx" | "tabIndex" | "variant" | "disabled" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "href" | "disableFocusRipple" | "loading" | "loadingIndicator" | "size" | "disableElevation" | "endIcon" | "fullWidth" | "loadingPosition" | "startIcon"> & MUIStyledCommonProps<Theme> & {
25
25
  currentColor?: string;
26
26
  }, {}, {}>;
27
27
  export declare const HiddenInput: StyledComponent<MUIStyledCommonProps<Theme>, DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, {}>;
@@ -3,7 +3,7 @@ import { ButtonOwnProps, ButtonBaseOwnProps, Theme, SelectProps } from '@mui/mat
3
3
  import { CommonProps } from '@mui/material/OverridableComponent';
4
4
  import { DetailedHTMLProps, ButtonHTMLAttributes, HTMLAttributes } from 'react';
5
5
  import { MUIStyledCommonProps, BoxOwnProps } from '@mui/system';
6
- export declare const ToolbarButton: StyledComponent< ButtonOwnProps & Omit< ButtonBaseOwnProps, "classes"> & CommonProps & Omit< DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "className" | "style" | "classes" | "color" | "children" | "sx" | "tabIndex" | "variant" | "disabled" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "href" | "disableFocusRipple" | "loading" | "loadingIndicator" | "size" | "fullWidth" | "disableElevation" | "endIcon" | "loadingPosition" | "startIcon"> & MUIStyledCommonProps<Theme>, {}, {}>;
6
+ export declare const ToolbarButton: StyledComponent< ButtonOwnProps & Omit< ButtonBaseOwnProps, "classes"> & CommonProps & Omit< DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "className" | "style" | "classes" | "color" | "children" | "sx" | "tabIndex" | "variant" | "disabled" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "href" | "disableFocusRipple" | "loading" | "loadingIndicator" | "size" | "disableElevation" | "endIcon" | "fullWidth" | "loadingPosition" | "startIcon"> & MUIStyledCommonProps<Theme>, {}, {}>;
7
7
  export declare const TextCommandsContainer: StyledComponent< BoxOwnProps<Theme> & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxOwnProps<Theme>> & MUIStyledCommonProps<Theme>, {}, {}>;
8
8
  export declare const ToolbarContainer: StyledComponent< BoxOwnProps<Theme> & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxOwnProps<Theme>> & MUIStyledCommonProps<Theme>, {}, {}>;
9
9
  export declare const ToolbarGroup: StyledComponent< BoxOwnProps<Theme> & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxOwnProps<Theme>> & MUIStyledCommonProps<Theme>, {}, {}>;
@@ -1,2 +1,2 @@
1
- import{jsx as o}from"react/jsx-runtime";import{FoodsIcon as e}from"../Icons/FoodsIcon.js";import{useFoodsSelectContext as r}from"../Select/FoodsSelect/Context/useSelect.js";import{FoodsTextInput as t}from"../Form/FoodsFormFields/FoodsTextInput.js";const s=()=>{const{search:s,setSearch:n,textOptions:c}=r();/* @__PURE__ */
2
- return o(t,{value:s,onChange:o=>{n(o)},ExtraInputProps:{placeholder:c.searchPlaceholder,endAdornment:/* @__PURE__ */o(e,{size:2,icon:"search"})}})};export{s as FoodsSearch};
1
+ import{jsx as e}from"react/jsx-runtime";import{useFoodsSelectContext as t}from"../Select/FoodsSelect/Context/useSelect.js";import{SearchBox as r}from"../Input/SearchBox.js";const o=()=>{const{search:o,setSearch:c,textOptions:a}=t();/* @__PURE__ */
2
+ return e(r,{value:o,onChange:c,placeholder:a.searchPlaceholder,clearButtonLabel:a.clearSearchLabel})};export{o as FoodsSearch};
@@ -0,0 +1,40 @@
1
+ import { SxProps, Theme } from '@mui/material';
2
+ import { FoodsSelectInfiniteScrollOptions } from '../FoodsSelect/FoodsSelect';
3
+ export type MultiSelectTextOptions = {
4
+ placeholder: string;
5
+ searchPlaceholder: string;
6
+ clearSearchLabel: string;
7
+ noResult: string;
8
+ searchLoadingText: string;
9
+ selectAll: string;
10
+ cancel: string;
11
+ apply: string;
12
+ removeTagLabel: (name: string) => string;
13
+ };
14
+ export type FoodsMultiSelectProps<T> = {
15
+ id?: string;
16
+ selectedOptions: T[];
17
+ options: T[];
18
+ onChange: (selectedOptions: T[]) => void;
19
+ getId: (item: T) => string | number;
20
+ getName: (item: T) => string;
21
+ getIcon?: (item: T) => React.JSX.Element;
22
+ getGroupName?: (item: T) => string;
23
+ textOptions: MultiSelectTextOptions;
24
+ disabled?: boolean;
25
+ error?: boolean;
26
+ errorMessage?: string;
27
+ disableSearch?: boolean;
28
+ withSelectAll?: boolean;
29
+ /** Enables draft selection. Called after onChange when Apply commits the draft. */
30
+ onApply?: (selectedOptions: T[]) => void;
31
+ BoxProps?: SxProps<Theme>;
32
+ infiniteScroll?: FoodsSelectInfiniteScrollOptions;
33
+ };
34
+ export type FoodsMultiSelectServerPaginationProps<T> = FoodsMultiSelectProps<T> & {
35
+ search: string;
36
+ setSearch: (value: string) => void;
37
+ isSearching?: boolean;
38
+ };
39
+ export declare const FoodsMultiSelect: <T>(props: FoodsMultiSelectProps<T>) => import("react/jsx-runtime").JSX.Element;
40
+ export declare const FoodsMultiSelectServerPagination: <T>(props: FoodsMultiSelectServerPaginationProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import{useTheme as r,Box as t,Button as i,Typography as n,Divider as s,CircularProgress as l}from"@mui/material";import{useState as c,useId as a,useRef as d,useEffect as p}from"react";import{FoodsCheckboxControl as u}from"../../Checkbox/FoodsCheckboxControl.js";import{SearchBox as h}from"../../Input/SearchBox.js";import{FoodsIcon as m}from"../../Icons/FoodsIcon.js";import{AnchoredPopover as g}from"../../Popover/AnchoredPopover.js";import{FoodsTags as x}from"../../Tags/FoodsTags.js";import{useResponsiveBreakpoints as b}from"../../../themes/responsive/useResponsiveBreakpoints.js";import{focusRingStyles as f}from"../../../themes/common/focusRing.js";import{matchesSelectSearch as y}from"../FoodsSelect/search.js";const k=k=>{const{selectedOptions:v,options:w,onChange:S,onApply:C,getId:I,getName:T,getIcon:A,getGroupName:H,textOptions:D,disabled:P=!1,error:j=!1,errorMessage:B,disableSearch:M=!1,withSelectAll:L=!1,BoxProps:E,infiniteScroll:F,search:N,setSearch:R,isSearching:$,serverPagination:q}=k,W=r(),{isMobile:O}=b(),z=a(),K=k.id??z,U=`${K}-error`,V=`${K}-options`,G=d(null),J=d(null),[Y,Q]=c(null),X=JSON.stringify(v.map(I)),[Z,_]=c({baseIds:X,selected:v}),ee=null!==Y,oe=j&&!P,re=C&&Z.baseIds===X?Z.selected:v,te=new Set(re.map(I)),ie=$?[]:q?w:w.filter(e=>y(T(e),N)),ne=new Set(ie.map(I)),se=ie.filter(e=>te.has(I(e))).length,le=ie.length>0&&se===ie.length,ce=se>0&&!le;p(()=>{if(!ee)return;const e=window.setTimeout(()=>{const e=J.current?.querySelector(M?L?'[role="checkbox"]':'[role="option"]':'input[type="search"]');e?.focus()},0);return()=>window.clearTimeout(e)},[ee,M,L]);const ae=()=>{Q(null),_({baseIds:X,selected:v}),R(""),window.setTimeout(()=>G.current?.focus(),0)};/* @__PURE__ */
2
+ return o(t,{sx:{width:O?"100%":W.custom.select.desktopWidth,...E},children:[
3
+ /* @__PURE__ */o(t,{sx:{position:"relative",display:"flex",alignItems:"center",minHeight:O?W.custom.select.mobileHeight:W.custom.select.desktopHeight,border:`1px solid ${oe?W.custom.select.errorBorder:W.custom.select.border}`,borderRadius:W.shape.borderRadius,backgroundColor:P?W.custom.select.disabledBackground:oe?W.custom.select.errorBackground:W.custom.select.background,"&:hover":{backgroundColor:P?W.custom.select.disabledBackground:oe?W.custom.select.errorBackground:W.custom.select.hoverBackground},"&:focus-within":{border:`2px solid ${oe?W.custom.select.errorBorder:W.custom.grey[2800]}`}},children:[
4
+ /* @__PURE__ */e(i,{ref:G,id:K,type:"button","aria-label":D.placeholder,"aria-haspopup":"listbox","aria-controls":ee?V:void 0,"aria-expanded":ee,"aria-invalid":oe||void 0,"aria-describedby":oe&&B?U:void 0,disabled:P,onClick:e=>{ee?ae():(_({baseIds:X,selected:v}),Q(e.currentTarget))},sx:{position:"absolute",inset:0,width:"100%",height:"100%",minWidth:0,display:"flex",justifyContent:"flex-end",alignItems:"flex-start",padding:W.spacing(1),color:P?W.custom.select.disabledText:W.custom.grey[2800],backgroundColor:"transparent","&:hover":{backgroundColor:"transparent"},"&:focus-visible":f(W,"outer")["&:focus-visible, &.Mui-focusVisible"]},children:/* @__PURE__ */e(m,{icon:ee?"arrowUpShort":"arrowDownShort",size:2})}),
5
+ /* @__PURE__ */e(t,{sx:{display:"flex",flexWrap:"wrap",gap:W.spacing(.5),alignItems:"center",width:"100%",minWidth:0,minHeight:O?W.custom.select.mobileHeight:W.custom.select.desktopHeight,padding:W.spacing(.5,5,.5,1),pointerEvents:"none"},children:0===v.length?/* @__PURE__ */e(n,{variant:"body-regular",sx:{color:W.custom.select.placeholderText},children:D.placeholder}):v.map(o=>/* @__PURE__ */e(x,{mode:"removable",label:T(o),disabled:P,onRemove:()=>(e=>{const o=I(e),r=v.filter(e=>I(e)!==o);S(r)})(o),removeAriaLabel:D.removeTagLabel(T(o)),sx:{pointerEvents:"auto"}},I(o)))})]}),oe&&B&&/* @__PURE__ */e(n,{id:U,variant:"small",sx:{display:"block",mt:W.spacing(1),color:W.custom.select.errorText},children:B}),
6
+ /* @__PURE__ */e(g,{anchor:Y,open:ee,onClose:ae,variant:"headless",anchorPosition:"rightside",paperProps:{width:W.custom.multiSelect.dropdownWidth,maxHeight:"min(480px, calc(100% - 32px))",display:"flex",flexDirection:"column",border:`1px solid ${W.custom.select.border}`,boxShadow:W.custom.shadows.popover},children:/* @__PURE__ */o(t,{ref:J,sx:{display:"flex",flexDirection:"column",minHeight:0},children:[!M&&/* @__PURE__ */e(t,{sx:{p:W.spacing(1)},onKeyDown:e=>{"ArrowDown"===e.key&&(e.preventDefault(),J.current?.querySelector(L?'[role="checkbox"]':'[role="option"]')?.focus())},children:/* @__PURE__ */e(h,{value:N,onChange:R,placeholder:D.searchPlaceholder,clearButtonLabel:D.clearSearchLabel})}),L&&!$&&ie.length>0&&/* @__PURE__ */o(i,{type:"button",role:"checkbox","aria-checked":ce?"mixed":le,onClick:()=>{if(0===ie.length)return;const e=le?re.filter(e=>!ne.has(I(e))):[...re,...ie.filter(e=>!te.has(I(e)))];C?_({baseIds:X,selected:e}):S(e)},onKeyDown:e=>{"ArrowDown"===e.key&&(e.preventDefault(),J.current?.querySelector('[role="option"]')?.focus())},sx:{justifyContent:"flex-start",textTransform:"none",color:W.custom.grey[2800],p:W.spacing(1,3),gap:W.spacing(1.5)},children:[
7
+ /* @__PURE__ */e(u,{checked:le,indeterminate:ce,tabIndex:-1,inputProps:{"aria-hidden":!0,tabIndex:-1},sx:{pointerEvents:"none"}}),D.selectAll]}),L&&/* @__PURE__ */e(s,{}),
8
+ /* @__PURE__ */o(t,{id:V,role:"listbox","aria-label":D.placeholder,"aria-multiselectable":"true",onKeyDown:e=>{const o=Array.from(e.currentTarget.querySelectorAll('[role="option"]')),r=o.indexOf(e.target);if("ArrowDown"===e.key||"ArrowUp"===e.key||"Home"===e.key||"End"===e.key){if(e.preventDefault(),"ArrowUp"===e.key&&0===r&&L)return void J.current?.querySelector('[role="checkbox"]')?.focus();const t="Home"===e.key?0:"End"===e.key?o.length-1:"ArrowDown"===e.key?Math.min(r+1,o.length-1):Math.max(r-1,0);o[t]?.focus()}" "===e.key&&r>=0&&(e.preventDefault(),o[r]?.click())},onScroll:e=>{if($||!F?.hasNextPage||F.isFetchingNextPage)return;const o=e.currentTarget;o.scrollHeight-o.scrollTop-o.clientHeight<=32&&F.onLoadMore()},sx:{overflowY:"auto",minHeight:0,flex:1,py:W.spacing(.5)},children:[$?/* @__PURE__ */o(t,{role:"status",sx:{p:W.spacing(2),textAlign:"center"},children:[
9
+ /* @__PURE__ */e(l,{size:W.spacing(5),"aria-hidden":"true"}),
10
+ /* @__PURE__ */e(n,{variant:"small",sx:{display:"block"},children:D.searchLoadingText})]}):0===ie.length?/* @__PURE__ */e(n,{sx:{p:W.spacing(2),display:"block",textAlign:"center"},variant:"body-medium",children:D.noResult}):ie.map((r,i)=>{const l=H?.(r),c=void 0!==l&&(0===i||H?.(ie[i-1])!==l),a=te.has(I(r));/* @__PURE__ */
11
+ return o(t,{children:[c&&/* @__PURE__ */o(t,{role:"presentation",sx:{px:W.spacing(3),py:W.spacing(1)},children:[i>0&&/* @__PURE__ */e(s,{sx:{mb:W.spacing(1)}}),
12
+ /* @__PURE__ */e(n,{variant:"body-bold",children:l})]}),
13
+ /* @__PURE__ */o(t,{role:"option",tabIndex:-1,"aria-selected":a,onClick:()=>(e=>{const o=I(e),r=te.has(o)?re.filter(e=>I(e)!==o):[...re,e];C?_({baseIds:X,selected:r}):S(r)})(r),sx:{display:"flex",alignItems:"center",gap:W.spacing(1.5),minHeight:W.custom.multiSelect.optionMinHeight,px:W.spacing(3),py:W.spacing(1),cursor:"pointer",color:W.custom.grey[2800],"&:hover":{backgroundColor:W.custom.grey[300]},"&:focus-visible":f(W,"inner")["&:focus-visible, &.Mui-focusVisible"]},children:[
14
+ /* @__PURE__ */e(u,{checked:a,tabIndex:-1,inputProps:{"aria-hidden":!0,tabIndex:-1},sx:{pointerEvents:"none"}}),A?.(r),
15
+ /* @__PURE__ */e(n,{variant:"body-regular",children:T(r)})]})]},I(r))}),F?.isFetchingNextPage&&/* @__PURE__ */o(t,{role:"status",sx:{p:W.spacing(1),textAlign:"center"},children:[
16
+ /* @__PURE__ */e(l,{size:18,"aria-hidden":"true"}),
17
+ /* @__PURE__ */e(n,{variant:"small",children:F.loadingText??D.searchLoadingText})]})]}),C&&/* @__PURE__ */o(t,{sx:{display:"flex",justifyContent:"space-between",p:W.spacing(1.5),borderTop:`1px solid ${W.custom.select.border}`},children:[
18
+ /* @__PURE__ */e(i,{type:"button",onClick:ae,sx:{color:W.palette.primary[800]},children:D.cancel}),
19
+ /* @__PURE__ */e(i,{type:"button",onClick:()=>{S(re),C?.(re),Q(null),R(""),window.setTimeout(()=>G.current?.focus(),0)},sx:{backgroundColor:W.palette.primary[800],color:W.custom.grey[100],"&:hover":{backgroundColor:W.palette.primary[900]}},children:D.apply})]})]})})]})},v=o=>{const[r,t]=c("");/* @__PURE__ */
20
+ return e(k,{...o,search:r,setSearch:t,isSearching:!1,serverPagination:!1})},w=o=>/* @__PURE__ */e(k,{...o,isSearching:o.isSearching??!1,serverPagination:!0});export{v as FoodsMultiSelect,w as FoodsMultiSelectServerPagination};
@@ -0,0 +1 @@
1
+ export * from './FoodsMultiSelect';
@@ -0,0 +1 @@
1
+ import{FoodsMultiSelect as o,FoodsMultiSelectServerPagination as t}from"./FoodsMultiSelect.js";export{o as FoodsMultiSelect,t as FoodsMultiSelectServerPagination};
@@ -2,6 +2,8 @@ import { ReactNode, Context } from 'react';
2
2
  type TextOptions = {
3
3
  placeholder: string;
4
4
  searchPlaceholder: string;
5
+ clearSearchLabel: string;
6
+ searchLoadingText?: string;
5
7
  emptyOptionsText: string;
6
8
  defaultValueText?: string;
7
9
  noResult: string;
@@ -24,10 +26,12 @@ type FoodsSelectContextInitialValues = ExtraSelectOptions & SearchOptions & {
24
26
  disabled: boolean;
25
27
  closeOnSelect: boolean;
26
28
  disableSearch: boolean;
29
+ isSearching: boolean;
27
30
  };
28
31
  export declare const FoodsSelectContext: Context<FoodsSelectContextInitialValues | null>;
29
32
  type FoodsSelectContextProviderProps = ExtraSelectOptions & SearchOptions & {
30
33
  children: ReactNode;
34
+ isSearching?: boolean;
31
35
  };
32
36
  export declare const FoodsSelectContextProvider: (props: FoodsSelectContextProviderProps) => import("react/jsx-runtime").JSX.Element;
33
37
  export {};
@@ -1,2 +1,2 @@
1
- import{jsx as e}from"react/jsx-runtime";import{createContext as r}from"react";const l=r(null),c=r=>{const{children:c,disabled:t=!1,closeOnSelect:i=!0,disableSearch:o=!1,...a}=r,d={disabled:t,closeOnSelect:i,disableSearch:o,...a};/* @__PURE__ */
2
- return e(l.Provider,{value:d,children:c})};export{l as FoodsSelectContext,c as FoodsSelectContextProvider};
1
+ import{jsx as e}from"react/jsx-runtime";import{createContext as r}from"react";const c=r(null),i=r=>{const{children:i,disabled:l=!1,closeOnSelect:a=!0,disableSearch:n=!1,isSearching:s=!1,...t}=r,o={disabled:l,closeOnSelect:a,disableSearch:n,isSearching:s,...t};/* @__PURE__ */
2
+ return e(c.Provider,{value:o,children:i})};export{c as FoodsSelectContext,i as FoodsSelectContextProvider};
@@ -3,4 +3,5 @@ export declare const useFoodsSelectContext: () => ExtraSelectOptions & SearchOpt
3
3
  disabled: boolean;
4
4
  closeOnSelect: boolean;
5
5
  disableSearch: boolean;
6
+ isSearching: boolean;
6
7
  };
@@ -26,5 +26,10 @@ export type FoodsSelectInfiniteScrollOptions = {
26
26
  };
27
27
  export type SelectWrapperProps<T> = FoodsSelectProps<T> & ExtraSelectOptions;
28
28
  export declare const FoodsSelect: <T>(props: SelectWrapperProps<T>) => import("react/jsx-runtime").JSX.Element;
29
- export type SelectWrapperWithServerPaginationProps<T> = Omit<SelectWrapperProps<T>, "disableSearch"> & SearchOptions;
29
+ export type SelectWrapperWithServerPaginationProps<T> = Omit<SelectWrapperProps<T>, "disableSearch" | "textOptions"> & SearchOptions & {
30
+ textOptions: ExtraSelectOptions["textOptions"] & {
31
+ searchLoadingText: string;
32
+ };
33
+ isSearching?: boolean;
34
+ };
30
35
  export declare const FoodsSelectServerPagination: <T>(props: SelectWrapperWithServerPaginationProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useTheme as o,Box as i,Typography as s,Button as r}from"@mui/material";import{useState as n,useId as l}from"react";import{useTranslation as a}from"react-i18next";import{FoodsIconButton as c}from"../../Button/FoodsIconButton.js";import{FoodsIcon as p}from"../../Icons/FoodsIcon.js";import{useResponsiveBreakpoints as d}from"../../../themes/responsive/useResponsiveBreakpoints.js";import{Select as m}from"./Select.js";import{FoodsSelectContextProvider as u}from"./Context/Provider.js";import{useFoodsSelectContext as h}from"./Context/useSelect.js";const g=n=>{const{options:u,id:g,selectedOption:f,originalValue:y,onChange:b,getId:S,getName:x,getIcon:O,getGroupName:k,unit:C,BoxProps:v={},BoxOptionsProps:z={},infiniteScroll:F,error:I=!1,errorMessage:W,resetButtonLabel:V}=n,{disabled:H,disableOnEmpty:j,textOptions:B}=h(),R=o(),{isMobile:w}=d(),{t:E}=a(),P=l(),$=g??P,G=`${$}-error`,N=I&&!H&&!(j&&0===u.length),T=V??E("reinitialiser_la_valeur_par_defaut",{defaultValue:"Reset default value"}),_=((e,t)=>!0!==e&&0!==t.length)(H,u);/* @__PURE__ */
2
- return t(i,{sx:{width:!w&&_&&y?`calc(${R.custom.select.desktopWidth} + ${R.custom.select.desktopResetGap} + ${R.custom.select.desktopResetActionWidth})`:R.custom.select.desktopWidth,...v,...w?{width:"100%"}:{}},children:[
3
- /* @__PURE__ */t(i,{sx:{display:"flex",alignItems:"center",direction:"row",gap:w?R.spacing(1):R.custom.select.desktopResetGap,minWidth:0},children:[
4
- /* @__PURE__ */e(m,{id:$,options:u,getId:S,getName:x,onChange:b,getIcon:O,getGroupName:k,selectedOption:f,BoxOptionsProps:z,infiniteScroll:F,error:N,errorMessageId:N&&W?G:void 0}),C&&/* @__PURE__ */e(s,{variant:"body",children:C}),!w&&_&&y&&/* @__PURE__ */e(c,{size:"m",icon:"reset",tooltip:{text:T},buttonProps:{onClick:()=>b(y),"aria-label":T}})]}),N&&W&&/* @__PURE__ */e(s,{id:G,variant:"inherit",style:{fontSize:w?R.custom.select.mobileSupportingFontSize:R.custom.select.desktopValueFontSize,fontWeight:R.typography["body-medium"].fontWeight,lineHeight:R.typography["body-medium"].lineHeight},sx:{display:"block",mt:R.spacing(1),color:R.custom.select.errorText},children:W}),_&&y&&/* @__PURE__ */t(s,{variant:"inherit",style:{fontSize:w?R.custom.select.mobileSupportingFontSize:R.custom.select.desktopSupportingFontSize,fontWeight:R.typography["body-regular"].fontWeight,lineHeight:R.typography["body-regular"].lineHeight},sx:{display:"block",mt:R.spacing(1),color:R.custom.select.defaultText},children:[B.defaultValueText?`${B.defaultValueText}: `:"",x(y)]}),w&&_&&y&&/* @__PURE__ */e(r,{variant:"text",startIcon:/* @__PURE__ */e(p,{icon:"reset",size:2}),onClick:()=>b(y),style:{fontSize:R.custom.select.mobileResetFontSize,fontWeight:R.typography.cta.fontWeight,lineHeight:R.typography.cta.lineHeight},sx:{minHeight:R.custom.select.mobileResetHeight,padding:0,color:R.palette.primary[800],textDecoration:"underline"},children:T})]})},f=t=>{const{textOptions:o,noValue:i,disabled:s,closeOnSelect:r,disableSearch:l,disableOnEmpty:a=!1,filterControls:c,...p}=t,[d,m]=n("");/* @__PURE__ */
5
- return e(u,{textOptions:o,noValue:i,disabled:s,closeOnSelect:r,disableSearch:l,search:d,setSearch:m,isSearchFound:e=>""===d||e.toLowerCase().includes(d.toLowerCase()),disableOnEmpty:a,filterControls:c,children:/* @__PURE__ */e(g,{...p})})},y=t=>{const{textOptions:o,noValue:i,disabled:s,closeOnSelect:r,search:n,setSearch:l,isSearchFound:a,disableOnEmpty:c=!1,filterControls:p,...d}=t;/* @__PURE__ */
6
- return e(u,{textOptions:o,noValue:i,disabled:s,closeOnSelect:r,search:n,setSearch:l,isSearchFound:a,disableOnEmpty:c,filterControls:p,children:/* @__PURE__ */e(g,{...d})})};export{f as FoodsSelect,y as FoodsSelectServerPagination};
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useTheme as o,Box as i,Typography as s,Button as r}from"@mui/material";import{useState as n,useId as l}from"react";import{useTranslation as a}from"react-i18next";import{FoodsIconButton as c}from"../../Button/FoodsIconButton.js";import{FoodsIcon as p}from"../../Icons/FoodsIcon.js";import{useResponsiveBreakpoints as d}from"../../../themes/responsive/useResponsiveBreakpoints.js";import{Select as m}from"./Select.js";import{FoodsSelectContextProvider as h}from"./Context/Provider.js";import{useFoodsSelectContext as u}from"./Context/useSelect.js";import{matchesSelectSearch as g}from"./search.js";const f=n=>{const{options:h,id:g,selectedOption:f,originalValue:S,onChange:y,getId:b,getName:x,getIcon:O,getGroupName:k,unit:v,BoxProps:z={},BoxOptionsProps:C={},infiniteScroll:F,error:I=!1,errorMessage:W,resetButtonLabel:V}=n,{disabled:j,disableOnEmpty:H,textOptions:B,isSearching:R,search:E}=u(),P=o(),{isMobile:$}=d(),{t:G}=a(),N=l(),T=g??N,_=`${T}-error`,w=j||!0===H&&0===h.length&&!R&&""===E,M=I&&!w,A=V??G("reinitialiser_la_valeur_par_defaut",{defaultValue:"Reset default value"}),D=((e,t)=>!0!==e&&0!==t.length)(j,h)||R&&!j;/* @__PURE__ */
2
+ return t(i,{sx:{width:!$&&D&&S?`calc(${P.custom.select.desktopWidth} + ${P.custom.select.desktopResetGap} + ${P.custom.select.desktopResetActionWidth})`:P.custom.select.desktopWidth,...z,...$?{width:"100%"}:{}},children:[
3
+ /* @__PURE__ */t(i,{sx:{display:"flex",alignItems:"center",direction:"row",gap:$?P.spacing(1):P.custom.select.desktopResetGap,minWidth:0},children:[
4
+ /* @__PURE__ */e(m,{id:T,options:h,getId:b,getName:x,onChange:y,getIcon:O,getGroupName:k,selectedOption:f,BoxOptionsProps:C,infiniteScroll:F,disabled:w,error:M,errorMessageId:M&&W?_:void 0}),v&&/* @__PURE__ */e(s,{variant:"body",children:v}),!$&&D&&S&&/* @__PURE__ */e(c,{size:"m",icon:"reset",tooltip:{text:A},buttonProps:{onClick:()=>y(S),"aria-label":A}})]}),M&&W&&/* @__PURE__ */e(s,{id:_,variant:"inherit",style:{fontSize:$?P.custom.select.mobileSupportingFontSize:P.custom.select.desktopValueFontSize,fontWeight:P.typography["body-medium"].fontWeight,lineHeight:P.typography["body-medium"].lineHeight},sx:{display:"block",mt:P.spacing(1),color:P.custom.select.errorText},children:W}),D&&S&&/* @__PURE__ */t(s,{variant:"inherit",style:{fontSize:$?P.custom.select.mobileSupportingFontSize:P.custom.select.desktopSupportingFontSize,fontWeight:P.typography["body-regular"].fontWeight,lineHeight:P.typography["body-regular"].lineHeight},sx:{display:"block",mt:P.spacing(1),color:P.custom.select.defaultText},children:[B.defaultValueText?`${B.defaultValueText}: `:"",x(S)]}),$&&D&&S&&/* @__PURE__ */e(r,{variant:"text",startIcon:/* @__PURE__ */e(p,{icon:"reset",size:2}),onClick:()=>y(S),style:{fontSize:P.custom.select.mobileResetFontSize,fontWeight:P.typography.cta.fontWeight,lineHeight:P.typography.cta.lineHeight},sx:{minHeight:P.custom.select.mobileResetHeight,padding:0,color:P.palette.primary[800],textDecoration:"underline"},children:A})]})},S=t=>{const{textOptions:o,noValue:i,disabled:s,closeOnSelect:r,disableSearch:l,disableOnEmpty:a=!1,filterControls:c,...p}=t,[d,m]=n("");/* @__PURE__ */
5
+ return e(h,{textOptions:o,noValue:i,disabled:s,closeOnSelect:r,disableSearch:l,search:d,setSearch:m,isSearchFound:e=>g(e,d),disableOnEmpty:a,filterControls:c,children:/* @__PURE__ */e(f,{...p})})},y=t=>{const{textOptions:o,noValue:i,disabled:s,closeOnSelect:r,search:n,setSearch:l,isSearchFound:a,isSearching:c=!1,disableOnEmpty:p=!1,filterControls:d,...m}=t;/* @__PURE__ */
6
+ return e(h,{textOptions:o,noValue:i,disabled:s,closeOnSelect:r,search:n,setSearch:l,isSearchFound:a,isSearching:c,disableOnEmpty:p,filterControls:d,children:/* @__PURE__ */e(f,{...m})})};export{S as FoodsSelect,y as FoodsSelectServerPagination};
@@ -4,4 +4,5 @@ export type OptionHeaderProps<T> = {
4
4
  getIcon?: (item: T) => React.JSX.Element;
5
5
  onChange: (selectedValue: T | null) => void;
6
6
  };
7
- export declare const OptionsHeader: <T>(props: OptionHeaderProps<T>) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const OptionsHeader: () => import("react/jsx-runtime").JSX.Element;
8
+ export declare const SelectedOptions: <T>(props: OptionHeaderProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import{jsxs as o,Fragment as e,jsx as i}from"react/jsx-runtime";import{useTheme as t,Box as l}from"@mui/material";import{OptionLine as n}from"../Line/OptionLine.js";import{FoodsIcon as r}from"../../../../Icons/FoodsIcon.js";import{FoodsSearch as s}from"../../../../Search/FoodsSearch.js";import{useFoodsSelectContext as c}from"../../Context/useSelect.js";const m={width:"90%",position:"relative",left:"5%",marginBottom:"10px"},d=d=>{const{selectedOption:p,onChange:a,getIcon:x,getName:u}=d,{noValue:f,disableSearch:h,filterControls:g}=c(),S=t(),j=((o,e)=>void 0===e||null===o?null:e(o))(p,x),y=null===p?"":u(p);/* @__PURE__ */
2
- return o(e,{children:[!1===h&&/* @__PURE__ */i(l,{sx:m,children:/* @__PURE__ */i(s,{})}),void 0!==g&&/* @__PURE__ */i(l,{sx:m,children:g}),
3
- /* @__PURE__ */o(l,{sx:{display:"fleX",flexDirection:"column",gap:"4px"},children:[f&&/* @__PURE__ */i(n,{isSelected:!1,icon:/* @__PURE__ */i(r,{size:1,icon:"close"}),displayText:f,onClick:()=>a(null)}),null!==p&&/* @__PURE__ */i(n,{isSelected:!0,icon:j,displayText:y}),
4
- /* @__PURE__ */i(l,{sx:{marginBlock:"4px",borderBottom:`1px solid ${S.custom.grey[500]}`}})]})]})};export{d as OptionsHeader};
1
+ import{jsxs as o,Fragment as e,jsx as i}from"react/jsx-runtime";import{Box as t,useTheme as n}from"@mui/material";import{OptionLine as r}from"../Line/OptionLine.js";import{FoodsIcon as l}from"../../../../Icons/FoodsIcon.js";import{FoodsSearch as s}from"../../../../Search/FoodsSearch.js";import{useFoodsSelectContext as c}from"../../Context/useSelect.js";const m={width:"90%",position:"relative",left:"5%",marginBottom:"10px"},d=()=>{const{disableSearch:n,filterControls:r}=c();/* @__PURE__ */
2
+ return o(e,{children:[!1===n&&/* @__PURE__ */i(t,{sx:m,children:/* @__PURE__ */i(s,{})}),void 0!==r&&/* @__PURE__ */i(t,{sx:m,children:r})]})},p=e=>{const{selectedOption:s,onChange:m,getIcon:d,getName:p}=e,{noValue:a}=c(),x=n(),u=((o,e)=>void 0===e||null===o?null:e(o))(s,d),f=null===s?"":p(s);/* @__PURE__ */
3
+ return o(t,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:[a&&/* @__PURE__ */i(r,{isSelected:!1,icon:/* @__PURE__ */i(l,{size:1,icon:"close"}),displayText:a,onClick:()=>m(null)}),null!==s&&/* @__PURE__ */i(r,{isSelected:!0,icon:u,displayText:f}),
4
+ /* @__PURE__ */i(t,{sx:{marginBlock:"4px",borderBottom:`1px solid ${x.custom.grey[500]}`}})]})};export{d as OptionsHeader,p as SelectedOptions};