@tonyarbor/components 0.7.1 → 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/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/chunk-GO2UDHKM.mjs +107 -0
- package/dist/chunk-GO2UDHKM.mjs.map +1 -0
- package/dist/chunk-I4ZVW4AI.mjs +100 -0
- package/dist/chunk-I4ZVW4AI.mjs.map +1 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +199 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -0
- package/package.json +11 -1
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SideNavButton
|
|
3
|
+
} from "./chunk-I4ZVW4AI.mjs";
|
|
4
|
+
|
|
5
|
+
// src/SideNavBar/SideNavBar.tsx
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
var SideNavBar = ({
|
|
8
|
+
selectedIcon,
|
|
9
|
+
onIconClick,
|
|
10
|
+
className,
|
|
11
|
+
style
|
|
12
|
+
}) => {
|
|
13
|
+
const containerStyles = {
|
|
14
|
+
display: "flex",
|
|
15
|
+
flexDirection: "column",
|
|
16
|
+
alignItems: "center",
|
|
17
|
+
justifyContent: "space-between",
|
|
18
|
+
backgroundColor: "#ffffff",
|
|
19
|
+
padding: "8px",
|
|
20
|
+
borderTopLeftRadius: "8px",
|
|
21
|
+
borderBottomLeftRadius: "8px",
|
|
22
|
+
height: "100%",
|
|
23
|
+
width: "58px",
|
|
24
|
+
boxSizing: "border-box",
|
|
25
|
+
...style
|
|
26
|
+
};
|
|
27
|
+
const topSectionStyles = {
|
|
28
|
+
display: "flex",
|
|
29
|
+
flexDirection: "column",
|
|
30
|
+
alignItems: "center",
|
|
31
|
+
gap: "16px"
|
|
32
|
+
};
|
|
33
|
+
const dividerStyles = {
|
|
34
|
+
width: "24.5px",
|
|
35
|
+
height: "1px",
|
|
36
|
+
backgroundColor: "#efefef"
|
|
37
|
+
};
|
|
38
|
+
const handleClick = (icon) => {
|
|
39
|
+
onIconClick?.(icon);
|
|
40
|
+
};
|
|
41
|
+
return /* @__PURE__ */ jsxs("div", { className, style: containerStyles, children: [
|
|
42
|
+
/* @__PURE__ */ jsxs("div", { style: topSectionStyles, children: [
|
|
43
|
+
/* @__PURE__ */ jsx(
|
|
44
|
+
SideNavButton,
|
|
45
|
+
{
|
|
46
|
+
icon: "side-menu",
|
|
47
|
+
selected: selectedIcon === "side-menu",
|
|
48
|
+
onClick: () => handleClick("side-menu"),
|
|
49
|
+
"aria-label": "Side menu"
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ jsx("div", { style: dividerStyles }),
|
|
53
|
+
/* @__PURE__ */ jsx(
|
|
54
|
+
SideNavButton,
|
|
55
|
+
{
|
|
56
|
+
icon: "favourite",
|
|
57
|
+
selected: selectedIcon === "favourite",
|
|
58
|
+
onClick: () => handleClick("favourite"),
|
|
59
|
+
"aria-label": "Favourites"
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ jsx(
|
|
63
|
+
SideNavButton,
|
|
64
|
+
{
|
|
65
|
+
icon: "notifications",
|
|
66
|
+
selected: selectedIcon === "notifications",
|
|
67
|
+
onClick: () => handleClick("notifications"),
|
|
68
|
+
"aria-label": "Notifications"
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ jsx(
|
|
72
|
+
SideNavButton,
|
|
73
|
+
{
|
|
74
|
+
icon: "calendar",
|
|
75
|
+
selected: selectedIcon === "calendar",
|
|
76
|
+
onClick: () => handleClick("calendar"),
|
|
77
|
+
"aria-label": "Calendar"
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ jsx("div", { style: dividerStyles }),
|
|
81
|
+
/* @__PURE__ */ jsx(
|
|
82
|
+
SideNavButton,
|
|
83
|
+
{
|
|
84
|
+
icon: "emergency-alert",
|
|
85
|
+
selected: selectedIcon === "emergency-alert",
|
|
86
|
+
onClick: () => handleClick("emergency-alert"),
|
|
87
|
+
"aria-label": "Emergency alerts"
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
] }),
|
|
91
|
+
/* @__PURE__ */ jsx(
|
|
92
|
+
SideNavButton,
|
|
93
|
+
{
|
|
94
|
+
icon: "help",
|
|
95
|
+
selected: selectedIcon === "help",
|
|
96
|
+
onClick: () => handleClick("help"),
|
|
97
|
+
"aria-label": "Help"
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
] });
|
|
101
|
+
};
|
|
102
|
+
SideNavBar.displayName = "SideNavBar";
|
|
103
|
+
|
|
104
|
+
export {
|
|
105
|
+
SideNavBar
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=chunk-GO2UDHKM.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/SideNavBar/SideNavBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { SideNavButton, SideNavButtonIcon } from '../SideNavButton';\n\nexport type SideNavBarIcon = Exclude<SideNavButtonIcon, 'home'>;\n\nexport interface SideNavBarProps {\n /**\n * The currently selected/active icon (if any)\n */\n selectedIcon?: SideNavBarIcon;\n /**\n * Click handler for icon buttons - receives the icon type that was clicked\n */\n onIconClick?: (icon: SideNavBarIcon) => void;\n /**\n * Custom className for the container\n */\n className?: string;\n /**\n * Custom style for the container\n */\n style?: React.CSSProperties;\n}\n\n/**\n * SideNavBar component - Arbor Design System\n *\n * A vertical side navigation bar with fixed icon layout.\n * Icons are grouped with dividers:\n * - Top: Side menu\n * - Middle: Favourite, Notifications, Calendar\n * - Lower: Emergency alert\n * - Bottom (pushed down): Help\n */\nexport const SideNavBar: React.FC<SideNavBarProps> = ({\n selectedIcon,\n onIconClick,\n className,\n style,\n}) => {\n const containerStyles: React.CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'space-between',\n backgroundColor: '#ffffff',\n padding: '8px',\n borderTopLeftRadius: '8px',\n borderBottomLeftRadius: '8px',\n height: '100%',\n width: '58px',\n boxSizing: 'border-box',\n ...style,\n };\n\n const topSectionStyles: React.CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n gap: '16px',\n };\n\n const dividerStyles: React.CSSProperties = {\n width: '24.5px',\n height: '1px',\n backgroundColor: '#efefef',\n };\n\n const handleClick = (icon: SideNavBarIcon) => {\n onIconClick?.(icon);\n };\n\n return (\n <div className={className} style={containerStyles}>\n {/* Top section with icon groups */}\n <div style={topSectionStyles}>\n {/* Side menu */}\n <SideNavButton\n icon=\"side-menu\"\n selected={selectedIcon === 'side-menu'}\n onClick={() => handleClick('side-menu')}\n aria-label=\"Side menu\"\n />\n\n {/* Divider */}\n <div style={dividerStyles} />\n\n {/* Main navigation group */}\n <SideNavButton\n icon=\"favourite\"\n selected={selectedIcon === 'favourite'}\n onClick={() => handleClick('favourite')}\n aria-label=\"Favourites\"\n />\n <SideNavButton\n icon=\"notifications\"\n selected={selectedIcon === 'notifications'}\n onClick={() => handleClick('notifications')}\n aria-label=\"Notifications\"\n />\n <SideNavButton\n icon=\"calendar\"\n selected={selectedIcon === 'calendar'}\n onClick={() => handleClick('calendar')}\n aria-label=\"Calendar\"\n />\n\n {/* Divider */}\n <div style={dividerStyles} />\n\n {/* Emergency alert */}\n <SideNavButton\n icon=\"emergency-alert\"\n selected={selectedIcon === 'emergency-alert'}\n onClick={() => handleClick('emergency-alert')}\n aria-label=\"Emergency alerts\"\n />\n </div>\n\n {/* Bottom section - Help */}\n <SideNavButton\n icon=\"help\"\n selected={selectedIcon === 'help'}\n onClick={() => handleClick('help')}\n aria-label=\"Help\"\n />\n </div>\n );\n};\n\nSideNavBar.displayName = 'SideNavBar';\n"],"mappings":";;;;;AA2EM,SAEE,KAFF;AAzCC,IAAM,aAAwC,CAAC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,kBAAuC;AAAA,IAC3C,SAAS;AAAA,IACT,eAAe;AAAA,IACf,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,SAAS;AAAA,IACT,qBAAqB;AAAA,IACrB,wBAAwB;AAAA,IACxB,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,WAAW;AAAA,IACX,GAAG;AAAA,EACL;AAEA,QAAM,mBAAwC;AAAA,IAC5C,SAAS;AAAA,IACT,eAAe;AAAA,IACf,YAAY;AAAA,IACZ,KAAK;AAAA,EACP;AAEA,QAAM,gBAAqC;AAAA,IACzC,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,iBAAiB;AAAA,EACnB;AAEA,QAAM,cAAc,CAAC,SAAyB;AAC5C,kBAAc,IAAI;AAAA,EACpB;AAEA,SACE,qBAAC,SAAI,WAAsB,OAAO,iBAEhC;AAAA,yBAAC,SAAI,OAAO,kBAEV;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,UAAU,iBAAiB;AAAA,UAC3B,SAAS,MAAM,YAAY,WAAW;AAAA,UACtC,cAAW;AAAA;AAAA,MACb;AAAA,MAGA,oBAAC,SAAI,OAAO,eAAe;AAAA,MAG3B;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,UAAU,iBAAiB;AAAA,UAC3B,SAAS,MAAM,YAAY,WAAW;AAAA,UACtC,cAAW;AAAA;AAAA,MACb;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,UAAU,iBAAiB;AAAA,UAC3B,SAAS,MAAM,YAAY,eAAe;AAAA,UAC1C,cAAW;AAAA;AAAA,MACb;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,UAAU,iBAAiB;AAAA,UAC3B,SAAS,MAAM,YAAY,UAAU;AAAA,UACrC,cAAW;AAAA;AAAA,MACb;AAAA,MAGA,oBAAC,SAAI,OAAO,eAAe;AAAA,MAG3B;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,UAAU,iBAAiB;AAAA,UAC3B,SAAS,MAAM,YAAY,iBAAiB;AAAA,UAC5C,cAAW;AAAA;AAAA,MACb;AAAA,OACF;AAAA,IAGA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,UAAU,iBAAiB;AAAA,QAC3B,SAAS,MAAM,YAAY,MAAM;AAAA,QACjC,cAAW;AAAA;AAAA,IACb;AAAA,KACF;AAEJ;AAEA,WAAW,cAAc;","names":[]}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// src/SideNavButton/SideNavButton.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Home, Menu, Star, Calendar, Bell, AlertTriangle, HelpCircle } from "lucide-react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var SideNavButton = React.forwardRef(
|
|
6
|
+
({
|
|
7
|
+
icon,
|
|
8
|
+
selected = false,
|
|
9
|
+
focused = false,
|
|
10
|
+
onClick,
|
|
11
|
+
"aria-label": ariaLabel,
|
|
12
|
+
className,
|
|
13
|
+
style
|
|
14
|
+
}, ref) => {
|
|
15
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
16
|
+
const [isActive, setIsActive] = React.useState(false);
|
|
17
|
+
const getIconColor = () => {
|
|
18
|
+
if (selected) return "#0e8a0e";
|
|
19
|
+
if (isActive || isHovered) return "#2f2f2f";
|
|
20
|
+
return "#7e7e7e";
|
|
21
|
+
};
|
|
22
|
+
const getBackgroundColor = () => {
|
|
23
|
+
if (selected) return "#f0faf3";
|
|
24
|
+
if (isActive) return "#efefef";
|
|
25
|
+
if (isHovered) return "#f8f8f8";
|
|
26
|
+
return "transparent";
|
|
27
|
+
};
|
|
28
|
+
const buttonStyles = {
|
|
29
|
+
display: "flex",
|
|
30
|
+
alignItems: "center",
|
|
31
|
+
justifyContent: "center",
|
|
32
|
+
width: "42px",
|
|
33
|
+
height: "42px",
|
|
34
|
+
borderRadius: "99px",
|
|
35
|
+
border: "none",
|
|
36
|
+
backgroundColor: getBackgroundColor(),
|
|
37
|
+
cursor: "pointer",
|
|
38
|
+
padding: 0,
|
|
39
|
+
outline: "none",
|
|
40
|
+
transition: "background-color 150ms ease, box-shadow 150ms ease",
|
|
41
|
+
boxShadow: focused ? "0px 0px 0px 3px #3cad51" : "none",
|
|
42
|
+
...style
|
|
43
|
+
};
|
|
44
|
+
const renderIcon = () => {
|
|
45
|
+
const iconColor = getIconColor();
|
|
46
|
+
const iconSize = 20;
|
|
47
|
+
const strokeWidth = 2;
|
|
48
|
+
const iconProps = {
|
|
49
|
+
size: iconSize,
|
|
50
|
+
color: iconColor,
|
|
51
|
+
strokeWidth
|
|
52
|
+
};
|
|
53
|
+
switch (icon) {
|
|
54
|
+
case "side-menu":
|
|
55
|
+
return /* @__PURE__ */ jsx(Menu, { ...iconProps });
|
|
56
|
+
case "home":
|
|
57
|
+
return /* @__PURE__ */ jsx(Home, { ...iconProps });
|
|
58
|
+
case "favourite":
|
|
59
|
+
return /* @__PURE__ */ jsx(Star, { ...iconProps });
|
|
60
|
+
case "calendar":
|
|
61
|
+
return /* @__PURE__ */ jsx(Calendar, { ...iconProps });
|
|
62
|
+
case "notifications":
|
|
63
|
+
return /* @__PURE__ */ jsx(Bell, { ...iconProps });
|
|
64
|
+
case "emergency-alert":
|
|
65
|
+
return /* @__PURE__ */ jsx(AlertTriangle, { ...iconProps });
|
|
66
|
+
case "help":
|
|
67
|
+
return /* @__PURE__ */ jsx(HelpCircle, { ...iconProps });
|
|
68
|
+
default:
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const defaultAriaLabel = icon.charAt(0).toUpperCase() + icon.slice(1);
|
|
73
|
+
return /* @__PURE__ */ jsx(
|
|
74
|
+
"button",
|
|
75
|
+
{
|
|
76
|
+
ref,
|
|
77
|
+
type: "button",
|
|
78
|
+
className,
|
|
79
|
+
style: buttonStyles,
|
|
80
|
+
onClick,
|
|
81
|
+
onMouseEnter: () => setIsHovered(true),
|
|
82
|
+
onMouseLeave: () => {
|
|
83
|
+
setIsHovered(false);
|
|
84
|
+
setIsActive(false);
|
|
85
|
+
},
|
|
86
|
+
onMouseDown: () => setIsActive(true),
|
|
87
|
+
onMouseUp: () => setIsActive(false),
|
|
88
|
+
"aria-label": ariaLabel || defaultAriaLabel,
|
|
89
|
+
"aria-pressed": selected,
|
|
90
|
+
children: renderIcon()
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
SideNavButton.displayName = "SideNavButton";
|
|
96
|
+
|
|
97
|
+
export {
|
|
98
|
+
SideNavButton
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=chunk-I4ZVW4AI.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/SideNavButton/SideNavButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Home, Menu, Star, Calendar, Bell, AlertTriangle, HelpCircle } from 'lucide-react';\n\nexport type SideNavButtonIcon = 'side-menu' | 'home' | 'favourite' | 'calendar' | 'notifications' | 'emergency-alert' | 'help';\n\nexport interface SideNavButtonProps {\n /**\n * The icon to display\n */\n icon: SideNavButtonIcon;\n /**\n * Whether the button is selected/active\n */\n selected?: boolean;\n /**\n * Whether the button is focused (shows green ring)\n */\n focused?: boolean;\n /**\n * Click handler\n */\n onClick?: () => void;\n /**\n * Accessible label for the button\n */\n 'aria-label'?: string;\n /**\n * Custom className\n */\n className?: string;\n /**\n * Custom style\n */\n style?: React.CSSProperties;\n}\n\n/**\n * SideNavButton component - Arbor Design System\n *\n * A circular navigation button used in the side navigation bar.\n * Supports different icons and states (default, hover, active, selected, focused).\n */\nexport const SideNavButton = React.forwardRef<HTMLButtonElement, SideNavButtonProps>(\n (\n {\n icon,\n selected = false,\n focused = false,\n onClick,\n 'aria-label': ariaLabel,\n className,\n style,\n },\n ref\n ) => {\n const [isHovered, setIsHovered] = React.useState(false);\n const [isActive, setIsActive] = React.useState(false);\n\n // Determine icon color based on state\n const getIconColor = () => {\n if (selected) return '#0e8a0e'; // Green for selected\n if (isActive || isHovered) return '#2f2f2f'; // Dark gray for hover/active\n return '#7e7e7e'; // Gray for default\n };\n\n // Determine background color based on state\n const getBackgroundColor = () => {\n if (selected) return '#f0faf3'; // Light green for selected\n if (isActive) return '#efefef'; // Darker gray for active\n if (isHovered) return '#f8f8f8'; // Light gray for hover\n return 'transparent'; // Transparent for default\n };\n\n const buttonStyles: React.CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '42px',\n height: '42px',\n borderRadius: '99px',\n border: 'none',\n backgroundColor: getBackgroundColor(),\n cursor: 'pointer',\n padding: 0,\n outline: 'none',\n transition: 'background-color 150ms ease, box-shadow 150ms ease',\n boxShadow: focused ? '0px 0px 0px 3px #3cad51' : 'none',\n ...style,\n };\n\n // Get the appropriate icon component\n const renderIcon = () => {\n const iconColor = getIconColor();\n const iconSize = 20;\n const strokeWidth = 2;\n\n // All icons are stroke-only (outline), no fill - just color changes\n const iconProps = {\n size: iconSize,\n color: iconColor,\n strokeWidth,\n };\n\n switch (icon) {\n case 'side-menu':\n return <Menu {...iconProps} />;\n case 'home':\n return <Home {...iconProps} />;\n case 'favourite':\n return <Star {...iconProps} />;\n case 'calendar':\n return <Calendar {...iconProps} />;\n case 'notifications':\n return <Bell {...iconProps} />;\n case 'emergency-alert':\n return <AlertTriangle {...iconProps} />;\n case 'help':\n return <HelpCircle {...iconProps} />;\n default:\n return null;\n }\n };\n\n // Default aria-label based on icon\n const defaultAriaLabel = icon.charAt(0).toUpperCase() + icon.slice(1);\n\n return (\n <button\n ref={ref}\n type=\"button\"\n className={className}\n style={buttonStyles}\n onClick={onClick}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => {\n setIsHovered(false);\n setIsActive(false);\n }}\n onMouseDown={() => setIsActive(true)}\n onMouseUp={() => setIsActive(false)}\n aria-label={ariaLabel || defaultAriaLabel}\n aria-pressed={selected}\n >\n {renderIcon()}\n </button>\n );\n }\n);\n\nSideNavButton.displayName = 'SideNavButton';\n"],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,MAAM,MAAM,MAAM,UAAU,MAAM,eAAe,kBAAkB;AAwG3D;AA/DV,IAAM,gBAAsB;AAAA,EACjC,CACE;AAAA,IACE;AAAA,IACA,WAAW;AAAA,IACX,UAAU;AAAA,IACV;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,EACF,GACA,QACG;AACH,UAAM,CAAC,WAAW,YAAY,IAAU,eAAS,KAAK;AACtD,UAAM,CAAC,UAAU,WAAW,IAAU,eAAS,KAAK;AAGpD,UAAM,eAAe,MAAM;AACzB,UAAI,SAAU,QAAO;AACrB,UAAI,YAAY,UAAW,QAAO;AAClC,aAAO;AAAA,IACT;AAGA,UAAM,qBAAqB,MAAM;AAC/B,UAAI,SAAU,QAAO;AACrB,UAAI,SAAU,QAAO;AACrB,UAAI,UAAW,QAAO;AACtB,aAAO;AAAA,IACT;AAEA,UAAM,eAAoC;AAAA,MACxC,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,cAAc;AAAA,MACd,QAAQ;AAAA,MACR,iBAAiB,mBAAmB;AAAA,MACpC,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,WAAW,UAAU,4BAA4B;AAAA,MACjD,GAAG;AAAA,IACL;AAGA,UAAM,aAAa,MAAM;AACvB,YAAM,YAAY,aAAa;AAC/B,YAAM,WAAW;AACjB,YAAM,cAAc;AAGpB,YAAM,YAAY;AAAA,QAChB,MAAM;AAAA,QACN,OAAO;AAAA,QACP;AAAA,MACF;AAEA,cAAQ,MAAM;AAAA,QACZ,KAAK;AACH,iBAAO,oBAAC,QAAM,GAAG,WAAW;AAAA,QAC9B,KAAK;AACH,iBAAO,oBAAC,QAAM,GAAG,WAAW;AAAA,QAC9B,KAAK;AACH,iBAAO,oBAAC,QAAM,GAAG,WAAW;AAAA,QAC9B,KAAK;AACH,iBAAO,oBAAC,YAAU,GAAG,WAAW;AAAA,QAClC,KAAK;AACH,iBAAO,oBAAC,QAAM,GAAG,WAAW;AAAA,QAC9B,KAAK;AACH,iBAAO,oBAAC,iBAAe,GAAG,WAAW;AAAA,QACvC,KAAK;AACH,iBAAO,oBAAC,cAAY,GAAG,WAAW;AAAA,QACpC;AACE,iBAAO;AAAA,MACX;AAAA,IACF;AAGA,UAAM,mBAAmB,KAAK,OAAO,CAAC,EAAE,YAAY,IAAI,KAAK,MAAM,CAAC;AAEpE,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,MAAK;AAAA,QACL;AAAA,QACA,OAAO;AAAA,QACP;AAAA,QACA,cAAc,MAAM,aAAa,IAAI;AAAA,QACrC,cAAc,MAAM;AAClB,uBAAa,KAAK;AAClB,sBAAY,KAAK;AAAA,QACnB;AAAA,QACA,aAAa,MAAM,YAAY,IAAI;AAAA,QACnC,WAAW,MAAM,YAAY,KAAK;AAAA,QAClC,cAAY,aAAa;AAAA,QACzB,gBAAc;AAAA,QAEb,qBAAW;AAAA;AAAA,IACd;AAAA,EAEJ;AACF;AAEA,cAAc,cAAc;","names":[]}
|
package/dist/index.d.mts
CHANGED
|
@@ -37,6 +37,8 @@ export { Modal, ModalContent, ModalContentProps, ModalProps } from './Modal.mjs'
|
|
|
37
37
|
export { AvatarLogoLockup, AvatarLogoLockupProps } from './AvatarLogoLockup.mjs';
|
|
38
38
|
export { TopNavItem, TopNavItemProps } from './TopNavItem.mjs';
|
|
39
39
|
export { NavItem, TopNavBar, TopNavBarProps } from './TopNavBar.mjs';
|
|
40
|
+
export { SideNavButton, SideNavButtonIcon, SideNavButtonProps } from './SideNavButton.mjs';
|
|
41
|
+
export { SideNavBar, SideNavBarIcon, SideNavBarProps } from './SideNavBar.mjs';
|
|
40
42
|
import 'react';
|
|
41
43
|
|
|
42
44
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ export { Modal, ModalContent, ModalContentProps, ModalProps } from './Modal.js';
|
|
|
37
37
|
export { AvatarLogoLockup, AvatarLogoLockupProps } from './AvatarLogoLockup.js';
|
|
38
38
|
export { TopNavItem, TopNavItemProps } from './TopNavItem.js';
|
|
39
39
|
export { NavItem, TopNavBar, TopNavBarProps } from './TopNavBar.js';
|
|
40
|
+
export { SideNavButton, SideNavButtonIcon, SideNavButtonProps } from './SideNavButton.js';
|
|
41
|
+
export { SideNavBar, SideNavBarIcon, SideNavBarProps } from './SideNavBar.js';
|
|
40
42
|
import 'react';
|
|
41
43
|
|
|
42
44
|
/**
|
package/dist/index.js
CHANGED
|
@@ -57,6 +57,8 @@ __export(src_exports, {
|
|
|
57
57
|
SectionHeading: () => SectionHeading,
|
|
58
58
|
SectionHeadingInteractive: () => SectionHeadingInteractive,
|
|
59
59
|
SectionIcon: () => SectionIcon,
|
|
60
|
+
SideNavBar: () => SideNavBar,
|
|
61
|
+
SideNavButton: () => SideNavButton,
|
|
60
62
|
SubSectionHeading: () => SubSectionHeading,
|
|
61
63
|
SubSectionInteractive: () => SubSectionInteractive,
|
|
62
64
|
Table: () => Table,
|
|
@@ -6749,6 +6751,201 @@ var TopNavBar = React39.forwardRef(
|
|
|
6749
6751
|
}
|
|
6750
6752
|
);
|
|
6751
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";
|
|
6752
6949
|
// Annotate the CommonJS export names for ESM import in node:
|
|
6753
6950
|
0 && (module.exports = {
|
|
6754
6951
|
Avatar,
|
|
@@ -6778,6 +6975,8 @@ TopNavBar.displayName = "TopNavBar";
|
|
|
6778
6975
|
SectionHeading,
|
|
6779
6976
|
SectionHeadingInteractive,
|
|
6780
6977
|
SectionIcon,
|
|
6978
|
+
SideNavBar,
|
|
6979
|
+
SideNavButton,
|
|
6781
6980
|
SubSectionHeading,
|
|
6782
6981
|
SubSectionInteractive,
|
|
6783
6982
|
Table,
|