@sonhoseong/mfa-lib 1.1.0 → 1.1.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickyNav.d.ts","sourceRoot":"","sources":["../../../src/components/navigation/StickyNav.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAEhE,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,+BAA+B;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sBAAsB;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB;IACjB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,eAAe;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"StickyNav.d.ts","sourceRoot":"","sources":["../../../src/components/navigation/StickyNav.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAEhE,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,+BAA+B;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sBAAsB;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB;IACjB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,eAAe;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAmK9C,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState, useEffect, useCallback } from 'react';
|
|
3
3
|
export const StickyNav = ({ sections, triggerPoint = 0.2, scrollOffset = 80, topPosition = 20, onLogoClick, showLogo = true, className = '' }) => {
|
|
4
4
|
const [activeSection, setActiveSection] = useState('');
|
|
5
|
+
const [hoveredSection, setHoveredSection] = useState(null);
|
|
5
6
|
// Scroll spy
|
|
6
7
|
useEffect(() => {
|
|
7
8
|
const handleScroll = () => {
|
|
@@ -97,15 +98,23 @@ export const StickyNav = ({ sections, triggerPoint = 0.2, scrollOffset = 80, top
|
|
|
97
98
|
whiteSpace: 'nowrap',
|
|
98
99
|
transition: 'all 0.2s ease',
|
|
99
100
|
},
|
|
101
|
+
pillHover: {
|
|
102
|
+
color: '#0EA5E9',
|
|
103
|
+
},
|
|
100
104
|
pillActive: {
|
|
101
105
|
color: '#ffffff',
|
|
102
|
-
background: '
|
|
103
|
-
boxShadow: '0 2px 8px rgba(
|
|
106
|
+
background: '#1E3A5F',
|
|
107
|
+
boxShadow: '0 2px 8px rgba(30, 58, 95, 0.25)',
|
|
104
108
|
},
|
|
105
109
|
};
|
|
106
|
-
return (_jsx("div", { style: styles.wrapper, className: `sticky-nav-wrapper ${className}`, children: _jsxs("nav", { style: styles.nav, className: "sticky-nav", children: [showLogo && (_jsxs("button", { style: styles.logoButton, onClick: handleLogoClick, className: "nav-logo-dots", "aria-label": "\uB9E8 \uC704\uB85C", children: [_jsx("span", { style: { ...styles.dot, background: '#3B82F6' }, className: "dot blue" }), _jsx("span", { style: { ...styles.dot, background: '#22C55E' }, className: "dot green" }), _jsx("span", { style: { ...styles.dot, background: '#F59E0B' }, className: "dot yellow" })] })), _jsx("ul", { style: styles.pillList, className: "nav-pills", children: sections.map((section) =>
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
+
return (_jsx("div", { style: styles.wrapper, className: `sticky-nav-wrapper ${className}`, children: _jsxs("nav", { style: styles.nav, className: "sticky-nav", children: [showLogo && (_jsxs("button", { style: styles.logoButton, onClick: handleLogoClick, className: "nav-logo-dots", "aria-label": "\uB9E8 \uC704\uB85C", children: [_jsx("span", { style: { ...styles.dot, background: '#3B82F6' }, className: "dot blue" }), _jsx("span", { style: { ...styles.dot, background: '#22C55E' }, className: "dot green" }), _jsx("span", { style: { ...styles.dot, background: '#F59E0B' }, className: "dot yellow" })] })), _jsx("ul", { style: styles.pillList, className: "nav-pills", children: sections.map((section) => {
|
|
111
|
+
const isActive = activeSection === section.id;
|
|
112
|
+
const isHovered = hoveredSection === section.id && !isActive;
|
|
113
|
+
return (_jsx("li", { children: _jsxs("button", { style: {
|
|
114
|
+
...styles.pill,
|
|
115
|
+
...(isHovered ? styles.pillHover : {}),
|
|
116
|
+
...(isActive ? styles.pillActive : {}),
|
|
117
|
+
}, className: `nav-pill ${isActive ? 'active' : ''}`, onClick: () => scrollToSection(section.id), onMouseEnter: () => setHoveredSection(section.id), onMouseLeave: () => setHoveredSection(null), children: [section.icon && _jsx("span", { style: { marginRight: '6px' }, children: section.icon }), section.label] }) }, section.id));
|
|
118
|
+
}) })] }) }));
|
|
110
119
|
};
|
|
111
120
|
export default StickyNav;
|