@vitality-ds/system-react-native 5.6.0-alpha.2 → 5.6.0

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,7 @@
1
+ import React from "react";
2
+ import { ProviderProps } from "./types";
3
+ declare function Provider({ children, config, }: ProviderProps): React.ReactElement;
4
+ declare namespace Provider {
5
+ var displayName: string;
6
+ }
7
+ export default Provider;
@@ -0,0 +1,7 @@
1
+ import { ThemeProviderProps } from "../ThemeProvider/types";
2
+ export type ProviderProps = {
3
+ children: React.ReactElement;
4
+ config?: {
5
+ theme: ThemeProviderProps["config"];
6
+ };
7
+ };
@@ -0,0 +1,5 @@
1
+ import type { AVAILABLE_THEMES_TYPE } from "../types";
2
+ import { UseTheme } from "./types";
3
+ export declare const DEFAULT_THEME_CONTEXT_VALUE: UseTheme;
4
+ export declare const DEFAULT_THEME_STORAGE_KEY = "vitality-app-theme";
5
+ export declare const AVAILABLE_THEMES: AVAILABLE_THEMES_TYPE;
@@ -0,0 +1,3 @@
1
+ import { ThemeProviderProps, UseTheme } from "../types";
2
+ declare const useTheme: (themeOverride: NonNullable<ThemeProviderProps["config"]>["themeOverride"]) => UseTheme;
3
+ export default useTheme;
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import { ThemeProviderProps, UseTheme } from "./types";
3
+ declare const ThemeContext: React.Context<UseTheme>;
4
+ declare function ThemeProvider({ config, children, }: ThemeProviderProps): React.ReactElement;
5
+ export { ThemeProvider, ThemeContext };
@@ -0,0 +1,3 @@
1
+ import { UseTheme } from "../types";
2
+ declare const getSavedTheme: () => Promise<UseTheme["theme"] | null>;
3
+ export default getSavedTheme;
@@ -0,0 +1 @@
1
+ export { default as setInitialState } from "./setInitialState";
@@ -0,0 +1,2 @@
1
+ declare const setInitialState: (setTheme: any, themeOverride: any, systemColorScheme: any) => Promise<any>;
2
+ export default setInitialState;
@@ -0,0 +1,3 @@
1
+ import { UseTheme } from "../types";
2
+ declare const setSavedTheme: (newMode: UseTheme["theme"]) => void;
3
+ export default setSavedTheme;
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import { Appearance } from "react-native";
3
+ type Themes = NonNullable<Appearance.AppearancePreferences["colorScheme"]>;
4
+ export type ThemeProviderProps = {
5
+ config?: {
6
+ themeOverride?: Themes;
7
+ };
8
+ children: React.ReactElement;
9
+ };
10
+ export type UseTheme = {
11
+ theme: Themes;
12
+ setTheme: (newTheme: Themes) => void;
13
+ useSystemTheme: () => void;
14
+ };
15
+ export {};
@@ -0,0 +1,26 @@
1
+ type ExcludedStyleProps = {
2
+ /**
3
+ * @ignore
4
+ */
5
+ className?: never;
6
+ /**
7
+ * @ignore
8
+ */
9
+ style?: never;
10
+ };
11
+ type ExcludedStitchesProps = {
12
+ /**
13
+ * @ignore
14
+ */
15
+ css?: never;
16
+ /**
17
+ * @ignore
18
+ */
19
+ as?: never;
20
+ /**
21
+ * @ignore
22
+ */
23
+ asChild?: never;
24
+ };
25
+ export type ExcludedProps = ExcludedStyleProps & ExcludedStitchesProps;
26
+ export {};
@@ -0,0 +1,9 @@
1
+ import { colorUseCases, getColorScaleFromThemeObject, getColorScaleValueByUseCase, getUseCasesByStep } from "@vitality-ds/tokens";
2
+ export type { CreateStitches } from "stitches-rn-vitality";
3
+ export { styled, css, createTheme, config, theme, ThemeProvider, darkTheme, } from "./stitches.config";
4
+ export { default as Provider } from "./Provider";
5
+ export { ThemeContext } from "./ThemeProvider";
6
+ export type { ExcludedProps } from "./exclude-types";
7
+ export type { CSS, VariantProps, ComponentProps, CSSProperties, ScaleValue, } from "./types";
8
+ export { AVAILABLE_THEMES_TYPE } from "./types";
9
+ export { getColorScaleFromThemeObject, getColorScaleValueByUseCase, colorUseCases, getUseCasesByStep, };