@foodpilot/foods 0.3.43 → 0.3.45

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.
@@ -5,8 +5,8 @@ type ComparisonBlockProps = {
5
5
  percentageDifference: string;
6
6
  comparedTo: {
7
7
  value: number;
8
- unit: string;
9
- label: string;
8
+ unit?: string;
9
+ label?: string;
10
10
  };
11
11
  iconName: keyof IconMapping;
12
12
  colors: ColorSet;
@@ -5,8 +5,8 @@ type ComparisonBlockProps = {
5
5
  percentageDifference: string;
6
6
  comparedTo: {
7
7
  value: number;
8
- unit: string;
9
- label: string;
8
+ unit?: string;
9
+ label?: string;
10
10
  };
11
11
  iconName: keyof IconMapping;
12
12
  colors: ColorSet;
@@ -3,10 +3,10 @@ import { ColorSet } from '../getColorAndArrow';
3
3
 
4
4
  type ComparisonBlockProps = {
5
5
  percentageDifference: string;
6
- comparedTo: {
7
- value: number;
8
- unit: string;
9
- label: string;
6
+ comparedTo?: {
7
+ value?: number;
8
+ unit?: string;
9
+ label?: string;
10
10
  };
11
11
  iconName: keyof IconMapping;
12
12
  colors: ColorSet;
@@ -5,8 +5,8 @@ type ComparisonBlockProps = {
5
5
  percentageDifference: string;
6
6
  comparedTo: {
7
7
  value: number;
8
- unit: string;
9
- label: string;
8
+ unit?: string;
9
+ label?: string;
10
10
  };
11
11
  iconName: keyof IconMapping;
12
12
  colors: ColorSet;
@@ -12,11 +12,11 @@ type ComparisonBlockProps = {
12
12
  currentValue: number;
13
13
  comparedTo: {
14
14
  value: number;
15
- unit: string;
16
- label: string;
15
+ unit?: string;
16
+ label?: string;
17
17
  };
18
- disableText?: boolean;
19
18
  improvement: Improvement;
19
+ disableText?: boolean;
20
20
  comparisonText?: string;
21
21
  layout?: Layout;
22
22
  };
package/dist/main.js CHANGED
@@ -42291,14 +42291,7 @@ const wre = (e) => {
42291
42291
  }
42292
42292
  );
42293
42293
  }, DU = (e) => {
42294
- const {
42295
- percentageDifference: t,
42296
- comparedTo: n,
42297
- comparisonText: o,
42298
- iconName: r,
42299
- colors: i,
42300
- disableText: a
42301
- } = e;
42294
+ const { percentageDifference: t, comparedTo: n, comparisonText: o, iconName: r, colors: i, disableText: a } = e;
42302
42295
  return /* @__PURE__ */ p.jsxs(Ue, { direction: "row", alignItems: "center", gap: "2px", flexWrap: "wrap", className: "comparison-block-wrapper", children: [
42303
42296
  /* @__PURE__ */ p.jsxs(
42304
42297
  be,
@@ -42317,45 +42310,20 @@ const wre = (e) => {
42317
42310
  },
42318
42311
  children: [
42319
42312
  /* @__PURE__ */ p.jsx(Vn, { icon: r, size: 1 }),
42320
- /* @__PURE__ */ p.jsx(be, { display: "flex", alignItems: "center", flexDirection: "row", gap: "8px", children: /* @__PURE__ */ p.jsx(
42321
- ve,
42322
- {
42323
- component: "span",
42324
- variant: "h6",
42325
- children: t
42326
- }
42327
- ) })
42313
+ /* @__PURE__ */ p.jsx(be, { display: "flex", alignItems: "center", flexDirection: "row", gap: "8px", children: /* @__PURE__ */ p.jsx(ve, { component: "span", variant: "h6", children: t }) })
42328
42314
  ]
42329
42315
  }
42330
42316
  ),
42331
42317
  !a && /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
42332
- /* @__PURE__ */ p.jsxs(ve, { component: "span", variant: "small", children: [
42318
+ o !== void 0 && (n == null ? void 0 : n.label) !== void 0 && /* @__PURE__ */ p.jsxs(ve, { component: "span", variant: "small", children: [
42333
42319
  o,
42334
42320
  " ",
42335
- /* @__PURE__ */ p.jsx(
42336
- ve,
42337
- {
42338
- component: "span",
42339
- variant: "small",
42340
- fontWeight: 600,
42341
- children: n.label
42342
- }
42343
- )
42321
+ /* @__PURE__ */ p.jsx(ve, { component: "span", variant: "small", fontWeight: 600, children: n.label })
42344
42322
  ] }),
42345
- " ",
42346
- /* @__PURE__ */ p.jsxs(ve, { component: "div", variant: "h6", children: [
42323
+ (n == null ? void 0 : n.value) !== void 0 && (n == null ? void 0 : n.unit) !== void 0 && /* @__PURE__ */ p.jsxs(ve, { component: "div", variant: "h6", children: [
42347
42324
  "(",
42348
42325
  n.value,
42349
- " ",
42350
- /* @__PURE__ */ p.jsx(
42351
- ve,
42352
- {
42353
- color: "#A3A2A0",
42354
- component: "span",
42355
- fontSize: "0.625rem",
42356
- children: n.unit
42357
- }
42358
- ),
42326
+ /* @__PURE__ */ p.jsx(ve, { color: "#A3A2A0", component: "span", fontSize: "0.625rem", children: n.unit }),
42359
42327
  ")"
42360
42328
  ] })
42361
42329
  ] })
@@ -42389,123 +42357,73 @@ const wre = (e) => {
42389
42357
  icon: a
42390
42358
  };
42391
42359
  }, AU = (e) => {
42392
- const {
42393
- percentageDifference: t,
42394
- comparedTo: n,
42395
- comparisonText: o,
42396
- iconName: r,
42397
- colors: i
42398
- } = e;
42360
+ const { percentageDifference: t, comparedTo: n, comparisonText: o, iconName: r, colors: i } = e;
42399
42361
  return /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
42400
42362
  /* @__PURE__ */ p.jsxs(be, { display: "flex", alignItems: "center", gap: "8px", mb: "4px", children: [
42401
- /* @__PURE__ */ p.jsx(ku, { icon: r, size: 3, boxProps: {
42402
- sx: {
42403
- backgroundColor: i.primaryColor,
42404
- borderRadius: "32px",
42405
- color: "#fff"
42406
- }
42407
- } }),
42408
42363
  /* @__PURE__ */ p.jsx(
42409
- ve,
42364
+ ku,
42410
42365
  {
42411
- component: "span",
42412
- variant: "h2",
42413
- children: t
42366
+ icon: r,
42367
+ size: 3,
42368
+ boxProps: {
42369
+ sx: {
42370
+ backgroundColor: i.primaryColor,
42371
+ borderRadius: "32px",
42372
+ color: "#fff"
42373
+ }
42374
+ }
42414
42375
  }
42415
- )
42376
+ ),
42377
+ /* @__PURE__ */ p.jsx(ve, { component: "span", variant: "h2", children: t })
42416
42378
  ] }),
42417
- /* @__PURE__ */ p.jsxs(ve, { component: "span", variant: "body", children: [
42379
+ o !== void 0 && (n == null ? void 0 : n.label) !== void 0 && /* @__PURE__ */ p.jsxs(ve, { component: "span", variant: "body", children: [
42418
42380
  o,
42419
42381
  " ",
42420
- /* @__PURE__ */ p.jsx(
42421
- ve,
42422
- {
42423
- component: "span",
42424
- variant: "body",
42425
- fontWeight: 600,
42426
- children: n.label
42427
- }
42428
- )
42382
+ /* @__PURE__ */ p.jsx(ve, { component: "span", variant: "body", fontWeight: 600, children: n.label })
42429
42383
  ] }),
42430
- /* @__PURE__ */ p.jsxs(ve, { component: "div", variant: "h4", fontSize: "0.875rem", children: [
42384
+ (n == null ? void 0 : n.value) !== void 0 && (n == null ? void 0 : n.unit) !== void 0 && /* @__PURE__ */ p.jsxs(ve, { component: "div", variant: "h4", fontSize: "0.875rem", children: [
42431
42385
  "(",
42432
42386
  n.value,
42433
42387
  " ",
42434
- /* @__PURE__ */ p.jsx(
42435
- ve,
42436
- {
42437
- color: "#A3A2A0",
42438
- component: "span",
42439
- fontSize: "0.625rem",
42440
- children: n.unit
42441
- }
42442
- ),
42388
+ /* @__PURE__ */ p.jsx(ve, { color: "#A3A2A0", component: "span", fontSize: "0.625rem", children: n.unit }),
42443
42389
  ")"
42444
42390
  ] })
42445
42391
  ] });
42446
42392
  }, VU = (e) => {
42447
- const {
42448
- percentageDifference: t,
42449
- comparedTo: n,
42450
- iconName: o,
42451
- colors: r,
42452
- comparisonText: i
42453
- } = e;
42393
+ const { percentageDifference: t, comparedTo: n, iconName: o, colors: r, comparisonText: i } = e;
42454
42394
  return /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
42455
42395
  /* @__PURE__ */ p.jsxs(be, { display: "flex", alignItems: "center", gap: "8px", children: [
42456
- /* @__PURE__ */ p.jsx(ku, { icon: o, size: 0.5, boxProps: {
42457
- sx: {
42458
- backgroundColor: r.primaryColor,
42459
- borderRadius: "32px",
42460
- color: "#fff"
42461
- }
42462
- } }),
42463
42396
  /* @__PURE__ */ p.jsx(
42464
- ve,
42397
+ ku,
42465
42398
  {
42466
- component: "span",
42467
- variant: "h4",
42468
- children: t
42399
+ icon: o,
42400
+ size: 0.5,
42401
+ boxProps: {
42402
+ sx: {
42403
+ backgroundColor: r.primaryColor,
42404
+ borderRadius: "32px",
42405
+ color: "#fff"
42406
+ }
42407
+ }
42469
42408
  }
42470
- )
42409
+ ),
42410
+ /* @__PURE__ */ p.jsx(ve, { component: "span", variant: "h4", children: t })
42471
42411
  ] }),
42472
- /* @__PURE__ */ p.jsxs(ve, { component: "span", variant: "small", children: [
42412
+ i !== void 0 && (n == null ? void 0 : n.label) !== void 0 && /* @__PURE__ */ p.jsxs(ve, { component: "span", variant: "small", children: [
42473
42413
  i,
42474
42414
  " ",
42475
- /* @__PURE__ */ p.jsx(
42476
- ve,
42477
- {
42478
- component: "span",
42479
- variant: "body",
42480
- fontWeight: 600,
42481
- children: n.label
42482
- }
42483
- )
42415
+ /* @__PURE__ */ p.jsx(ve, { component: "span", variant: "body", fontWeight: 600, children: n.label })
42484
42416
  ] }),
42485
- /* @__PURE__ */ p.jsxs(ve, { component: "div", fontWeight: 700, fontSize: "0.625rem", children: [
42417
+ (n == null ? void 0 : n.value) !== void 0 && (n == null ? void 0 : n.unit) !== void 0 && /* @__PURE__ */ p.jsxs(ve, { component: "div", fontWeight: 700, fontSize: "0.625rem", children: [
42486
42418
  "(",
42487
42419
  n.value,
42488
42420
  " ",
42489
- /* @__PURE__ */ p.jsx(
42490
- ve,
42491
- {
42492
- color: "#A3A2A0",
42493
- component: "span",
42494
- fontSize: "0.625rem",
42495
- children: n.unit
42496
- }
42497
- ),
42421
+ /* @__PURE__ */ p.jsx(ve, { color: "#A3A2A0", component: "span", fontSize: "0.625rem", children: n.unit }),
42498
42422
  ")"
42499
42423
  ] })
42500
42424
  ] });
42501
42425
  }, $U = (e) => {
42502
- const {
42503
- percentageDifference: t,
42504
- comparedTo: n,
42505
- iconName: o,
42506
- colors: r,
42507
- comparisonText: i
42508
- } = e;
42426
+ const { percentageDifference: t, comparedTo: n, iconName: o, colors: r, comparisonText: i } = e;
42509
42427
  return /* @__PURE__ */ p.jsx(p.Fragment, { children: /* @__PURE__ */ p.jsxs(be, { display: "flex", alignItems: "center", flexDirection: "row", gap: "8px", mb: "4px", flexWrap: "wrap", children: [
42510
42428
  /* @__PURE__ */ p.jsx(
42511
42429
  ku,
@@ -42521,40 +42439,17 @@ const wre = (e) => {
42521
42439
  }
42522
42440
  }
42523
42441
  ),
42524
- /* @__PURE__ */ p.jsx(
42525
- ve,
42526
- {
42527
- component: "span",
42528
- variant: "h2",
42529
- children: t
42530
- }
42531
- ),
42532
- /* @__PURE__ */ p.jsxs(ve, { component: "span", variant: "body", children: [
42442
+ /* @__PURE__ */ p.jsx(ve, { component: "span", variant: "h2", children: t }),
42443
+ i !== void 0 && (n == null ? void 0 : n.label) !== void 0 && /* @__PURE__ */ p.jsxs(ve, { component: "span", variant: "body", children: [
42533
42444
  i,
42534
42445
  " ",
42535
- /* @__PURE__ */ p.jsx(
42536
- ve,
42537
- {
42538
- component: "span",
42539
- variant: "body",
42540
- fontWeight: 600,
42541
- children: n.label
42542
- }
42543
- )
42446
+ /* @__PURE__ */ p.jsx(ve, { component: "span", variant: "body", fontWeight: 600, children: n.label })
42544
42447
  ] }),
42545
- /* @__PURE__ */ p.jsxs(ve, { component: "div", fontWeight: 700, fontSize: "0.875rem", children: [
42448
+ (n == null ? void 0 : n.value) !== void 0 && (n == null ? void 0 : n.unit) !== void 0 && /* @__PURE__ */ p.jsxs(ve, { component: "div", fontWeight: 700, fontSize: "0.875rem", children: [
42546
42449
  "(",
42547
42450
  n.value,
42548
42451
  " ",
42549
- /* @__PURE__ */ p.jsx(
42550
- ve,
42551
- {
42552
- color: "#A3A2A0",
42553
- component: "span",
42554
- fontSize: "0.625rem",
42555
- children: n.unit
42556
- }
42557
- ),
42452
+ /* @__PURE__ */ p.jsx(ve, { color: "#A3A2A0", component: "span", fontSize: "0.625rem", children: n.unit }),
42558
42453
  ")"
42559
42454
  ] })
42560
42455
  ] }) });
@@ -42605,7 +42500,10 @@ const wre = (e) => {
42605
42500
  },
42606
42501
  disableText: a = !1
42607
42502
  // works only for horizontal-m;
42608
- } = e, l = LU(t, n.value, o), d = `${n.value > 0 ? Math.round(Math.abs(100 - t / n.value * 100)) : "N/A"} %`;
42503
+ } = e;
42504
+ if (n === void 0 || n.value === void 0)
42505
+ throw new Error("comparedTo.value is required for ComparisonBlock");
42506
+ const l = LU(t, n.value, o), d = `${n.value > 0 ? Math.round(Math.abs(100 - t / n.value * 100)) : "N/A"} %`;
42609
42507
  if (i.direction === "vertical")
42610
42508
  return /* @__PURE__ */ p.jsxs(
42611
42509
  be,
@@ -64627,8 +64525,12 @@ const rie = (e) => /* @__PURE__ */ p.jsx(be, { sx: { minWidth: 205 }, children:
64627
64525
  "aria-controls": `tabpanel-${e}`
64628
64526
  }), Dne = W(be)(({ theme: e }) => () => ({
64629
64527
  "&.secondary-tabs-wrapper": {
64528
+ width: "100%",
64529
+ border: `1px solid ${Re[500]}`,
64530
+ borderRadius: "12px",
64630
64531
  "& > .secondary-tabs": {
64631
- background: Re[200],
64532
+ borderTopLeftRadius: "12px",
64533
+ borderTopRightRadius: "12px",
64632
64534
  "& .MuiTabs-indicator": {
64633
64535
  backgroundColor: e.palette.background.paper
64634
64536
  },
@@ -64674,6 +64576,8 @@ const rie = (e) => /* @__PURE__ */ p.jsx(be, { sx: { minWidth: 205 }, children:
64674
64576
  }
64675
64577
  },
64676
64578
  "& .secondary-tabs-content": {
64579
+ borderBottomLeftRadius: "12px",
64580
+ borderBottomRightRadius: "12px",
64677
64581
  padding: "1.5rem",
64678
64582
  backgroundColor: e.palette.background.paper
64679
64583
  }