@titan-design/react-ui 0.9.1 → 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.
@@ -1,5 +1,6 @@
1
1
  import { Platform, View } from 'react-native';
2
- import { vars } from 'nativewind';
2
+ import { vars, useColorScheme } from 'nativewind';
3
+ import { createContext } from 'react';
3
4
  import { jsx as jsx$1 } from 'react/jsx-runtime';
4
5
 
5
6
  // src/theme/tokens/primitives.ts
@@ -1949,6 +1950,8 @@ var audiobookPreset = {
1949
1950
  },
1950
1951
  rootClasses: ["atmosphere-warm", "grain"]
1951
1952
  };
1953
+ var DEFAULT_CONTEXT = { mode: "dark", level: "base" };
1954
+ var SurfaceContext = createContext(DEFAULT_CONTEXT);
1952
1955
  function wrapJsx(fn) {
1953
1956
  return function(type, props, ...rest) {
1954
1957
  if (props && typeof props.className === "string" && props.className) {
@@ -1977,7 +1980,9 @@ function ThemeProvider({
1977
1980
  children,
1978
1981
  ...props
1979
1982
  }) {
1980
- return /* @__PURE__ */ jsx(View, { style: [MODE_VARS[mode], { flex: 1 }, style], ...props, children });
1983
+ const { colorScheme } = useColorScheme();
1984
+ const resolved = mode === "system" ? colorScheme ?? "dark" : mode;
1985
+ return /* @__PURE__ */ jsx(SurfaceContext.Provider, { value: { mode: resolved, level: "base" }, children: /* @__PURE__ */ jsx(View, { style: [MODE_VARS[resolved], { flex: 1 }, style], ...props, children }) });
1981
1986
  }
1982
1987
 
1983
1988
  export { CATEGORICAL_CVD_SAFE_MAX, ThemeProvider, applyThemePreset, audiobookPreset, bestTextColor, buttonSizes, categoricalPalette, componentElevationRanges, createFlatShadow, createPressedHoverShadow, createPressedShadow, createRaisedHoverShadow, createRaisedShadow, darkThemeCSSVars, darken, defaultPreset, discreteRainbow, divergingScale, elevationSystem, getBaseSurfaceColor, getCategoricalColor, getDiscreteRainbowColor, getElevationConfig, getElevationShadow, getElevationSurface, getGlowShadow, getHoverColors, getSemanticColors, getThemeCSSVars, getValidatedElevation, gluestackConfig, hexToRgb, hsvToRgb, isCssPropertyManifest, isDark, lightThemeCSSVars, lighten, linearGradient, neumorphicShadows, primitiveBorderRadius, primitiveBreakpoints, primitiveColors, primitiveRamps, primitiveShadows, primitiveSpacing, primitiveTypography, primitiveZIndex, resolveColor, rgbToHex, rgbToHsv, semanticColorsDark, semanticColorsLight, semanticTypography, sequentialEffort, shadowColors, surfaceGradient, validateCssPropertyManifest };