@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.
- package/dist/index.d.mts +205 -126
- package/dist/index.d.ts +205 -126
- package/dist/index.js +302 -255
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +157 -117
- package/dist/index.mjs.map +1 -1
- package/dist/pages.js +2 -1
- package/dist/pages.js.map +1 -1
- package/dist/pages.mjs +2 -1
- package/dist/pages.mjs.map +1 -1
- package/dist/theme/index.d.mts +774 -769
- package/dist/theme/index.d.ts +774 -769
- package/dist/theme/index.js +6 -1
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/index.mjs +7 -2
- package/dist/theme/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/custom/Workout/ExerciseHeading.tsx +5 -3
- package/src/components/custom/Workout/SessionHeader.tsx +11 -12
- package/src/components/custom/Workout/SessionRail.tsx +26 -13
- package/src/components/custom/Workout/SetsRepsLoad.tsx +2 -1
- package/src/components/shell/DashboardShell.tsx +11 -10
- package/src/components/shell/NavItem.tsx +6 -1
- package/src/components/ui/surface/Surface.stories.tsx +50 -1
- package/src/components/ui/surface/Surface.test.tsx +105 -1
- package/src/components/ui/surface/Surface.tsx +69 -19
- package/src/components/ui/surface/SurfaceContext.ts +86 -0
- package/src/components/ui/surface/index.ts +12 -0
- package/src/test/nativewind-stub.ts +13 -0
- package/src/theme/ThemeProvider.test.tsx +24 -0
- package/src/theme/ThemeProvider.tsx +23 -6
package/dist/theme/index.mjs
CHANGED
|
@@ -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
|
-
|
|
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 };
|