aura-glass 2.0.35 → 2.0.37

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 @@
1
+ export * from '../index';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC"}
@@ -0,0 +1,3 @@
1
+ 'use client';
2
+
3
+ module.exports = require('../index.js');
@@ -0,0 +1,3 @@
1
+ 'use client';
2
+
3
+ export * from '../index.mjs';
@@ -0,0 +1,2 @@
1
+ export declare const AURAGLASS_STYLED_REGISTRY_FLAG: "__AURAGLASS_HAS_STYLED_COMPONENTS_REGISTRY__";
2
+ //# sourceMappingURL=runtimeFlags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtimeFlags.d.ts","sourceRoot":"","sources":["../../src/constants/runtimeFlags.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,EACzC,8CAAuD,CAAC"}
package/dist/index.js CHANGED
@@ -4759,14 +4759,14 @@ const defaultGlassContext = {
4759
4759
  // Create the glass context
4760
4760
  const GlassContext = /*#__PURE__*/React.createContext(defaultGlassContext);
4761
4761
 
4762
+ const AURAGLASS_STYLED_REGISTRY_FLAG = "__AURAGLASS_HAS_STYLED_COMPONENTS_REGISTRY__";
4763
+
4762
4764
  // Theme constants
4763
4765
  const THEME_VARIANTS = ['default', 'compact', 'expanded'];
4764
4766
  const BLUR_STRENGTHS = ['none', 'subtle', 'light', 'standard', 'strong', 'intense'];
4765
4767
  const GLOW_INTENSITIES = ['none', 'subtle', 'medium', 'strong', 'intense'];
4766
4768
 
4767
4769
  const _excluded$2Q = ["variant", "elevation", "interactive", "children"];
4768
- // Lazy styled-components import - only loads at render time, not module initialization
4769
- // This prevents styled-components from executing during Next.js build-time static analysis
4770
4770
  function getStyledThemeProvider() {
4771
4771
  try {
4772
4772
  const sc = require("styled-components");
@@ -4775,6 +4775,23 @@ function getStyledThemeProvider() {
4775
4775
  return null;
4776
4776
  }
4777
4777
  }
4778
+ const isStyledRegistryMounted = () => {
4779
+ try {
4780
+ if (typeof window !== "undefined") {
4781
+ return Boolean(window[AURAGLASS_STYLED_REGISTRY_FLAG]);
4782
+ }
4783
+ return Boolean(globalThis[AURAGLASS_STYLED_REGISTRY_FLAG]);
4784
+ } catch (_unused2) {
4785
+ return false;
4786
+ }
4787
+ };
4788
+ const reportMissingStyledRegistry = () => {
4789
+ const message = "[AuraGlass] StyledComponentsRegistry was not detected. Wrap your app with <StyledComponentsRegistry> from 'aura-glass/registry' before rendering ThemeProvider or client components.";
4790
+ if (process.env.NODE_ENV !== "production") {
4791
+ throw new Error(message);
4792
+ }
4793
+ console.error(message);
4794
+ };
4778
4795
  const ColorModeContext = /*#__PURE__*/React.createContext({
4779
4796
  colorMode: "system",
4780
4797
  setColorMode: mode => {
@@ -4898,6 +4915,11 @@ const UnifiedThemeProvider = _ref => {
4898
4915
  const lastUpdateTime = React.useRef(Date.now());
4899
4916
  const pendingUpdates = React.useRef({});
4900
4917
  const commitTimerRef = React.useRef(null);
4918
+ React.useEffect(() => {
4919
+ if (!isStyledRegistryMounted()) {
4920
+ reportMissingStyledRegistry();
4921
+ }
4922
+ }, []);
4901
4923
  // ------ Initialize System Preferences ------
4902
4924
  React.useEffect(() => {
4903
4925
  if (!enableAutoDetection || !isBrowser()) return;