@foodpilot/foods 0.2.0 → 0.3.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 (98) hide show
  1. package/dist/components/Accordion/FormAccordion.d.ts +39 -0
  2. package/dist/components/Accordion/ProductAccordion.d.ts +3 -2
  3. package/dist/components/Accordion/index.d.ts +1 -0
  4. package/dist/components/Badge.d.ts +7 -0
  5. package/dist/components/Box/AdditionalContentBox.d.ts +10 -0
  6. package/dist/components/Box/CategoryBox.d.ts +1 -0
  7. package/dist/components/Box/ContextualContentBox.d.ts +8 -0
  8. package/dist/components/Box/HelperBox.d.ts +2 -0
  9. package/dist/components/Box/SectionBox.d.ts +8 -0
  10. package/dist/components/Box/WhiteBox.d.ts +2 -0
  11. package/dist/components/Box/index.d.ts +5 -0
  12. package/dist/components/Button/TertiaryToggleButton.d.ts +6 -2
  13. package/dist/components/Button/TertiaryToggleButtonNodeTitle.d.ts +13 -0
  14. package/dist/components/Button/index.d.ts +1 -0
  15. package/dist/components/Chart/DoughnutChart.d.ts +12 -0
  16. package/dist/components/Chart/ScatterPlot.d.ts +22 -0
  17. package/dist/components/Chart/index.d.ts +2 -0
  18. package/dist/components/Checkbox/BaseCheckbox.d.ts +21 -0
  19. package/dist/components/Checkbox/FoodsCheckbox.d.ts +9 -0
  20. package/dist/components/Checkbox/PrimaryCheckbox.d.ts +2 -2
  21. package/dist/components/Checkbox/helperFunctions.d.ts +3 -0
  22. package/dist/components/Checkbox/index.d.ts +3 -0
  23. package/dist/components/Checkbox/types.d.ts +9 -0
  24. package/dist/components/CustomTypography/CustomTypography.d.ts +6 -0
  25. package/dist/components/CustomTypography/TypographyList.d.ts +7 -0
  26. package/dist/components/CustomTypography/index.d.ts +2 -0
  27. package/dist/components/Dialog/PrimaryDialog.d.ts +2 -2
  28. package/dist/components/Field/NumberField.d.ts +1 -1
  29. package/dist/components/Form/FoodsFormBase/ConfirmDialog.d.ts +8 -0
  30. package/dist/components/Form/FoodsFormBase/FoodsFormBase.d.ts +40 -0
  31. package/dist/components/Form/FoodsFormBase/FormBaseContext.d.ts +24 -0
  32. package/dist/components/Form/FoodsFormBase/FormTopBar/ActionButtons.d.ts +1 -0
  33. package/dist/components/Form/FoodsFormBase/FormTopBar/BarTitle.d.ts +1 -0
  34. package/dist/components/Form/FoodsFormBase/FormTopBar/FormTopBar.d.ts +1 -0
  35. package/dist/components/Form/FoodsFormBase/FormTopBar/IconThread.d.ts +1 -0
  36. package/dist/components/Form/FoodsFormBase/FormTopBar/SavingCloudStatus.d.ts +1 -0
  37. package/dist/components/Form/FoodsFormBase/FormTopBar/index.d.ts +1 -0
  38. package/dist/components/Form/FoodsFormBase/MainPageLayout.d.ts +1 -0
  39. package/dist/components/Form/FoodsFormBase/index.d.ts +3 -0
  40. package/dist/components/Form/FoodsFormBase/usePageLock.d.ts +17 -0
  41. package/dist/components/Form/FormBase.d.ts +22 -13
  42. package/dist/components/Form/FormBox.d.ts +7 -0
  43. package/dist/components/Form/FormPropertyBox.d.ts +14 -0
  44. package/dist/components/Form/FormTopBar.d.ts +21 -6
  45. package/dist/components/Form/FormUnit.d.ts +7 -0
  46. package/dist/components/Form/index.d.ts +5 -0
  47. package/dist/components/Grid/Cell/GreyCell.d.ts +2 -1
  48. package/dist/components/Grid/Cell/index.d.ts +0 -2
  49. package/dist/components/Indicator/ComparaisonIndicator.d.ts +4 -0
  50. package/dist/components/Indicator/index.d.ts +1 -0
  51. package/dist/components/LinearProgress.d.ts +8 -3
  52. package/dist/components/Navigation/FoodsNavBar/FoodsNavbar.d.ts +52 -0
  53. package/dist/components/Navigation/FoodsNavBar/Footer/Footer.d.ts +11 -0
  54. package/dist/components/Navigation/FoodsNavBar/Footer/UserButton.d.ts +10 -0
  55. package/dist/components/Navigation/FoodsNavBar/Footer/UserPopover.d.ts +12 -0
  56. package/dist/components/Navigation/FoodsNavBar/Footer/index.d.ts +1 -0
  57. package/dist/components/Navigation/FoodsNavBar/NavbarAction.d.ts +8 -0
  58. package/dist/components/Navigation/FoodsNavBar/Organization.d.ts +7 -0
  59. package/dist/components/Navigation/FoodsNavBar/index.d.ts +2 -0
  60. package/dist/components/Navigation/IconThread.d.ts +5 -6
  61. package/dist/components/Navigation/Navbar.d.ts +50 -7
  62. package/dist/components/Navigation/index.d.ts +1 -1
  63. package/dist/components/Number/NumberUnit.d.ts +7 -0
  64. package/dist/components/Number/Score.d.ts +7 -0
  65. package/dist/components/Number/index.d.ts +2 -0
  66. package/dist/components/Popover/AnchoredPopover.d.ts +2 -0
  67. package/dist/components/Popover/BigPopoverLayout.d.ts +5 -5
  68. package/dist/components/Popover/CoordinatePopover.d.ts +9 -0
  69. package/dist/components/Popover/OptionsPopover.d.ts +16 -0
  70. package/dist/components/Popover/WhitePopover.d.ts +8 -0
  71. package/dist/components/Popover/index.d.ts +3 -0
  72. package/dist/components/Radio/BaseRadio.d.ts +22 -0
  73. package/dist/components/Radio/FoodsRadioList.d.ts +9 -0
  74. package/dist/components/Radio/RadioBoolean.d.ts +8 -0
  75. package/dist/components/Radio/RadioList.d.ts +18 -0
  76. package/dist/components/Radio/index.d.ts +3 -0
  77. package/dist/components/{SsqCard.d.ts → Ssq/SsqCard.d.ts} +10 -6
  78. package/dist/components/Ssq/index.d.ts +1 -0
  79. package/dist/components/Tabs/ButtonTabs.d.ts +10 -0
  80. package/dist/components/Tabs/SectionTabs.d.ts +20 -0
  81. package/dist/components/Tabs/index.d.ts +2 -0
  82. package/dist/components/Text/TextBlock.d.ts +13 -0
  83. package/dist/components/Text/TextTitle.d.ts +2 -2
  84. package/dist/components/Text/index.d.ts +1 -0
  85. package/dist/components/Textarea/Textarea.d.ts +6 -0
  86. package/dist/components/index.d.ts +9 -1
  87. package/dist/main.d.ts +2 -18
  88. package/dist/main.js +47244 -31358
  89. package/dist/main.umd.cjs +253 -182
  90. package/dist/themes/FoodPilotTheme.d.ts +3 -1
  91. package/dist/themes/ThemeExtensions.d.ts +53 -2
  92. package/dist/themes/WinePilotTheme.d.ts +3 -1
  93. package/package.json +6 -2
  94. package/dist/components/Grid/Cell/ArrayCell.d.ts +0 -3
  95. package/dist/components/Grid/Cell/LinkCell.d.ts +0 -5
  96. package/dist/components/Grid/MaterialGrid.d.ts +0 -6
  97. package/dist/types/Product.d.ts +0 -18
  98. package/dist/types/index.d.ts +0 -42
@@ -0,0 +1,39 @@
1
+ import { ReactNode } from "react";
2
+ export type FormAccordionContent = {
3
+ title: ReactNode;
4
+ content: ReactNode;
5
+ indicator?: {
6
+ value: number;
7
+ unit: string;
8
+ };
9
+ };
10
+ export type FormAccordionProps = {
11
+ pages: FormAccordionContent[];
12
+ };
13
+ export declare const StyledFormAccordion: import("@emotion/styled").StyledComponent<{
14
+ children: NonNullable<ReactNode>;
15
+ classes?: Partial<import("@mui/material").AccordionClasses> | undefined;
16
+ defaultExpanded?: boolean | undefined;
17
+ disabled?: boolean | undefined;
18
+ disableGutters?: boolean | undefined;
19
+ expanded?: boolean | undefined;
20
+ onChange?: ((event: import("react").SyntheticEvent<Element, Event>, expanded: boolean) => void) | undefined;
21
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
22
+ TransitionComponent?: import("react").JSXElementConstructor<import("@mui/material/transitions").TransitionProps & {
23
+ children?: import("react").ReactElement<any, any> | undefined;
24
+ }> | undefined;
25
+ TransitionProps?: import("@mui/material/transitions").TransitionProps | undefined;
26
+ } & import("@mui/material").AccordionSlotsAndSlotProps & Omit<import("@mui/material").PaperOwnProps, "classes" | "onChange"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
27
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
28
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "onChange" | "elevation" | "disabled" | "variant" | "square" | "defaultExpanded" | "disableGutters" | "expanded" | "TransitionComponent" | "TransitionProps" | keyof import("@mui/material").AccordionSlotsAndSlotProps> & {
29
+ theme?: import("@emotion/react").Theme | undefined;
30
+ }, {}, {}>;
31
+ export declare const StyledFormAccordionSummary: import("@emotion/styled").StyledComponent<import("@mui/material").AccordionSummaryOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
32
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
33
+ }, "className" | "style" | "classes" | "children" | "sx" | "tabIndex" | "disabled" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "expandIcon"> & {
34
+ theme?: import("@emotion/react").Theme | undefined;
35
+ }, {}, {}>;
36
+ export declare const StyledFormAccordionDetails: import("@emotion/styled").StyledComponent<import("@mui/material").AccordionDetailsProps & {
37
+ theme?: import("@emotion/react").Theme | undefined;
38
+ }, {}, {}>;
39
+ export declare const FormAccordion: (props: FormAccordionProps) => import("react/jsx-runtime").JSX.Element;
@@ -12,14 +12,15 @@ export declare const StyledAccordion: import("@emotion/styled").StyledComponent<
12
12
  children?: React.ReactElement<any, any> | undefined;
13
13
  }> | undefined;
14
14
  TransitionProps?: import("@mui/material/transitions").TransitionProps | undefined;
15
- } & Omit<import("@mui/material").PaperOwnProps, "classes" | "onChange"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
15
+ } & import("@mui/material/Accordion").AccordionSlotsAndSlotProps & Omit<import("@mui/material").PaperOwnProps, "classes" | "onChange"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
16
16
  ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
17
- }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "disabled" | "sx" | "variant" | "onChange" | "elevation" | "square" | "defaultExpanded" | "disableGutters" | "expanded" | "TransitionComponent" | "TransitionProps"> & {
17
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "onChange" | "elevation" | "disabled" | "variant" | "square" | "defaultExpanded" | "disableGutters" | "expanded" | "TransitionComponent" | "TransitionProps" | keyof import("@mui/material/Accordion").AccordionSlotsAndSlotProps> & {
18
18
  theme?: import("@emotion/react").Theme | undefined;
19
19
  }, {}, {}>;
20
20
  export type AccordionContent = {
21
21
  title: JSX.Element;
22
22
  content: JSX.Element;
23
+ onOpenAction?: () => void;
23
24
  };
24
25
  export type AccordionProductProps = {
25
26
  pages: AccordionContent[];
@@ -1,2 +1,3 @@
1
+ export * from "./FormAccordion";
1
2
  export * from "./ProductAccordion";
2
3
  export * from "./GenericAccordion";
@@ -0,0 +1,7 @@
1
+ import { BoxProps } from "@mui/material";
2
+ import { ReactNode } from "react";
3
+ export type BadgeProps = Omit<BoxProps, "content"> & {
4
+ size?: "small" | "medium" | "big";
5
+ children: ReactNode;
6
+ };
7
+ export declare const Badge: (props: BadgeProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from "react";
2
+ export type AdditionalContentBoxProps = {
3
+ title: string;
4
+ type?: "brand" | "default";
5
+ orientation?: "vertical" | "horizontal";
6
+ icon: ReactNode;
7
+ children?: ReactNode;
8
+ cta?: ReactNode;
9
+ };
10
+ export declare const AdditionalContentBox: (props: AdditionalContentBoxProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  export type CategoryBoxProps = {
2
2
  text: string;
3
+ action?: () => void;
3
4
  };
4
5
  export declare const CategoryBox: (props: CategoryBoxProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from "react";
2
+ export type ContextualContentBoxProps = {
3
+ title?: string;
4
+ size?: "big" | "small";
5
+ children?: ReactNode;
6
+ cta?: ReactNode;
7
+ };
8
+ export declare const ContextualContentBox: (props: ContextualContentBoxProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { BoxProps } from "@mui/material";
2
+ export declare const HelperBox: (props: BoxProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { BoxProps } from "@mui/material";
2
+ import { ReactNode } from "react";
3
+ export type SectionBoxProps = BoxProps & {
4
+ size?: "big" | "small";
5
+ header: ReactNode;
6
+ footer?: ReactNode;
7
+ };
8
+ export declare const SectionBox: (props: SectionBoxProps) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { BoxProps } from "@mui/material";
2
+ export declare const WhiteBox: (props: BoxProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,12 @@
1
+ export * from "./AdditionalContentBox";
1
2
  export * from "./CategoryBox";
3
+ export * from "./ContextualContentBox";
2
4
  export * from "./DottedBox";
5
+ export * from "./HelperBox";
3
6
  export * from "./InfoBox";
4
7
  export * from "./LineGroupBox";
5
8
  export * from "./QuoteBox";
9
+ export * from "./SectionBox";
6
10
  export * from "./SolidGreyBox";
7
11
  export * from "./WarningBox";
12
+ export * from "./WhiteBox";
@@ -1,9 +1,13 @@
1
1
  /// <reference types="react" />
2
+ import { ToggleButtonProps } from "@mui/material";
2
3
  export declare const CustomToggleButton: import("@emotion/styled").StyledComponent<import("@mui/material").ToggleButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
3
4
  ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
4
- }, "color" | "className" | "style" | "classes" | "action" | "centerRipple" | "children" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "tabIndex" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "fullWidth" | "size" | "value" | "onChange" | "onClick" | "selected"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
5
- export type TertiaryToggleButtonProps = {
5
+ }, "size" | "className" | "style" | "classes" | "color" | "children" | "sx" | "tabIndex" | "onChange" | "onClick" | "disabled" | "value" | "action" | "selected" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "fullWidth"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
6
+ type ToggleButtonsPropsWithoutEnforcedKeys = Omit<ToggleButtonProps, "value" | "onClick" | "selected">;
7
+ export type TertiaryToggleButtonProps = ToggleButtonsPropsWithoutEnforcedKeys & {
6
8
  choices: string[];
7
9
  onClick?: (index: number) => void;
10
+ currentIndexSelected?: number;
8
11
  };
9
12
  export declare const TertiaryToggleButton: (props: TertiaryToggleButtonProps) => import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,13 @@
1
+ import { ToggleButtonProps } from "@mui/material";
2
+ import { ReactNode } from "react";
3
+ export declare const CustomToggleButtonNodeTitle: import("@emotion/styled").StyledComponent<import("@mui/material").ToggleButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
4
+ ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
5
+ }, "size" | "className" | "style" | "classes" | "color" | "children" | "sx" | "tabIndex" | "onChange" | "onClick" | "disabled" | "value" | "action" | "selected" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "fullWidth"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
6
+ type ToggleButtonsPropsWithoutEnforcedKeys = Omit<ToggleButtonProps, "value" | "onClick" | "selected">;
7
+ export type TertiaryToggleButtonPropsNodeTitle = ToggleButtonsPropsWithoutEnforcedKeys & {
8
+ choices: ReactNode[];
9
+ onClick?: (index: number) => void;
10
+ currentIndexSelected?: number;
11
+ };
12
+ export declare const TertiaryToggleButtonNodeTitle: (props: TertiaryToggleButtonPropsNodeTitle) => import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -1 +1,2 @@
1
1
  export * from "./TertiaryToggleButton";
2
+ export * from "./TertiaryToggleButtonNodeTitle";
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from "react";
2
+ import { ChartProps } from "react-chartjs-2";
3
+ import { Property } from "csstype";
4
+ export type DoughnutChartProps = Omit<ChartProps<"doughnut">, "data" | "type"> & {
5
+ values?: number[];
6
+ labels?: string[];
7
+ colors?: Property.Color[];
8
+ legend?: boolean;
9
+ children?: ReactNode;
10
+ emptyMessage?: string;
11
+ };
12
+ export declare const DoughnutChart: (props: DoughnutChartProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { ReactNode } from "react";
2
+ export type ScatterPlotProps = {
3
+ values: Array<Point>;
4
+ x: ReactNode;
5
+ y: ReactNode;
6
+ color: string;
7
+ onPointSelection: (selectedPoint: SelectedPoint | null) => void;
8
+ };
9
+ type Coordinate = {
10
+ x: number;
11
+ y: number;
12
+ };
13
+ export type Point = {
14
+ label: string;
15
+ id?: number;
16
+ } & Coordinate;
17
+ export type SelectedPoint = {
18
+ point: Point;
19
+ absoluteCoordinate: Coordinate;
20
+ };
21
+ export declare const ScatterPlot: (props: ScatterPlotProps) => import("react/jsx-runtime").JSX.Element;
22
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from "./DoughnutChart";
2
+ export * from "./ScatterPlot";
@@ -0,0 +1,21 @@
1
+ import { CheckboxProps, FormGroupProps, FormControlLabelProps } from "@mui/material";
2
+ export type CheckboxId = string | number;
3
+ export type CheckboxName = string | number;
4
+ export type CheckboxProperties<T> = Record<CheckboxId, CheckboxPropertyValue<T>>;
5
+ export type CheckboxPropertyValue<T> = {
6
+ name: CheckboxName;
7
+ state: boolean;
8
+ disabled?: boolean;
9
+ rawData: T;
10
+ };
11
+ export type BaseCheckboxOverrides = {
12
+ FormGroupProps?: FormGroupProps;
13
+ FormControlLabelProps?: Omit<FormControlLabelProps, "control" | "label">;
14
+ CheckboxProps?: Omit<CheckboxProps, "onChange">;
15
+ };
16
+ type BaseCheckboxProps<T> = BaseCheckboxOverrides & {
17
+ values: CheckboxProperties<T>;
18
+ onChange: (newCheckbox: CheckboxProperties<T>) => void;
19
+ };
20
+ export declare const BaseCheckbox: <T>(props: BaseCheckboxProps<T>) => import("react/jsx-runtime").JSX.Element;
21
+ export {};
@@ -0,0 +1,9 @@
1
+ import { BaseCheckboxOverrides } from "./BaseCheckbox";
2
+ export type FoodsCheckboxProps<T> = BaseCheckboxOverrides & {
3
+ selectedItems: T[] | undefined;
4
+ values: T[];
5
+ onChange: (selectedValues: T[]) => void;
6
+ getId?: (item: T) => string | number;
7
+ getName?: (item: T) => string | number;
8
+ };
9
+ export declare const FoodsCheckbox: <T>(props: FoodsCheckboxProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import { CheckboxProps } from "@mui/material";
2
- export type CheckboxProperties = Record<string, boolean>;
2
+ import { CheckboxProperties } from "./types";
3
3
  type PrimaryCheckboxProps = Omit<CheckboxProps, "onChange"> & {
4
4
  values: CheckboxProperties;
5
- onChange: (label: string, isChecked: boolean) => void;
5
+ onChange: (newCheckbox: CheckboxProperties) => void;
6
6
  };
7
7
  export declare const PrimaryCheckbox: (props: PrimaryCheckboxProps) => import("react/jsx-runtime").JSX.Element;
8
8
  export {};
@@ -0,0 +1,3 @@
1
+ import { CheckboxProperties, MandatoryFields } from "./types";
2
+ export declare const checkboxToAny: <T extends MandatoryFields, U extends T>(startingValues: T[], checkboxProperties: CheckboxProperties, defaultValue: (fields: MandatoryFields) => U) => T[];
3
+ export declare const anyToCheckbox: <T extends MandatoryFields, U extends MandatoryFields>(allValues: T[], selectedValues: U[]) => CheckboxProperties;
@@ -1 +1,4 @@
1
1
  export * from "./PrimaryCheckbox";
2
+ export * from "./helperFunctions";
3
+ export * from "./types";
4
+ export * from "./FoodsCheckbox";
@@ -0,0 +1,9 @@
1
+ export type CheckboxProperties = Record<string, CheckboxPropertyValue>;
2
+ export type CheckboxPropertyValue = {
3
+ name: string;
4
+ state: boolean;
5
+ };
6
+ export type MandatoryFields = {
7
+ id: number;
8
+ name: string;
9
+ };
@@ -0,0 +1,6 @@
1
+ import { TypographyProps } from "@mui/material";
2
+ export type CustomTypographyProps = {
3
+ value: string[];
4
+ maxLength: number;
5
+ } & TypographyProps;
6
+ export declare const CustomTypography: (props: CustomTypographyProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { TypographyProps } from "@mui/material";
2
+ export type TypographyListProps = {
3
+ value: string[];
4
+ maxLength: number;
5
+ separator?: string;
6
+ } & TypographyProps;
7
+ export declare const TypographyList: (props: TypographyListProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from "./CustomTypography";
2
+ export * from "./TypographyList";
@@ -1,11 +1,11 @@
1
1
  import { Dispatch, SetStateAction } from "react";
2
+ import { DialogProps } from "@mui/material/Dialog";
2
3
  type Settings = {
3
4
  title: JSX.Element;
4
5
  content: JSX.Element;
5
6
  error?: JSX.Element;
6
7
  };
7
- type PrimaryDialogProps = {
8
- isOpen: boolean;
8
+ type PrimaryDialogProps = DialogProps & {
9
9
  setOpen: Dispatch<SetStateAction<boolean>>;
10
10
  options: Settings;
11
11
  onValidate?: () => void;
@@ -3,7 +3,7 @@ export type NumberFieldProps = RoundInputProps & {
3
3
  title: string;
4
4
  unit: string;
5
5
  placeholder: string;
6
- value?: number;
6
+ value?: number | string;
7
7
  description?: string;
8
8
  };
9
9
  export declare const NumberField: (props: NumberFieldProps) => JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { ConfirmOptionsType } from "./FoodsFormBase";
2
+ type ConfirmDialogProps = {
3
+ open: boolean;
4
+ onClose: () => void;
5
+ confirmOptions: ConfirmOptionsType;
6
+ };
7
+ export declare const ConfirmDialog: (props: ConfirmDialogProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,40 @@
1
+ import { ReactNode } from "react";
2
+ export type FoodsPage = {
3
+ title?: string;
4
+ subtitle?: ReactNode;
5
+ icon?: JSX.Element;
6
+ content: ReactNode;
7
+ };
8
+ export type DisplayTextOptions = {
9
+ title: string;
10
+ subtitle?: ReactNode;
11
+ nextPage: string;
12
+ previousPage: string;
13
+ finalPage?: string;
14
+ syncingMessage?: string;
15
+ savingDefaultMessage?: string;
16
+ };
17
+ export type ConfirmOptionsType = {
18
+ titleText: string;
19
+ infoText?: string;
20
+ confirmText: string;
21
+ cancelText: string;
22
+ onConfirm: () => void;
23
+ onCancel: () => void;
24
+ };
25
+ export type ConfirmOptions = ({
26
+ confirmExit: false;
27
+ }) | {
28
+ confirmExit: true;
29
+ confirmOptions: ConfirmOptionsType;
30
+ };
31
+ export type FoodsFormBaseProps = ConfirmOptions & {
32
+ textOptions: DisplayTextOptions;
33
+ pages: FoodsPage[];
34
+ startingPage?: number;
35
+ onClose?: () => void;
36
+ onValidate?: () => void;
37
+ onPageChange?: (newPageIndex: number, previousPageIndex: number) => void;
38
+ showSync?: boolean;
39
+ };
40
+ export declare const FoodsFormBase: (props: FoodsFormBaseProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { ReactNode } from "react";
2
+ import { FoodsPage } from "./FoodsFormBase";
3
+ import { PageLocks } from "./usePageLock";
4
+ import { FoodsFormBaseProps } from "./FoodsFormBase";
5
+ type FormBasePropsBlackList = Omit<FoodsFormBaseProps, "startingPage">;
6
+ type ExtraFormOptions = {
7
+ isSaving: boolean;
8
+ setSaving: (isSaving: boolean) => void;
9
+ selectedPage: FoodsPage;
10
+ selectedPageIndex: number;
11
+ setPage: (value: number) => void;
12
+ maxPage: number;
13
+ formSaved: boolean;
14
+ setFormSaved: (isSaved: boolean) => void;
15
+ openConfirmDialog: () => void;
16
+ };
17
+ type FormBaseContextInitialValues = (PageLocks & FormBasePropsBlackList & ExtraFormOptions);
18
+ type FormBaseContextProviderProps = FoodsFormBaseProps & {
19
+ children: ReactNode;
20
+ openConfirmDialog: () => void;
21
+ };
22
+ export declare const FormBaseContextProvider: (props: FormBaseContextProviderProps) => import("react/jsx-runtime").JSX.Element;
23
+ export declare const useFormBaseContext: () => FormBaseContextInitialValues;
24
+ export {};
@@ -0,0 +1 @@
1
+ export declare const ActionButtons: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const BarTitle: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const FormTopBar: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const IconThread: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const SavingCloudStatus: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { FormTopBar } from "./FormTopBar";
@@ -0,0 +1 @@
1
+ export declare const MainPageLayout: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export { FoodsFormBase } from "./FoodsFormBase";
2
+ export type * from "./FoodsFormBase";
3
+ export { useFormBaseContext, FormBaseContextProvider } from "./FormBaseContext";
@@ -0,0 +1,17 @@
1
+ export type PageLock = {
2
+ isLocked: false;
3
+ } | {
4
+ isLocked: true;
5
+ message?: string;
6
+ };
7
+ export type PageLocks = {
8
+ forwardLock: PageLock;
9
+ lockForward: (message?: string) => void;
10
+ unlockForward: () => void;
11
+ previousLock: PageLock;
12
+ lockPrevious: (message?: string) => void;
13
+ unlockPrevious: () => void;
14
+ lockAll: (message?: string) => void;
15
+ unlockAll: () => void;
16
+ };
17
+ export declare const usePageLock: () => PageLocks;
@@ -1,21 +1,30 @@
1
- /// <reference types="react" />
1
+ import { ReactNode } from "react";
2
+ import { SavingStateProps } from "./FormTopBar";
2
3
  export type Page = {
3
- title: string;
4
- subTitle?: string;
4
+ title?: string;
5
+ subTitle?: ReactNode;
5
6
  info?: JSX.Element;
6
- bigIcon: JSX.Element;
7
- smallIcon: {
8
- selected: JSX.Element;
9
- unselected: JSX.Element;
10
- };
11
- content: JSX.Element | JSX.Element[];
7
+ bigIcon?: JSX.Element;
8
+ icon?: ReactNode;
9
+ content: ReactNode;
12
10
  usesBaseLayout?: boolean;
13
11
  };
14
12
  export type FormBaseProps = {
15
13
  title: string;
16
- icon: JSX.Element;
14
+ subtitle?: string;
17
15
  pages: Page[];
18
- onPageChange?: (page: number) => void;
19
- onSaveDraft?: () => void;
16
+ pageIndexToDisplay?: number;
17
+ onPageForward: () => void;
18
+ onPageBack: () => void;
19
+ nextPageText: string | undefined;
20
+ previousPageText: string;
21
+ validateSteps?: boolean[];
22
+ validateStepsTexts?: (string | null)[];
23
+ warningText?: string;
24
+ savingState?: SavingStateProps;
25
+ navigable?: boolean;
26
+ onNavigate?: (index: number) => void;
27
+ closeable?: boolean;
28
+ onClose?: () => void;
20
29
  };
21
- export declare const FormBase: (props: FormBaseProps) => JSX.Element;
30
+ export declare const FormBase: (props: FormBaseProps) => ReactNode;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { BoxProps } from "@mui/material";
3
+ interface FormBoxProps extends BoxProps {
4
+ sx?: React.CSSProperties;
5
+ }
6
+ export declare const FormBox: ({ sx, ...props }: FormBoxProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,14 @@
1
+ import { BoxProps } from "@mui/material";
2
+ import { ReactNode } from "react";
3
+ type PropertyIndicator = {
4
+ value: number;
5
+ unit: string;
6
+ };
7
+ type FormPropertyBoxProps = BoxProps & {
8
+ title: string;
9
+ hint?: string;
10
+ indicator?: PropertyIndicator;
11
+ children: ReactNode;
12
+ };
13
+ export declare const FormPropertyBox: (props: FormPropertyBoxProps) => import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -1,12 +1,27 @@
1
- /// <reference types="react" />
2
- import { Icon } from "../Navigation/IconThread";
1
+ import { ReactNode } from "react";
3
2
  type FormTopBarProps = {
4
3
  title: string;
5
- icon: JSX.Element;
6
- pageIcons: Icon[];
4
+ subtitle?: ReactNode;
5
+ icons?: ReactNode[];
6
+ steps?: number;
7
7
  currentPage: number;
8
- setPage: (value: number) => void;
9
- onSaveDraft?: () => void;
8
+ onPageForward: () => void;
9
+ onPageBack: () => void;
10
+ nextPageText: string | undefined;
11
+ previousPageText: string;
12
+ validateSteps?: boolean[];
13
+ validateStepsTexts?: (string | null)[];
14
+ warningText?: string;
15
+ savingState?: SavingStateProps | undefined;
16
+ navigable?: boolean | undefined;
17
+ onNavigate?: (index: number) => void | undefined;
18
+ closeable: boolean | undefined;
19
+ onClose: (() => void) | undefined;
10
20
  };
11
21
  export declare const FormTopBar: (props: FormTopBarProps) => import("react/jsx-runtime").JSX.Element;
22
+ export type SavingStateProps = {
23
+ saving: boolean;
24
+ savingMessage: string;
25
+ savedMessage: string;
26
+ };
12
27
  export {};
@@ -0,0 +1,7 @@
1
+ import { BoxProps } from "@mui/material";
2
+ type FormUnitProps = BoxProps & {
3
+ value: number;
4
+ unit: string;
5
+ };
6
+ export declare const FormUnit: (props: FormUnitProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -1 +1,6 @@
1
1
  export * from "./FormBase";
2
+ export * from "./FormBox";
3
+ export * from "./FormPropertyBox";
4
+ export * from "./FormTopBar";
5
+ export * from "./FormUnit";
6
+ export * from "./FoodsFormBase";
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from "react";
1
2
  export declare function GreyTextCell(props: {
2
- value: string;
3
+ value: ReactNode;
3
4
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,3 @@
1
- export * from "./ArrayCell";
2
1
  export * from "./EcoScoreCell";
3
2
  export * from "./GreyCell";
4
- export * from "./LinkCell";
5
3
  export * from "./PointsCell";
@@ -0,0 +1,4 @@
1
+ export type ComparaisonIndicatorProps = {
2
+ value: number;
3
+ };
4
+ export declare const ComparaisonIndicator: (props: ComparaisonIndicatorProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./ComparaisonIndicator";
@@ -2,8 +2,13 @@ import { LinearProgressProps as MuiLinearProgressProps } from "@mui/material/Lin
2
2
  type LinearProgressBaseProps = Omit<MuiLinearProgressProps, "classes" | "sx" | "valueBuffer" | "variant">;
3
3
  export interface LinearProgressProps extends LinearProgressBaseProps {
4
4
  value: number;
5
+ styleProperties?: LinearProgressStyleProperties;
5
6
  }
6
- export declare const LinearProgress: (props: LinearProgressProps & {
7
- value: number;
8
- }) => import("react/jsx-runtime").JSX.Element;
7
+ export type LinearProgressStyleProperties = {
8
+ lineColor?: string;
9
+ fontColor?: string;
10
+ fullUpLineColor?: string;
11
+ fullUpFontColor?: string;
12
+ };
13
+ export declare const LinearProgress: (props: LinearProgressProps) => import("react/jsx-runtime").JSX.Element;
9
14
  export {};