@foodpilot/foods 2.11.20 → 2.11.22

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.
@@ -3,14 +3,18 @@ type LinearProgressBaseProps = Omit<MuiLinearProgressProps, "classes" | "sx" | "
3
3
  export interface LinearProgressProps extends LinearProgressBaseProps {
4
4
  value: number;
5
5
  height?: string;
6
+ minContainerHeight?: string;
6
7
  hideValueLabel?: boolean;
7
8
  styleProperties?: LinearProgressStyleProperties;
8
9
  }
9
10
  export type LinearProgressStyleProperties = {
10
11
  lineColor?: string;
11
- fontColor?: string;
12
12
  fullUpLineColor?: string;
13
+ backgroundLineColor?: string;
14
+ fontColor?: string;
13
15
  fullUpFontColor?: string;
16
+ fontBackgroundColor?: string;
17
+ fontBackgroundCompleteColor?: string;
14
18
  };
15
19
  export declare const LinearProgress: (props: LinearProgressProps) => import("react/jsx-runtime").JSX.Element;
16
20
  export {};
@@ -2,59 +2,84 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import MuiLinearProgress from "@mui/material/LinearProgress";
3
3
  import Typography from "@mui/material/Typography";
4
4
  import Box from "@mui/material/Box";
5
- import { useTheme } from "@mui/material";
5
+ import { useTheme, Stack } from "@mui/material";
6
6
  const LinearProgress = (props) => {
7
- const { hideValueLabel, height = "8px" } = props;
7
+ var _a, _b, _c, _d, _e, _f, _g;
8
+ const { hideValueLabel, height = "8px", minContainerHeight = "30px" } = props;
8
9
  const theme = useTheme();
9
- const defaultStyleProperties = {
10
- lineColor: theme.custom.grey[1500],
11
- fontColor: theme.custom.grey[2500],
12
- fullUpLineColor: theme.custom.green[400],
13
- fullUpFontColor: theme.custom.green[400]
10
+ const cs = {
11
+ lineColor: ((_a = props.styleProperties) == null ? void 0 : _a.lineColor) || theme.custom.grey[1500],
12
+ fontColor: ((_b = props.styleProperties) == null ? void 0 : _b.fontColor) || theme.custom.grey[2500],
13
+ fullUpLineColor: ((_c = props.styleProperties) == null ? void 0 : _c.fullUpLineColor) || theme.custom.green[400],
14
+ fullUpFontColor: ((_d = props.styleProperties) == null ? void 0 : _d.fullUpFontColor) || theme.custom.green[400],
15
+ backgroundLineColor: ((_e = props.styleProperties) == null ? void 0 : _e.backgroundLineColor) || theme.custom.grey[400],
16
+ fontBackgroundColor: ((_f = props.styleProperties) == null ? void 0 : _f.fontBackgroundColor) || theme.custom.grey[400],
17
+ fontBackgroundCompleteColor: ((_g = props.styleProperties) == null ? void 0 : _g.fontBackgroundCompleteColor) || theme.custom.green[50]
14
18
  };
15
19
  const isFull = props.value >= 100;
16
- const getStyleProperties = () => {
17
- const mergedStyleProperties = {
18
- ...defaultStyleProperties,
19
- ...props.styleProperties
20
- };
21
- return {
22
- color: isFull ? mergedStyleProperties.fullUpLineColor : mergedStyleProperties.lineColor,
23
- fontColor: isFull ? mergedStyleProperties.fullUpFontColor : mergedStyleProperties.fontColor
24
- };
20
+ const currentStyleProperties = {
21
+ color: isFull ? cs.fullUpLineColor : cs.lineColor,
22
+ backgroundColor: cs.backgroundLineColor,
23
+ fontColor: isFull ? cs.fullUpFontColor : cs.fontColor,
24
+ fontBackgroundColor: isFull ? cs.fontBackgroundCompleteColor : cs.fontBackgroundColor
25
25
  };
26
- const currentStyleProperties = getStyleProperties();
27
- return /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: "5px" }, children: [
28
- /* @__PURE__ */ jsx(Box, { sx: { width: "100%", mr: 1 }, children: /* @__PURE__ */ jsx(
29
- MuiLinearProgress,
30
- {
31
- variant: "determinate",
32
- ...props,
33
- sx: {
34
- "&.MuiLinearProgress-determinate": {
35
- backgroundColor: theme.custom.grey[400],
36
- borderBottomLeftRadius: height,
37
- borderTopLeftRadius: height,
38
- borderTopRightRadius: height,
39
- borderBottomRightRadius: height,
40
- height
41
- },
42
- "& .MuiLinearProgress-bar": {
43
- backgroundColor: currentStyleProperties.color,
44
- borderRadius: height
26
+ return /* @__PURE__ */ jsxs(
27
+ Stack,
28
+ {
29
+ flexDirection: "row",
30
+ width: "100%",
31
+ justifyContent: "space-between",
32
+ alignItems: "center",
33
+ gap: theme.spacing(1),
34
+ minHeight: minContainerHeight,
35
+ children: [
36
+ /* @__PURE__ */ jsx(Box, { width: "100%", children: /* @__PURE__ */ jsx(
37
+ MuiLinearProgress,
38
+ {
39
+ variant: "determinate",
40
+ ...props,
41
+ sx: {
42
+ "&.MuiLinearProgress-determinate": {
43
+ backgroundColor: currentStyleProperties.backgroundColor,
44
+ borderBottomLeftRadius: height,
45
+ borderTopLeftRadius: height,
46
+ borderTopRightRadius: height,
47
+ borderBottomRightRadius: height,
48
+ height
49
+ },
50
+ "& .MuiLinearProgress-bar": {
51
+ backgroundColor: currentStyleProperties.color,
52
+ borderRadius: height
53
+ }
54
+ }
45
55
  }
46
- }
47
- }
48
- ) }),
49
- !hideValueLabel && /* @__PURE__ */ jsx(Box, { sx: { minWidth: 35 }, children: /* @__PURE__ */ jsx(
50
- Typography,
51
- {
52
- variant: isFull ? "body-bold" : "body",
53
- sx: { color: currentStyleProperties.fontColor },
54
- children: `${Math.round(props.value)}%`
55
- }
56
- ) })
57
- ] });
56
+ ) }),
57
+ !hideValueLabel && /* @__PURE__ */ jsx(
58
+ Box,
59
+ {
60
+ sx: {
61
+ minWidth: "50px",
62
+ display: "flex",
63
+ justifyContent: "center",
64
+ paddingInline: theme.spacing(0.5),
65
+ borderRadius: theme.spacing(0.5),
66
+ backgroundColor: currentStyleProperties.fontBackgroundColor
67
+ },
68
+ children: /* @__PURE__ */ jsx(
69
+ Typography,
70
+ {
71
+ variant: isFull ? "body-bold" : "body",
72
+ sx: {
73
+ color: currentStyleProperties.fontColor
74
+ },
75
+ children: `${Math.round(props.value)}%`
76
+ }
77
+ )
78
+ }
79
+ )
80
+ ]
81
+ }
82
+ );
58
83
  };
59
84
  export {
60
85
  LinearProgress
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useTheme, Box, PaginationItem, Stack, Typography } from "@mui/material";
3
3
  import { FoodsTooltip } from "../../Tooltip/FoodsTooltip.js";
4
- import { FoodsIcon } from "../../Icons/FoodsIcon.js";
4
+ import { FoodsTags } from "../../Tags/FoodsTags.js";
5
5
  const PageItem = (props) => {
6
6
  const theme = useTheme();
7
7
  const { selected, currentPage } = props;
@@ -29,26 +29,10 @@ const PageItem = (props) => {
29
29
  return /* @__PURE__ */ jsx(
30
30
  FoodsTooltip,
31
31
  {
32
- title: tooltipLabel !== void 0 && /* @__PURE__ */ jsxs(Stack, { width: "100%", justifyContent: "center", alignItems: "center", children: [
32
+ width: "auto",
33
+ title: tooltipLabel !== void 0 && /* @__PURE__ */ jsxs(Stack, { width: "100%", justifyContent: "center", alignItems: "center", gap: theme.spacing(1), children: [
33
34
  /* @__PURE__ */ jsx(Typography, { variant: "body-medium", children: tooltipLabel }),
34
- tooltipStatus === true && statusMessage !== void 0 && /* @__PURE__ */ jsxs(
35
- Stack,
36
- {
37
- flexDirection: "row",
38
- width: "100%",
39
- borderRadius: "4px",
40
- bgcolor: theme.custom.green[50],
41
- gap: theme.spacing(0.5),
42
- color: theme.custom.green[700],
43
- alignItems: "center",
44
- justifyContent: "center",
45
- padding: theme.spacing(0.25, 0.5),
46
- children: [
47
- /* @__PURE__ */ jsx(FoodsIcon, { size: 1, icon: "check" }),
48
- /* @__PURE__ */ jsx(Typography, { variant: "body-bold", sx: { color: theme.custom.green[700] }, children: statusMessage })
49
- ]
50
- }
51
- )
35
+ tooltipStatus === true && statusMessage !== void 0 && /* @__PURE__ */ jsx(FoodsTags, { variant: "tags-green", startIcon: "check", label: statusMessage, disabled: true })
52
36
  ] }),
53
37
  children: /* @__PURE__ */ jsx(
54
38
  Box,
@@ -29,7 +29,6 @@ export * from './Radio';
29
29
  export * from './RichTextEditor';
30
30
  export * from './Search';
31
31
  export * from './Select';
32
- export * from './Ssq';
33
32
  export * from './Tabs';
34
33
  export * from './Tags';
35
34
  export * from './Text';
package/dist/main.js CHANGED
@@ -126,7 +126,6 @@ import { RadioBoolean } from "./components/Radio/RadioBoolean.js";
126
126
  import { RichTextEditor } from "./components/RichTextEditor/RichTextEditor.js";
127
127
  import { FoodsSearch } from "./components/Search/FoodsSearch.js";
128
128
  import { FoodsSelect, FoodsSelectServerPagination } from "./components/Select/FoodsSelect/FoodsSelect.js";
129
- import { SsqCard } from "./components/Ssq/SsqCard.js";
130
129
  import { ButtonTabs } from "./components/Tabs/ButtonTabs.js";
131
130
  import { SectionTabs } from "./components/Tabs/SectionTabs/SectionTabs.js";
132
131
  import { BoxStyled, SecondaryTabs } from "./components/Tabs/SecondaryTabs.js";
@@ -286,7 +285,6 @@ export {
286
285
  SolidGreyBox,
287
286
  SpecialTab,
288
287
  SpecialTabs,
289
- SsqCard,
290
288
  SubMenu,
291
289
  SuggestionBlock,
292
290
  TertiaryToggleButton,
@@ -366,8 +366,7 @@ const components = {
366
366
  }
367
367
  } : {
368
368
  ":hover": {
369
- // cursor: "default",
370
- backgroundColor: theme.custom.grey[400]
369
+ cursor: "default"
371
370
  }
372
371
  }
373
372
  },
@@ -399,8 +398,7 @@ const components = {
399
398
  }
400
399
  } : {
401
400
  ":hover": {
402
- cursor: "default",
403
- backgroundColor: theme.custom.grey[400]
401
+ cursor: "default"
404
402
  }
405
403
  }
406
404
  },
@@ -432,8 +430,7 @@ const components = {
432
430
  }
433
431
  } : {
434
432
  ":hover": {
435
- cursor: "default",
436
- backgroundColor: theme.custom.grey[400]
433
+ cursor: "default"
437
434
  }
438
435
  }
439
436
  },
@@ -465,8 +462,7 @@ const components = {
465
462
  }
466
463
  } : {
467
464
  ":hover": {
468
- cursor: "default",
469
- backgroundColor: theme.custom.grey[400]
465
+ cursor: "default"
470
466
  }
471
467
  }
472
468
  },
@@ -499,8 +495,7 @@ const components = {
499
495
  }
500
496
  } : {
501
497
  ":hover": {
502
- cursor: "default",
503
- backgroundColor: theme.custom.grey[400]
498
+ cursor: "default"
504
499
  }
505
500
  }
506
501
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@foodpilot/foods",
3
3
  "private": false,
4
- "version": "2.11.20",
4
+ "version": "2.11.22",
5
5
  "type": "module",
6
6
  "main": "./dist/main.js",
7
7
  "module": "./dist/main.js",
@@ -1,26 +0,0 @@
1
- import { ElementType } from 'react';
2
- export type SsqCardProps = {
3
- heading: {
4
- title: string;
5
- description: string;
6
- contentUrl?: string;
7
- properties?: {
8
- "@id": string;
9
- title: string;
10
- fields: {
11
- "@id": string;
12
- type: string;
13
- }[];
14
- }[];
15
- };
16
- progress: {
17
- value: number;
18
- label: string;
19
- };
20
- link: {
21
- component: ElementType;
22
- to: string;
23
- label: string;
24
- };
25
- };
26
- export declare const SsqCard: (props: SsqCardProps) => JSX.Element | null;
@@ -1,57 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import ArrowForwardIcon from "@mui/icons-material/ArrowForward";
3
- import Box from "@mui/material/Box";
4
- import MuiCard from "@mui/material/Card";
5
- import CardActions from "@mui/material/CardActions";
6
- import CardContent from "@mui/material/CardContent";
7
- import Button from "@mui/material/Button";
8
- import Typography from "@mui/material/Typography";
9
- import { LinearProgress } from "../LinearProgress.js";
10
- const SsqCard = (props) => {
11
- return /* @__PURE__ */ jsx(Box, { sx: { minWidth: 205 }, children: /* @__PURE__ */ jsxs(MuiCard, { variant: "outlined", style: { borderRadius: "10px" }, children: [
12
- /* @__PURE__ */ jsxs(
13
- CardContent,
14
- {
15
- style: {
16
- textAlign: "left",
17
- marginLeft: "0.5rem",
18
- marginRight: "0.5rem"
19
- },
20
- children: [
21
- props.heading.contentUrl && /* @__PURE__ */ jsx("img", { src: props.heading.contentUrl, width: "30", alt: "icon-ssq" }),
22
- /* @__PURE__ */ jsx("div", { style: { minHeight: "100px", marginTop: "0.5rem" }, children: /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", component: "div", style: { fontWeight: "bold" }, children: props.heading.title }) }),
23
- /* @__PURE__ */ jsx(Typography, { variant: "caption", component: "div", children: props.progress.label }),
24
- /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(LinearProgress, { value: props.progress.value }) })
25
- ]
26
- }
27
- ),
28
- /* @__PURE__ */ jsx(
29
- CardActions,
30
- {
31
- style: {
32
- textAlign: "left",
33
- marginLeft: "0.5rem",
34
- marginRight: "0.5rem"
35
- },
36
- children: /* @__PURE__ */ jsxs(Box, { sx: { color: "#AA062B" }, children: [
37
- /* @__PURE__ */ jsx(
38
- Button,
39
- {
40
- variant: "text",
41
- size: "small",
42
- color: "inherit",
43
- style: { textTransform: "initial", fontWeight: "bold" },
44
- component: props.link.component,
45
- to: props.link.to,
46
- children: props.link.label
47
- }
48
- ),
49
- /* @__PURE__ */ jsx(ArrowForwardIcon, { color: "inherit", style: { verticalAlign: "middle" } })
50
- ] })
51
- }
52
- )
53
- ] }) });
54
- };
55
- export {
56
- SsqCard
57
- };
@@ -1 +0,0 @@
1
- export * from './SsqCard';