@titan-design/react-ui 0.9.2 → 0.9.3

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.
@@ -2,6 +2,7 @@
2
2
 
3
3
  var reactNative = require('react-native');
4
4
  var nativewind = require('nativewind');
5
+ var react = require('react');
5
6
  var jsxRuntime = require('react/jsx-runtime');
6
7
 
7
8
  // src/theme/tokens/primitives.ts
@@ -1951,6 +1952,8 @@ var audiobookPreset = {
1951
1952
  },
1952
1953
  rootClasses: ["atmosphere-warm", "grain"]
1953
1954
  };
1955
+ var DEFAULT_CONTEXT = { mode: "dark", level: "base" };
1956
+ var SurfaceContext = react.createContext(DEFAULT_CONTEXT);
1954
1957
  function wrapJsx(fn) {
1955
1958
  return function(type, props, ...rest) {
1956
1959
  if (props && typeof props.className === "string" && props.className) {
@@ -1979,7 +1982,9 @@ function ThemeProvider({
1979
1982
  children,
1980
1983
  ...props
1981
1984
  }) {
1982
- return /* @__PURE__ */ jsx(reactNative.View, { style: [MODE_VARS[mode], { flex: 1 }, style], ...props, children });
1985
+ const { colorScheme } = nativewind.useColorScheme();
1986
+ const resolved = mode === "system" ? colorScheme ?? "dark" : mode;
1987
+ return /* @__PURE__ */ jsx(SurfaceContext.Provider, { value: { mode: resolved, level: "base" }, children: /* @__PURE__ */ jsx(reactNative.View, { style: [MODE_VARS[resolved], { flex: 1 }, style], ...props, children }) });
1983
1988
  }
1984
1989
 
1985
1990
  exports.CATEGORICAL_CVD_SAFE_MAX = CATEGORICAL_CVD_SAFE_MAX;