aura-glass 2.0.26 → 2.0.27

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.
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Styled Components Registry Export
3
+ *
4
+ * CRITICAL: Import StyledComponentsRegistry from THIS path, not from 'aura-glass/styled'
5
+ *
6
+ * Why this separate export path exists:
7
+ * - The 'aura-glass/styled' barrel export includes ALL styled-components
8
+ * - When Next.js loads app/layout.tsx during build, it executes all imports
9
+ * - Those imports include `import styled from 'styled-components'` which crashes
10
+ * - This standalone export ONLY includes the registry, no styled-components imports
11
+ *
12
+ * REQUIRED SETUP FOR NEXT.JS APP ROUTER:
13
+ *
14
+ * 1. Install styled-components:
15
+ * ```bash
16
+ * npm install styled-components
17
+ * ```
18
+ *
19
+ * 2. Wrap your app with StyledComponentsRegistry in app/layout.tsx:
20
+ * ```tsx
21
+ * import { StyledComponentsRegistry } from 'aura-glass/registry'; // ← Use /registry, NOT /styled!
22
+ *
23
+ * export default function RootLayout({ children }: { children: React.ReactNode }) {
24
+ * return (
25
+ * <html lang="en">
26
+ * <body>
27
+ * <StyledComponentsRegistry>{children}</StyledComponentsRegistry>
28
+ * </body>
29
+ * </html>
30
+ * );
31
+ * }
32
+ * ```
33
+ *
34
+ * This prevents "Cannot read properties of null (reading 'useState')" or
35
+ * "Cannot read properties of null (reading 'useContext')" errors during
36
+ * Next.js build-time static analysis.
37
+ */
38
+ export { StyledComponentsRegistry } from "../styled/StyledComponentsRegistry";
39
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC"}
@@ -0,0 +1,51 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+ var react = require('react');
6
+
7
+ // Dynamic imports to avoid build errors (next/navigation only available in Next.js apps)
8
+ let useServerInsertedHTML;
9
+ let ServerStyleSheet;
10
+ let StyleSheetManager;
11
+ try {
12
+ // Only load these in Next.js environment
13
+ const nextNav = require('next/navigation');
14
+ useServerInsertedHTML = nextNav.useServerInsertedHTML;
15
+ const sc = require('styled-components');
16
+ ServerStyleSheet = sc.ServerStyleSheet;
17
+ StyleSheetManager = sc.StyleSheetManager;
18
+ } catch {
19
+ // Not in Next.js environment or styled-components not installed
20
+ }
21
+ function StyledComponentsRegistry({
22
+ children
23
+ }) {
24
+ // If dependencies aren't available, just render children
25
+ if (!useServerInsertedHTML || !ServerStyleSheet || !StyleSheetManager) {
26
+ return jsxRuntime.jsx(jsxRuntime.Fragment, {
27
+ children: children
28
+ });
29
+ }
30
+ // Only executed on client side, not during build
31
+ const [styledComponentsStyleSheet] = react.useState(() => new ServerStyleSheet());
32
+ useServerInsertedHTML(() => {
33
+ const styles = styledComponentsStyleSheet.getStyleElement();
34
+ styledComponentsStyleSheet.instance.clearTag();
35
+ return jsxRuntime.jsx(jsxRuntime.Fragment, {
36
+ children: styles
37
+ });
38
+ });
39
+ if (typeof window !== 'undefined') {
40
+ return jsxRuntime.jsx(jsxRuntime.Fragment, {
41
+ children: children
42
+ });
43
+ }
44
+ return jsxRuntime.jsx(StyleSheetManager, {
45
+ sheet: styledComponentsStyleSheet.instance,
46
+ children: children
47
+ });
48
+ }
49
+
50
+ exports.StyledComponentsRegistry = StyledComponentsRegistry;
51
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,49 @@
1
+ 'use client';
2
+ import { jsx, Fragment } from 'react/jsx-runtime';
3
+ import { useState } from 'react';
4
+
5
+ // Dynamic imports to avoid build errors (next/navigation only available in Next.js apps)
6
+ let useServerInsertedHTML;
7
+ let ServerStyleSheet;
8
+ let StyleSheetManager;
9
+ try {
10
+ // Only load these in Next.js environment
11
+ const nextNav = require('next/navigation');
12
+ useServerInsertedHTML = nextNav.useServerInsertedHTML;
13
+ const sc = require('styled-components');
14
+ ServerStyleSheet = sc.ServerStyleSheet;
15
+ StyleSheetManager = sc.StyleSheetManager;
16
+ } catch {
17
+ // Not in Next.js environment or styled-components not installed
18
+ }
19
+ function StyledComponentsRegistry({
20
+ children
21
+ }) {
22
+ // If dependencies aren't available, just render children
23
+ if (!useServerInsertedHTML || !ServerStyleSheet || !StyleSheetManager) {
24
+ return jsx(Fragment, {
25
+ children: children
26
+ });
27
+ }
28
+ // Only executed on client side, not during build
29
+ const [styledComponentsStyleSheet] = useState(() => new ServerStyleSheet());
30
+ useServerInsertedHTML(() => {
31
+ const styles = styledComponentsStyleSheet.getStyleElement();
32
+ styledComponentsStyleSheet.instance.clearTag();
33
+ return jsx(Fragment, {
34
+ children: styles
35
+ });
36
+ });
37
+ if (typeof window !== 'undefined') {
38
+ return jsx(Fragment, {
39
+ children: children
40
+ });
41
+ }
42
+ return jsx(StyleSheetManager, {
43
+ sheet: styledComponentsStyleSheet.instance,
44
+ children: children
45
+ });
46
+ }
47
+
48
+ export { StyledComponentsRegistry };
49
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,26 +1,31 @@
1
1
  {
2
2
  "name": "aura-glass",
3
- "version": "2.0.26",
3
+ "version": "2.0.27",
4
4
  "description": "A comprehensive glassmorphism design system for React applications with 142+ production-ready components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
+ "types": "./dist/index.d.ts",
10
11
  "import": "./dist/index.mjs",
11
- "require": "./dist/index.js",
12
- "types": "./dist/index.d.ts"
12
+ "require": "./dist/index.js"
13
13
  },
14
14
  "./styles": "./dist/styles/index.css",
15
15
  "./styled": {
16
+ "types": "./dist/styled/index.d.ts",
16
17
  "import": "./dist/styled/index.mjs",
17
- "require": "./dist/styled/index.js",
18
- "types": "./dist/styled/index.d.ts"
18
+ "require": "./dist/styled/index.js"
19
+ },
20
+ "./registry": {
21
+ "types": "./dist/registry/index.d.ts",
22
+ "import": "./dist/registry/index.mjs",
23
+ "require": "./dist/registry/index.js"
19
24
  },
20
25
  "./ssr": {
26
+ "types": "./dist/ssr/index.d.ts",
21
27
  "import": "./dist/ssr/index.mjs",
22
- "require": "./dist/ssr/index.js",
23
- "types": "./dist/ssr/index.d.ts"
28
+ "require": "./dist/ssr/index.js"
24
29
  },
25
30
  "./package.json": "./package.json"
26
31
  },
@@ -86,7 +91,7 @@
86
91
  "release": "npm run ci && npx semantic-release",
87
92
  "storybook": "storybook dev -p 6006",
88
93
  "build-storybook": "storybook build",
89
- "prepublishOnly": "pnpm run build",
94
+ "prepublishOnly": "NODE_OPTIONS='--max-old-space-size=8192' pnpm run build",
90
95
  "size-check": "bundlesize",
91
96
  "analyze": "npm run build && npx bundle-analyzer dist/index.esm.js"
92
97
  },