@moontra/moonui-pro 2.5.3 → 2.5.4

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/index.d.ts CHANGED
@@ -1851,6 +1851,7 @@ interface SidebarConfig {
1851
1851
  animatedBackground?: boolean;
1852
1852
  keyboardShortcuts?: boolean;
1853
1853
  persistState?: boolean;
1854
+ persistKey?: string;
1854
1855
  onStateChange?: (state: SidebarState) => void;
1855
1856
  customStyles?: {
1856
1857
  background?: string;
@@ -1872,7 +1873,7 @@ interface SidebarProps extends SidebarConfig {
1872
1873
  activePath?: string;
1873
1874
  onNavigate?: (href: string) => void;
1874
1875
  }
1875
- declare function Sidebar({ sections, footer, showSearch, searchPlaceholder, onSearchChange, showThemeToggle, theme, onThemeChange, branding, collapsible, defaultCollapsed, floatingActionButton, glassmorphism, animatedBackground, keyboardShortcuts, persistState, onStateChange, customStyles, className, activePath, onNavigate }: SidebarProps): react_jsx_runtime.JSX.Element;
1876
+ declare function Sidebar({ sections, footer, showSearch, searchPlaceholder, onSearchChange, showThemeToggle, theme, onThemeChange, branding, collapsible, defaultCollapsed, floatingActionButton, glassmorphism, animatedBackground, keyboardShortcuts, persistState, persistKey, onStateChange, customStyles, className, activePath, onNavigate }: SidebarProps): react_jsx_runtime.JSX.Element;
1876
1877
 
1877
1878
  declare const enhancedButtonVariants: (props?: ({
1878
1879
  variant?: "link" | "default" | "ghost" | "outline" | "secondary" | "destructive" | "gradient" | "glow" | null | undefined;
package/dist/index.mjs CHANGED
@@ -56323,6 +56323,7 @@ function Sidebar({
56323
56323
  animatedBackground = false,
56324
56324
  keyboardShortcuts = true,
56325
56325
  persistState = true,
56326
+ persistKey = "moonui-sidebar-state",
56326
56327
  onStateChange,
56327
56328
  customStyles,
56328
56329
  className,
@@ -56342,7 +56343,7 @@ function Sidebar({
56342
56343
  const springY = useSpring(mouseY, { stiffness: 300, damping: 30 });
56343
56344
  useEffect(() => {
56344
56345
  if (persistState && typeof window !== "undefined") {
56345
- const savedState = localStorage.getItem("moonui-sidebar-state");
56346
+ const savedState = localStorage.getItem(persistKey);
56346
56347
  if (savedState) {
56347
56348
  const state = JSON.parse(savedState);
56348
56349
  setCollapsed(state.collapsed);
@@ -56350,7 +56351,7 @@ function Sidebar({
56350
56351
  setPinnedItems(state.pinnedItems || []);
56351
56352
  }
56352
56353
  }
56353
- }, [persistState]);
56354
+ }, [persistState, persistKey]);
56354
56355
  useEffect(() => {
56355
56356
  if (persistState && typeof window !== "undefined") {
56356
56357
  const state = {
@@ -56360,10 +56361,10 @@ function Sidebar({
56360
56361
  pinnedItems,
56361
56362
  recentItems: []
56362
56363
  };
56363
- localStorage.setItem("moonui-sidebar-state", JSON.stringify(state));
56364
+ localStorage.setItem(persistKey, JSON.stringify(state));
56364
56365
  onStateChange?.(state);
56365
56366
  }
56366
- }, [collapsed, expandedSections, searchQuery, pinnedItems, persistState, onStateChange]);
56367
+ }, [collapsed, expandedSections, searchQuery, pinnedItems, persistState, persistKey, onStateChange]);
56367
56368
  useEffect(() => {
56368
56369
  const checkMobile = () => {
56369
56370
  setIsMobile(window.innerWidth < 768);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.5.3",
3
+ "version": "2.5.4",
4
4
  "description": "Premium React components for MoonUI - Advanced UI library with 50+ pro components including performance, interactive, and gesture components",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",
@@ -80,6 +80,7 @@ export interface SidebarConfig {
80
80
  animatedBackground?: boolean
81
81
  keyboardShortcuts?: boolean
82
82
  persistState?: boolean
83
+ persistKey?: string
83
84
  onStateChange?: (state: SidebarState) => void
84
85
  customStyles?: {
85
86
  background?: string
@@ -121,6 +122,7 @@ export function Sidebar({
121
122
  animatedBackground = false,
122
123
  keyboardShortcuts = true,
123
124
  persistState = true,
125
+ persistKey = 'moonui-sidebar-state',
124
126
  onStateChange,
125
127
  customStyles,
126
128
  className,
@@ -142,7 +144,7 @@ export function Sidebar({
142
144
  // Load persisted state
143
145
  useEffect(() => {
144
146
  if (persistState && typeof window !== 'undefined') {
145
- const savedState = localStorage.getItem('moonui-sidebar-state')
147
+ const savedState = localStorage.getItem(persistKey)
146
148
  if (savedState) {
147
149
  const state = JSON.parse(savedState) as SidebarState
148
150
  setCollapsed(state.collapsed)
@@ -150,7 +152,7 @@ export function Sidebar({
150
152
  setPinnedItems(state.pinnedItems || [])
151
153
  }
152
154
  }
153
- }, [persistState])
155
+ }, [persistState, persistKey])
154
156
 
155
157
  // Save state changes
156
158
  useEffect(() => {
@@ -162,10 +164,10 @@ export function Sidebar({
162
164
  pinnedItems,
163
165
  recentItems: []
164
166
  }
165
- localStorage.setItem('moonui-sidebar-state', JSON.stringify(state))
167
+ localStorage.setItem(persistKey, JSON.stringify(state))
166
168
  onStateChange?.(state)
167
169
  }
168
- }, [collapsed, expandedSections, searchQuery, pinnedItems, persistState, onStateChange])
170
+ }, [collapsed, expandedSections, searchQuery, pinnedItems, persistState, persistKey, onStateChange])
169
171
 
170
172
  // Check mobile
171
173
  useEffect(() => {