@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.
- package/dist/components/Accordion/FormAccordion.d.ts +39 -0
- package/dist/components/Accordion/ProductAccordion.d.ts +3 -2
- package/dist/components/Accordion/index.d.ts +1 -0
- package/dist/components/Badge.d.ts +7 -0
- package/dist/components/Box/AdditionalContentBox.d.ts +10 -0
- package/dist/components/Box/CategoryBox.d.ts +1 -0
- package/dist/components/Box/ContextualContentBox.d.ts +8 -0
- package/dist/components/Box/HelperBox.d.ts +2 -0
- package/dist/components/Box/SectionBox.d.ts +8 -0
- package/dist/components/Box/WhiteBox.d.ts +2 -0
- package/dist/components/Box/index.d.ts +5 -0
- package/dist/components/Button/TertiaryToggleButton.d.ts +6 -2
- package/dist/components/Button/TertiaryToggleButtonNodeTitle.d.ts +13 -0
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/Chart/DoughnutChart.d.ts +12 -0
- package/dist/components/Chart/ScatterPlot.d.ts +22 -0
- package/dist/components/Chart/index.d.ts +2 -0
- package/dist/components/Checkbox/BaseCheckbox.d.ts +21 -0
- package/dist/components/Checkbox/FoodsCheckbox.d.ts +9 -0
- package/dist/components/Checkbox/PrimaryCheckbox.d.ts +2 -2
- package/dist/components/Checkbox/helperFunctions.d.ts +3 -0
- package/dist/components/Checkbox/index.d.ts +3 -0
- package/dist/components/Checkbox/types.d.ts +9 -0
- package/dist/components/CustomTypography/CustomTypography.d.ts +6 -0
- package/dist/components/CustomTypography/TypographyList.d.ts +7 -0
- package/dist/components/CustomTypography/index.d.ts +2 -0
- package/dist/components/Dialog/PrimaryDialog.d.ts +2 -2
- package/dist/components/Field/NumberField.d.ts +1 -1
- package/dist/components/Form/FoodsFormBase/ConfirmDialog.d.ts +8 -0
- package/dist/components/Form/FoodsFormBase/FoodsFormBase.d.ts +40 -0
- package/dist/components/Form/FoodsFormBase/FormBaseContext.d.ts +24 -0
- package/dist/components/Form/FoodsFormBase/FormTopBar/ActionButtons.d.ts +1 -0
- package/dist/components/Form/FoodsFormBase/FormTopBar/BarTitle.d.ts +1 -0
- package/dist/components/Form/FoodsFormBase/FormTopBar/FormTopBar.d.ts +1 -0
- package/dist/components/Form/FoodsFormBase/FormTopBar/IconThread.d.ts +1 -0
- package/dist/components/Form/FoodsFormBase/FormTopBar/SavingCloudStatus.d.ts +1 -0
- package/dist/components/Form/FoodsFormBase/FormTopBar/index.d.ts +1 -0
- package/dist/components/Form/FoodsFormBase/MainPageLayout.d.ts +1 -0
- package/dist/components/Form/FoodsFormBase/index.d.ts +3 -0
- package/dist/components/Form/FoodsFormBase/usePageLock.d.ts +17 -0
- package/dist/components/Form/FormBase.d.ts +22 -13
- package/dist/components/Form/FormBox.d.ts +7 -0
- package/dist/components/Form/FormPropertyBox.d.ts +14 -0
- package/dist/components/Form/FormTopBar.d.ts +21 -6
- package/dist/components/Form/FormUnit.d.ts +7 -0
- package/dist/components/Form/index.d.ts +5 -0
- package/dist/components/Grid/Cell/GreyCell.d.ts +2 -1
- package/dist/components/Grid/Cell/index.d.ts +0 -2
- package/dist/components/Indicator/ComparaisonIndicator.d.ts +4 -0
- package/dist/components/Indicator/index.d.ts +1 -0
- package/dist/components/LinearProgress.d.ts +8 -3
- package/dist/components/Navigation/FoodsNavBar/FoodsNavbar.d.ts +52 -0
- package/dist/components/Navigation/FoodsNavBar/Footer/Footer.d.ts +11 -0
- package/dist/components/Navigation/FoodsNavBar/Footer/UserButton.d.ts +10 -0
- package/dist/components/Navigation/FoodsNavBar/Footer/UserPopover.d.ts +12 -0
- package/dist/components/Navigation/FoodsNavBar/Footer/index.d.ts +1 -0
- package/dist/components/Navigation/FoodsNavBar/NavbarAction.d.ts +8 -0
- package/dist/components/Navigation/FoodsNavBar/Organization.d.ts +7 -0
- package/dist/components/Navigation/FoodsNavBar/index.d.ts +2 -0
- package/dist/components/Navigation/IconThread.d.ts +5 -6
- package/dist/components/Navigation/Navbar.d.ts +50 -7
- package/dist/components/Navigation/index.d.ts +1 -1
- package/dist/components/Number/NumberUnit.d.ts +7 -0
- package/dist/components/Number/Score.d.ts +7 -0
- package/dist/components/Number/index.d.ts +2 -0
- package/dist/components/Popover/AnchoredPopover.d.ts +2 -0
- package/dist/components/Popover/BigPopoverLayout.d.ts +5 -5
- package/dist/components/Popover/CoordinatePopover.d.ts +9 -0
- package/dist/components/Popover/OptionsPopover.d.ts +16 -0
- package/dist/components/Popover/WhitePopover.d.ts +8 -0
- package/dist/components/Popover/index.d.ts +3 -0
- package/dist/components/Radio/BaseRadio.d.ts +22 -0
- package/dist/components/Radio/FoodsRadioList.d.ts +9 -0
- package/dist/components/Radio/RadioBoolean.d.ts +8 -0
- package/dist/components/Radio/RadioList.d.ts +18 -0
- package/dist/components/Radio/index.d.ts +3 -0
- package/dist/components/{SsqCard.d.ts → Ssq/SsqCard.d.ts} +10 -6
- package/dist/components/Ssq/index.d.ts +1 -0
- package/dist/components/Tabs/ButtonTabs.d.ts +10 -0
- package/dist/components/Tabs/SectionTabs.d.ts +20 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Text/TextBlock.d.ts +13 -0
- package/dist/components/Text/TextTitle.d.ts +2 -2
- package/dist/components/Text/index.d.ts +1 -0
- package/dist/components/Textarea/Textarea.d.ts +6 -0
- package/dist/components/index.d.ts +9 -1
- package/dist/main.d.ts +2 -18
- package/dist/main.js +47244 -31358
- package/dist/main.umd.cjs +253 -182
- package/dist/themes/FoodPilotTheme.d.ts +3 -1
- package/dist/themes/ThemeExtensions.d.ts +53 -2
- package/dist/themes/WinePilotTheme.d.ts +3 -1
- package/package.json +6 -2
- package/dist/components/Grid/Cell/ArrayCell.d.ts +0 -3
- package/dist/components/Grid/Cell/LinkCell.d.ts +0 -5
- package/dist/components/Grid/MaterialGrid.d.ts +0 -6
- package/dist/types/Product.d.ts +0 -18
- 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" | "
|
|
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[];
|
|
@@ -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;
|
|
@@ -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,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;
|
|
@@ -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
|
-
}, "
|
|
5
|
-
|
|
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 {};
|
|
@@ -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,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
|
-
|
|
2
|
+
import { CheckboxProperties } from "./types";
|
|
3
3
|
type PrimaryCheckboxProps = Omit<CheckboxProps, "onChange"> & {
|
|
4
4
|
values: CheckboxProperties;
|
|
5
|
-
onChange: (
|
|
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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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,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
|
-
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { SavingStateProps } from "./FormTopBar";
|
|
2
3
|
export type Page = {
|
|
3
|
-
title
|
|
4
|
-
subTitle?:
|
|
4
|
+
title?: string;
|
|
5
|
+
subTitle?: ReactNode;
|
|
5
6
|
info?: JSX.Element;
|
|
6
|
-
bigIcon
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
14
|
+
subtitle?: string;
|
|
17
15
|
pages: Page[];
|
|
18
|
-
|
|
19
|
-
|
|
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) =>
|
|
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
|
-
|
|
2
|
-
import { Icon } from "../Navigation/IconThread";
|
|
1
|
+
import { ReactNode } from "react";
|
|
3
2
|
type FormTopBarProps = {
|
|
4
3
|
title: string;
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
subtitle?: ReactNode;
|
|
5
|
+
icons?: ReactNode[];
|
|
6
|
+
steps?: number;
|
|
7
7
|
currentPage: number;
|
|
8
|
-
|
|
9
|
-
|
|
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 @@
|
|
|
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
|
|
7
|
-
|
|
8
|
-
|
|
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 {};
|