@opencosmos/ui 1.3.4 → 1.3.5

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.mjs CHANGED
@@ -10723,13 +10723,13 @@ var DEFAULT_CONTEXT = {
10723
10723
  function useAppSidebar() {
10724
10724
  return useContext9(AppSidebarContext) ?? DEFAULT_CONTEXT;
10725
10725
  }
10726
- function AppSidebarProvider({ children, defaultOpen = true }) {
10726
+ function AppSidebarProvider({ children, defaultOpen = true, storageKey = STORAGE_KEY }) {
10727
10727
  const [isOpen, setIsOpen] = useState17(defaultOpen);
10728
10728
  useEffect11(() => {
10729
- const stored = localStorage.getItem(STORAGE_KEY);
10729
+ const stored = localStorage.getItem(storageKey);
10730
10730
  if (stored !== null) setIsOpen(stored === "true");
10731
- }, []);
10732
- const persist3 = (value) => localStorage.setItem(STORAGE_KEY, String(value));
10731
+ }, [storageKey]);
10732
+ const persist3 = (value) => localStorage.setItem(storageKey, String(value));
10733
10733
  const toggle = () => setIsOpen((prev) => {
10734
10734
  const next = !prev;
10735
10735
  persist3(next);