@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
@@ -1,3 +1,5 @@
1
- import { GreyShades } from "./ThemeExtensions";
1
+ import { GreenShades, GreyShades, RedShades } from "./ThemeExtensions";
2
2
  export declare const greyTheme: GreyShades;
3
+ export declare const redTheme: RedShades;
4
+ export declare const greenTheme: GreenShades;
3
5
  export declare const FoodPilotTheme: import("@mui/material").Theme;
@@ -4,6 +4,8 @@ type CustomThemeKeys = {
4
4
  custom: {
5
5
  color: CustomColor;
6
6
  grey: GreyShades;
7
+ red: RedShades;
8
+ green: GreenShades;
7
9
  searchBox: SxProps;
8
10
  rowMenuElement: SxProps;
9
11
  productGrid: {
@@ -64,8 +66,33 @@ export type GreyShades = {
64
66
  2900: string;
65
67
  3000: string;
66
68
  };
67
- export type customTypographyVariants = "h1" | "h2" | "h3" | "h4" | "h5" | "huge" | "big-bold" | "big-medium" | "big" | "body-bold" | "body" | "body-light" | "popover-header" | "grey-tag" | "white-tag";
68
- export type customButtonVariants = "primary" | "secondary" | "ternary" | "text" | "black-text" | "navbar-current" | "navbar" | "black-filled" | "white-filled" | "white-filled-no-shadow";
69
+ export type RedShades = {
70
+ 100: string;
71
+ 200: string;
72
+ 300: string;
73
+ 400: string;
74
+ 500: string;
75
+ 600: string;
76
+ 700: string;
77
+ 800: string;
78
+ 900: string;
79
+ 1000: string;
80
+ };
81
+ export type GreenShades = {
82
+ 100: string;
83
+ 200: string;
84
+ 300: string;
85
+ 400: string;
86
+ 500: string;
87
+ 600: string;
88
+ 700: string;
89
+ 800: string;
90
+ 900: string;
91
+ 1000: string;
92
+ };
93
+ export type customTypographyVariants = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "huge-bold" | "huge-medium" | "huge" | "big-bold" | "big-medium" | "big" | "body-bold" | "body-medium" | "body" | "small-bold" | "small-medium" | "small";
94
+ export type customButtonVariants = "primary" | "secondary" | "ternary" | "text" | "black-text" | "selected-menu" | "selected-submenu" | "default-menu" | "black-filled" | "white-filled" | "white-filled-no-shadow";
95
+ export type customAvatarVariants = "small" | "medium" | "big";
69
96
  type TypographyNewVariants = Record<customTypographyVariants, React.CSSProperties>;
70
97
  type TypographyPropsNewVariants = Record<customTypographyVariants, true>;
71
98
  declare module "@mui/material/styles" {
@@ -84,6 +111,30 @@ declare module "@mui/material/styles" {
84
111
  interface ThemeOptions extends CustomThemeKeys {
85
112
  }
86
113
  }
114
+ type AvatarNewVariants = Record<customAvatarVariants, React.CSSProperties>;
115
+ type AvatarPropsNewVariants = Record<customAvatarVariants, true>;
116
+ declare module "@mui/material/styles" {
117
+ interface AvatarVariants extends AvatarNewVariants {
118
+ }
119
+ interface AvatarVariantsOptions extends AvatarNewVariants {
120
+ }
121
+ }
122
+ declare module "@mui/material/Avatar" {
123
+ interface AvatarPropsVariantOverrides extends AvatarPropsNewVariants {
124
+ }
125
+ }
126
+ type AvatarGroupNewVariants = Record<customAvatarVariants, React.CSSProperties>;
127
+ type AvatarGroupPropsNewVariants = Record<customAvatarVariants, true>;
128
+ declare module "@mui/material/styles" {
129
+ interface AvatarGroupVariants extends AvatarGroupNewVariants {
130
+ }
131
+ interface AvatarGroupVariantsOptions extends AvatarGroupNewVariants {
132
+ }
133
+ }
134
+ declare module "@mui/material/AvatarGroup" {
135
+ interface AvatarGroupPropsVariantOverrides extends AvatarGroupPropsNewVariants {
136
+ }
137
+ }
87
138
  type ButtonNewVariants = Record<customButtonVariants, React.CSSProperties>;
88
139
  type ButtonPropsNewVariants = Record<customButtonVariants, true>;
89
140
  declare module "@mui/material/styles" {
@@ -1,3 +1,5 @@
1
- import { GreyShades } from "./ThemeExtensions";
1
+ import { GreenShades, GreyShades, RedShades } from "./ThemeExtensions";
2
2
  export declare const greyTheme: GreyShades;
3
+ export declare const redTheme: RedShades;
4
+ export declare const greenTheme: GreenShades;
3
5
  export declare const WinePilotTheme: import("@mui/material").Theme;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@foodpilot/foods",
3
3
  "private": false,
4
- "version": "0.2.0",
4
+ "version": "0.3.0",
5
5
  "type": "module",
6
6
  "main": "./dist/main.umd.cjs",
7
7
  "module": "./dist/main.js",
@@ -49,6 +49,7 @@
49
49
  "@storybook/react": "^7.6.7",
50
50
  "@storybook/react-vite": "^7.6.7",
51
51
  "@storybook/testing-library": "^0.2.2",
52
+ "@types/chroma-js": "^2.4.4",
52
53
  "@types/react": "^18.2.47",
53
54
  "@types/react-dom": "^18.2.18",
54
55
  "@typescript-eslint/eslint-plugin": "^6.18.1",
@@ -74,16 +75,19 @@
74
75
  },
75
76
  "dependencies": {
76
77
  "@mui/x-date-pickers": "^6.18.7",
78
+ "chart.js": "^4.4.2",
79
+ "chartjs-plugin-datalabels": "^2.2.0",
80
+ "chroma-js": "^2.4.2",
77
81
  "i18next": "^23.7.16",
78
82
  "i18next-browser-languagedetector": "^7.2.0",
79
83
  "i18next-http-backend": "^2.4.2",
80
84
  "lodash": "^4.17.21",
81
85
  "material-react-table": "^2.5.1",
82
86
  "prettier": "^3.1.1",
87
+ "react-chartjs-2": "^5.2.0",
83
88
  "react-dnd": "^16.0.1",
84
89
  "react-dnd-html5-backend": "^16.0.1",
85
90
  "react-i18next": "^14.0.0",
86
- "recoil": "^0.7.7",
87
91
  "typeface-montserrat": "^1.1.13",
88
92
  "uuid": "^9.0.1"
89
93
  }
@@ -1,3 +0,0 @@
1
- export declare function ArrayCell(props: {
2
- value: string[];
3
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +0,0 @@
1
- export declare function LinkCell(props: {
2
- value: string;
3
- chain: boolean;
4
- tag: string;
5
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +0,0 @@
1
- import { Packaging } from "../../types";
2
- export type MaterialGridProps = {
3
- packaging: Packaging;
4
- onChange: (newPackaging: Packaging) => void;
5
- };
6
- export declare const MaterialGrid: (props: MaterialGridProps) => JSX.Element;
@@ -1,18 +0,0 @@
1
- export declare enum ProductKeys {
2
- "name" = "name",
3
- "brand" = "brand",
4
- "tags" = "tags",
5
- "identifier" = "identifier",
6
- "upts" = "upts",
7
- "hasUptsWarning" = "hasUptsWarning",
8
- "isFavorite" = "isFavorite"
9
- }
10
- export type Product = {
11
- [ProductKeys.name]: string;
12
- [ProductKeys.brand]: string;
13
- [ProductKeys.tags]: string[];
14
- [ProductKeys.identifier]: string;
15
- [ProductKeys.upts]: number | null;
16
- [ProductKeys.hasUptsWarning]: boolean;
17
- [ProductKeys.isFavorite]: boolean;
18
- };
@@ -1,42 +0,0 @@
1
- export type Product = {
2
- name: string;
3
- clientId: string;
4
- agribalyseId: string;
5
- netWeight: number;
6
- gamme: string[];
7
- tags: string[];
8
- ingredients: Ingredient[];
9
- packagings: Packaging[];
10
- transformations: Transformation[];
11
- consumptions: Consumption[];
12
- model?: string;
13
- distribution: string;
14
- };
15
- export type EmptyProduct = Partial<Product>;
16
- export type Transformation = {
17
- id: number;
18
- weight: number;
19
- name: string;
20
- };
21
- export type Ingredient = {
22
- name: string;
23
- proportion: number;
24
- weight: number;
25
- chain: boolean;
26
- supplier: string[];
27
- tags: string[];
28
- };
29
- export type Material = {
30
- name: string;
31
- weight: number;
32
- unit: string;
33
- recycledPart: number;
34
- };
35
- export type Packaging = {
36
- name: string;
37
- weight: number;
38
- items: Material[];
39
- };
40
- export type Consumption = {
41
- name: string;
42
- };