@tonyarbor/components 0.7.1 → 0.9.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/Button.js +2 -0
- package/dist/Button.js.map +1 -1
- package/dist/Button.mjs +1 -1
- package/dist/SideNavBar.d.mts +50 -0
- package/dist/SideNavBar.d.ts +50 -0
- package/dist/SideNavBar.js +291 -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.js +2 -0
- package/dist/TopNavBar.js.map +1 -1
- package/dist/TopNavBar.mjs +2 -2
- package/dist/chunk-I4ZVW4AI.mjs +100 -0
- package/dist/chunk-I4ZVW4AI.mjs.map +1 -0
- package/dist/{chunk-NOUFR6W2.mjs → chunk-NXCJQPN2.mjs} +3 -1
- package/dist/chunk-NXCJQPN2.mjs.map +1 -0
- package/dist/chunk-XHHK23VA.mjs +163 -0
- package/dist/chunk-XHHK23VA.mjs.map +1 -0
- package/dist/{chunk-YUXQQX7M.mjs → chunk-ZJKDUWEH.mjs} +2 -2
- package/dist/index.d.mts +71 -2
- package/dist/index.d.ts +71 -2
- package/dist/index.js +425 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +177 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -1
- package/dist/chunk-NOUFR6W2.mjs.map +0 -1
- /package/dist/{chunk-YUXQQX7M.mjs.map → chunk-ZJKDUWEH.mjs.map} +0 -0
package/dist/Button.js
CHANGED
|
@@ -44,6 +44,8 @@ var buttonStyles = {
|
|
|
44
44
|
display: "inline-flex",
|
|
45
45
|
alignItems: "center",
|
|
46
46
|
justifyContent: "center",
|
|
47
|
+
gap: "8px",
|
|
48
|
+
// Consistent spacing between icon and text
|
|
47
49
|
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
48
50
|
fontWeight: "500",
|
|
49
51
|
borderRadius: "99px",
|
package/dist/Button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Button/index.ts","../src/Button/Button.tsx"],"sourcesContent":["export { Button } from './Button';\nexport type { ButtonProps } from './Button';\n","import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { clsx } from 'clsx';\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'destructive' | 'destructive-secondary' | 'ghost';\nexport type ButtonSize = 'small' | 'medium';\n\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * The visual style variant of the button\n * @default 'primary'\n */\n variant?: ButtonVariant;\n /**\n * The size of the button\n * @default 'medium'\n */\n size?: ButtonSize;\n /**\n * If true, the component will be rendered as a child element\n * and merge its props with the child\n */\n asChild?: boolean;\n /**\n * The content of the button\n */\n children: React.ReactNode;\n}\n\n// Arbor Design System button styles\nconst buttonStyles = {\n base: {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n fontFamily: \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n fontWeight: '500',\n borderRadius: '99px', // Pill shape\n border: 'none',\n cursor: 'pointer',\n transition: 'all 0.2s ease-in-out',\n outline: 'none',\n },\n variants: {\n primary: {\n backgroundColor: '#0e8a0e', // brand-600\n color: '#ffffff',\n ':hover': {\n backgroundColor: '#005700', // brand-800\n },\n ':active': {\n backgroundColor: '#024002', // brand-900\n },\n ':focus-visible': {\n outline: '3px solid #3cad51', // brand-500\n outlineOffset: '0px',\n },\n ':disabled': {\n backgroundColor: '#b3b3b3', // grey-400\n cursor: 'not-allowed',\n },\n },\n secondary: {\n backgroundColor: '#ffffff',\n color: '#2f2f2f', // grey-900\n border: '1px solid #d1d1d1', // grey-300\n ':hover': {\n backgroundColor: '#f8f8f8', // grey-050\n },\n ':active': {\n backgroundColor: '#efefef', // grey-100\n },\n ':focus-visible': {\n outline: '3px solid #3cad51', // brand-500\n outlineOffset: '0px',\n },\n ':disabled': {\n backgroundColor: '#f8f8f8',\n color: '#b3b3b3',\n cursor: 'not-allowed',\n },\n },\n tertiary: {\n backgroundColor: '#efefef', // grey-100\n color: '#2f2f2f', // grey-900\n ':hover': {\n backgroundColor: '#dfdfdf', // grey-200\n },\n ':active': {\n backgroundColor: '#d1d1d1', // grey-300\n },\n ':focus-visible': {\n outline: '3px solid #3cad51', // brand-500\n outlineOffset: '0px',\n },\n ':disabled': {\n backgroundColor: '#f8f8f8', // grey-050\n color: '#b3b3b3', // grey-400\n cursor: 'not-allowed',\n },\n },\n destructive: {\n backgroundColor: '#c93232', // destructive-500\n color: '#ffffff',\n ':hover': {\n backgroundColor: '#920a0a', // destructive-700\n },\n ':active': {\n backgroundColor: '#610202', // destructive-800\n },\n ':focus-visible': {\n outline: '3px solid #e86565', // destructive-300\n outlineOffset: '0px',\n },\n ':disabled': {\n backgroundColor: '#b3b3b3',\n cursor: 'not-allowed',\n },\n },\n 'destructive-secondary': {\n backgroundColor: '#ffffff',\n color: '#a62323', // destructive-600\n border: '1px solid #c93232', // destructive-500\n ':hover': {\n backgroundColor: '#a62323', // destructive-600\n color: '#ffffff',\n border: '1px solid #a62323',\n },\n ':active': {\n backgroundColor: '#920a0a', // destructive-700\n color: '#ffffff',\n border: '1px solid #920a0a',\n },\n ':focus-visible': {\n outline: '3px solid #3cad51', // brand-500 (green focus ring)\n outlineOffset: '0px',\n },\n ':disabled': {\n backgroundColor: '#ffffff',\n color: '#b3b3b3',\n border: '1px solid #d1d1d1',\n cursor: 'not-allowed',\n },\n },\n ghost: {\n backgroundColor: 'transparent',\n color: '#0b800b', // brand-700 for link style\n textDecoration: 'underline',\n ':hover': {\n color: '#005700', // brand-800\n },\n ':active': {\n color: '#024002', // brand-900\n },\n ':focus-visible': {\n outline: '3px solid #3cad51',\n outlineOffset: '2px',\n },\n ':disabled': {\n color: '#b3b3b3',\n cursor: 'not-allowed',\n },\n },\n },\n sizes: {\n small: {\n height: '32px',\n fontSize: '13px',\n padding: '8px 16px',\n },\n medium: {\n height: '36px',\n fontSize: '13px',\n padding: '8px 16px',\n },\n },\n};\n\n/**\n * Button component - Arbor Design System\n *\n * A flexible button component with pill-shaped design following Arbor's design system.\n * Supports primary (green), secondary (outlined), destructive (red), and ghost (link-style) variants.\n *\n * @example\n * ```tsx\n * <Button variant=\"primary\" size=\"medium\">\n * Save Changes\n * </Button>\n * ```\n */\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n variant = 'primary',\n size = 'medium',\n asChild = false,\n className,\n disabled,\n style,\n children,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : 'button';\n const [isHovered, setIsHovered] = React.useState(false);\n const [isFocused, setIsFocused] = React.useState(false);\n\n const variantStyles = buttonStyles.variants[variant];\n const sizeStyles = buttonStyles.sizes[size];\n\n const combinedStyle: React.CSSProperties = {\n ...buttonStyles.base,\n ...variantStyles,\n ...sizeStyles,\n ...(isHovered && !disabled && variantStyles[':hover']),\n ...(isFocused && !disabled && variantStyles[':focus-visible']),\n ...(disabled && variantStyles[':disabled']),\n ...style,\n };\n\n const handleMouseEnter = (e: React.MouseEvent<HTMLButtonElement>) => {\n setIsHovered(true);\n onMouseEnter?.(e);\n };\n\n const handleMouseLeave = (e: React.MouseEvent<HTMLButtonElement>) => {\n setIsHovered(false);\n onMouseLeave?.(e);\n };\n\n const handleFocus = (e: React.FocusEvent<HTMLButtonElement>) => {\n setIsFocused(true);\n onFocus?.(e);\n };\n\n const handleBlur = (e: React.FocusEvent<HTMLButtonElement>) => {\n setIsFocused(false);\n onBlur?.(e);\n };\n\n return (\n <Comp\n ref={ref}\n className={clsx('arbor-button', className)}\n style={combinedStyle}\n disabled={disabled}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onFocus={handleFocus}\n onBlur={handleBlur}\n {...props}\n >\n {children}\n </Comp>\n );\n }\n);\n\nButton.displayName = 'Button';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,wBAAqB;AACrB,kBAAqB;AAqPf;AAzNN,IAAM,eAAe;AAAA,EACnB,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,cAAc;AAAA;AAAA,IACd,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,SAAS;AAAA,EACX;AAAA,EACA,UAAU;AAAA,IACR,SAAS;AAAA,MACP,iBAAiB;AAAA;AAAA,MACjB,OAAO;AAAA,MACP,UAAU;AAAA,QACR,iBAAiB;AAAA;AAAA,MACnB;AAAA,MACA,WAAW;AAAA,QACT,iBAAiB;AAAA;AAAA,MACnB;AAAA,MACA,kBAAkB;AAAA,QAChB,SAAS;AAAA;AAAA,QACT,eAAe;AAAA,MACjB;AAAA,MACA,aAAa;AAAA,QACX,iBAAiB;AAAA;AAAA,QACjB,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,IACA,WAAW;AAAA,MACT,iBAAiB;AAAA,MACjB,OAAO;AAAA;AAAA,MACP,QAAQ;AAAA;AAAA,MACR,UAAU;AAAA,QACR,iBAAiB;AAAA;AAAA,MACnB;AAAA,MACA,WAAW;AAAA,QACT,iBAAiB;AAAA;AAAA,MACnB;AAAA,MACA,kBAAkB;AAAA,QAChB,SAAS;AAAA;AAAA,QACT,eAAe;AAAA,MACjB;AAAA,MACA,aAAa;AAAA,QACX,iBAAiB;AAAA,QACjB,OAAO;AAAA,QACP,QAAQ;AAAA,MACV;AAAA,IACF;A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,IAClB;AAEA,UAAM,cAAc,CAAC,MAA2C;AAC9D,mBAAa,IAAI;AACjB,gBAAU,CAAC;AAAA,IACb;AAEA,UAAM,aAAa,CAAC,MAA2C;AAC7D,mBAAa,KAAK;AAClB,eAAS,CAAC;AAAA,IACZ;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,kBAAK,gBAAgB,SAAS;AAAA,QACzC,OAAO;AAAA,QACP;AAAA,QACA,cAAc;AAAA,QACd,cAAc;AAAA,QACd,SAAS;AAAA,QACT,QAAQ;AAAA,QACP,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,OAAO,cAAc;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/Button/index.ts","../src/Button/Button.tsx"],"sourcesContent":["export { Button } from './Button';\nexport type { ButtonProps } from './Button';\n","import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { clsx } from 'clsx';\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'destructive' | 'destructive-secondary' | 'ghost';\nexport type ButtonSize = 'small' | 'medium';\n\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * The visual style variant of the button\n * @default 'primary'\n */\n variant?: ButtonVariant;\n /**\n * The size of the button\n * @default 'medium'\n */\n size?: ButtonSize;\n /**\n * If true, the component will be rendered as a child element\n * and merge its props with the child\n */\n asChild?: boolean;\n /**\n * The content of the button\n */\n children: React.ReactNode;\n}\n\n// Arbor Design System button styles\nconst buttonStyles = {\n base: {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: '8px', // Consistent spacing between icon and text\n fontFamily: \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n fontWeight: '500',\n borderRadius: '99px', // Pill shape\n border: 'none',\n cursor: 'pointer',\n transition: 'all 0.2s ease-in-out',\n outline: 'none',\n },\n variants: {\n primary: {\n backgroundColor: '#0e8a0e', // brand-600\n color: '#ffffff',\n ':hover': {\n backgroundColor: '#005700', // brand-800\n },\n ':active': {\n backgroundColor: '#024002', // brand-900\n },\n ':focus-visible': {\n outline: '3px solid #3cad51', // brand-500\n outlineOffset: '0px',\n },\n ':disabled': {\n backgroundColor: '#b3b3b3', // grey-400\n cursor: 'not-allowed',\n },\n },\n secondary: {\n backgroundColor: '#ffffff',\n color: '#2f2f2f', // grey-900\n border: '1px solid #d1d1d1', // grey-300\n ':hover': {\n backgroundColor: '#f8f8f8', // grey-050\n },\n ':active': {\n backgroundColor: '#efefef', // grey-100\n },\n ':focus-visible': {\n outline: '3px solid #3cad51', // brand-500\n outlineOffset: '0px',\n },\n ':disabled': {\n backgroundColor: '#f8f8f8',\n color: '#b3b3b3',\n cursor: 'not-allowed',\n },\n },\n tertiary: {\n backgroundColor: '#efefef', // grey-100\n color: '#2f2f2f', // grey-900\n ':hover': {\n backgroundColor: '#dfdfdf', // grey-200\n },\n ':active': {\n backgroundColor: '#d1d1d1', // grey-300\n },\n ':focus-visible': {\n outline: '3px solid #3cad51', // brand-500\n outlineOffset: '0px',\n },\n ':disabled': {\n backgroundColor: '#f8f8f8', // grey-050\n color: '#b3b3b3', // grey-400\n cursor: 'not-allowed',\n },\n },\n destructive: {\n backgroundColor: '#c93232', // destructive-500\n color: '#ffffff',\n ':hover': {\n backgroundColor: '#920a0a', // destructive-700\n },\n ':active': {\n backgroundColor: '#610202', // destructive-800\n },\n ':focus-visible': {\n outline: '3px solid #e86565', // destructive-300\n outlineOffset: '0px',\n },\n ':disabled': {\n backgroundColor: '#b3b3b3',\n cursor: 'not-allowed',\n },\n },\n 'destructive-secondary': {\n backgroundColor: '#ffffff',\n color: '#a62323', // destructive-600\n border: '1px solid #c93232', // destructive-500\n ':hover': {\n backgroundColor: '#a62323', // destructive-600\n color: '#ffffff',\n border: '1px solid #a62323',\n },\n ':active': {\n backgroundColor: '#920a0a', // destructive-700\n color: '#ffffff',\n border: '1px solid #920a0a',\n },\n ':focus-visible': {\n outline: '3px solid #3cad51', // brand-500 (green focus ring)\n outlineOffset: '0px',\n },\n ':disabled': {\n backgroundColor: '#ffffff',\n color: '#b3b3b3',\n border: '1px solid #d1d1d1',\n cursor: 'not-allowed',\n },\n },\n ghost: {\n backgroundColor: 'transparent',\n color: '#0b800b', // brand-700 for link style\n textDecoration: 'underline',\n ':hover': {\n color: '#005700', // brand-800\n },\n ':active': {\n color: '#024002', // brand-900\n },\n ':focus-visible': {\n outline: '3px solid #3cad51',\n outlineOffset: '2px',\n },\n ':disabled': {\n color: '#b3b3b3',\n cursor: 'not-allowed',\n },\n },\n },\n sizes: {\n small: {\n height: '32px',\n fontSize: '13px',\n padding: '8px 16px',\n },\n medium: {\n height: '36px',\n fontSize: '13px',\n padding: '8px 16px',\n },\n },\n};\n\n/**\n * Button component - Arbor Design System\n *\n * A flexible button component with pill-shaped design following Arbor's design system.\n * Supports primary (green), secondary (outlined), destructive (red), and ghost (link-style) variants.\n *\n * @example\n * ```tsx\n * <Button variant=\"primary\" size=\"medium\">\n * Save Changes\n * </Button>\n * ```\n */\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n variant = 'primary',\n size = 'medium',\n asChild = false,\n className,\n disabled,\n style,\n children,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : 'button';\n const [isHovered, setIsHovered] = React.useState(false);\n const [isFocused, setIsFocused] = React.useState(false);\n\n const variantStyles = buttonStyles.variants[variant];\n const sizeStyles = buttonStyles.sizes[size];\n\n const combinedStyle: React.CSSProperties = {\n ...buttonStyles.base,\n ...variantStyles,\n ...sizeStyles,\n ...(isHovered && !disabled && variantStyles[':hover']),\n ...(isFocused && !disabled && variantStyles[':focus-visible']),\n ...(disabled && variantStyles[':disabled']),\n ...style,\n };\n\n const handleMouseEnter = (e: React.MouseEvent<HTMLButtonElement>) => {\n setIsHovered(true);\n onMouseEnter?.(e);\n };\n\n const handleMouseLeave = (e: React.MouseEvent<HTMLButtonElement>) => {\n setIsHovered(false);\n onMouseLeave?.(e);\n };\n\n const handleFocus = (e: React.FocusEvent<HTMLButtonElement>) => {\n setIsFocused(true);\n onFocus?.(e);\n };\n\n const handleBlur = (e: React.FocusEvent<HTMLButtonElement>) => {\n setIsFocused(false);\n onBlur?.(e);\n };\n\n return (\n <Comp\n ref={ref}\n className={clsx('arbor-button', className)}\n style={combinedStyle}\n disabled={disabled}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onFocus={handleFocus}\n onBlur={handleBlur}\n {...props}\n >\n {children}\n </Comp>\n );\n }\n);\n\nButton.displayName = 'Button';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,wBAAqB;AACrB,kBAAqB;AAsPf;AA1NN,IAAM,eAAe;AAAA,EACnB,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,KAAK;AAAA;AAAA,IACL,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,cAAc;AAAA;AAAA,IACd,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,SAAS;AAAA,EACX;AAAA,EACA,UAAU;AAAA,IACR,SAAS;AAAA,MACP,iBAAiB;AAAA;AAAA,MACjB,OAAO;AAAA,MACP,UAAU;AAAA,QACR,iBAAiB;AAAA;AAAA,MACnB;AAAA,MACA,WAAW;AAAA,QACT,iBAAiB;AAAA;AAAA,MACnB;AAAA,MACA,kBAAkB;AAAA,QAChB,SAAS;AAAA;AAAA,QACT,eAAe;AAAA,MACjB;AAAA,MACA,aAAa;AAAA,QACX,iBAAiB;AAAA;AAAA,QACjB,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,IACA,WAAW;AAAA,MACT,iBAAiB;AAAA,MACjB,OAAO;AAAA;AAAA,MACP,QAAQ;AAA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AAAA,MACpD,GAAI,aAAa,CAAC,YAAY,cAAc,gBAAgB;AAAA,MAC5D,GAAI,YAAY,cAAc,WAAW;AAAA,MACzC,GAAG;AAAA,IACL;AAEA,UAAM,mBAAmB,CAAC,MAA2C;AACnE,mBAAa,IAAI;AACjB,qBAAe,CAAC;AAAA,IAClB;AAEA,UAAM,mBAAmB,CAAC,MAA2C;AACnE,mBAAa,KAAK;AAClB,qBAAe,CAAC;AAAA,IAClB;AAEA,UAAM,cAAc,CAAC,MAA2C;AAC9D,mBAAa,IAAI;AACjB,gBAAU,CAAC;AAAA,IACb;AAEA,UAAM,aAAa,CAAC,MAA2C;AAC7D,mBAAa,KAAK;AAClB,eAAS,CAAC;AAAA,IACZ;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,kBAAK,gBAAgB,SAAS;AAAA,QACzC,OAAO;AAAA,QACP;AAAA,QACA,cAAc;AAAA,QACd,cAAc;AAAA,QACd,SAAS;AAAA,QACT,QAAQ;AAAA,QACP,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,OAAO,cAAc;","names":[]}
|
package/dist/Button.mjs
CHANGED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SideNavButtonIcon } from './SideNavButton.mjs';
|
|
3
|
+
|
|
4
|
+
type SideNavBarIcon = Exclude<SideNavButtonIcon, 'home'>;
|
|
5
|
+
interface SideNavBarProps {
|
|
6
|
+
/**
|
|
7
|
+
* Whether the navigation panel is open (showing title and children)
|
|
8
|
+
* @default false
|
|
9
|
+
*/
|
|
10
|
+
isOpen?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Title displayed in the header when open (e.g., "Attendance")
|
|
13
|
+
*/
|
|
14
|
+
title?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Navigation items to display when open (typically SideNavItem components)
|
|
17
|
+
*/
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* The currently selected/active icon (if any)
|
|
21
|
+
*/
|
|
22
|
+
selectedIcon?: SideNavBarIcon;
|
|
23
|
+
/**
|
|
24
|
+
* Click handler for icon buttons - receives the icon type that was clicked
|
|
25
|
+
*/
|
|
26
|
+
onIconClick?: (icon: SideNavBarIcon) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Custom className for the container
|
|
29
|
+
*/
|
|
30
|
+
className?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Custom style for the container
|
|
33
|
+
*/
|
|
34
|
+
style?: React.CSSProperties;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* SideNavBar component - Arbor Design System
|
|
38
|
+
*
|
|
39
|
+
* A vertical side navigation bar with fixed icon layout.
|
|
40
|
+
* Icons are grouped with dividers:
|
|
41
|
+
* - Top: Side menu
|
|
42
|
+
* - Middle: Favourite, Notifications, Calendar
|
|
43
|
+
* - Lower: Emergency alert
|
|
44
|
+
* - Bottom (pushed down): Help
|
|
45
|
+
*
|
|
46
|
+
* When open, displays a content panel with a title header and navigation items.
|
|
47
|
+
*/
|
|
48
|
+
declare const SideNavBar: React.FC<SideNavBarProps>;
|
|
49
|
+
|
|
50
|
+
export { SideNavBar, type SideNavBarIcon, type SideNavBarProps };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SideNavButtonIcon } from './SideNavButton.js';
|
|
3
|
+
|
|
4
|
+
type SideNavBarIcon = Exclude<SideNavButtonIcon, 'home'>;
|
|
5
|
+
interface SideNavBarProps {
|
|
6
|
+
/**
|
|
7
|
+
* Whether the navigation panel is open (showing title and children)
|
|
8
|
+
* @default false
|
|
9
|
+
*/
|
|
10
|
+
isOpen?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Title displayed in the header when open (e.g., "Attendance")
|
|
13
|
+
*/
|
|
14
|
+
title?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Navigation items to display when open (typically SideNavItem components)
|
|
17
|
+
*/
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* The currently selected/active icon (if any)
|
|
21
|
+
*/
|
|
22
|
+
selectedIcon?: SideNavBarIcon;
|
|
23
|
+
/**
|
|
24
|
+
* Click handler for icon buttons - receives the icon type that was clicked
|
|
25
|
+
*/
|
|
26
|
+
onIconClick?: (icon: SideNavBarIcon) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Custom className for the container
|
|
29
|
+
*/
|
|
30
|
+
className?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Custom style for the container
|
|
33
|
+
*/
|
|
34
|
+
style?: React.CSSProperties;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* SideNavBar component - Arbor Design System
|
|
38
|
+
*
|
|
39
|
+
* A vertical side navigation bar with fixed icon layout.
|
|
40
|
+
* Icons are grouped with dividers:
|
|
41
|
+
* - Top: Side menu
|
|
42
|
+
* - Middle: Favourite, Notifications, Calendar
|
|
43
|
+
* - Lower: Emergency alert
|
|
44
|
+
* - Bottom (pushed down): Help
|
|
45
|
+
*
|
|
46
|
+
* When open, displays a content panel with a title header and navigation items.
|
|
47
|
+
*/
|
|
48
|
+
declare const SideNavBar: React.FC<SideNavBarProps>;
|
|
49
|
+
|
|
50
|
+
export { SideNavBar, type SideNavBarIcon, type SideNavBarProps };
|
|
@@ -0,0 +1,291 @@
|
|
|
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
|
+
isOpen = false,
|
|
137
|
+
title,
|
|
138
|
+
children,
|
|
139
|
+
selectedIcon,
|
|
140
|
+
onIconClick,
|
|
141
|
+
className,
|
|
142
|
+
style
|
|
143
|
+
}) => {
|
|
144
|
+
const wrapperStyles = {
|
|
145
|
+
display: "flex",
|
|
146
|
+
height: "100%",
|
|
147
|
+
...style
|
|
148
|
+
};
|
|
149
|
+
const iconBarStyles = {
|
|
150
|
+
display: "flex",
|
|
151
|
+
flexDirection: "column",
|
|
152
|
+
alignItems: "center",
|
|
153
|
+
justifyContent: "space-between",
|
|
154
|
+
backgroundColor: "#ffffff",
|
|
155
|
+
padding: "8px",
|
|
156
|
+
borderTopLeftRadius: "8px",
|
|
157
|
+
borderBottomLeftRadius: "8px",
|
|
158
|
+
height: "100%",
|
|
159
|
+
width: "58px",
|
|
160
|
+
boxSizing: "border-box",
|
|
161
|
+
flexShrink: 0
|
|
162
|
+
};
|
|
163
|
+
const topSectionStyles = {
|
|
164
|
+
display: "flex",
|
|
165
|
+
flexDirection: "column",
|
|
166
|
+
alignItems: "center",
|
|
167
|
+
gap: "16px"
|
|
168
|
+
};
|
|
169
|
+
const dividerStyles = {
|
|
170
|
+
width: "24.5px",
|
|
171
|
+
height: "1px",
|
|
172
|
+
backgroundColor: "#efefef"
|
|
173
|
+
};
|
|
174
|
+
const contentPanelStyles = {
|
|
175
|
+
display: "flex",
|
|
176
|
+
flexDirection: "column",
|
|
177
|
+
backgroundColor: "#ffffff",
|
|
178
|
+
borderLeft: "1px solid #f8f8f8",
|
|
179
|
+
height: "100%",
|
|
180
|
+
width: "232px",
|
|
181
|
+
boxSizing: "border-box",
|
|
182
|
+
flexShrink: 0,
|
|
183
|
+
minWidth: 0,
|
|
184
|
+
minHeight: 0
|
|
185
|
+
};
|
|
186
|
+
const headerStyles = {
|
|
187
|
+
display: "flex",
|
|
188
|
+
alignItems: "center",
|
|
189
|
+
height: "62px",
|
|
190
|
+
paddingLeft: "20px",
|
|
191
|
+
paddingRight: "16px",
|
|
192
|
+
paddingTop: "4px",
|
|
193
|
+
paddingBottom: "4px",
|
|
194
|
+
borderBottom: "1px solid #f8f8f8",
|
|
195
|
+
boxSizing: "border-box",
|
|
196
|
+
flexShrink: 0
|
|
197
|
+
};
|
|
198
|
+
const titleStyles = {
|
|
199
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
200
|
+
fontSize: "13px",
|
|
201
|
+
fontWeight: 600,
|
|
202
|
+
color: "#2f2f2f",
|
|
203
|
+
lineHeight: 1.5
|
|
204
|
+
};
|
|
205
|
+
const navListStyles = {
|
|
206
|
+
display: "flex",
|
|
207
|
+
flexDirection: "column",
|
|
208
|
+
gap: "4px",
|
|
209
|
+
flex: 1,
|
|
210
|
+
minHeight: 0,
|
|
211
|
+
overflowX: "hidden",
|
|
212
|
+
overflowY: "auto",
|
|
213
|
+
padding: "8px",
|
|
214
|
+
boxSizing: "border-box"
|
|
215
|
+
};
|
|
216
|
+
const handleClick = (icon) => {
|
|
217
|
+
onIconClick?.(icon);
|
|
218
|
+
};
|
|
219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className, style: wrapperStyles, children: [
|
|
220
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: iconBarStyles, children: [
|
|
221
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: topSectionStyles, children: [
|
|
222
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
223
|
+
SideNavButton,
|
|
224
|
+
{
|
|
225
|
+
icon: "side-menu",
|
|
226
|
+
selected: selectedIcon === "side-menu",
|
|
227
|
+
onClick: () => handleClick("side-menu"),
|
|
228
|
+
"aria-label": "Side menu"
|
|
229
|
+
}
|
|
230
|
+
),
|
|
231
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: dividerStyles }),
|
|
232
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
233
|
+
SideNavButton,
|
|
234
|
+
{
|
|
235
|
+
icon: "favourite",
|
|
236
|
+
selected: selectedIcon === "favourite",
|
|
237
|
+
onClick: () => handleClick("favourite"),
|
|
238
|
+
"aria-label": "Favourites"
|
|
239
|
+
}
|
|
240
|
+
),
|
|
241
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
242
|
+
SideNavButton,
|
|
243
|
+
{
|
|
244
|
+
icon: "notifications",
|
|
245
|
+
selected: selectedIcon === "notifications",
|
|
246
|
+
onClick: () => handleClick("notifications"),
|
|
247
|
+
"aria-label": "Notifications"
|
|
248
|
+
}
|
|
249
|
+
),
|
|
250
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
251
|
+
SideNavButton,
|
|
252
|
+
{
|
|
253
|
+
icon: "calendar",
|
|
254
|
+
selected: selectedIcon === "calendar",
|
|
255
|
+
onClick: () => handleClick("calendar"),
|
|
256
|
+
"aria-label": "Calendar"
|
|
257
|
+
}
|
|
258
|
+
),
|
|
259
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: dividerStyles }),
|
|
260
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
261
|
+
SideNavButton,
|
|
262
|
+
{
|
|
263
|
+
icon: "emergency-alert",
|
|
264
|
+
selected: selectedIcon === "emergency-alert",
|
|
265
|
+
onClick: () => handleClick("emergency-alert"),
|
|
266
|
+
"aria-label": "Emergency alerts"
|
|
267
|
+
}
|
|
268
|
+
)
|
|
269
|
+
] }),
|
|
270
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
271
|
+
SideNavButton,
|
|
272
|
+
{
|
|
273
|
+
icon: "help",
|
|
274
|
+
selected: selectedIcon === "help",
|
|
275
|
+
onClick: () => handleClick("help"),
|
|
276
|
+
"aria-label": "Help"
|
|
277
|
+
}
|
|
278
|
+
)
|
|
279
|
+
] }),
|
|
280
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: contentPanelStyles, children: [
|
|
281
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: headerStyles, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { style: titleStyles, children: title }) }),
|
|
282
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: navListStyles, children })
|
|
283
|
+
] })
|
|
284
|
+
] });
|
|
285
|
+
};
|
|
286
|
+
SideNavBar.displayName = "SideNavBar";
|
|
287
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
288
|
+
0 && (module.exports = {
|
|
289
|
+
SideNavBar
|
|
290
|
+
});
|
|
291
|
+
//# 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 * Whether the navigation panel is open (showing title and children)\n * @default false\n */\n isOpen?: boolean;\n /**\n * Title displayed in the header when open (e.g., \"Attendance\")\n */\n title?: string;\n /**\n * Navigation items to display when open (typically SideNavItem components)\n */\n children?: React.ReactNode;\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 *\n * When open, displays a content panel with a title header and navigation items.\n */\nexport const SideNavBar: React.FC<SideNavBarProps> = ({\n isOpen = false,\n title,\n children,\n selectedIcon,\n onIconClick,\n className,\n style,\n}) => {\n const wrapperStyles: React.CSSProperties = {\n display: 'flex',\n height: '100%',\n ...style,\n };\n\n const iconBarStyles: 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 flexShrink: 0,\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 contentPanelStyles: React.CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n backgroundColor: '#ffffff',\n borderLeft: '1px solid #f8f8f8',\n height: '100%',\n width: '232px',\n boxSizing: 'border-box',\n flexShrink: 0,\n minWidth: 0,\n minHeight: 0,\n };\n\n const headerStyles: React.CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n height: '62px',\n paddingLeft: '20px',\n paddingRight: '16px',\n paddingTop: '4px',\n paddingBottom: '4px',\n borderBottom: '1px solid #f8f8f8',\n boxSizing: 'border-box',\n flexShrink: 0,\n };\n\n const titleStyles: React.CSSProperties = {\n fontFamily: \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n fontSize: '13px',\n fontWeight: 600,\n color: '#2f2f2f',\n lineHeight: 1.5,\n };\n\n const navListStyles: React.CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n gap: '4px',\n flex: 1,\n minHeight: 0,\n overflowX: 'hidden',\n overflowY: 'auto',\n padding: '8px',\n boxSizing: 'border-box',\n };\n\n const handleClick = (icon: SideNavBarIcon) => {\n onIconClick?.(icon);\n };\n\n return (\n <div className={className} style={wrapperStyles}>\n {/* Icon Bar */}\n <div style={iconBarStyles}>\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 {/* Content Panel (only shown when open) */}\n {isOpen && (\n <div style={contentPanelStyles}>\n {/* Header with title */}\n {title && (\n <div style={headerStyles}>\n <span style={titleStyles}>{title}</span>\n </div>\n )}\n\n {/* Navigation list container */}\n <div style={navListStyles}>\n {children}\n </div>\n </div>\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,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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AA,UACC,MAAK;AAAA,UACL,UAAU,iBAAiB;AAAA,UAC3B,SAAS,MAAM,YAAY,MAAM;AAAA,UACjC,cAAW;AAAA;AAAA,MACb;AAAA,OACF;AAAA,IAGC,UACC,8CAAC,SAAI,OAAO,oBAET;AAAA,eACC,6CAAC,SAAI,OAAO,cACV,uDAAC,UAAK,OAAO,aAAc,iBAAM,GACnC;AAAA,MAIF,6CAAC,SAAI,OAAO,eACT,UACH;AAAA,OACF;AAAA,KAEJ;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 };
|