baaz-custom-components 3.2.0 → 3.2.1
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/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +13 -8
- package/dist/index.mjs +13 -8
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -20,7 +20,6 @@ interface UserData {
|
|
|
20
20
|
role: string;
|
|
21
21
|
email: string;
|
|
22
22
|
phone: string;
|
|
23
|
-
hubDetails: hubDetail[];
|
|
24
23
|
currentHubId: number;
|
|
25
24
|
}
|
|
26
25
|
interface NotificationDataTypes {
|
|
@@ -41,10 +40,11 @@ interface NavbarProps {
|
|
|
41
40
|
onLogout: () => void;
|
|
42
41
|
notificationData: NotificationDataTypes[];
|
|
43
42
|
router: RouterAdapter;
|
|
43
|
+
hubDetails: hubDetail[];
|
|
44
44
|
hubIdChangeHandler: (value: string) => void;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
declare function Navbar({ navbarData, userData, onLogout, notificationData, router, hubIdChangeHandler, }: NavbarProps): react.JSX.Element | null;
|
|
47
|
+
declare function Navbar({ navbarData, userData, onLogout, notificationData, router, hubDetails, hubIdChangeHandler, }: NavbarProps): react.JSX.Element | null;
|
|
48
48
|
|
|
49
49
|
type BreadcrumbProps = {
|
|
50
50
|
layoutName: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,6 @@ interface UserData {
|
|
|
20
20
|
role: string;
|
|
21
21
|
email: string;
|
|
22
22
|
phone: string;
|
|
23
|
-
hubDetails: hubDetail[];
|
|
24
23
|
currentHubId: number;
|
|
25
24
|
}
|
|
26
25
|
interface NotificationDataTypes {
|
|
@@ -41,10 +40,11 @@ interface NavbarProps {
|
|
|
41
40
|
onLogout: () => void;
|
|
42
41
|
notificationData: NotificationDataTypes[];
|
|
43
42
|
router: RouterAdapter;
|
|
43
|
+
hubDetails: hubDetail[];
|
|
44
44
|
hubIdChangeHandler: (value: string) => void;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
declare function Navbar({ navbarData, userData, onLogout, notificationData, router, hubIdChangeHandler, }: NavbarProps): react.JSX.Element | null;
|
|
47
|
+
declare function Navbar({ navbarData, userData, onLogout, notificationData, router, hubDetails, hubIdChangeHandler, }: NavbarProps): react.JSX.Element | null;
|
|
48
48
|
|
|
49
49
|
type BreadcrumbProps = {
|
|
50
50
|
layoutName: string;
|
package/dist/index.js
CHANGED
|
@@ -452,22 +452,22 @@ var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
|
452
452
|
var User = ({
|
|
453
453
|
userData,
|
|
454
454
|
onLogout,
|
|
455
|
+
hubDetails,
|
|
455
456
|
hubIdChangeHandler
|
|
456
457
|
}) => {
|
|
457
|
-
var _a, _b, _c
|
|
458
|
+
var _a, _b, _c;
|
|
458
459
|
const safeUserData = userData || {
|
|
459
460
|
name: "User",
|
|
460
461
|
role: "User",
|
|
461
462
|
email: "No email provided",
|
|
462
463
|
phone: "No phone provided",
|
|
463
|
-
hubDetails: [],
|
|
464
464
|
currentHubId: 9
|
|
465
465
|
};
|
|
466
466
|
const [selectedHubId, setSelectedHubId] = (0, import_react.useState)(
|
|
467
467
|
safeUserData.currentHubId
|
|
468
468
|
);
|
|
469
|
-
const hubIds = (
|
|
470
|
-
const selectedZone = ((
|
|
469
|
+
const hubIds = (_a = hubDetails == null ? void 0 : hubDetails.map((h) => h.id)) != null ? _a : [];
|
|
470
|
+
const selectedZone = ((_b = hubDetails.find((hub) => hub.id === selectedHubId)) == null ? void 0 : _b.zone) || "No location provided";
|
|
471
471
|
const handleLogout = (e) => {
|
|
472
472
|
e.preventDefault();
|
|
473
473
|
if (onLogout) {
|
|
@@ -498,11 +498,11 @@ var User = ({
|
|
|
498
498
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h1", { className: "font-semibold", children: safeUserData.name }),
|
|
499
499
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h3", { className: "text-primary text-sm", children: safeUserData.role }),
|
|
500
500
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Separator2, { className: "my-4" }),
|
|
501
|
-
(
|
|
501
|
+
(_c = [
|
|
502
502
|
{ icon: import_lucide_react3.Mail, text: safeUserData.email },
|
|
503
503
|
{ icon: import_lucide_react3.Phone, text: safeUserData.phone },
|
|
504
504
|
{ icon: import_lucide_react3.MapPin, text: selectedZone }
|
|
505
|
-
]) == null ? void 0 :
|
|
505
|
+
]) == null ? void 0 : _c.map(({ icon: Icon2, text }, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
506
506
|
"p",
|
|
507
507
|
{
|
|
508
508
|
className: "flex items-center gap-4 text-sm py-1",
|
|
@@ -852,6 +852,7 @@ function DesktopNavbar({
|
|
|
852
852
|
onLogout,
|
|
853
853
|
notificationData,
|
|
854
854
|
router,
|
|
855
|
+
hubDetails,
|
|
855
856
|
hubIdChangeHandler
|
|
856
857
|
}) {
|
|
857
858
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("nav", { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex justify-between px-10 py-2 bg-card items-center border-b-1", children: [
|
|
@@ -876,7 +877,7 @@ function DesktopNavbar({
|
|
|
876
877
|
] }),
|
|
877
878
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex gap-4 items-center", children: [
|
|
878
879
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(notifications_default, { notificationData }),
|
|
879
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(user_default2, { userData, onLogout, hubIdChangeHandler })
|
|
880
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(user_default2, { userData, onLogout, hubIdChangeHandler, hubDetails })
|
|
880
881
|
] })
|
|
881
882
|
] }) });
|
|
882
883
|
}
|
|
@@ -1592,6 +1593,7 @@ function MobileNavbar({
|
|
|
1592
1593
|
onLogout,
|
|
1593
1594
|
notificationData,
|
|
1594
1595
|
router,
|
|
1596
|
+
hubDetails,
|
|
1595
1597
|
hubIdChangeHandler
|
|
1596
1598
|
}) {
|
|
1597
1599
|
var _a;
|
|
@@ -1610,7 +1612,7 @@ function MobileNavbar({
|
|
|
1610
1612
|
),
|
|
1611
1613
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex gap-4 items-center", children: [
|
|
1612
1614
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(notifications_default, { notificationData }),
|
|
1613
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(user_default2, { userData, onLogout, hubIdChangeHandler })
|
|
1615
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(user_default2, { userData, onLogout, hubIdChangeHandler, hubDetails })
|
|
1614
1616
|
] })
|
|
1615
1617
|
] }),
|
|
1616
1618
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SidebarInset, { className: "pt-12", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AppSidebar, { data: safeData, router }) })
|
|
@@ -1625,6 +1627,7 @@ function Navbar({
|
|
|
1625
1627
|
onLogout,
|
|
1626
1628
|
notificationData,
|
|
1627
1629
|
router,
|
|
1630
|
+
hubDetails,
|
|
1628
1631
|
hubIdChangeHandler
|
|
1629
1632
|
}) {
|
|
1630
1633
|
const isMobile = useIsMobile();
|
|
@@ -1641,6 +1644,7 @@ function Navbar({
|
|
|
1641
1644
|
onLogout,
|
|
1642
1645
|
notificationData,
|
|
1643
1646
|
router,
|
|
1647
|
+
hubDetails,
|
|
1644
1648
|
hubIdChangeHandler
|
|
1645
1649
|
}
|
|
1646
1650
|
) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
@@ -1651,6 +1655,7 @@ function Navbar({
|
|
|
1651
1655
|
onLogout,
|
|
1652
1656
|
notificationData,
|
|
1653
1657
|
router,
|
|
1658
|
+
hubDetails,
|
|
1654
1659
|
hubIdChangeHandler
|
|
1655
1660
|
}
|
|
1656
1661
|
) });
|
package/dist/index.mjs
CHANGED
|
@@ -418,22 +418,22 @@ import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
|
418
418
|
var User = ({
|
|
419
419
|
userData,
|
|
420
420
|
onLogout,
|
|
421
|
+
hubDetails,
|
|
421
422
|
hubIdChangeHandler
|
|
422
423
|
}) => {
|
|
423
|
-
var _a, _b, _c
|
|
424
|
+
var _a, _b, _c;
|
|
424
425
|
const safeUserData = userData || {
|
|
425
426
|
name: "User",
|
|
426
427
|
role: "User",
|
|
427
428
|
email: "No email provided",
|
|
428
429
|
phone: "No phone provided",
|
|
429
|
-
hubDetails: [],
|
|
430
430
|
currentHubId: 9
|
|
431
431
|
};
|
|
432
432
|
const [selectedHubId, setSelectedHubId] = useState2(
|
|
433
433
|
safeUserData.currentHubId
|
|
434
434
|
);
|
|
435
|
-
const hubIds = (
|
|
436
|
-
const selectedZone = ((
|
|
435
|
+
const hubIds = (_a = hubDetails == null ? void 0 : hubDetails.map((h) => h.id)) != null ? _a : [];
|
|
436
|
+
const selectedZone = ((_b = hubDetails.find((hub) => hub.id === selectedHubId)) == null ? void 0 : _b.zone) || "No location provided";
|
|
437
437
|
const handleLogout = (e) => {
|
|
438
438
|
e.preventDefault();
|
|
439
439
|
if (onLogout) {
|
|
@@ -464,11 +464,11 @@ var User = ({
|
|
|
464
464
|
/* @__PURE__ */ jsx7("h1", { className: "font-semibold", children: safeUserData.name }),
|
|
465
465
|
/* @__PURE__ */ jsx7("h3", { className: "text-primary text-sm", children: safeUserData.role }),
|
|
466
466
|
/* @__PURE__ */ jsx7(Separator2, { className: "my-4" }),
|
|
467
|
-
(
|
|
467
|
+
(_c = [
|
|
468
468
|
{ icon: Mail, text: safeUserData.email },
|
|
469
469
|
{ icon: Phone, text: safeUserData.phone },
|
|
470
470
|
{ icon: MapPin, text: selectedZone }
|
|
471
|
-
]) == null ? void 0 :
|
|
471
|
+
]) == null ? void 0 : _c.map(({ icon: Icon2, text }, i) => /* @__PURE__ */ jsxs5(
|
|
472
472
|
"p",
|
|
473
473
|
{
|
|
474
474
|
className: "flex items-center gap-4 text-sm py-1",
|
|
@@ -818,6 +818,7 @@ function DesktopNavbar({
|
|
|
818
818
|
onLogout,
|
|
819
819
|
notificationData,
|
|
820
820
|
router,
|
|
821
|
+
hubDetails,
|
|
821
822
|
hubIdChangeHandler
|
|
822
823
|
}) {
|
|
823
824
|
return /* @__PURE__ */ jsx11("nav", { children: /* @__PURE__ */ jsxs9("div", { className: "flex justify-between px-10 py-2 bg-card items-center border-b-1", children: [
|
|
@@ -842,7 +843,7 @@ function DesktopNavbar({
|
|
|
842
843
|
] }),
|
|
843
844
|
/* @__PURE__ */ jsxs9("div", { className: "flex gap-4 items-center", children: [
|
|
844
845
|
/* @__PURE__ */ jsx11(notifications_default, { notificationData }),
|
|
845
|
-
/* @__PURE__ */ jsx11(user_default2, { userData, onLogout, hubIdChangeHandler })
|
|
846
|
+
/* @__PURE__ */ jsx11(user_default2, { userData, onLogout, hubIdChangeHandler, hubDetails })
|
|
846
847
|
] })
|
|
847
848
|
] }) });
|
|
848
849
|
}
|
|
@@ -1558,6 +1559,7 @@ function MobileNavbar({
|
|
|
1558
1559
|
onLogout,
|
|
1559
1560
|
notificationData,
|
|
1560
1561
|
router,
|
|
1562
|
+
hubDetails,
|
|
1561
1563
|
hubIdChangeHandler
|
|
1562
1564
|
}) {
|
|
1563
1565
|
var _a;
|
|
@@ -1576,7 +1578,7 @@ function MobileNavbar({
|
|
|
1576
1578
|
),
|
|
1577
1579
|
/* @__PURE__ */ jsxs14("div", { className: "flex gap-4 items-center", children: [
|
|
1578
1580
|
/* @__PURE__ */ jsx18(notifications_default, { notificationData }),
|
|
1579
|
-
/* @__PURE__ */ jsx18(user_default2, { userData, onLogout, hubIdChangeHandler })
|
|
1581
|
+
/* @__PURE__ */ jsx18(user_default2, { userData, onLogout, hubIdChangeHandler, hubDetails })
|
|
1580
1582
|
] })
|
|
1581
1583
|
] }),
|
|
1582
1584
|
/* @__PURE__ */ jsx18(SidebarInset, { className: "pt-12", children: /* @__PURE__ */ jsx18(AppSidebar, { data: safeData, router }) })
|
|
@@ -1591,6 +1593,7 @@ function Navbar({
|
|
|
1591
1593
|
onLogout,
|
|
1592
1594
|
notificationData,
|
|
1593
1595
|
router,
|
|
1596
|
+
hubDetails,
|
|
1594
1597
|
hubIdChangeHandler
|
|
1595
1598
|
}) {
|
|
1596
1599
|
const isMobile = useIsMobile();
|
|
@@ -1607,6 +1610,7 @@ function Navbar({
|
|
|
1607
1610
|
onLogout,
|
|
1608
1611
|
notificationData,
|
|
1609
1612
|
router,
|
|
1613
|
+
hubDetails,
|
|
1610
1614
|
hubIdChangeHandler
|
|
1611
1615
|
}
|
|
1612
1616
|
) : /* @__PURE__ */ jsx19(
|
|
@@ -1617,6 +1621,7 @@ function Navbar({
|
|
|
1617
1621
|
onLogout,
|
|
1618
1622
|
notificationData,
|
|
1619
1623
|
router,
|
|
1624
|
+
hubDetails,
|
|
1620
1625
|
hubIdChangeHandler
|
|
1621
1626
|
}
|
|
1622
1627
|
) });
|