ai-design-system 0.1.4 → 0.1.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.
@@ -54,8 +54,8 @@ export const AdjustableLayout = React.memo<AdjustableLayoutProps>(
54
54
  }
55
55
  const containerRef = React.useRef<HTMLDivElement>(null)
56
56
  const [sizes, setSizes] = React.useState<number[]>(() => {
57
- // Load from localStorage or use defaults
58
- if (storageKey) {
57
+ // Load from localStorage or use defaults (only in browser)
58
+ if (storageKey && typeof window !== 'undefined') {
59
59
  const saved = localStorage.getItem(storageKey)
60
60
  if (saved) {
61
61
  try {
@@ -96,9 +96,9 @@ export const AdjustableLayout = React.memo<AdjustableLayoutProps>(
96
96
  return () => window.removeEventListener('resize', updateContainerSize)
97
97
  }, [orientation])
98
98
 
99
- // Save to localStorage when sizes change
99
+ // Save to localStorage when sizes change (only in browser)
100
100
  React.useEffect(() => {
101
- if (storageKey) {
101
+ if (storageKey && typeof window !== 'undefined') {
102
102
  localStorage.setItem(storageKey, JSON.stringify(sizes))
103
103
  }
104
104
  }, [sizes, storageKey])
package/dist/index.cjs CHANGED
@@ -6795,7 +6795,7 @@ var AdjustableLayout = React33__namespace.memo(
6795
6795
  };
6796
6796
  const containerRef = React33__namespace.useRef(null);
6797
6797
  const [sizes, setSizes] = React33__namespace.useState(() => {
6798
- if (storageKey) {
6798
+ if (storageKey && typeof window !== "undefined") {
6799
6799
  const saved = localStorage.getItem(storageKey);
6800
6800
  if (saved) {
6801
6801
  try {
@@ -6830,7 +6830,7 @@ var AdjustableLayout = React33__namespace.memo(
6830
6830
  return () => window.removeEventListener("resize", updateContainerSize);
6831
6831
  }, [orientation]);
6832
6832
  React33__namespace.useEffect(() => {
6833
- if (storageKey) {
6833
+ if (storageKey && typeof window !== "undefined") {
6834
6834
  localStorage.setItem(storageKey, JSON.stringify(sizes));
6835
6835
  }
6836
6836
  }, [sizes, storageKey]);