@tonyarbor/components 0.7.0 → 0.8.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.
- package/dist/AvatarLogoLockup.d.mts +41 -0
- package/dist/AvatarLogoLockup.d.ts +41 -0
- package/dist/AvatarLogoLockup.js +344 -0
- package/dist/AvatarLogoLockup.js.map +1 -0
- package/dist/AvatarLogoLockup.mjs +9 -0
- package/dist/AvatarLogoLockup.mjs.map +1 -0
- package/dist/SideNavBar.d.mts +35 -0
- package/dist/SideNavBar.d.ts +35 -0
- package/dist/SideNavBar.js +235 -0
- package/dist/SideNavBar.js.map +1 -0
- package/dist/SideNavBar.mjs +8 -0
- package/dist/SideNavBar.mjs.map +1 -0
- package/dist/SideNavButton.d.mts +42 -0
- package/dist/SideNavButton.d.ts +42 -0
- package/dist/SideNavButton.js +136 -0
- package/dist/SideNavButton.js.map +1 -0
- package/dist/SideNavButton.mjs +7 -0
- package/dist/SideNavButton.mjs.map +1 -0
- package/dist/TopNavBar.d.mts +103 -0
- package/dist/TopNavBar.d.ts +103 -0
- package/dist/TopNavBar.js +994 -0
- package/dist/TopNavBar.js.map +1 -0
- package/dist/TopNavBar.mjs +13 -0
- package/dist/TopNavBar.mjs.map +1 -0
- package/dist/TopNavItem.d.mts +33 -0
- package/dist/TopNavItem.d.ts +33 -0
- package/dist/TopNavItem.js +108 -0
- package/dist/TopNavItem.js.map +1 -0
- package/dist/TopNavItem.mjs +7 -0
- package/dist/TopNavItem.mjs.map +1 -0
- package/dist/chunk-AVYGOALO.mjs +72 -0
- package/dist/chunk-AVYGOALO.mjs.map +1 -0
- package/dist/chunk-GO2UDHKM.mjs +107 -0
- package/dist/chunk-GO2UDHKM.mjs.map +1 -0
- package/dist/chunk-HG2ORLLW.mjs +116 -0
- package/dist/chunk-HG2ORLLW.mjs.map +1 -0
- package/dist/chunk-I4ZVW4AI.mjs +100 -0
- package/dist/chunk-I4ZVW4AI.mjs.map +1 -0
- package/dist/chunk-YUXQQX7M.mjs +182 -0
- package/dist/chunk-YUXQQX7M.mjs.map +1 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +545 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -1
- package/package.json +26 -1
package/dist/index.js
CHANGED
|
@@ -31,6 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
33
|
Avatar: () => Avatar,
|
|
34
|
+
AvatarLogoLockup: () => AvatarLogoLockup,
|
|
34
35
|
Banner: () => Banner,
|
|
35
36
|
Breadcrumbs: () => Breadcrumbs,
|
|
36
37
|
Button: () => Button,
|
|
@@ -56,6 +57,8 @@ __export(src_exports, {
|
|
|
56
57
|
SectionHeading: () => SectionHeading,
|
|
57
58
|
SectionHeadingInteractive: () => SectionHeadingInteractive,
|
|
58
59
|
SectionIcon: () => SectionIcon,
|
|
60
|
+
SideNavBar: () => SideNavBar,
|
|
61
|
+
SideNavButton: () => SideNavButton,
|
|
59
62
|
SubSectionHeading: () => SubSectionHeading,
|
|
60
63
|
SubSectionInteractive: () => SubSectionInteractive,
|
|
61
64
|
Table: () => Table,
|
|
@@ -66,7 +69,9 @@ __export(src_exports, {
|
|
|
66
69
|
TextArea: () => TextArea,
|
|
67
70
|
Toast: () => Toast,
|
|
68
71
|
Toggle: () => Toggle,
|
|
69
|
-
Tooltip: () => Tooltip
|
|
72
|
+
Tooltip: () => Tooltip,
|
|
73
|
+
TopNavBar: () => TopNavBar,
|
|
74
|
+
TopNavItem: () => TopNavItem
|
|
70
75
|
});
|
|
71
76
|
module.exports = __toCommonJS(src_exports);
|
|
72
77
|
|
|
@@ -6408,9 +6413,543 @@ var ModalContent = React36.forwardRef(
|
|
|
6408
6413
|
}
|
|
6409
6414
|
);
|
|
6410
6415
|
ModalContent.displayName = "ModalContent";
|
|
6416
|
+
|
|
6417
|
+
// src/AvatarLogoLockup/AvatarLogoLockup.tsx
|
|
6418
|
+
var React37 = __toESM(require("react"));
|
|
6419
|
+
var import_lucide_react14 = require("lucide-react");
|
|
6420
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
6421
|
+
var AvatarLogoLockup = React37.forwardRef(
|
|
6422
|
+
({
|
|
6423
|
+
avatarSrc,
|
|
6424
|
+
avatarInitials,
|
|
6425
|
+
avatarAlt = "User avatar",
|
|
6426
|
+
onAvatarClick,
|
|
6427
|
+
onLogoClick,
|
|
6428
|
+
className,
|
|
6429
|
+
style
|
|
6430
|
+
}, ref) => {
|
|
6431
|
+
const [isHovered, setIsHovered] = React37.useState(false);
|
|
6432
|
+
const containerStyles6 = {
|
|
6433
|
+
display: "inline-flex",
|
|
6434
|
+
alignItems: "center",
|
|
6435
|
+
gap: "4px",
|
|
6436
|
+
padding: "4px",
|
|
6437
|
+
height: "40px",
|
|
6438
|
+
backgroundColor: isHovered ? "#f8f8f8" : "#ffffff",
|
|
6439
|
+
border: "1px solid #efefef",
|
|
6440
|
+
borderRadius: "99px",
|
|
6441
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
6442
|
+
boxSizing: "border-box",
|
|
6443
|
+
transition: "background-color 0.15s ease-in-out",
|
|
6444
|
+
...style
|
|
6445
|
+
};
|
|
6446
|
+
const avatarSectionStyles = {
|
|
6447
|
+
display: "flex",
|
|
6448
|
+
alignItems: "center",
|
|
6449
|
+
gap: "4px",
|
|
6450
|
+
borderRadius: "99px",
|
|
6451
|
+
cursor: onAvatarClick ? "pointer" : "default",
|
|
6452
|
+
backgroundColor: "transparent",
|
|
6453
|
+
border: "none",
|
|
6454
|
+
padding: 0
|
|
6455
|
+
};
|
|
6456
|
+
const dividerStyles = {
|
|
6457
|
+
width: "1px",
|
|
6458
|
+
height: "24px",
|
|
6459
|
+
backgroundColor: "#efefef",
|
|
6460
|
+
flexShrink: 0
|
|
6461
|
+
};
|
|
6462
|
+
const logoSectionStyles = {
|
|
6463
|
+
display: "flex",
|
|
6464
|
+
alignItems: "center",
|
|
6465
|
+
cursor: onLogoClick ? "pointer" : "default",
|
|
6466
|
+
padding: 0
|
|
6467
|
+
};
|
|
6468
|
+
const AvatarSection = onAvatarClick ? "button" : "div";
|
|
6469
|
+
const LogoSection = onLogoClick ? "button" : "div";
|
|
6470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
6471
|
+
"div",
|
|
6472
|
+
{
|
|
6473
|
+
ref,
|
|
6474
|
+
className,
|
|
6475
|
+
style: containerStyles6,
|
|
6476
|
+
onMouseEnter: () => setIsHovered(true),
|
|
6477
|
+
onMouseLeave: () => setIsHovered(false),
|
|
6478
|
+
children: [
|
|
6479
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
6480
|
+
AvatarSection,
|
|
6481
|
+
{
|
|
6482
|
+
style: {
|
|
6483
|
+
...avatarSectionStyles,
|
|
6484
|
+
...onAvatarClick ? { outline: "none" } : {}
|
|
6485
|
+
},
|
|
6486
|
+
onClick: onAvatarClick,
|
|
6487
|
+
...onAvatarClick ? { type: "button" } : {},
|
|
6488
|
+
children: [
|
|
6489
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6490
|
+
Avatar,
|
|
6491
|
+
{
|
|
6492
|
+
size: "medium",
|
|
6493
|
+
src: avatarSrc,
|
|
6494
|
+
initials: avatarInitials,
|
|
6495
|
+
alt: avatarAlt
|
|
6496
|
+
}
|
|
6497
|
+
),
|
|
6498
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react14.ChevronDown, { size: 12, color: "#2f2f2f", strokeWidth: 2 })
|
|
6499
|
+
]
|
|
6500
|
+
}
|
|
6501
|
+
),
|
|
6502
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { style: dividerStyles }),
|
|
6503
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6504
|
+
LogoSection,
|
|
6505
|
+
{
|
|
6506
|
+
style: {
|
|
6507
|
+
...logoSectionStyles,
|
|
6508
|
+
...onLogoClick ? { outline: "none", backgroundColor: "transparent", border: "none" } : {}
|
|
6509
|
+
},
|
|
6510
|
+
onClick: onLogoClick,
|
|
6511
|
+
...onLogoClick ? { type: "button" } : {},
|
|
6512
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Logo, { withText: true, light: true, height: 25 })
|
|
6513
|
+
}
|
|
6514
|
+
)
|
|
6515
|
+
]
|
|
6516
|
+
}
|
|
6517
|
+
);
|
|
6518
|
+
}
|
|
6519
|
+
);
|
|
6520
|
+
AvatarLogoLockup.displayName = "AvatarLogoLockup";
|
|
6521
|
+
|
|
6522
|
+
// src/TopNavItem/TopNavItem.tsx
|
|
6523
|
+
var React38 = __toESM(require("react"));
|
|
6524
|
+
var import_lucide_react15 = require("lucide-react");
|
|
6525
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
6526
|
+
var TopNavItem = React38.forwardRef(
|
|
6527
|
+
({
|
|
6528
|
+
children,
|
|
6529
|
+
active = false,
|
|
6530
|
+
onClick,
|
|
6531
|
+
className,
|
|
6532
|
+
style
|
|
6533
|
+
}, ref) => {
|
|
6534
|
+
const [isHovered, setIsHovered] = React38.useState(false);
|
|
6535
|
+
const [isFocused, setIsFocused] = React38.useState(false);
|
|
6536
|
+
const textColor = active ? "#005700" : "#474747";
|
|
6537
|
+
const iconColor = active ? "#005700" : "#474747";
|
|
6538
|
+
const getBackgroundColor = () => {
|
|
6539
|
+
if (active) return "#f0faf3";
|
|
6540
|
+
if (isHovered) return "#f8f8f8";
|
|
6541
|
+
return "transparent";
|
|
6542
|
+
};
|
|
6543
|
+
const containerStyles6 = {
|
|
6544
|
+
display: "inline-flex",
|
|
6545
|
+
alignItems: "center",
|
|
6546
|
+
justifyContent: "center",
|
|
6547
|
+
gap: "4px",
|
|
6548
|
+
padding: "4px 8px",
|
|
6549
|
+
backgroundColor: getBackgroundColor(),
|
|
6550
|
+
borderRadius: "8px",
|
|
6551
|
+
border: "none",
|
|
6552
|
+
cursor: "pointer",
|
|
6553
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
6554
|
+
boxSizing: "border-box",
|
|
6555
|
+
transition: "background-color 0.15s ease-in-out",
|
|
6556
|
+
outline: "none",
|
|
6557
|
+
boxShadow: isFocused ? "0px 0px 0px 3px #3cad51" : "none",
|
|
6558
|
+
...style
|
|
6559
|
+
};
|
|
6560
|
+
const textStyles3 = {
|
|
6561
|
+
fontSize: "13px",
|
|
6562
|
+
fontWeight: 600,
|
|
6563
|
+
color: textColor,
|
|
6564
|
+
lineHeight: 1.5,
|
|
6565
|
+
textAlign: "center",
|
|
6566
|
+
whiteSpace: "nowrap"
|
|
6567
|
+
};
|
|
6568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
6569
|
+
"button",
|
|
6570
|
+
{
|
|
6571
|
+
ref,
|
|
6572
|
+
className,
|
|
6573
|
+
style: containerStyles6,
|
|
6574
|
+
onClick,
|
|
6575
|
+
onMouseEnter: () => setIsHovered(true),
|
|
6576
|
+
onMouseLeave: () => setIsHovered(false),
|
|
6577
|
+
onFocus: () => setIsFocused(true),
|
|
6578
|
+
onBlur: () => setIsFocused(false),
|
|
6579
|
+
type: "button",
|
|
6580
|
+
children: [
|
|
6581
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { style: textStyles3, children }),
|
|
6582
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react15.ChevronDown, { size: 12, color: iconColor, strokeWidth: 2 })
|
|
6583
|
+
]
|
|
6584
|
+
}
|
|
6585
|
+
);
|
|
6586
|
+
}
|
|
6587
|
+
);
|
|
6588
|
+
TopNavItem.displayName = "TopNavItem";
|
|
6589
|
+
|
|
6590
|
+
// src/TopNavBar/TopNavBar.tsx
|
|
6591
|
+
var React39 = __toESM(require("react"));
|
|
6592
|
+
var import_lucide_react16 = require("lucide-react");
|
|
6593
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
6594
|
+
var TopNavBar = React39.forwardRef(
|
|
6595
|
+
({
|
|
6596
|
+
schoolLogoSrc,
|
|
6597
|
+
schoolLogoAlt = "School logo",
|
|
6598
|
+
onSchoolLogoClick,
|
|
6599
|
+
navItems = [],
|
|
6600
|
+
onNavItemClick,
|
|
6601
|
+
searchValue = "",
|
|
6602
|
+
onSearchChange,
|
|
6603
|
+
onSearchSubmit,
|
|
6604
|
+
onSearchClear,
|
|
6605
|
+
actionButtonLabel = "Ask Arbor",
|
|
6606
|
+
onActionButtonClick,
|
|
6607
|
+
showActionButton = true,
|
|
6608
|
+
avatarSrc,
|
|
6609
|
+
avatarInitials,
|
|
6610
|
+
avatarAlt = "User avatar",
|
|
6611
|
+
onAvatarClick,
|
|
6612
|
+
onLogoClick,
|
|
6613
|
+
className,
|
|
6614
|
+
style
|
|
6615
|
+
}, ref) => {
|
|
6616
|
+
const containerStyles6 = {
|
|
6617
|
+
position: "fixed",
|
|
6618
|
+
top: 0,
|
|
6619
|
+
left: 0,
|
|
6620
|
+
right: 0,
|
|
6621
|
+
display: "flex",
|
|
6622
|
+
alignItems: "center",
|
|
6623
|
+
justifyContent: "space-between",
|
|
6624
|
+
padding: "4px 8px",
|
|
6625
|
+
backgroundColor: "#ffffff",
|
|
6626
|
+
boxShadow: "0px 1px 2px 0px rgba(0, 0, 0, 0.08)",
|
|
6627
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
6628
|
+
boxSizing: "border-box",
|
|
6629
|
+
zIndex: 1e3,
|
|
6630
|
+
height: "48px",
|
|
6631
|
+
...style
|
|
6632
|
+
};
|
|
6633
|
+
const leftSectionStyles = {
|
|
6634
|
+
display: "flex",
|
|
6635
|
+
alignItems: "center",
|
|
6636
|
+
gap: "16px"
|
|
6637
|
+
};
|
|
6638
|
+
const schoolLogoContainerStyles = {
|
|
6639
|
+
display: "flex",
|
|
6640
|
+
alignItems: "center",
|
|
6641
|
+
justifyContent: "center",
|
|
6642
|
+
width: "64px",
|
|
6643
|
+
height: "40px",
|
|
6644
|
+
backgroundColor: "#ffffff",
|
|
6645
|
+
border: "1px solid #efefef",
|
|
6646
|
+
borderRadius: "8px",
|
|
6647
|
+
overflow: "hidden",
|
|
6648
|
+
padding: "2px",
|
|
6649
|
+
boxSizing: "border-box",
|
|
6650
|
+
cursor: onSchoolLogoClick ? "pointer" : "default"
|
|
6651
|
+
};
|
|
6652
|
+
const schoolLogoImageStyles = {
|
|
6653
|
+
maxWidth: "100%",
|
|
6654
|
+
maxHeight: "100%",
|
|
6655
|
+
objectFit: "contain"
|
|
6656
|
+
};
|
|
6657
|
+
const placeholderStyles = {
|
|
6658
|
+
width: "100%",
|
|
6659
|
+
height: "100%",
|
|
6660
|
+
display: "flex",
|
|
6661
|
+
alignItems: "center",
|
|
6662
|
+
justifyContent: "center",
|
|
6663
|
+
backgroundColor: "#f8f8f8",
|
|
6664
|
+
color: "#949494",
|
|
6665
|
+
fontSize: "10px",
|
|
6666
|
+
fontWeight: 500,
|
|
6667
|
+
textAlign: "center"
|
|
6668
|
+
};
|
|
6669
|
+
const navItemsGroupStyles = {
|
|
6670
|
+
display: "flex",
|
|
6671
|
+
alignItems: "center",
|
|
6672
|
+
gap: "8px"
|
|
6673
|
+
};
|
|
6674
|
+
const rightSectionStyles = {
|
|
6675
|
+
display: "flex",
|
|
6676
|
+
alignItems: "center",
|
|
6677
|
+
gap: "16px"
|
|
6678
|
+
};
|
|
6679
|
+
const actionButtonStyles2 = {
|
|
6680
|
+
display: "flex",
|
|
6681
|
+
alignItems: "center",
|
|
6682
|
+
gap: "8px"
|
|
6683
|
+
};
|
|
6684
|
+
const SchoolLogoElement = onSchoolLogoClick ? "button" : "div";
|
|
6685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("nav", { ref, className, style: containerStyles6, children: [
|
|
6686
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { style: leftSectionStyles, children: [
|
|
6687
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6688
|
+
SchoolLogoElement,
|
|
6689
|
+
{
|
|
6690
|
+
style: {
|
|
6691
|
+
...schoolLogoContainerStyles,
|
|
6692
|
+
...onSchoolLogoClick ? { outline: "none", border: "1px solid #efefef" } : {}
|
|
6693
|
+
},
|
|
6694
|
+
onClick: onSchoolLogoClick,
|
|
6695
|
+
...onSchoolLogoClick ? { type: "button" } : {},
|
|
6696
|
+
children: schoolLogoSrc ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6697
|
+
"img",
|
|
6698
|
+
{
|
|
6699
|
+
src: schoolLogoSrc,
|
|
6700
|
+
alt: schoolLogoAlt,
|
|
6701
|
+
style: schoolLogoImageStyles
|
|
6702
|
+
}
|
|
6703
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { style: placeholderStyles, children: "Logo" })
|
|
6704
|
+
}
|
|
6705
|
+
),
|
|
6706
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { style: navItemsGroupStyles, children: navItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6707
|
+
TopNavItem,
|
|
6708
|
+
{
|
|
6709
|
+
active: item.active,
|
|
6710
|
+
onClick: () => onNavItemClick?.(item),
|
|
6711
|
+
children: item.label
|
|
6712
|
+
},
|
|
6713
|
+
item.id
|
|
6714
|
+
)) })
|
|
6715
|
+
] }),
|
|
6716
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { style: rightSectionStyles, children: [
|
|
6717
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6718
|
+
SearchGlobal,
|
|
6719
|
+
{
|
|
6720
|
+
value: searchValue,
|
|
6721
|
+
onChange: onSearchChange,
|
|
6722
|
+
onSubmit: onSearchSubmit,
|
|
6723
|
+
onClear: onSearchClear
|
|
6724
|
+
}
|
|
6725
|
+
),
|
|
6726
|
+
showActionButton && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
6727
|
+
Button,
|
|
6728
|
+
{
|
|
6729
|
+
variant: "secondary",
|
|
6730
|
+
size: "small",
|
|
6731
|
+
onClick: onActionButtonClick,
|
|
6732
|
+
style: actionButtonStyles2,
|
|
6733
|
+
children: [
|
|
6734
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react16.Sparkles, { size: 16, strokeWidth: 2 }),
|
|
6735
|
+
actionButtonLabel
|
|
6736
|
+
]
|
|
6737
|
+
}
|
|
6738
|
+
),
|
|
6739
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6740
|
+
AvatarLogoLockup,
|
|
6741
|
+
{
|
|
6742
|
+
avatarSrc,
|
|
6743
|
+
avatarInitials,
|
|
6744
|
+
avatarAlt,
|
|
6745
|
+
onAvatarClick,
|
|
6746
|
+
onLogoClick
|
|
6747
|
+
}
|
|
6748
|
+
)
|
|
6749
|
+
] })
|
|
6750
|
+
] });
|
|
6751
|
+
}
|
|
6752
|
+
);
|
|
6753
|
+
TopNavBar.displayName = "TopNavBar";
|
|
6754
|
+
|
|
6755
|
+
// src/SideNavButton/SideNavButton.tsx
|
|
6756
|
+
var React40 = __toESM(require("react"));
|
|
6757
|
+
var import_lucide_react17 = require("lucide-react");
|
|
6758
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
6759
|
+
var SideNavButton = React40.forwardRef(
|
|
6760
|
+
({
|
|
6761
|
+
icon,
|
|
6762
|
+
selected = false,
|
|
6763
|
+
focused = false,
|
|
6764
|
+
onClick,
|
|
6765
|
+
"aria-label": ariaLabel,
|
|
6766
|
+
className,
|
|
6767
|
+
style
|
|
6768
|
+
}, ref) => {
|
|
6769
|
+
const [isHovered, setIsHovered] = React40.useState(false);
|
|
6770
|
+
const [isActive, setIsActive] = React40.useState(false);
|
|
6771
|
+
const getIconColor = () => {
|
|
6772
|
+
if (selected) return "#0e8a0e";
|
|
6773
|
+
if (isActive || isHovered) return "#2f2f2f";
|
|
6774
|
+
return "#7e7e7e";
|
|
6775
|
+
};
|
|
6776
|
+
const getBackgroundColor = () => {
|
|
6777
|
+
if (selected) return "#f0faf3";
|
|
6778
|
+
if (isActive) return "#efefef";
|
|
6779
|
+
if (isHovered) return "#f8f8f8";
|
|
6780
|
+
return "transparent";
|
|
6781
|
+
};
|
|
6782
|
+
const buttonStyles4 = {
|
|
6783
|
+
display: "flex",
|
|
6784
|
+
alignItems: "center",
|
|
6785
|
+
justifyContent: "center",
|
|
6786
|
+
width: "42px",
|
|
6787
|
+
height: "42px",
|
|
6788
|
+
borderRadius: "99px",
|
|
6789
|
+
border: "none",
|
|
6790
|
+
backgroundColor: getBackgroundColor(),
|
|
6791
|
+
cursor: "pointer",
|
|
6792
|
+
padding: 0,
|
|
6793
|
+
outline: "none",
|
|
6794
|
+
transition: "background-color 150ms ease, box-shadow 150ms ease",
|
|
6795
|
+
boxShadow: focused ? "0px 0px 0px 3px #3cad51" : "none",
|
|
6796
|
+
...style
|
|
6797
|
+
};
|
|
6798
|
+
const renderIcon = () => {
|
|
6799
|
+
const iconColor = getIconColor();
|
|
6800
|
+
const iconSize = 20;
|
|
6801
|
+
const strokeWidth = 2;
|
|
6802
|
+
const iconProps = {
|
|
6803
|
+
size: iconSize,
|
|
6804
|
+
color: iconColor,
|
|
6805
|
+
strokeWidth
|
|
6806
|
+
};
|
|
6807
|
+
switch (icon) {
|
|
6808
|
+
case "side-menu":
|
|
6809
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react17.Menu, { ...iconProps });
|
|
6810
|
+
case "home":
|
|
6811
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react17.Home, { ...iconProps });
|
|
6812
|
+
case "favourite":
|
|
6813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react17.Star, { ...iconProps });
|
|
6814
|
+
case "calendar":
|
|
6815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react17.Calendar, { ...iconProps });
|
|
6816
|
+
case "notifications":
|
|
6817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react17.Bell, { ...iconProps });
|
|
6818
|
+
case "emergency-alert":
|
|
6819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react17.AlertTriangle, { ...iconProps });
|
|
6820
|
+
case "help":
|
|
6821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react17.HelpCircle, { ...iconProps });
|
|
6822
|
+
default:
|
|
6823
|
+
return null;
|
|
6824
|
+
}
|
|
6825
|
+
};
|
|
6826
|
+
const defaultAriaLabel = icon.charAt(0).toUpperCase() + icon.slice(1);
|
|
6827
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6828
|
+
"button",
|
|
6829
|
+
{
|
|
6830
|
+
ref,
|
|
6831
|
+
type: "button",
|
|
6832
|
+
className,
|
|
6833
|
+
style: buttonStyles4,
|
|
6834
|
+
onClick,
|
|
6835
|
+
onMouseEnter: () => setIsHovered(true),
|
|
6836
|
+
onMouseLeave: () => {
|
|
6837
|
+
setIsHovered(false);
|
|
6838
|
+
setIsActive(false);
|
|
6839
|
+
},
|
|
6840
|
+
onMouseDown: () => setIsActive(true),
|
|
6841
|
+
onMouseUp: () => setIsActive(false),
|
|
6842
|
+
"aria-label": ariaLabel || defaultAriaLabel,
|
|
6843
|
+
"aria-pressed": selected,
|
|
6844
|
+
children: renderIcon()
|
|
6845
|
+
}
|
|
6846
|
+
);
|
|
6847
|
+
}
|
|
6848
|
+
);
|
|
6849
|
+
SideNavButton.displayName = "SideNavButton";
|
|
6850
|
+
|
|
6851
|
+
// src/SideNavBar/SideNavBar.tsx
|
|
6852
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
6853
|
+
var SideNavBar = ({
|
|
6854
|
+
selectedIcon,
|
|
6855
|
+
onIconClick,
|
|
6856
|
+
className,
|
|
6857
|
+
style
|
|
6858
|
+
}) => {
|
|
6859
|
+
const containerStyles6 = {
|
|
6860
|
+
display: "flex",
|
|
6861
|
+
flexDirection: "column",
|
|
6862
|
+
alignItems: "center",
|
|
6863
|
+
justifyContent: "space-between",
|
|
6864
|
+
backgroundColor: "#ffffff",
|
|
6865
|
+
padding: "8px",
|
|
6866
|
+
borderTopLeftRadius: "8px",
|
|
6867
|
+
borderBottomLeftRadius: "8px",
|
|
6868
|
+
height: "100%",
|
|
6869
|
+
width: "58px",
|
|
6870
|
+
boxSizing: "border-box",
|
|
6871
|
+
...style
|
|
6872
|
+
};
|
|
6873
|
+
const topSectionStyles = {
|
|
6874
|
+
display: "flex",
|
|
6875
|
+
flexDirection: "column",
|
|
6876
|
+
alignItems: "center",
|
|
6877
|
+
gap: "16px"
|
|
6878
|
+
};
|
|
6879
|
+
const dividerStyles = {
|
|
6880
|
+
width: "24.5px",
|
|
6881
|
+
height: "1px",
|
|
6882
|
+
backgroundColor: "#efefef"
|
|
6883
|
+
};
|
|
6884
|
+
const handleClick = (icon) => {
|
|
6885
|
+
onIconClick?.(icon);
|
|
6886
|
+
};
|
|
6887
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className, style: containerStyles6, children: [
|
|
6888
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { style: topSectionStyles, children: [
|
|
6889
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6890
|
+
SideNavButton,
|
|
6891
|
+
{
|
|
6892
|
+
icon: "side-menu",
|
|
6893
|
+
selected: selectedIcon === "side-menu",
|
|
6894
|
+
onClick: () => handleClick("side-menu"),
|
|
6895
|
+
"aria-label": "Side menu"
|
|
6896
|
+
}
|
|
6897
|
+
),
|
|
6898
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { style: dividerStyles }),
|
|
6899
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6900
|
+
SideNavButton,
|
|
6901
|
+
{
|
|
6902
|
+
icon: "favourite",
|
|
6903
|
+
selected: selectedIcon === "favourite",
|
|
6904
|
+
onClick: () => handleClick("favourite"),
|
|
6905
|
+
"aria-label": "Favourites"
|
|
6906
|
+
}
|
|
6907
|
+
),
|
|
6908
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6909
|
+
SideNavButton,
|
|
6910
|
+
{
|
|
6911
|
+
icon: "notifications",
|
|
6912
|
+
selected: selectedIcon === "notifications",
|
|
6913
|
+
onClick: () => handleClick("notifications"),
|
|
6914
|
+
"aria-label": "Notifications"
|
|
6915
|
+
}
|
|
6916
|
+
),
|
|
6917
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6918
|
+
SideNavButton,
|
|
6919
|
+
{
|
|
6920
|
+
icon: "calendar",
|
|
6921
|
+
selected: selectedIcon === "calendar",
|
|
6922
|
+
onClick: () => handleClick("calendar"),
|
|
6923
|
+
"aria-label": "Calendar"
|
|
6924
|
+
}
|
|
6925
|
+
),
|
|
6926
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { style: dividerStyles }),
|
|
6927
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6928
|
+
SideNavButton,
|
|
6929
|
+
{
|
|
6930
|
+
icon: "emergency-alert",
|
|
6931
|
+
selected: selectedIcon === "emergency-alert",
|
|
6932
|
+
onClick: () => handleClick("emergency-alert"),
|
|
6933
|
+
"aria-label": "Emergency alerts"
|
|
6934
|
+
}
|
|
6935
|
+
)
|
|
6936
|
+
] }),
|
|
6937
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6938
|
+
SideNavButton,
|
|
6939
|
+
{
|
|
6940
|
+
icon: "help",
|
|
6941
|
+
selected: selectedIcon === "help",
|
|
6942
|
+
onClick: () => handleClick("help"),
|
|
6943
|
+
"aria-label": "Help"
|
|
6944
|
+
}
|
|
6945
|
+
)
|
|
6946
|
+
] });
|
|
6947
|
+
};
|
|
6948
|
+
SideNavBar.displayName = "SideNavBar";
|
|
6411
6949
|
// Annotate the CommonJS export names for ESM import in node:
|
|
6412
6950
|
0 && (module.exports = {
|
|
6413
6951
|
Avatar,
|
|
6952
|
+
AvatarLogoLockup,
|
|
6414
6953
|
Banner,
|
|
6415
6954
|
Breadcrumbs,
|
|
6416
6955
|
Button,
|
|
@@ -6436,6 +6975,8 @@ ModalContent.displayName = "ModalContent";
|
|
|
6436
6975
|
SectionHeading,
|
|
6437
6976
|
SectionHeadingInteractive,
|
|
6438
6977
|
SectionIcon,
|
|
6978
|
+
SideNavBar,
|
|
6979
|
+
SideNavButton,
|
|
6439
6980
|
SubSectionHeading,
|
|
6440
6981
|
SubSectionInteractive,
|
|
6441
6982
|
Table,
|
|
@@ -6446,6 +6987,8 @@ ModalContent.displayName = "ModalContent";
|
|
|
6446
6987
|
TextArea,
|
|
6447
6988
|
Toast,
|
|
6448
6989
|
Toggle,
|
|
6449
|
-
Tooltip
|
|
6990
|
+
Tooltip,
|
|
6991
|
+
TopNavBar,
|
|
6992
|
+
TopNavItem
|
|
6450
6993
|
});
|
|
6451
6994
|
//# sourceMappingURL=index.js.map
|