@foodpilot/foods 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/dist/components/Accordion/FormAccordion.d.ts +39 -0
  2. package/dist/components/Accordion/ProductAccordion.d.ts +4 -2
  3. package/dist/components/Accordion/index.d.ts +1 -0
  4. package/dist/components/Badge/Badge.d.ts +7 -0
  5. package/dist/components/Badge/FoodsBadge.d.ts +8 -0
  6. package/dist/components/Badge/index.d.ts +2 -0
  7. package/dist/components/Box/AdditionalContentBox.d.ts +10 -0
  8. package/dist/components/Box/CategoryBox.d.ts +1 -0
  9. package/dist/components/Box/ContextualContentBox.d.ts +8 -0
  10. package/dist/components/Box/HelperBox.d.ts +2 -0
  11. package/dist/components/Box/SectionBox.d.ts +8 -0
  12. package/dist/components/Box/WhiteBox.d.ts +2 -0
  13. package/dist/components/Box/index.d.ts +5 -0
  14. package/dist/components/Button/FoodsIconButton.d.ts +5 -0
  15. package/dist/components/Button/FoodsToggleButton.d.ts +14 -0
  16. package/dist/components/Button/TertiaryToggleButton.d.ts +6 -2
  17. package/dist/components/Button/TertiaryToggleButtonNodeTitle.d.ts +13 -0
  18. package/dist/components/Button/index.d.ts +2 -0
  19. package/dist/components/Chart/DoughnutChart.d.ts +11 -0
  20. package/dist/components/Chart/ScatterPlot.d.ts +22 -0
  21. package/dist/components/Chart/index.d.ts +2 -0
  22. package/dist/components/Checkbox/BaseCheckbox.d.ts +21 -0
  23. package/dist/components/Checkbox/FoodsCheckbox.d.ts +9 -0
  24. package/dist/components/Checkbox/PrimaryCheckbox.d.ts +2 -2
  25. package/dist/components/Checkbox/helperFunctions.d.ts +3 -0
  26. package/dist/components/Checkbox/index.d.ts +3 -0
  27. package/dist/components/Checkbox/types.d.ts +9 -0
  28. package/dist/components/CustomTypography/CustomTypography.d.ts +6 -0
  29. package/dist/components/CustomTypography/TypographyList.d.ts +7 -0
  30. package/dist/components/CustomTypography/index.d.ts +2 -0
  31. package/dist/components/Dialog/PrimaryDialog.d.ts +15 -6
  32. package/dist/components/Field/NumberField.d.ts +1 -1
  33. package/dist/components/Form/FoodsFormBase/ConfirmDialog.d.ts +8 -0
  34. package/dist/components/Form/FoodsFormBase/FoodsFormBase.d.ts +42 -0
  35. package/dist/components/Form/FoodsFormBase/FormBaseContext.d.ts +24 -0
  36. package/dist/components/Form/FoodsFormBase/FormTopBar/ActionButtons.d.ts +1 -0
  37. package/dist/components/Form/FoodsFormBase/FormTopBar/BarTitle.d.ts +1 -0
  38. package/dist/components/Form/FoodsFormBase/FormTopBar/FormTopBar.d.ts +1 -0
  39. package/dist/components/Form/FoodsFormBase/FormTopBar/IconThread.d.ts +1 -0
  40. package/dist/components/Form/FoodsFormBase/FormTopBar/SavingCloudStatus.d.ts +1 -0
  41. package/dist/components/Form/FoodsFormBase/FormTopBar/index.d.ts +1 -0
  42. package/dist/components/Form/FoodsFormBase/MainPageLayout.d.ts +1 -0
  43. package/dist/components/Form/FoodsFormBase/index.d.ts +3 -0
  44. package/dist/components/Form/FoodsFormBase/usePageLock.d.ts +17 -0
  45. package/dist/components/Form/FormBase.d.ts +22 -13
  46. package/dist/components/Form/FormBox.d.ts +7 -0
  47. package/dist/components/Form/FormPropertyBox.d.ts +14 -0
  48. package/dist/components/Form/FormTopBar.d.ts +21 -6
  49. package/dist/components/Form/FormUnit.d.ts +7 -0
  50. package/dist/components/Form/index.d.ts +5 -0
  51. package/dist/components/Grid/Cell/GreyCell.d.ts +2 -1
  52. package/dist/components/Grid/Cell/index.d.ts +0 -2
  53. package/dist/components/Icons/FoodsIcon.d.ts +9 -0
  54. package/dist/components/Icons/FoodsIllustrations.d.ts +6 -0
  55. package/dist/components/Icons/Illustrations/Actions.d.ts +1 -0
  56. package/dist/components/Icons/Illustrations/Carbon emissions reduction.d.ts +1 -0
  57. package/dist/components/Icons/Illustrations/Carbon neutrality.d.ts +1 -0
  58. package/dist/components/Icons/Illustrations/Data analysis.d.ts +1 -0
  59. package/dist/components/Icons/Illustrations/Inputs & chemicals.d.ts +1 -0
  60. package/dist/components/Icons/Illustrations/Questionnaire.d.ts +1 -0
  61. package/dist/components/Icons/Illustrations/Scores & indicators.d.ts +1 -0
  62. package/dist/components/Icons/Illustrations/Under construction.d.ts +1 -0
  63. package/dist/components/Icons/iconConfig.d.ts +368 -0
  64. package/dist/components/Icons/illustrationsConfig.d.ts +10 -0
  65. package/dist/components/Icons/index.d.ts +4 -0
  66. package/dist/components/Indicator/ComparaisonIndicator.d.ts +4 -0
  67. package/dist/components/Indicator/index.d.ts +1 -0
  68. package/dist/components/LinearProgress.d.ts +8 -3
  69. package/dist/components/Navigation/FoodsNavBar/FoodsNavbar.d.ts +47 -0
  70. package/dist/components/Navigation/FoodsNavBar/Footer/DefaultUserAction.d.ts +7 -0
  71. package/dist/components/Navigation/FoodsNavBar/Footer/Footer.d.ts +12 -0
  72. package/dist/components/Navigation/FoodsNavBar/Footer/UserButton.d.ts +11 -0
  73. package/dist/components/Navigation/FoodsNavBar/Footer/UserPopover.d.ts +13 -0
  74. package/dist/components/Navigation/FoodsNavBar/Footer/index.d.ts +1 -0
  75. package/dist/components/Navigation/FoodsNavBar/NavbarAction.d.ts +8 -0
  76. package/dist/components/Navigation/FoodsNavBar/Organization.d.ts +7 -0
  77. package/dist/components/Navigation/FoodsNavBar/index.d.ts +2 -0
  78. package/dist/components/Navigation/IconThread.d.ts +5 -6
  79. package/dist/components/Navigation/Navbar.d.ts +50 -7
  80. package/dist/components/Navigation/index.d.ts +1 -1
  81. package/dist/components/Number/NumberUnit.d.ts +7 -0
  82. package/dist/components/Number/Score.d.ts +7 -0
  83. package/dist/components/Number/index.d.ts +2 -0
  84. package/dist/components/Popover/AnchoredPopover.d.ts +3 -0
  85. package/dist/components/Popover/BigPopoverLayout.d.ts +5 -5
  86. package/dist/components/Popover/CoordinatePopover.d.ts +9 -0
  87. package/dist/components/Popover/OptionsPopover.d.ts +17 -0
  88. package/dist/components/Popover/WhitePopover.d.ts +9 -0
  89. package/dist/components/Popover/index.d.ts +3 -0
  90. package/dist/components/Radio/BaseRadio.d.ts +22 -0
  91. package/dist/components/Radio/FoodsRadioList.d.ts +9 -0
  92. package/dist/components/Radio/RadioBoolean.d.ts +8 -0
  93. package/dist/components/Radio/RadioList.d.ts +18 -0
  94. package/dist/components/Radio/index.d.ts +3 -0
  95. package/dist/components/Search/FoodsSearch.d.ts +1 -0
  96. package/dist/components/Search/index.d.ts +1 -0
  97. package/dist/components/Select/FoodsSelect/Context/Provider.d.ts +29 -0
  98. package/dist/components/Select/FoodsSelect/Context/useSelect.d.ts +8 -0
  99. package/dist/components/Select/FoodsSelect/FoodsSelect.d.ts +14 -0
  100. package/dist/components/Select/FoodsSelect/Options/Header/OptionHeader.d.ts +8 -0
  101. package/dist/components/Select/FoodsSelect/Options/Header/SearchBar.d.ts +0 -0
  102. package/dist/components/Select/FoodsSelect/Options/Line/Default.d.ts +6 -0
  103. package/dist/components/Select/FoodsSelect/Options/Line/LineBox.d.ts +2 -0
  104. package/dist/components/Select/FoodsSelect/Options/Line/OptionLine.d.ts +8 -0
  105. package/dist/components/Select/FoodsSelect/Options/Line/Selected.d.ts +6 -0
  106. package/dist/components/Select/FoodsSelect/Options/SelectOptions.d.ts +10 -0
  107. package/dist/components/Select/FoodsSelect/Select.d.ts +10 -0
  108. package/dist/components/Select/FoodsSelect/index.d.ts +1 -0
  109. package/dist/components/Select/index.d.ts +1 -0
  110. package/dist/components/{SsqCard.d.ts → Ssq/SsqCard.d.ts} +10 -6
  111. package/dist/components/Ssq/index.d.ts +1 -0
  112. package/dist/components/Tabs/ButtonTabs.d.ts +10 -0
  113. package/dist/components/Tabs/SectionTabs.d.ts +20 -0
  114. package/dist/components/Tabs/index.d.ts +2 -0
  115. package/dist/components/Text/TextBlock.d.ts +13 -0
  116. package/dist/components/Text/TextTitle.d.ts +2 -2
  117. package/dist/components/Text/index.d.ts +1 -0
  118. package/dist/components/Textarea/Textarea.d.ts +6 -0
  119. package/dist/components/index.d.ts +14 -3
  120. package/dist/main.d.ts +2 -18
  121. package/dist/main.js +49401 -32707
  122. package/dist/main.umd.cjs +253 -182
  123. package/dist/themes/FoodPilotTheme.d.ts +3 -1
  124. package/dist/themes/ThemeExtensions.d.ts +53 -2
  125. package/dist/themes/WinePilotTheme.d.ts +3 -1
  126. package/package.json +6 -2
  127. package/dist/components/Grid/Cell/ArrayCell.d.ts +0 -3
  128. package/dist/components/Grid/Cell/LinkCell.d.ts +0 -5
  129. package/dist/components/Grid/MaterialGrid.d.ts +0 -6
  130. package/dist/types/Product.d.ts +0 -18
  131. 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,16 +12,18 @@ 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[];
27
+ defaultIndex?: number;
26
28
  };
27
29
  export declare const AccordionProduct: (props: AccordionProductProps) => import("react/jsx-runtime").JSX.Element;
@@ -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,8 @@
1
+ import { BoxProps } from "@mui/material";
2
+ import { FoodsIconProps } from "../Icons/FoodsIcon";
3
+ export type FoodsBadgeProps = {
4
+ size: number;
5
+ icon: FoodsIconProps["icon"];
6
+ boxProps?: BoxProps;
7
+ };
8
+ export declare const FoodsBadge: (props: FoodsBadgeProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from "./Badge";
2
+ export * from "./FoodsBadge";
@@ -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";
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export type FoodsIconButton = {
3
+ icon: JSX.Element;
4
+ };
5
+ export declare const FoodsIconButton: (props: FoodsIconButton) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { ToggleButtonProps } from "@mui/material";
2
+ type ToggleButtonsPropsWithoutEnforcedKeys = Omit<ToggleButtonProps, "key" | "value" | "onClick" | "selected">;
3
+ type ToggleChoice = {
4
+ id: number;
5
+ name: string;
6
+ };
7
+ export type FoodsToggleButtonProps = ToggleButtonsPropsWithoutEnforcedKeys & {
8
+ selectedChoice: ToggleChoice | null;
9
+ choices: ToggleChoice[];
10
+ onSelection: (selectedChoiceId: number) => void;
11
+ ToggleButtonProps?: ToggleButtonsPropsWithoutEnforcedKeys;
12
+ };
13
+ export declare const FoodsToggleButton: (props: FoodsToggleButtonProps) => import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -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,3 @@
1
1
  export * from "./TertiaryToggleButton";
2
+ export * from "./TertiaryToggleButtonNodeTitle";
3
+ export * from "./FoodsToggleButton";
@@ -0,0 +1,11 @@
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
+ };
11
+ 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,16 +1,25 @@
1
- import { Dispatch, SetStateAction } from "react";
1
+ import { Dispatch, ReactNode, SetStateAction } from "react";
2
+ import { DialogProps } from "@mui/material/Dialog";
2
3
  type Settings = {
3
- title: JSX.Element;
4
- content: JSX.Element;
5
- error?: JSX.Element;
4
+ title: ReactNode;
5
+ content: ReactNode;
6
+ error?: ReactNode;
6
7
  };
7
- type PrimaryDialogProps = {
8
- isOpen: boolean;
8
+ type ConfirmAction = {
9
+ title: ReactNode;
10
+ content: ReactNode;
11
+ cancelText?: string;
12
+ validateText?: string;
13
+ };
14
+ type PrimaryDialogProps = DialogProps & {
9
15
  setOpen: Dispatch<SetStateAction<boolean>>;
10
16
  options: Settings;
11
17
  onValidate?: () => void;
12
18
  onCancel?: () => void;
13
19
  canValidate?: boolean;
20
+ confirmAction?: ConfirmAction;
21
+ cancelText: string;
22
+ validateText: string;
14
23
  };
15
24
  export declare const PrimaryDialog: (props: PrimaryDialogProps) => import("react/jsx-runtime").JSX.Element;
16
25
  export {};
@@ -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,42 @@
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
+ warningText?: string;
17
+ };
18
+ export type ConfirmOptionsType = {
19
+ titleText: string;
20
+ infoText?: string;
21
+ confirmText: string;
22
+ cancelText: string;
23
+ onConfirm: () => void;
24
+ onCancel: () => void;
25
+ };
26
+ export type ConfirmOptions = ({
27
+ confirmExit: false;
28
+ }) | {
29
+ confirmExit: true;
30
+ confirmOptions: ConfirmOptionsType;
31
+ };
32
+ export type FoodsFormBaseProps = ConfirmOptions & {
33
+ textOptions: DisplayTextOptions;
34
+ pages: FoodsPage[];
35
+ startingPage?: number;
36
+ onClose?: () => void;
37
+ onValidate?: () => void;
38
+ onPageChange?: (newPageIndex: number, previousPageIndex: number) => void;
39
+ showSync?: boolean;
40
+ isLoading?: boolean;
41
+ };
42
+ 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 {};