@mantajs/dashboard 0.1.7 → 0.1.9

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/app.js CHANGED
@@ -100375,10 +100375,11 @@ var init_user_menu2 = __esm({
100375
100375
  });
100376
100376
 
100377
100377
  // src/components/layout/main-layout/main-layout.tsx
100378
- var import_icons10, import_ui14, import_radix_ui5, import_react_i18next10, import_react_router_dom9, import_menu_config, import_jsx_runtime22, ICON_MAP, MainLayout, MainSidebar, Logout2, Header, getDefaultMedusaRoutes, useCoreRoutes, Searchbar, CoreRouteSection, getMainMenuPaths, MAIN_MENU_PATHS, ExtensionRouteSection, UtilitySection, UserSection;
100378
+ var MedusaIcons, import_icons10, import_ui14, import_radix_ui5, import_react_i18next10, import_react_router_dom9, import_menu_config, import_jsx_runtime22, getIcon, MainLayout, MainSidebar, Logout2, Header, getDefaultMedusaRoutes, useCoreRoutes, Searchbar, CoreRouteSection, getMainMenuPaths, MAIN_MENU_PATHS, ExtensionRouteSection, UtilitySection, UserSection;
100379
100379
  var init_main_layout = __esm({
100380
100380
  "src/components/layout/main-layout/main-layout.tsx"() {
100381
100381
  "use strict";
100382
+ MedusaIcons = __toESM(require("@medusajs/icons"));
100382
100383
  import_icons10 = require("@medusajs/icons");
100383
100384
  import_ui14 = require("@medusajs/ui");
100384
100385
  import_radix_ui5 = require("radix-ui");
@@ -100396,16 +100397,9 @@ var init_main_layout = __esm({
100396
100397
  init_use_document_direction();
100397
100398
  import_menu_config = __toESM(require("virtual:dashboard/menu-config"));
100398
100399
  import_jsx_runtime22 = require("react/jsx-runtime");
100399
- ICON_MAP = {
100400
- ShoppingCart: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.ShoppingCart, {}),
100401
- Tag: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.Tag, {}),
100402
- Buildings: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.Buildings, {}),
100403
- Users: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.Users, {}),
100404
- ReceiptPercent: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.ReceiptPercent, {}),
100405
- CurrencyDollar: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.CurrencyDollar, {}),
100406
- BuildingStorefront: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.BuildingStorefront, {}),
100407
- CogSixTooth: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.CogSixTooth, {}),
100408
- SquaresPlus: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.SquaresPlus, {})
100400
+ getIcon = (name) => {
100401
+ const IconComponent = MedusaIcons[name] || MedusaIcons.SquaresPlus;
100402
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(IconComponent, {});
100409
100403
  };
100410
100404
  MainLayout = () => {
100411
100405
  return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(MainSidebar, {}) });
@@ -100511,7 +100505,7 @@ var init_main_layout = __esm({
100511
100505
  ] }),
100512
100506
  /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_ui14.DropdownMenu.Separator, {}),
100513
100507
  /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_ui14.DropdownMenu.Item, { className: "gap-x-2", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_react_router_dom9.Link, { to: "/settings/store", children: [
100514
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.BuildingStorefront, { className: "text-ui-fg-subtle" }),
100508
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(BuildingStorefront, { className: "text-ui-fg-subtle" }),
100515
100509
  t5("app.nav.main.storeSettings")
100516
100510
  ] }) }),
100517
100511
  /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_ui14.DropdownMenu.Separator, {}),
@@ -100522,21 +100516,21 @@ var init_main_layout = __esm({
100522
100516
  ) });
100523
100517
  };
100524
100518
  getDefaultMedusaRoutes = (t5) => [
100525
- { icon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.ShoppingCart, {}), label: t5("orders.domain"), to: "/orders", items: [] },
100526
- { icon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.Tag, {}), label: t5("products.domain"), to: "/products", items: [
100519
+ { icon: getIcon("ShoppingCart"), label: t5("orders.domain"), to: "/orders", items: [] },
100520
+ { icon: getIcon("Tag"), label: t5("products.domain"), to: "/products", items: [
100527
100521
  { label: t5("collections.domain"), to: "/collections" },
100528
100522
  { label: t5("categories.domain"), to: "/categories" }
100529
100523
  ] },
100530
- { icon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.Buildings, {}), label: t5("inventory.domain"), to: "/inventory", items: [
100524
+ { icon: getIcon("Buildings"), label: t5("inventory.domain"), to: "/inventory", items: [
100531
100525
  { label: t5("reservations.domain"), to: "/reservations" }
100532
100526
  ] },
100533
- { icon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.Users, {}), label: t5("customers.domain"), to: "/customers", items: [
100527
+ { icon: getIcon("Users"), label: t5("customers.domain"), to: "/customers", items: [
100534
100528
  { label: t5("customerGroups.domain"), to: "/customer-groups" }
100535
100529
  ] },
100536
- { icon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.ReceiptPercent, {}), label: t5("promotions.domain"), to: "/promotions", items: [
100530
+ { icon: getIcon("ReceiptPercent"), label: t5("promotions.domain"), to: "/promotions", items: [
100537
100531
  { label: t5("campaigns.domain"), to: "/campaigns" }
100538
100532
  ] },
100539
- { icon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.CurrencyDollar, {}), label: t5("priceLists.domain"), to: "/price-lists" }
100533
+ { icon: getIcon("CurrencyDollar"), label: t5("priceLists.domain"), to: "/price-lists" }
100540
100534
  ];
100541
100535
  useCoreRoutes = () => {
100542
100536
  const { t: t5 } = (0, import_react_i18next10.useTranslation)();
@@ -100544,7 +100538,7 @@ var init_main_layout = __esm({
100544
100538
  return getDefaultMedusaRoutes(t5);
100545
100539
  }
100546
100540
  return import_menu_config.default.items.map((item) => ({
100547
- icon: ICON_MAP[item.icon] || /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.SquaresPlus, {}),
100541
+ icon: getIcon(item.icon),
100548
100542
  label: item.useTranslation ? t5(item.label) : item.label,
100549
100543
  to: item.to,
100550
100544
  items: item.items?.map((sub2) => ({
@@ -100628,7 +100622,7 @@ var init_main_layout = __esm({
100628
100622
  {
100629
100623
  to: item.to,
100630
100624
  label: item.label,
100631
- icon: item.icon ? item.icon : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.SquaresPlus, {}),
100625
+ icon: item.icon ? item.icon : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SquaresPlus, {}),
100632
100626
  items: item.items,
100633
100627
  translationNs: item.translationNs,
100634
100628
  type: "extension"
@@ -100648,7 +100642,7 @@ var init_main_layout = __esm({
100648
100642
  label: t5("app.nav.settings.header"),
100649
100643
  to: "/settings",
100650
100644
  from: location.pathname,
100651
- icon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.CogSixTooth, {})
100645
+ icon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CogSixTooth, {})
100652
100646
  }
100653
100647
  ) });
100654
100648
  };
package/dist/app.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DashboardApp
3
- } from "./chunk-ZQVS3F3X.mjs";
3
+ } from "./chunk-DWLO2F7H.mjs";
4
4
  import "./chunk-2SSUH2HJ.mjs";
5
5
  import "./chunk-ONB3JEHR.mjs";
6
6
  import "./chunk-YCDDT44O.mjs";
@@ -94515,21 +94515,13 @@ var ProtectedRoute = () => {
94515
94515
  };
94516
94516
 
94517
94517
  // src/components/layout/main-layout/main-layout.tsx
94518
+ import * as MedusaIcons from "@medusajs/icons";
94518
94519
  import {
94519
- BuildingStorefront,
94520
- Buildings,
94521
94520
  ChevronDownMini,
94522
- CogSixTooth,
94523
- CurrencyDollar,
94524
94521
  EllipsisHorizontal as EllipsisHorizontal2,
94525
94522
  MagnifyingGlass as MagnifyingGlass2,
94526
94523
  MinusMini,
94527
- OpenRectArrowOut as OpenRectArrowOut2,
94528
- ReceiptPercent,
94529
- ShoppingCart,
94530
- SquaresPlus,
94531
- Tag,
94532
- Users
94524
+ OpenRectArrowOut as OpenRectArrowOut2
94533
94525
  } from "@medusajs/icons";
94534
94526
  import { Avatar as Avatar2, Divider, DropdownMenu as DropdownMenu3, Text as Text5, clx as clx6 } from "@medusajs/ui";
94535
94527
  import { Collapsible as RadixCollapsible2 } from "radix-ui";
@@ -95394,16 +95386,9 @@ var UserItem = () => {
95394
95386
  // src/components/layout/main-layout/main-layout.tsx
95395
95387
  import menuConfig from "virtual:dashboard/menu-config";
95396
95388
  import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
95397
- var ICON_MAP = {
95398
- ShoppingCart: /* @__PURE__ */ jsx13(ShoppingCart, {}),
95399
- Tag: /* @__PURE__ */ jsx13(Tag, {}),
95400
- Buildings: /* @__PURE__ */ jsx13(Buildings, {}),
95401
- Users: /* @__PURE__ */ jsx13(Users, {}),
95402
- ReceiptPercent: /* @__PURE__ */ jsx13(ReceiptPercent, {}),
95403
- CurrencyDollar: /* @__PURE__ */ jsx13(CurrencyDollar, {}),
95404
- BuildingStorefront: /* @__PURE__ */ jsx13(BuildingStorefront, {}),
95405
- CogSixTooth: /* @__PURE__ */ jsx13(CogSixTooth, {}),
95406
- SquaresPlus: /* @__PURE__ */ jsx13(SquaresPlus, {})
95389
+ var getIcon = (name) => {
95390
+ const IconComponent = MedusaIcons[name] || MedusaIcons.SquaresPlus;
95391
+ return /* @__PURE__ */ jsx13(IconComponent, {});
95407
95392
  };
95408
95393
  var MainLayout = () => {
95409
95394
  return /* @__PURE__ */ jsx13(Shell, { children: /* @__PURE__ */ jsx13(MainSidebar, {}) });
@@ -95520,21 +95505,21 @@ var Header = () => {
95520
95505
  ) });
95521
95506
  };
95522
95507
  var getDefaultMedusaRoutes = (t2) => [
95523
- { icon: /* @__PURE__ */ jsx13(ShoppingCart, {}), label: t2("orders.domain"), to: "/orders", items: [] },
95524
- { icon: /* @__PURE__ */ jsx13(Tag, {}), label: t2("products.domain"), to: "/products", items: [
95508
+ { icon: getIcon("ShoppingCart"), label: t2("orders.domain"), to: "/orders", items: [] },
95509
+ { icon: getIcon("Tag"), label: t2("products.domain"), to: "/products", items: [
95525
95510
  { label: t2("collections.domain"), to: "/collections" },
95526
95511
  { label: t2("categories.domain"), to: "/categories" }
95527
95512
  ] },
95528
- { icon: /* @__PURE__ */ jsx13(Buildings, {}), label: t2("inventory.domain"), to: "/inventory", items: [
95513
+ { icon: getIcon("Buildings"), label: t2("inventory.domain"), to: "/inventory", items: [
95529
95514
  { label: t2("reservations.domain"), to: "/reservations" }
95530
95515
  ] },
95531
- { icon: /* @__PURE__ */ jsx13(Users, {}), label: t2("customers.domain"), to: "/customers", items: [
95516
+ { icon: getIcon("Users"), label: t2("customers.domain"), to: "/customers", items: [
95532
95517
  { label: t2("customerGroups.domain"), to: "/customer-groups" }
95533
95518
  ] },
95534
- { icon: /* @__PURE__ */ jsx13(ReceiptPercent, {}), label: t2("promotions.domain"), to: "/promotions", items: [
95519
+ { icon: getIcon("ReceiptPercent"), label: t2("promotions.domain"), to: "/promotions", items: [
95535
95520
  { label: t2("campaigns.domain"), to: "/campaigns" }
95536
95521
  ] },
95537
- { icon: /* @__PURE__ */ jsx13(CurrencyDollar, {}), label: t2("priceLists.domain"), to: "/price-lists" }
95522
+ { icon: getIcon("CurrencyDollar"), label: t2("priceLists.domain"), to: "/price-lists" }
95538
95523
  ];
95539
95524
  var useCoreRoutes = () => {
95540
95525
  const { t: t2 } = useTranslation9();
@@ -95542,7 +95527,7 @@ var useCoreRoutes = () => {
95542
95527
  return getDefaultMedusaRoutes(t2);
95543
95528
  }
95544
95529
  return menuConfig.items.map((item) => ({
95545
- icon: ICON_MAP[item.icon] || /* @__PURE__ */ jsx13(SquaresPlus, {}),
95530
+ icon: getIcon(item.icon),
95546
95531
  label: item.useTranslation ? t2(item.label) : item.label,
95547
95532
  to: item.to,
95548
95533
  items: item.items?.map((sub) => ({
@@ -95961,7 +95946,7 @@ function getRouteMap({
95961
95946
  children: [
95962
95947
  {
95963
95948
  path: "create",
95964
- lazy: () => import("./product-create-P26FHFTZ.mjs")
95949
+ lazy: () => import("./product-create-5HMCLMAO.mjs")
95965
95950
  },
95966
95951
  {
95967
95952
  path: "import",
@@ -95977,7 +95962,7 @@ function getRouteMap({
95977
95962
  path: ":id",
95978
95963
  errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
95979
95964
  lazy: async () => {
95980
- const { Breadcrumb, loader } = await import("./product-detail-6VCLGLEL.mjs");
95965
+ const { Breadcrumb, loader } = await import("./product-detail-D2EGSWFF.mjs");
95981
95966
  return {
95982
95967
  Component: Outlet4,
95983
95968
  loader,
@@ -95989,11 +95974,11 @@ function getRouteMap({
95989
95974
  children: [
95990
95975
  {
95991
95976
  path: "",
95992
- lazy: () => import("./product-detail-6VCLGLEL.mjs"),
95977
+ lazy: () => import("./product-detail-D2EGSWFF.mjs"),
95993
95978
  children: [
95994
95979
  {
95995
95980
  path: "edit",
95996
- lazy: () => import("./product-edit-D75EWPGG.mjs")
95981
+ lazy: () => import("./product-edit-4HWE7N3O.mjs")
95997
95982
  },
95998
95983
  {
95999
95984
  path: "edit-variant",
@@ -96005,11 +95990,11 @@ function getRouteMap({
96005
95990
  },
96006
95991
  {
96007
95992
  path: "attributes",
96008
- lazy: () => import("./product-attributes-DZZZDS2K.mjs")
95993
+ lazy: () => import("./product-attributes-UJ4WTBZH.mjs")
96009
95994
  },
96010
95995
  {
96011
95996
  path: "organization",
96012
- lazy: () => import("./product-organization-FESACGNN.mjs")
95997
+ lazy: () => import("./product-organization-2Q76MMR4.mjs")
96013
95998
  },
96014
95999
  {
96015
96000
  path: "shipping-profile",
@@ -15,7 +15,7 @@ import {
15
15
  import {
16
16
  FormExtensionZone,
17
17
  useExtendableForm
18
- } from "./chunk-ZQVS3F3X.mjs";
18
+ } from "./chunk-DWLO2F7H.mjs";
19
19
  import "./chunk-2SSUH2HJ.mjs";
20
20
  import "./chunk-ONB3JEHR.mjs";
21
21
  import "./chunk-YCDDT44O.mjs";
@@ -57,7 +57,7 @@ import {
57
57
  import {
58
58
  FormExtensionZone,
59
59
  useExtendableForm
60
- } from "./chunk-ZQVS3F3X.mjs";
60
+ } from "./chunk-DWLO2F7H.mjs";
61
61
  import "./chunk-2SSUH2HJ.mjs";
62
62
  import "./chunk-ONB3JEHR.mjs";
63
63
  import "./chunk-YCDDT44O.mjs";
@@ -17,7 +17,7 @@ import {
17
17
  } from "./chunk-GIZFNLKK.mjs";
18
18
  import {
19
19
  getLinkedFields
20
- } from "./chunk-ZQVS3F3X.mjs";
20
+ } from "./chunk-DWLO2F7H.mjs";
21
21
  import "./chunk-2SSUH2HJ.mjs";
22
22
  import "./chunk-ONB3JEHR.mjs";
23
23
  import "./chunk-YCDDT44O.mjs";
@@ -18,7 +18,7 @@ import {
18
18
  import {
19
19
  FormExtensionZone,
20
20
  useExtendableForm
21
- } from "./chunk-ZQVS3F3X.mjs";
21
+ } from "./chunk-DWLO2F7H.mjs";
22
22
  import "./chunk-2SSUH2HJ.mjs";
23
23
  import "./chunk-ONB3JEHR.mjs";
24
24
  import "./chunk-YCDDT44O.mjs";
@@ -20,7 +20,7 @@ import {
20
20
  import {
21
21
  FormExtensionZone,
22
22
  useExtendableForm
23
- } from "./chunk-ZQVS3F3X.mjs";
23
+ } from "./chunk-DWLO2F7H.mjs";
24
24
  import "./chunk-2SSUH2HJ.mjs";
25
25
  import "./chunk-ONB3JEHR.mjs";
26
26
  import "./chunk-YCDDT44O.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mantajs/dashboard",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "B2B Admin Dashboard for Medusa - Fork of @medusajs/dashboard",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -1,18 +1,10 @@
1
+ import * as MedusaIcons from "@medusajs/icons"
1
2
  import {
2
- BuildingStorefront,
3
- Buildings,
4
3
  ChevronDownMini,
5
- CogSixTooth,
6
- CurrencyDollar,
7
4
  EllipsisHorizontal,
8
5
  MagnifyingGlass,
9
6
  MinusMini,
10
7
  OpenRectArrowOut,
11
- ReceiptPercent,
12
- ShoppingCart,
13
- SquaresPlus,
14
- Tag,
15
- Users,
16
8
  } from "@medusajs/icons"
17
9
  import { Avatar, Divider, DropdownMenu, Text, clx } from "@medusajs/ui"
18
10
  import { Collapsible as RadixCollapsible } from "radix-ui"
@@ -33,16 +25,9 @@ import { useDocumentDirection } from "../../../hooks/use-document-direction"
33
25
  import menuConfig from "virtual:dashboard/menu-config"
34
26
  import type { MenuConfig } from "../../../vite-plugin/types"
35
27
 
36
- const ICON_MAP: Record<string, React.ReactNode> = {
37
- ShoppingCart: <ShoppingCart />,
38
- Tag: <Tag />,
39
- Buildings: <Buildings />,
40
- Users: <Users />,
41
- ReceiptPercent: <ReceiptPercent />,
42
- CurrencyDollar: <CurrencyDollar />,
43
- BuildingStorefront: <BuildingStorefront />,
44
- CogSixTooth: <CogSixTooth />,
45
- SquaresPlus: <SquaresPlus />,
28
+ const getIcon = (name: string): React.ReactNode => {
29
+ const IconComponent = (MedusaIcons as any)[name] || MedusaIcons.SquaresPlus
30
+ return <IconComponent />
46
31
  }
47
32
 
48
33
  export const MainLayout = () => {
@@ -192,21 +177,21 @@ const Header = () => {
192
177
  }
193
178
 
194
179
  const getDefaultMedusaRoutes = (t: (key: string) => string): Omit<INavItem, "pathname">[] => [
195
- { icon: <ShoppingCart />, label: t("orders.domain"), to: "/orders", items: [] },
196
- { icon: <Tag />, label: t("products.domain"), to: "/products", items: [
180
+ { icon: getIcon("ShoppingCart"), label: t("orders.domain"), to: "/orders", items: [] },
181
+ { icon: getIcon("Tag"), label: t("products.domain"), to: "/products", items: [
197
182
  { label: t("collections.domain"), to: "/collections" },
198
183
  { label: t("categories.domain"), to: "/categories" },
199
184
  ]},
200
- { icon: <Buildings />, label: t("inventory.domain"), to: "/inventory", items: [
185
+ { icon: getIcon("Buildings"), label: t("inventory.domain"), to: "/inventory", items: [
201
186
  { label: t("reservations.domain"), to: "/reservations" },
202
187
  ]},
203
- { icon: <Users />, label: t("customers.domain"), to: "/customers", items: [
188
+ { icon: getIcon("Users"), label: t("customers.domain"), to: "/customers", items: [
204
189
  { label: t("customerGroups.domain"), to: "/customer-groups" },
205
190
  ]},
206
- { icon: <ReceiptPercent />, label: t("promotions.domain"), to: "/promotions", items: [
191
+ { icon: getIcon("ReceiptPercent"), label: t("promotions.domain"), to: "/promotions", items: [
207
192
  { label: t("campaigns.domain"), to: "/campaigns" },
208
193
  ]},
209
- { icon: <CurrencyDollar />, label: t("priceLists.domain"), to: "/price-lists" },
194
+ { icon: getIcon("CurrencyDollar"), label: t("priceLists.domain"), to: "/price-lists" },
210
195
  ]
211
196
 
212
197
  const useCoreRoutes = (): Omit<INavItem, "pathname">[] => {
@@ -217,7 +202,7 @@ const useCoreRoutes = (): Omit<INavItem, "pathname">[] => {
217
202
  }
218
203
 
219
204
  return (menuConfig as MenuConfig).items.map((item) => ({
220
- icon: ICON_MAP[item.icon] || <SquaresPlus />,
205
+ icon: getIcon(item.icon),
221
206
  label: item.useTranslation ? t(item.label) : item.label,
222
207
  to: item.to,
223
208
  items: item.items?.map((sub) => ({