@codeandmoney/soelma 0.0.0-dev.0 → 0.0.0-dev.10

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.
Files changed (76) hide show
  1. package/.eslintrc.js +1 -5
  2. package/biome.jsonc +73 -0
  3. package/example/AppStyleX/app.json +4 -16
  4. package/example/AppStyleX/babel.config.js +1 -1
  5. package/example/AppStyleX/index.js +3 -3
  6. package/example/AppStyleX/metro.config.js +1 -4
  7. package/example/AppStyleX/src/App.tsx +7 -10
  8. package/example/AppStyleX/src/BottomNav/index.tsx +9 -15
  9. package/example/AppStyleX/src/Circle/index.tsx +6 -6
  10. package/example/AppStyleX/src/Circle/styles.ts +4 -4
  11. package/example/AppStyleX/src/Root/index.tsx +12 -18
  12. package/example/AppStyleX/src/Root/styles.ts +5 -5
  13. package/example/AppStyleX/src/ToggleButton/index.tsx +10 -24
  14. package/example/AppStyleX/src/ToggleButton/styles.ts +13 -15
  15. package/example/AppStyleX/src/style-system/hooks/useAnimatedBgColor.ts +2 -2
  16. package/example/AppStyleX/src/style-system/hooks/useAnimatedTextColor.ts +2 -2
  17. package/example/AppStyleX/src/style-system/hooks/useIsDark.ts +2 -2
  18. package/example/AppStyleX/src/style-system/palette.ts +6 -6
  19. package/example/AppStyleX/src/style-system/theme.ts +2 -2
  20. package/example/AppStyleX/src/style-system/utils.ts +4 -7
  21. package/example/AppStyleX/src/stylex.d.ts +3 -3
  22. package/package.json +15 -11
  23. package/src/appearance/index.ts +5 -12
  24. package/src/appearance/init.ts +2 -2
  25. package/src/context.ts +2 -5
  26. package/src/dark-mode/index.ts +2 -5
  27. package/src/dark-mode/init.ts +2 -2
  28. package/src/{dependencyUsage.ts → dependency-usage.ts} +0 -10
  29. package/src/dimensions/index.ts +1 -1
  30. package/src/dimensions/init.ts +5 -10
  31. package/src/dimensions/utils.ts +1 -3
  32. package/src/i18n.ts +1 -4
  33. package/src/index.ts +6 -6
  34. package/src/{makeUseStyles/createUseStylesTheme.js → make-use-styles/create-use-styles-theme.js} +23 -6
  35. package/src/{makeUseStyles/createUseStylesTheme.test.js → make-use-styles/create-use-styles-theme.test.js} +1 -1
  36. package/src/{makeUseStyles/createUseStylesWithoutTheme.js → make-use-styles/create-use-styles-without-theme.js} +20 -4
  37. package/src/make-use-styles/index.d.ts +20 -0
  38. package/src/make-use-styles/index.js +12 -0
  39. package/src/make-use-styles/types.ts +43 -0
  40. package/src/{makeUseStyles → make-use-styles}/utils.js +7 -12
  41. package/src/media-query/base.ts +19 -30
  42. package/src/media-query/breakpoints.ts +12 -37
  43. package/src/orientation.ts +3 -7
  44. package/src/safe-area/{eventEmitter.ts → event-emitter.ts} +1 -1
  45. package/src/safe-area/index.tsx +3 -3
  46. package/src/safe-area/init.tsx +2 -2
  47. package/src/safe-area/safe-area-provider.tsx +18 -0
  48. package/src/safe-area/{StylexSaveAreaConsumer.ts → stylex-save-area-consumer.ts} +4 -5
  49. package/src/safe-area/types.ts +2 -2
  50. package/src/{__tests__ → tests}/createEventEmitter.test.ts +1 -1
  51. package/src/{__tests__ → tests}/dependencyRegistry.test.ts +1 -1
  52. package/src/{__tests__ → tests}/dependencyUsage.test.ts +1 -1
  53. package/src/{__tests__ → tests}/dimensions.test.ts +4 -7
  54. package/src/{__tests__ → tests}/makeUseStyles.types-test.ts +1 -1
  55. package/src/{__tests__ → tests}/media-query.test.ts +1 -9
  56. package/src/{__tests__ → tests}/useTheme.test.ts +1 -1
  57. package/src/{__tests__ → tests}/withStyles.types-test.tsx +7 -8
  58. package/src/{useColorTransition.ts → use-color-transition.ts} +3 -3
  59. package/src/{useTheme.ts → use-theme.ts} +2 -4
  60. package/src/with-styles.tsx +22 -0
  61. package/tsconfig.build.json +31 -0
  62. package/src/makeUseStyles/index.d.ts +0 -7
  63. package/src/makeUseStyles/index.js +0 -12
  64. package/src/safe-area/SafeAreaProvider.tsx +0 -17
  65. package/src/withStyles.tsx +0 -35
  66. /package/src/{createEventEmitter.ts → create-event-emitter.ts} +0 -0
  67. /package/src/{DefaultTheme.ts → default-theme.ts} +0 -0
  68. /package/src/{dependencyRegistry.ts → dependency-registry.ts} +0 -0
  69. /package/src/{makeUseStyles/createUseStylesWithoutTheme.test.js → make-use-styles/create-use-styles-without-theme.test.js} +0 -0
  70. /package/src/{makeUseStyles → make-use-styles}/index.test.js +0 -0
  71. /package/src/{makeUseStyles → make-use-styles}/test-type.js +0 -0
  72. /package/src/{__tests__ → tests}/createBreakpoints.test.ts +0 -0
  73. /package/src/{__tests__ → tests}/createBreakpointsMatcher.test.ts +0 -0
  74. /package/src/{__tests__ → tests}/createBreakpointsMatcher.types-test.ts +0 -0
  75. /package/src/{__tests__ → tests}/dark-mode.test.ts +0 -0
  76. /package/src/{__tests__ → tests}/orientation.test.ts +0 -0
package/.eslintrc.js CHANGED
@@ -1,10 +1,6 @@
1
1
  module.exports = {
2
2
  parser: "@typescript-eslint/parser",
3
- extends: [
4
- "plugin:react/recommended",
5
- "plugin:@typescript-eslint/recommended",
6
- "prettier",
7
- ],
3
+ extends: ["plugin:react/recommended", "plugin:@typescript-eslint/recommended", "prettier"],
8
4
  parserOptions: {
9
5
  ecmaVersion: 2020,
10
6
  sourceType: "module",
package/biome.jsonc ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/2.2.5/schema.json",
3
+ "vcs": {
4
+ "enabled": false,
5
+ "clientKind": "git",
6
+ "useIgnoreFile": false
7
+ },
8
+ "files": {
9
+ "ignoreUnknown": false,
10
+ "maxSize": 1001048576
11
+ },
12
+ "formatter": {
13
+ "enabled": true,
14
+ "indentStyle": "space",
15
+ "lineWidth": 160,
16
+ "includes": ["**", "!**/*/routeTree.gen.ts"],
17
+ "formatWithErrors": true
18
+ },
19
+ "css": {
20
+ "parser": {
21
+ "tailwindDirectives": true
22
+ }
23
+ },
24
+ "linter": {
25
+ "enabled": true,
26
+ "rules": {
27
+ "recommended": true,
28
+ "complexity": {
29
+ "noVoid": "off",
30
+ "noArguments": "error",
31
+ "noBannedTypes": "error",
32
+ "noCommaOperator": "error",
33
+ "noEmptyTypeParameters": "error",
34
+ "noExtraBooleanCast": "off",
35
+ "noFlatMapIdentity": "error",
36
+ "noForEach": "error",
37
+ "noImplicitCoercions": "error",
38
+ "noStaticOnlyClass": "error",
39
+ "noUselessCatch": "error",
40
+ "noUselessConstructor": "error",
41
+ "noUselessContinue": "error",
42
+ "noUselessFragments": "error",
43
+ "noUselessLabel": "error",
44
+ "useArrowFunction": "off",
45
+ "useOptionalChain": "error",
46
+ "useSimpleNumberKeys": "error",
47
+ "useWhile": "error"
48
+ },
49
+ "suspicious": {
50
+ "noVar": "error",
51
+ "useAwait": "error",
52
+ "useDefaultSwitchClauseLast": "error"
53
+ },
54
+ "correctness": {
55
+ "noUnusedVariables": "off",
56
+ "noVoidTypeReturn": "off"
57
+ }
58
+ }
59
+ },
60
+ "javascript": {
61
+ "formatter": {
62
+ "quoteStyle": "double"
63
+ }
64
+ },
65
+ "assist": {
66
+ "enabled": true,
67
+ "actions": {
68
+ "source": {
69
+ "organizeImports": "on"
70
+ }
71
+ }
72
+ }
73
+ }
@@ -8,21 +8,9 @@
8
8
  }
9
9
  ],
10
10
  "resources": {
11
- "android": [
12
- "dist/res",
13
- "dist/main.android.jsbundle"
14
- ],
15
- "ios": [
16
- "dist/assets",
17
- "dist/main.ios.jsbundle"
18
- ],
19
- "macos": [
20
- "dist/assets",
21
- "dist/main.macos.jsbundle"
22
- ],
23
- "windows": [
24
- "dist/assets",
25
- "dist/main.windows.bundle"
26
- ]
11
+ "android": ["dist/res", "dist/main.android.jsbundle"],
12
+ "ios": ["dist/assets", "dist/main.ios.jsbundle"],
13
+ "macos": ["dist/assets", "dist/main.macos.jsbundle"],
14
+ "windows": ["dist/assets", "dist/main.windows.bundle"]
27
15
  }
28
16
  }
@@ -1,3 +1,3 @@
1
1
  module.exports = {
2
- presets: ['module:@react-native/babel-preset'],
2
+ presets: ["module:@react-native/babel-preset"],
3
3
  };
@@ -2,8 +2,8 @@
2
2
  * @format
3
3
  */
4
4
 
5
- import {AppRegistry} from 'react-native';
6
- import {App} from './src/App';
7
- import {name as appName} from './app.json';
5
+ import { AppRegistry } from "react-native";
6
+ import { App } from "./src/App";
7
+ import { name as appName } from "./app.json";
8
8
 
9
9
  AppRegistry.registerComponent(appName, () => App);
@@ -44,10 +44,7 @@ const config = {
44
44
 
45
45
  try {
46
46
  // Starting with react-native 0.72, we are required to provide a full config.
47
- const {
48
- getDefaultConfig,
49
- mergeConfig,
50
- } = require("@react-native/metro-config");
47
+ const { getDefaultConfig, mergeConfig } = require("@react-native/metro-config");
51
48
  module.exports = mergeConfig(getDefaultConfig(__dirname), config);
52
49
  } catch (_) {
53
50
  module.exports = config;
@@ -1,18 +1,15 @@
1
- import React, {useState} from 'react';
2
- import {ThemeProvider} from 'react-native-stylex';
3
- import {SafeAreaProvider} from 'react-native-safe-area-context';
4
- import {StylexSaveAreaConsumer} from 'react-native-stylex/safe-area';
1
+ import React, { useState } from "react";
2
+ import { ThemeProvider } from "react-native-stylex";
3
+ import { SafeAreaProvider } from "react-native-safe-area-context";
4
+ import { StylexSaveAreaConsumer } from "react-native-stylex/safe-area";
5
5
 
6
- import {darkTheme, lightTheme} from './style-system/theme';
6
+ import { darkTheme, lightTheme } from "./style-system/theme";
7
7
 
8
- import {Root} from './Root';
8
+ import { Root } from "./Root";
9
9
 
10
10
  export const App = () => {
11
11
  const [theme, setTheme] = useState(lightTheme);
12
- const toggleTheme = () =>
13
- setTheme((currentTheme) =>
14
- currentTheme === darkTheme ? lightTheme : darkTheme,
15
- );
12
+ const toggleTheme = () => setTheme((currentTheme) => (currentTheme === darkTheme ? lightTheme : darkTheme));
16
13
 
17
14
  return (
18
15
  <SafeAreaProvider>
@@ -1,31 +1,25 @@
1
- import React from 'react';
2
- import {Animated} from 'react-native';
3
- import {useColorTransition} from 'react-native-stylex';
1
+ import React from "react";
2
+ import { Animated } from "react-native";
3
+ import { useColorTransition } from "react-native-stylex";
4
4
 
5
- import {useAnimatedBgColor} from '../style-system/hooks/useAnimatedBgColor';
6
- import {useAnimatedTextColor} from '../style-system/hooks/useAnimatedTextColor';
5
+ import { useAnimatedBgColor } from "../style-system/hooks/useAnimatedBgColor";
6
+ import { useAnimatedTextColor } from "../style-system/hooks/useAnimatedTextColor";
7
7
 
8
- import {useStyles} from './styles';
8
+ import { useStyles } from "./styles";
9
9
 
10
10
  export const BottomNav = () => {
11
11
  const styles = useStyles();
12
12
  const bgStyle = useAnimatedBgColor();
13
13
  const textStyle = useAnimatedTextColor();
14
14
  const skipAnimatedStyle = {
15
- color: useColorTransition(({palette, utils}) =>
16
- utils.fade(palette.text, 0.5),
17
- ),
15
+ color: useColorTransition(({ palette, utils }) => utils.fade(palette.text, 0.5)),
18
16
  };
19
17
 
20
18
  return (
21
19
  <>
22
- <Animated.Text style={[styles.skipBtn, skipAnimatedStyle]}>
23
- Skip
24
- </Animated.Text>
20
+ <Animated.Text style={[styles.skipBtn, skipAnimatedStyle]}>Skip</Animated.Text>
25
21
  <Animated.View style={[styles.nextButton, bgStyle]}>
26
- <Animated.Text style={[styles.nextButtonText, textStyle]}>
27
-
28
- </Animated.Text>
22
+ <Animated.Text style={[styles.nextButtonText, textStyle]}>→</Animated.Text>
29
23
  </Animated.View>
30
24
  </>
31
25
  );
@@ -1,12 +1,12 @@
1
- import React, {useEffect, useRef} from 'react';
2
- import {Animated, View} from 'react-native';
1
+ import React, { useEffect, useRef } from "react";
2
+ import { Animated, View } from "react-native";
3
3
 
4
- import {useIsDark} from '../style-system/hooks/useIsDark';
5
- import {useAnimatedBgColor} from '../style-system/hooks/useAnimatedBgColor';
4
+ import { useIsDark } from "../style-system/hooks/useIsDark";
5
+ import { useAnimatedBgColor } from "../style-system/hooks/useAnimatedBgColor";
6
6
 
7
- import {useStyles} from './styles';
7
+ import { useStyles } from "./styles";
8
8
 
9
- const {Value, timing} = Animated;
9
+ const { Value, timing } = Animated;
10
10
 
11
11
  export const Circle = () => {
12
12
  const styles = useStyles();
@@ -1,8 +1,8 @@
1
- import {makeUseStyles} from 'react-native-stylex';
1
+ import { makeUseStyles } from "react-native-stylex";
2
2
 
3
- export const useStyles = makeUseStyles(({palette}) => ({
3
+ export const useStyles = makeUseStyles(({ palette }) => ({
4
4
  root: {
5
- alignSelf: 'center',
5
+ alignSelf: "center",
6
6
  },
7
7
  circle: {
8
8
  width: 150,
@@ -12,7 +12,7 @@ export const useStyles = makeUseStyles(({palette}) => ({
12
12
  marginBottom: 80,
13
13
  },
14
14
  overlay: {
15
- position: 'absolute',
15
+ position: "absolute",
16
16
  right: -20,
17
17
  top: -20,
18
18
  width: 145,
@@ -1,21 +1,21 @@
1
- import React from 'react';
2
- import {Animated} from 'react-native';
1
+ import React from "react";
2
+ import { Animated } from "react-native";
3
3
 
4
- import {useAnimatedBgColor} from '../style-system/hooks/useAnimatedBgColor';
5
- import {useAnimatedTextColor} from '../style-system/hooks/useAnimatedTextColor';
4
+ import { useAnimatedBgColor } from "../style-system/hooks/useAnimatedBgColor";
5
+ import { useAnimatedTextColor } from "../style-system/hooks/useAnimatedTextColor";
6
6
 
7
- import {ToggleButton} from '../ToggleButton';
8
- import {BottomNav} from '../BottomNav';
9
- import {Circle} from '../Circle';
7
+ import { ToggleButton } from "../ToggleButton";
8
+ import { BottomNav } from "../BottomNav";
9
+ import { Circle } from "../Circle";
10
10
 
11
- import {useStyles} from './styles';
11
+ import { useStyles } from "./styles";
12
12
 
13
13
  interface Props {
14
14
  toggleTheme: () => void;
15
15
  }
16
16
 
17
17
  // Concept: https://dribbble.com/shots/5846239-Light-dark-toggle-switch-InVision-Studio
18
- export const Root = ({toggleTheme}: Props) => {
18
+ export const Root = ({ toggleTheme }: Props) => {
19
19
  const styles = useStyles();
20
20
  const bgStyle = useAnimatedBgColor();
21
21
  const textStyle = useAnimatedTextColor();
@@ -24,15 +24,9 @@ export const Root = ({toggleTheme}: Props) => {
24
24
  <Animated.View style={[styles.root, bgStyle]}>
25
25
  <Circle />
26
26
 
27
- <Animated.Text style={[styles.title, textStyle]}>
28
- Choose a style
29
- </Animated.Text>
30
- <Animated.Text style={[styles.text, textStyle]}>
31
- Pop or subtle. Day or night.
32
- </Animated.Text>
33
- <Animated.Text style={[styles.text, textStyle]}>
34
- Customize your interface.
35
- </Animated.Text>
27
+ <Animated.Text style={[styles.title, textStyle]}>Choose a style</Animated.Text>
28
+ <Animated.Text style={[styles.text, textStyle]}>Pop or subtle. Day or night.</Animated.Text>
29
+ <Animated.Text style={[styles.text, textStyle]}>Customize your interface.</Animated.Text>
36
30
 
37
31
  <ToggleButton onPress={toggleTheme} />
38
32
  <BottomNav />
@@ -1,18 +1,18 @@
1
- import {makeUseStyles} from 'react-native-stylex';
1
+ import { makeUseStyles } from "react-native-stylex";
2
2
 
3
3
  export const useStyles = makeUseStyles(() => ({
4
4
  root: {
5
5
  flex: 1,
6
- justifyContent: 'center',
6
+ justifyContent: "center",
7
7
  },
8
8
  title: {
9
- textAlign: 'center',
9
+ textAlign: "center",
10
10
  fontSize: 26,
11
- fontWeight: '600',
11
+ fontWeight: "600",
12
12
  marginBottom: 16,
13
13
  },
14
14
  text: {
15
- textAlign: 'center',
15
+ textAlign: "center",
16
16
  fontSize: 20,
17
17
  },
18
18
  }));
@@ -1,23 +1,23 @@
1
- import React, {useEffect, useRef} from 'react';
2
- import {Animated, View, Pressable, Text} from 'react-native';
3
- import {useColorTransition} from 'react-native-stylex';
1
+ import React, { useEffect, useRef } from "react";
2
+ import { Animated, View, Pressable, Text } from "react-native";
3
+ import { useColorTransition } from "react-native-stylex";
4
4
 
5
- import {useIsDark} from '../style-system/hooks/useIsDark';
5
+ import { useIsDark } from "../style-system/hooks/useIsDark";
6
6
 
7
- import {useStyles, ROOT_WIDTH} from './styles';
7
+ import { useStyles, ROOT_WIDTH } from "./styles";
8
8
 
9
- const {Value, spring} = Animated;
9
+ const { Value, spring } = Animated;
10
10
  const HALF_ROOT_WIDTH = ROOT_WIDTH / 2;
11
11
 
12
12
  interface Props {
13
13
  onPress: () => void;
14
14
  }
15
15
 
16
- export const ToggleButton = ({onPress}: Props) => {
16
+ export const ToggleButton = ({ onPress }: Props) => {
17
17
  const styles = useStyles();
18
18
  const isDark = useIsDark();
19
19
  const bgStyle = {
20
- backgroundColor: useColorTransition(({palette}) => palette.bg),
20
+ backgroundColor: useColorTransition(({ palette }) => palette.bg),
21
21
  };
22
22
  const animatedOffset = useRef(new Value(0));
23
23
  const animatedStyle = {
@@ -43,22 +43,8 @@ export const ToggleButton = ({onPress}: Props) => {
43
43
  <View style={styles.root}>
44
44
  <Animated.View style={[styles.activeBg, animatedStyle, bgStyle]} />
45
45
  <View style={styles.labelsRoot}>
46
- <Text
47
- style={[
48
- styles.labelText,
49
- styles.lightLabelText,
50
- !isDark && styles.activeLabelText,
51
- ]}>
52
- Light
53
- </Text>
54
- <Text
55
- style={[
56
- styles.labelText,
57
- styles.darkLabelText,
58
- isDark && styles.activeLabelText,
59
- ]}>
60
- Dark
61
- </Text>
46
+ <Text style={[styles.labelText, styles.lightLabelText, !isDark && styles.activeLabelText]}>Light</Text>
47
+ <Text style={[styles.labelText, styles.darkLabelText, isDark && styles.activeLabelText]}>Dark</Text>
62
48
  </View>
63
49
  </View>
64
50
  </Pressable>
@@ -1,24 +1,22 @@
1
- import {makeUseStyles} from 'react-native-stylex';
2
- import {StyleSheet, Platform} from 'react-native';
1
+ import { makeUseStyles } from "react-native-stylex";
2
+ import { StyleSheet, Platform } from "react-native";
3
3
 
4
4
  export const ROOT_WIDTH = 280;
5
5
 
6
- export const useStyles = makeUseStyles(({palette, utils}) => ({
6
+ export const useStyles = makeUseStyles(({ palette, utils }) => ({
7
7
  root: {
8
8
  marginTop: 36,
9
- alignSelf: 'center',
9
+ alignSelf: "center",
10
10
  height: 60,
11
11
  borderRadius: 60,
12
12
  width: ROOT_WIDTH,
13
- backgroundColor: utils.isDark(palette.bg)
14
- ? utils.lighten(palette.bg, 0.3)
15
- : utils.darken(palette.bg, 0.3),
13
+ backgroundColor: utils.isDark(palette.bg) ? utils.lighten(palette.bg, 0.3) : utils.darken(palette.bg, 0.3),
16
14
  },
17
15
  activeBg: {
18
- width: '50%',
19
- height: '100%',
16
+ width: "50%",
17
+ height: "100%",
20
18
  borderRadius: 60,
21
- position: 'absolute',
19
+ position: "absolute",
22
20
  top: 0,
23
21
  left: 0,
24
22
  backgroundColor: palette.bg,
@@ -39,15 +37,15 @@ export const useStyles = makeUseStyles(({palette, utils}) => ({
39
37
  elevation: 5,
40
38
  },
41
39
  labelText: {
42
- position: 'absolute',
43
- height: '100%',
44
- width: '50%',
40
+ position: "absolute",
41
+ height: "100%",
42
+ width: "50%",
45
43
  top: 0,
46
44
 
47
45
  fontSize: 20,
48
- fontWeight: '700',
46
+ fontWeight: "700",
49
47
  color: utils.fade(palette.text, 0.5),
50
- textAlign: 'center',
48
+ textAlign: "center",
51
49
  ...Platform.select({
52
50
  web: {
53
51
  lineHeight: 60,
@@ -1,5 +1,5 @@
1
- import {useColorTransition} from 'react-native-stylex';
1
+ import { useColorTransition } from "react-native-stylex";
2
2
 
3
3
  export const useAnimatedBgColor = () => ({
4
- backgroundColor: useColorTransition(({palette}) => palette.bg),
4
+ backgroundColor: useColorTransition(({ palette }) => palette.bg),
5
5
  });
@@ -1,5 +1,5 @@
1
- import {useColorTransition} from 'react-native-stylex';
1
+ import { useColorTransition } from "react-native-stylex";
2
2
 
3
3
  export const useAnimatedTextColor = () => ({
4
- color: useColorTransition(({palette}) => palette.text),
4
+ color: useColorTransition(({ palette }) => palette.text),
5
5
  });
@@ -1,5 +1,5 @@
1
- import {useTheme} from 'react-native-stylex';
2
- import {darkTheme} from '../theme';
1
+ import { useTheme } from "react-native-stylex";
2
+ import { darkTheme } from "../theme";
3
3
 
4
4
  export const useIsDark = (): boolean => {
5
5
  const theme = useTheme();
@@ -1,11 +1,11 @@
1
1
  export const lightPalette = {
2
- text: '#000',
3
- bg: '#fff',
4
- accent: '#ff643d',
2
+ text: "#000",
3
+ bg: "#fff",
4
+ accent: "#ff643d",
5
5
  };
6
6
 
7
7
  export const darkPalette = {
8
- text: '#fff',
9
- bg: '#262431',
10
- accent: '#8d8aff',
8
+ text: "#fff",
9
+ bg: "#262431",
10
+ accent: "#8d8aff",
11
11
  };
@@ -1,5 +1,5 @@
1
- import {lightPalette, darkPalette} from './palette';
2
- import {utils} from './utils';
1
+ import { lightPalette, darkPalette } from "./palette";
2
+ import { utils } from "./utils";
3
3
 
4
4
  export const lightTheme = {
5
5
  palette: lightPalette,
@@ -1,11 +1,8 @@
1
- import Color from 'color';
1
+ import Color from "color";
2
2
 
3
3
  export const utils = {
4
4
  isDark: (color: string): boolean => Color(color).isDark(),
5
- fade: (color: string, alpha: number): string =>
6
- Color(color).alpha(alpha).string(),
7
- lighten: (color: string, val: number): string =>
8
- Color(color).lighten(val).string(),
9
- darken: (color: string, val: number): string =>
10
- Color(color).darken(val).string(),
5
+ fade: (color: string, alpha: number): string => Color(color).alpha(alpha).string(),
6
+ lighten: (color: string, val: number): string => Color(color).lighten(val).string(),
7
+ darken: (color: string, val: number): string => Color(color).darken(val).string(),
11
8
  };
@@ -1,6 +1,6 @@
1
- import 'react-native-stylex';
2
- import type {Theme} from './style-system/theme';
1
+ import "react-native-stylex";
2
+ import type { Theme } from "./style-system/theme";
3
3
 
4
- declare module 'react-native-stylex' {
4
+ declare module "react-native-stylex" {
5
5
  export interface DefaultTheme extends Theme {}
6
6
  }
package/package.json CHANGED
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "name": "@codeandmoney/soelma",
3
- "publishConfig": {"access": "public"},
4
- "version": "0.0.0-dev.0",
3
+ "publishConfig": {
4
+ "access": "public"
5
+ },
6
+ "version": "0.0.0-dev.10",
5
7
  "private": false,
6
8
  "main": "index.js",
7
9
  "types": "index.d.ts",
@@ -10,9 +12,10 @@
10
12
  "license": "MIT",
11
13
  "scripts": {
12
14
  "prebuild": "rm -rf lib",
13
- "build": "tsc",
14
- "postbuild": "mkdir lib/makeUseStyles && cp src/makeUseStyles/* lib/makeUseStyles && rm -rf lib/**/*test.* && prettier --write lib/**/*.{js,ts}",
15
+ "build": "tsc -p ./tsconfig.build.json",
16
+ "postbuild": "mkdir -p lib/make-use-styles && cp src/make-use-styles/* lib/make-use-styles && rm -rf lib/**/*test.* && prettier --write lib/**/*.{js,ts}",
15
17
  "clean-publish": "yarn test && yarn build && node ./node_modules/clean-publish/clear-package-json.js package.json > lib/package.json && cp CHANGELOG.md LICENSE README.md lib",
18
+ "pub": "yarn build && node ./node_modules/clean-publish/clear-package-json.js package.json > lib/package.json && cp CHANGELOG.md LICENSE README.md lib",
16
19
  "publish-next": "yarn clean-publish && cd lib && npm publish --tag next",
17
20
  "presize": "yarn build",
18
21
  "postinstall": "rm -rf node_modules/@types/node node_modules/@types/yauzl node_modules/@types/graceful-fs",
@@ -34,10 +37,11 @@
34
37
  }
35
38
  },
36
39
  "devDependencies": {
40
+ "@react-native/babel-preset": "^0.83.0",
37
41
  "@size-limit/preset-app": "^11.0.1",
38
42
  "@testing-library/react-hooks": "^8.0.1",
39
- "@types/jest": "^29.5.11",
40
- "@types/react": "^18.2.45",
43
+ "@types/jest": "^30.0.0",
44
+ "@types/react": "^19.2.7",
41
45
  "@typescript-eslint/eslint-plugin": "^6.14.0",
42
46
  "@typescript-eslint/parser": "^6.14.0",
43
47
  "clean-publish": "^4.2.0",
@@ -47,12 +51,12 @@
47
51
  "eslint-plugin-react": "^7.33.2",
48
52
  "jest": "^29.7.0",
49
53
  "prettier": "^3.1.1",
50
- "react": "^18.2.0",
51
- "react-native": "^0.73.0",
54
+ "react": "^19.2.3",
55
+ "react-native": "^0.83.0",
52
56
  "react-native-dark-mode": "^0.2.2",
53
- "react-native-safe-area-context": "^4.8.1",
54
- "react-native-test-app": "^2.5.34",
55
- "react-test-renderer": "^18.2.0",
57
+ "react-native-safe-area-context": "^5.6.2",
58
+ "react-native-test-app": "^5.0.5",
59
+ "react-test-renderer": "^19.2.3",
56
60
  "size-limit": "^11.0.1",
57
61
  "typescript": "^5.3.3"
58
62
  }
@@ -2,17 +2,13 @@ import "./init";
2
2
 
3
3
  import { Appearance } from "react-native";
4
4
 
5
- import { onUse } from "../dependencyUsage";
5
+ import { onUse } from "../dependency-usage";
6
6
 
7
7
  import { UI_MODE_DEPENDENCY_KEY } from "./consts";
8
8
 
9
9
  export type ColorSchemeName = "light" | "dark" | "default";
10
10
 
11
- export function appearance<T>({
12
- dark,
13
- light,
14
- default: defaultScheme,
15
- }: { [mode in ColorSchemeName]?: T }): T | undefined {
11
+ export function appearance<T>({ dark, light, default: defaultScheme }: { [mode in ColorSchemeName]?: T }): T | undefined {
16
12
  onUse(UI_MODE_DEPENDENCY_KEY);
17
13
 
18
14
  // Note: getColorScheme() will always return light when debugging with Chrome.
@@ -27,11 +23,8 @@ export function appearance<T>({
27
23
  return defaultScheme;
28
24
  }
29
25
 
30
- export const darkAppearance = <T>(dark: T): T | undefined =>
31
- appearance<T>({ dark });
26
+ export const darkAppearance = <T>(dark: T): T | undefined => appearance<T>({ dark });
32
27
 
33
- export const lightAppearance = <T>(light: T): T | undefined =>
34
- appearance<T>({ light });
28
+ export const lightAppearance = <T>(light: T): T | undefined => appearance<T>({ light });
35
29
 
36
- export const noPreferenceAppearance = <T>(defaultScheme: T): T | undefined =>
37
- appearance<T>({ default: defaultScheme });
30
+ export const noPreferenceAppearance = <T>(defaultScheme: T): T | undefined => appearance<T>({ default: defaultScheme });
@@ -1,7 +1,7 @@
1
1
  import { Appearance } from "react-native";
2
2
 
3
- import { addDependency } from "../dependencyRegistry";
4
- import { createEventEmitter } from "../createEventEmitter";
3
+ import { addDependency } from "../dependency-registry";
4
+ import { createEventEmitter } from "../create-event-emitter";
5
5
 
6
6
  import { UI_MODE_DEPENDENCY_KEY } from "./consts";
7
7
 
package/src/context.ts CHANGED
@@ -1,9 +1,6 @@
1
1
  import { createContext } from "react";
2
- import { DefaultTheme } from "./DefaultTheme";
2
+ import { DefaultTheme } from "./default-theme";
3
3
 
4
4
  export const themeContext = createContext<DefaultTheme | null>(null);
5
5
 
6
- export const {
7
- Provider: ThemeProvider,
8
- Consumer: ThemeConsumer,
9
- } = themeContext;
6
+ export const { Provider: ThemeProvider, Consumer: ThemeConsumer } = themeContext;