@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,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SideNavButtonIcon } from './SideNavButton.mjs';
|
|
3
|
+
|
|
4
|
+
type SideNavBarIcon = Exclude<SideNavButtonIcon, 'home'>;
|
|
5
|
+
interface SideNavBarProps {
|
|
6
|
+
/**
|
|
7
|
+
* The currently selected/active icon (if any)
|
|
8
|
+
*/
|
|
9
|
+
selectedIcon?: SideNavBarIcon;
|
|
10
|
+
/**
|
|
11
|
+
* Click handler for icon buttons - receives the icon type that was clicked
|
|
12
|
+
*/
|
|
13
|
+
onIconClick?: (icon: SideNavBarIcon) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Custom className for the container
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Custom style for the container
|
|
20
|
+
*/
|
|
21
|
+
style?: React.CSSProperties;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* SideNavBar component - Arbor Design System
|
|
25
|
+
*
|
|
26
|
+
* A vertical side navigation bar with fixed icon layout.
|
|
27
|
+
* Icons are grouped with dividers:
|
|
28
|
+
* - Top: Side menu
|
|
29
|
+
* - Middle: Favourite, Notifications, Calendar
|
|
30
|
+
* - Lower: Emergency alert
|
|
31
|
+
* - Bottom (pushed down): Help
|
|
32
|
+
*/
|
|
33
|
+
declare const SideNavBar: React.FC<SideNavBarProps>;
|
|
34
|
+
|
|
35
|
+
export { SideNavBar, type SideNavBarIcon, type SideNavBarProps };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SideNavButtonIcon } from './SideNavButton.js';
|
|
3
|
+
|
|
4
|
+
type SideNavBarIcon = Exclude<SideNavButtonIcon, 'home'>;
|
|
5
|
+
interface SideNavBarProps {
|
|
6
|
+
/**
|
|
7
|
+
* The currently selected/active icon (if any)
|
|
8
|
+
*/
|
|
9
|
+
selectedIcon?: SideNavBarIcon;
|
|
10
|
+
/**
|
|
11
|
+
* Click handler for icon buttons - receives the icon type that was clicked
|
|
12
|
+
*/
|
|
13
|
+
onIconClick?: (icon: SideNavBarIcon) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Custom className for the container
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Custom style for the container
|
|
20
|
+
*/
|
|
21
|
+
style?: React.CSSProperties;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* SideNavBar component - Arbor Design System
|
|
25
|
+
*
|
|
26
|
+
* A vertical side navigation bar with fixed icon layout.
|
|
27
|
+
* Icons are grouped with dividers:
|
|
28
|
+
* - Top: Side menu
|
|
29
|
+
* - Middle: Favourite, Notifications, Calendar
|
|
30
|
+
* - Lower: Emergency alert
|
|
31
|
+
* - Bottom (pushed down): Help
|
|
32
|
+
*/
|
|
33
|
+
declare const SideNavBar: React.FC<SideNavBarProps>;
|
|
34
|
+
|
|
35
|
+
export { SideNavBar, type SideNavBarIcon, type SideNavBarProps };
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/SideNavBar/index.ts
|
|
31
|
+
var SideNavBar_exports = {};
|
|
32
|
+
__export(SideNavBar_exports, {
|
|
33
|
+
SideNavBar: () => SideNavBar
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(SideNavBar_exports);
|
|
36
|
+
|
|
37
|
+
// src/SideNavButton/SideNavButton.tsx
|
|
38
|
+
var React = __toESM(require("react"));
|
|
39
|
+
var import_lucide_react = require("lucide-react");
|
|
40
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
+
var SideNavButton = React.forwardRef(
|
|
42
|
+
({
|
|
43
|
+
icon,
|
|
44
|
+
selected = false,
|
|
45
|
+
focused = false,
|
|
46
|
+
onClick,
|
|
47
|
+
"aria-label": ariaLabel,
|
|
48
|
+
className,
|
|
49
|
+
style
|
|
50
|
+
}, ref) => {
|
|
51
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
52
|
+
const [isActive, setIsActive] = React.useState(false);
|
|
53
|
+
const getIconColor = () => {
|
|
54
|
+
if (selected) return "#0e8a0e";
|
|
55
|
+
if (isActive || isHovered) return "#2f2f2f";
|
|
56
|
+
return "#7e7e7e";
|
|
57
|
+
};
|
|
58
|
+
const getBackgroundColor = () => {
|
|
59
|
+
if (selected) return "#f0faf3";
|
|
60
|
+
if (isActive) return "#efefef";
|
|
61
|
+
if (isHovered) return "#f8f8f8";
|
|
62
|
+
return "transparent";
|
|
63
|
+
};
|
|
64
|
+
const buttonStyles = {
|
|
65
|
+
display: "flex",
|
|
66
|
+
alignItems: "center",
|
|
67
|
+
justifyContent: "center",
|
|
68
|
+
width: "42px",
|
|
69
|
+
height: "42px",
|
|
70
|
+
borderRadius: "99px",
|
|
71
|
+
border: "none",
|
|
72
|
+
backgroundColor: getBackgroundColor(),
|
|
73
|
+
cursor: "pointer",
|
|
74
|
+
padding: 0,
|
|
75
|
+
outline: "none",
|
|
76
|
+
transition: "background-color 150ms ease, box-shadow 150ms ease",
|
|
77
|
+
boxShadow: focused ? "0px 0px 0px 3px #3cad51" : "none",
|
|
78
|
+
...style
|
|
79
|
+
};
|
|
80
|
+
const renderIcon = () => {
|
|
81
|
+
const iconColor = getIconColor();
|
|
82
|
+
const iconSize = 20;
|
|
83
|
+
const strokeWidth = 2;
|
|
84
|
+
const iconProps = {
|
|
85
|
+
size: iconSize,
|
|
86
|
+
color: iconColor,
|
|
87
|
+
strokeWidth
|
|
88
|
+
};
|
|
89
|
+
switch (icon) {
|
|
90
|
+
case "side-menu":
|
|
91
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Menu, { ...iconProps });
|
|
92
|
+
case "home":
|
|
93
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Home, { ...iconProps });
|
|
94
|
+
case "favourite":
|
|
95
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Star, { ...iconProps });
|
|
96
|
+
case "calendar":
|
|
97
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Calendar, { ...iconProps });
|
|
98
|
+
case "notifications":
|
|
99
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Bell, { ...iconProps });
|
|
100
|
+
case "emergency-alert":
|
|
101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.AlertTriangle, { ...iconProps });
|
|
102
|
+
case "help":
|
|
103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.HelpCircle, { ...iconProps });
|
|
104
|
+
default:
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
const defaultAriaLabel = icon.charAt(0).toUpperCase() + icon.slice(1);
|
|
109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
110
|
+
"button",
|
|
111
|
+
{
|
|
112
|
+
ref,
|
|
113
|
+
type: "button",
|
|
114
|
+
className,
|
|
115
|
+
style: buttonStyles,
|
|
116
|
+
onClick,
|
|
117
|
+
onMouseEnter: () => setIsHovered(true),
|
|
118
|
+
onMouseLeave: () => {
|
|
119
|
+
setIsHovered(false);
|
|
120
|
+
setIsActive(false);
|
|
121
|
+
},
|
|
122
|
+
onMouseDown: () => setIsActive(true),
|
|
123
|
+
onMouseUp: () => setIsActive(false),
|
|
124
|
+
"aria-label": ariaLabel || defaultAriaLabel,
|
|
125
|
+
"aria-pressed": selected,
|
|
126
|
+
children: renderIcon()
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
SideNavButton.displayName = "SideNavButton";
|
|
132
|
+
|
|
133
|
+
// src/SideNavBar/SideNavBar.tsx
|
|
134
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
135
|
+
var SideNavBar = ({
|
|
136
|
+
selectedIcon,
|
|
137
|
+
onIconClick,
|
|
138
|
+
className,
|
|
139
|
+
style
|
|
140
|
+
}) => {
|
|
141
|
+
const containerStyles = {
|
|
142
|
+
display: "flex",
|
|
143
|
+
flexDirection: "column",
|
|
144
|
+
alignItems: "center",
|
|
145
|
+
justifyContent: "space-between",
|
|
146
|
+
backgroundColor: "#ffffff",
|
|
147
|
+
padding: "8px",
|
|
148
|
+
borderTopLeftRadius: "8px",
|
|
149
|
+
borderBottomLeftRadius: "8px",
|
|
150
|
+
height: "100%",
|
|
151
|
+
width: "58px",
|
|
152
|
+
boxSizing: "border-box",
|
|
153
|
+
...style
|
|
154
|
+
};
|
|
155
|
+
const topSectionStyles = {
|
|
156
|
+
display: "flex",
|
|
157
|
+
flexDirection: "column",
|
|
158
|
+
alignItems: "center",
|
|
159
|
+
gap: "16px"
|
|
160
|
+
};
|
|
161
|
+
const dividerStyles = {
|
|
162
|
+
width: "24.5px",
|
|
163
|
+
height: "1px",
|
|
164
|
+
backgroundColor: "#efefef"
|
|
165
|
+
};
|
|
166
|
+
const handleClick = (icon) => {
|
|
167
|
+
onIconClick?.(icon);
|
|
168
|
+
};
|
|
169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className, style: containerStyles, children: [
|
|
170
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: topSectionStyles, children: [
|
|
171
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
172
|
+
SideNavButton,
|
|
173
|
+
{
|
|
174
|
+
icon: "side-menu",
|
|
175
|
+
selected: selectedIcon === "side-menu",
|
|
176
|
+
onClick: () => handleClick("side-menu"),
|
|
177
|
+
"aria-label": "Side menu"
|
|
178
|
+
}
|
|
179
|
+
),
|
|
180
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: dividerStyles }),
|
|
181
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
182
|
+
SideNavButton,
|
|
183
|
+
{
|
|
184
|
+
icon: "favourite",
|
|
185
|
+
selected: selectedIcon === "favourite",
|
|
186
|
+
onClick: () => handleClick("favourite"),
|
|
187
|
+
"aria-label": "Favourites"
|
|
188
|
+
}
|
|
189
|
+
),
|
|
190
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
191
|
+
SideNavButton,
|
|
192
|
+
{
|
|
193
|
+
icon: "notifications",
|
|
194
|
+
selected: selectedIcon === "notifications",
|
|
195
|
+
onClick: () => handleClick("notifications"),
|
|
196
|
+
"aria-label": "Notifications"
|
|
197
|
+
}
|
|
198
|
+
),
|
|
199
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
200
|
+
SideNavButton,
|
|
201
|
+
{
|
|
202
|
+
icon: "calendar",
|
|
203
|
+
selected: selectedIcon === "calendar",
|
|
204
|
+
onClick: () => handleClick("calendar"),
|
|
205
|
+
"aria-label": "Calendar"
|
|
206
|
+
}
|
|
207
|
+
),
|
|
208
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: dividerStyles }),
|
|
209
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
210
|
+
SideNavButton,
|
|
211
|
+
{
|
|
212
|
+
icon: "emergency-alert",
|
|
213
|
+
selected: selectedIcon === "emergency-alert",
|
|
214
|
+
onClick: () => handleClick("emergency-alert"),
|
|
215
|
+
"aria-label": "Emergency alerts"
|
|
216
|
+
}
|
|
217
|
+
)
|
|
218
|
+
] }),
|
|
219
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
220
|
+
SideNavButton,
|
|
221
|
+
{
|
|
222
|
+
icon: "help",
|
|
223
|
+
selected: selectedIcon === "help",
|
|
224
|
+
onClick: () => handleClick("help"),
|
|
225
|
+
"aria-label": "Help"
|
|
226
|
+
}
|
|
227
|
+
)
|
|
228
|
+
] });
|
|
229
|
+
};
|
|
230
|
+
SideNavBar.displayName = "SideNavBar";
|
|
231
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
232
|
+
0 && (module.exports = {
|
|
233
|
+
SideNavBar
|
|
234
|
+
});
|
|
235
|
+
//# sourceMappingURL=SideNavBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/SideNavBar/index.ts","../src/SideNavButton/SideNavButton.tsx","../src/SideNavBar/SideNavBar.tsx"],"sourcesContent":["export { SideNavBar } from './SideNavBar';\nexport type { SideNavBarProps, SideNavBarIcon } from './SideNavBar';\n","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","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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,0BAA4E;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,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,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,6CAAC,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":["import_jsx_runtime"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type SideNavButtonIcon = 'side-menu' | 'home' | 'favourite' | 'calendar' | 'notifications' | 'emergency-alert' | 'help';
|
|
4
|
+
interface SideNavButtonProps {
|
|
5
|
+
/**
|
|
6
|
+
* The icon to display
|
|
7
|
+
*/
|
|
8
|
+
icon: SideNavButtonIcon;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the button is selected/active
|
|
11
|
+
*/
|
|
12
|
+
selected?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the button is focused (shows green ring)
|
|
15
|
+
*/
|
|
16
|
+
focused?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Click handler
|
|
19
|
+
*/
|
|
20
|
+
onClick?: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* Accessible label for the button
|
|
23
|
+
*/
|
|
24
|
+
'aria-label'?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Custom className
|
|
27
|
+
*/
|
|
28
|
+
className?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Custom style
|
|
31
|
+
*/
|
|
32
|
+
style?: React.CSSProperties;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* SideNavButton component - Arbor Design System
|
|
36
|
+
*
|
|
37
|
+
* A circular navigation button used in the side navigation bar.
|
|
38
|
+
* Supports different icons and states (default, hover, active, selected, focused).
|
|
39
|
+
*/
|
|
40
|
+
declare const SideNavButton: React.ForwardRefExoticComponent<SideNavButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
41
|
+
|
|
42
|
+
export { SideNavButton, type SideNavButtonIcon, type SideNavButtonProps };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type SideNavButtonIcon = 'side-menu' | 'home' | 'favourite' | 'calendar' | 'notifications' | 'emergency-alert' | 'help';
|
|
4
|
+
interface SideNavButtonProps {
|
|
5
|
+
/**
|
|
6
|
+
* The icon to display
|
|
7
|
+
*/
|
|
8
|
+
icon: SideNavButtonIcon;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the button is selected/active
|
|
11
|
+
*/
|
|
12
|
+
selected?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the button is focused (shows green ring)
|
|
15
|
+
*/
|
|
16
|
+
focused?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Click handler
|
|
19
|
+
*/
|
|
20
|
+
onClick?: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* Accessible label for the button
|
|
23
|
+
*/
|
|
24
|
+
'aria-label'?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Custom className
|
|
27
|
+
*/
|
|
28
|
+
className?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Custom style
|
|
31
|
+
*/
|
|
32
|
+
style?: React.CSSProperties;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* SideNavButton component - Arbor Design System
|
|
36
|
+
*
|
|
37
|
+
* A circular navigation button used in the side navigation bar.
|
|
38
|
+
* Supports different icons and states (default, hover, active, selected, focused).
|
|
39
|
+
*/
|
|
40
|
+
declare const SideNavButton: React.ForwardRefExoticComponent<SideNavButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
41
|
+
|
|
42
|
+
export { SideNavButton, type SideNavButtonIcon, type SideNavButtonProps };
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/SideNavButton/index.ts
|
|
31
|
+
var SideNavButton_exports = {};
|
|
32
|
+
__export(SideNavButton_exports, {
|
|
33
|
+
SideNavButton: () => SideNavButton
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(SideNavButton_exports);
|
|
36
|
+
|
|
37
|
+
// src/SideNavButton/SideNavButton.tsx
|
|
38
|
+
var React = __toESM(require("react"));
|
|
39
|
+
var import_lucide_react = require("lucide-react");
|
|
40
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
+
var SideNavButton = React.forwardRef(
|
|
42
|
+
({
|
|
43
|
+
icon,
|
|
44
|
+
selected = false,
|
|
45
|
+
focused = false,
|
|
46
|
+
onClick,
|
|
47
|
+
"aria-label": ariaLabel,
|
|
48
|
+
className,
|
|
49
|
+
style
|
|
50
|
+
}, ref) => {
|
|
51
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
52
|
+
const [isActive, setIsActive] = React.useState(false);
|
|
53
|
+
const getIconColor = () => {
|
|
54
|
+
if (selected) return "#0e8a0e";
|
|
55
|
+
if (isActive || isHovered) return "#2f2f2f";
|
|
56
|
+
return "#7e7e7e";
|
|
57
|
+
};
|
|
58
|
+
const getBackgroundColor = () => {
|
|
59
|
+
if (selected) return "#f0faf3";
|
|
60
|
+
if (isActive) return "#efefef";
|
|
61
|
+
if (isHovered) return "#f8f8f8";
|
|
62
|
+
return "transparent";
|
|
63
|
+
};
|
|
64
|
+
const buttonStyles = {
|
|
65
|
+
display: "flex",
|
|
66
|
+
alignItems: "center",
|
|
67
|
+
justifyContent: "center",
|
|
68
|
+
width: "42px",
|
|
69
|
+
height: "42px",
|
|
70
|
+
borderRadius: "99px",
|
|
71
|
+
border: "none",
|
|
72
|
+
backgroundColor: getBackgroundColor(),
|
|
73
|
+
cursor: "pointer",
|
|
74
|
+
padding: 0,
|
|
75
|
+
outline: "none",
|
|
76
|
+
transition: "background-color 150ms ease, box-shadow 150ms ease",
|
|
77
|
+
boxShadow: focused ? "0px 0px 0px 3px #3cad51" : "none",
|
|
78
|
+
...style
|
|
79
|
+
};
|
|
80
|
+
const renderIcon = () => {
|
|
81
|
+
const iconColor = getIconColor();
|
|
82
|
+
const iconSize = 20;
|
|
83
|
+
const strokeWidth = 2;
|
|
84
|
+
const iconProps = {
|
|
85
|
+
size: iconSize,
|
|
86
|
+
color: iconColor,
|
|
87
|
+
strokeWidth
|
|
88
|
+
};
|
|
89
|
+
switch (icon) {
|
|
90
|
+
case "side-menu":
|
|
91
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Menu, { ...iconProps });
|
|
92
|
+
case "home":
|
|
93
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Home, { ...iconProps });
|
|
94
|
+
case "favourite":
|
|
95
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Star, { ...iconProps });
|
|
96
|
+
case "calendar":
|
|
97
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Calendar, { ...iconProps });
|
|
98
|
+
case "notifications":
|
|
99
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Bell, { ...iconProps });
|
|
100
|
+
case "emergency-alert":
|
|
101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.AlertTriangle, { ...iconProps });
|
|
102
|
+
case "help":
|
|
103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.HelpCircle, { ...iconProps });
|
|
104
|
+
default:
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
const defaultAriaLabel = icon.charAt(0).toUpperCase() + icon.slice(1);
|
|
109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
110
|
+
"button",
|
|
111
|
+
{
|
|
112
|
+
ref,
|
|
113
|
+
type: "button",
|
|
114
|
+
className,
|
|
115
|
+
style: buttonStyles,
|
|
116
|
+
onClick,
|
|
117
|
+
onMouseEnter: () => setIsHovered(true),
|
|
118
|
+
onMouseLeave: () => {
|
|
119
|
+
setIsHovered(false);
|
|
120
|
+
setIsActive(false);
|
|
121
|
+
},
|
|
122
|
+
onMouseDown: () => setIsActive(true),
|
|
123
|
+
onMouseUp: () => setIsActive(false),
|
|
124
|
+
"aria-label": ariaLabel || defaultAriaLabel,
|
|
125
|
+
"aria-pressed": selected,
|
|
126
|
+
children: renderIcon()
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
SideNavButton.displayName = "SideNavButton";
|
|
132
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
133
|
+
0 && (module.exports = {
|
|
134
|
+
SideNavButton
|
|
135
|
+
});
|
|
136
|
+
//# sourceMappingURL=SideNavButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/SideNavButton/index.ts","../src/SideNavButton/SideNavButton.tsx"],"sourcesContent":["export { SideNavButton } from './SideNavButton';\nexport type { SideNavButtonProps, SideNavButtonIcon } from './SideNavButton';\n","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;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,0BAA4E;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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