@robin-ux/native 0.1.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.
Files changed (112) hide show
  1. package/.eslintrc.js +5 -0
  2. package/README.md +35 -0
  3. package/android/build.gradle +43 -0
  4. package/android/src/main/AndroidManifest.xml +2 -0
  5. package/android/src/main/java/expo/modules/robinuxnative/RobinUxNativeModule.kt +50 -0
  6. package/android/src/main/java/expo/modules/robinuxnative/RobinUxNativeView.kt +30 -0
  7. package/build/RobinUxNative.types.d.ts +18 -0
  8. package/build/RobinUxNative.types.d.ts.map +1 -0
  9. package/build/RobinUxNative.types.js +2 -0
  10. package/build/RobinUxNative.types.js.map +1 -0
  11. package/build/RobinUxNativeModule.d.ts +10 -0
  12. package/build/RobinUxNativeModule.d.ts.map +1 -0
  13. package/build/RobinUxNativeModule.js +4 -0
  14. package/build/RobinUxNativeModule.js.map +1 -0
  15. package/build/RobinUxNativeModule.web.d.ts +10 -0
  16. package/build/RobinUxNativeModule.web.d.ts.map +1 -0
  17. package/build/RobinUxNativeModule.web.js +12 -0
  18. package/build/RobinUxNativeModule.web.js.map +1 -0
  19. package/build/RobinUxNativeView.d.ts +4 -0
  20. package/build/RobinUxNativeView.d.ts.map +1 -0
  21. package/build/RobinUxNativeView.js +7 -0
  22. package/build/RobinUxNativeView.js.map +1 -0
  23. package/build/RobinUxNativeView.web.d.ts +4 -0
  24. package/build/RobinUxNativeView.web.d.ts.map +1 -0
  25. package/build/RobinUxNativeView.web.js +7 -0
  26. package/build/RobinUxNativeView.web.js.map +1 -0
  27. package/build/components/Badge.d.ts +36 -0
  28. package/build/components/Badge.d.ts.map +1 -0
  29. package/build/components/Badge.js +78 -0
  30. package/build/components/Badge.js.map +1 -0
  31. package/build/components/Button.d.ts +43 -0
  32. package/build/components/Button.d.ts.map +1 -0
  33. package/build/components/Button.js +120 -0
  34. package/build/components/Button.js.map +1 -0
  35. package/build/components/DynamicStatusBar.d.ts +30 -0
  36. package/build/components/DynamicStatusBar.d.ts.map +1 -0
  37. package/build/components/DynamicStatusBar.js +70 -0
  38. package/build/components/DynamicStatusBar.js.map +1 -0
  39. package/build/components/Input.d.ts +73 -0
  40. package/build/components/Input.d.ts.map +1 -0
  41. package/build/components/Input.js +138 -0
  42. package/build/components/Input.js.map +1 -0
  43. package/build/components/SegmentedControl.d.ts +40 -0
  44. package/build/components/SegmentedControl.d.ts.map +1 -0
  45. package/build/components/SegmentedControl.js +73 -0
  46. package/build/components/SegmentedControl.js.map +1 -0
  47. package/build/components/Text.d.ts +32 -0
  48. package/build/components/Text.d.ts.map +1 -0
  49. package/build/components/Text.js +51 -0
  50. package/build/components/Text.js.map +1 -0
  51. package/build/components/index.d.ts +13 -0
  52. package/build/components/index.d.ts.map +1 -0
  53. package/build/components/index.js +13 -0
  54. package/build/components/index.js.map +1 -0
  55. package/build/index.d.ts +7 -0
  56. package/build/index.d.ts.map +1 -0
  57. package/build/index.js +10 -0
  58. package/build/index.js.map +1 -0
  59. package/build/theme/ThemeContext.d.ts +22 -0
  60. package/build/theme/ThemeContext.d.ts.map +1 -0
  61. package/build/theme/ThemeContext.js +35 -0
  62. package/build/theme/ThemeContext.js.map +1 -0
  63. package/build/theme/ThemeProvider.d.ts +33 -0
  64. package/build/theme/ThemeProvider.d.ts.map +1 -0
  65. package/build/theme/ThemeProvider.js +31 -0
  66. package/build/theme/ThemeProvider.js.map +1 -0
  67. package/build/theme/defaultTheme.d.ts +18 -0
  68. package/build/theme/defaultTheme.d.ts.map +1 -0
  69. package/build/theme/defaultTheme.js +77 -0
  70. package/build/theme/defaultTheme.js.map +1 -0
  71. package/build/theme/index.d.ts +6 -0
  72. package/build/theme/index.d.ts.map +1 -0
  73. package/build/theme/index.js +7 -0
  74. package/build/theme/index.js.map +1 -0
  75. package/build/theme/types.d.ts +40 -0
  76. package/build/theme/types.d.ts.map +1 -0
  77. package/build/theme/types.js +2 -0
  78. package/build/theme/types.js.map +1 -0
  79. package/build/utils/index.d.ts +3 -0
  80. package/build/utils/index.d.ts.map +1 -0
  81. package/build/utils/index.js +3 -0
  82. package/build/utils/index.js.map +1 -0
  83. package/build/utils/styles.d.ts +88 -0
  84. package/build/utils/styles.d.ts.map +1 -0
  85. package/build/utils/styles.js +150 -0
  86. package/build/utils/styles.js.map +1 -0
  87. package/expo-module.config.json +9 -0
  88. package/ios/RobinUxNative.podspec +29 -0
  89. package/ios/RobinUxNativeModule.swift +48 -0
  90. package/ios/RobinUxNativeView.swift +38 -0
  91. package/package.json +69 -0
  92. package/src/RobinUxNative.types.ts +19 -0
  93. package/src/RobinUxNativeModule.ts +12 -0
  94. package/src/RobinUxNativeModule.web.ts +15 -0
  95. package/src/RobinUxNativeView.tsx +11 -0
  96. package/src/RobinUxNativeView.web.tsx +15 -0
  97. package/src/components/Badge.tsx +101 -0
  98. package/src/components/Button.tsx +176 -0
  99. package/src/components/DynamicStatusBar.tsx +93 -0
  100. package/src/components/Input.tsx +248 -0
  101. package/src/components/SegmentedControl.tsx +107 -0
  102. package/src/components/Text.tsx +107 -0
  103. package/src/components/index.ts +23 -0
  104. package/src/index.ts +70 -0
  105. package/src/theme/ThemeContext.ts +38 -0
  106. package/src/theme/ThemeProvider.tsx +45 -0
  107. package/src/theme/defaultTheme.ts +91 -0
  108. package/src/theme/index.ts +12 -0
  109. package/src/theme/types.ts +52 -0
  110. package/src/utils/index.ts +19 -0
  111. package/src/utils/styles.ts +188 -0
  112. package/tsconfig.json +9 -0
@@ -0,0 +1,7 @@
1
+ export { ThemeProvider, ThemeContext, useTheme, useThemeSafe, defaultTheme, defaultDarkTheme, defaultLightColors, defaultDarkColors, } from './theme';
2
+ export type { Theme, ThemeColors, ThemeContextValue, ThemeProviderProps, } from './theme';
3
+ export { Button, Text, Input, PasswordInput, BaseInput, SegmentedControl, Badge, DynamicStatusBar, } from './components';
4
+ export type { ButtonProps, ButtonVariant, ButtonSize, TextProps, TextVariant, TextWeight, TextColor, TextAlign, InputProps, SegmentedControlProps, Segment, BadgeProps, BadgeStatus, DynamicStatusBarProps, } from './components';
5
+ export { spacing, borderRadius, typography, shadows, layouts, useThemedStyles, createThemedStyle, } from './utils';
6
+ export type { SpacingKey, BorderRadiusKey, TypographyVariant, ShadowKey, LayoutKey, } from './utils';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,KAAK,EACL,WAAW,EACX,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,MAAM,EACN,IAAI,EACJ,KAAK,EACL,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,KAAK,EACL,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,WAAW,EACX,aAAa,EACb,UAAU,EACV,SAAS,EACT,WAAW,EACX,UAAU,EACV,SAAS,EACT,SAAS,EACT,UAAU,EACV,qBAAqB,EACrB,OAAO,EACP,UAAU,EACV,WAAW,EACX,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,OAAO,EACP,YAAY,EACZ,UAAU,EACV,OAAO,EACP,OAAO,EACP,eAAe,EACf,iBAAiB,GAClB,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,SAAS,GACV,MAAM,SAAS,CAAC"}
package/build/index.js ADDED
@@ -0,0 +1,10 @@
1
+ // ============================================================================
2
+ // @robin-ux/native - Themeable React Native UI Components
3
+ // ============================================================================
4
+ // Theme system
5
+ export { ThemeProvider, ThemeContext, useTheme, useThemeSafe, defaultTheme, defaultDarkTheme, defaultLightColors, defaultDarkColors, } from './theme';
6
+ // Components
7
+ export { Button, Text, Input, PasswordInput, BaseInput, SegmentedControl, Badge, DynamicStatusBar, } from './components';
8
+ // Utilities
9
+ export { spacing, borderRadius, typography, shadows, layouts, useThemedStyles, createThemedStyle, } from './utils';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,0DAA0D;AAC1D,+EAA+E;AAE/E,eAAe;AACf,OAAO,EACL,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,SAAS,CAAC;AASjB,aAAa;AACb,OAAO,EACL,MAAM,EACN,IAAI,EACJ,KAAK,EACL,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,KAAK,EACL,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAmBtB,YAAY;AACZ,OAAO,EACL,OAAO,EACP,YAAY,EACZ,UAAU,EACV,OAAO,EACP,OAAO,EACP,eAAe,EACf,iBAAiB,GAClB,MAAM,SAAS,CAAC","sourcesContent":["// ============================================================================\n// @robin-ux/native - Themeable React Native UI Components\n// ============================================================================\n\n// Theme system\nexport {\n ThemeProvider,\n ThemeContext,\n useTheme,\n useThemeSafe,\n defaultTheme,\n defaultDarkTheme,\n defaultLightColors,\n defaultDarkColors,\n} from './theme';\n\nexport type {\n Theme,\n ThemeColors,\n ThemeContextValue,\n ThemeProviderProps,\n} from './theme';\n\n// Components\nexport {\n Button,\n Text,\n Input,\n PasswordInput,\n BaseInput,\n SegmentedControl,\n Badge,\n DynamicStatusBar,\n} from './components';\n\nexport type {\n ButtonProps,\n ButtonVariant,\n ButtonSize,\n TextProps,\n TextVariant,\n TextWeight,\n TextColor,\n TextAlign,\n InputProps,\n SegmentedControlProps,\n Segment,\n BadgeProps,\n BadgeStatus,\n DynamicStatusBarProps,\n} from './components';\n\n// Utilities\nexport {\n spacing,\n borderRadius,\n typography,\n shadows,\n layouts,\n useThemedStyles,\n createThemedStyle,\n} from './utils';\n\nexport type {\n SpacingKey,\n BorderRadiusKey,\n TypographyVariant,\n ShadowKey,\n LayoutKey,\n} from './utils';\n"]}
@@ -0,0 +1,22 @@
1
+ import { Theme, ThemeContextValue } from './types';
2
+ /**
3
+ * Theme context for providing theme to components.
4
+ * Default value is undefined to allow detection of missing provider.
5
+ */
6
+ export declare const ThemeContext: import("react").Context<ThemeContextValue | undefined>;
7
+ /**
8
+ * Hook to access the theme context.
9
+ * Throws an error if used outside of a ThemeProvider.
10
+ *
11
+ * @throws Error if no ThemeProvider is found in the component tree
12
+ */
13
+ export declare function useTheme(): Theme;
14
+ /**
15
+ * Safe hook to access theme with fallback to default.
16
+ * Never throws - returns default theme if no provider is found.
17
+ *
18
+ * This is the recommended hook for component libraries to ensure
19
+ * components work even without an explicit ThemeProvider.
20
+ */
21
+ export declare function useThemeSafe(): Theme;
22
+ //# sourceMappingURL=ThemeContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../src/theme/ThemeContext.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,YAAY,wDAA0D,CAAC;AAEpF;;;;;GAKG;AACH,wBAAgB,QAAQ,IAAI,KAAK,CAMhC;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,IAAI,KAAK,CAMpC"}
@@ -0,0 +1,35 @@
1
+ import { createContext, useContext } from 'react';
2
+ import { defaultTheme } from './defaultTheme';
3
+ /**
4
+ * Theme context for providing theme to components.
5
+ * Default value is undefined to allow detection of missing provider.
6
+ */
7
+ export const ThemeContext = createContext(undefined);
8
+ /**
9
+ * Hook to access the theme context.
10
+ * Throws an error if used outside of a ThemeProvider.
11
+ *
12
+ * @throws Error if no ThemeProvider is found in the component tree
13
+ */
14
+ export function useTheme() {
15
+ const context = useContext(ThemeContext);
16
+ if (context === undefined) {
17
+ throw new Error('useTheme must be used within a ThemeProvider');
18
+ }
19
+ return context.theme;
20
+ }
21
+ /**
22
+ * Safe hook to access theme with fallback to default.
23
+ * Never throws - returns default theme if no provider is found.
24
+ *
25
+ * This is the recommended hook for component libraries to ensure
26
+ * components work even without an explicit ThemeProvider.
27
+ */
28
+ export function useThemeSafe() {
29
+ const context = useContext(ThemeContext);
30
+ if (context === undefined) {
31
+ return defaultTheme;
32
+ }
33
+ return context.theme;
34
+ }
35
+ //# sourceMappingURL=ThemeContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeContext.js","sourceRoot":"","sources":["../../src/theme/ThemeContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAgC,SAAS,CAAC,CAAC;AAEpF;;;;;GAKG;AACH,MAAM,UAAU,QAAQ;IACtB,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IACzC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,OAAO,CAAC,KAAK,CAAC;AACvB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IACzC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,YAAY,CAAC;IACtB,CAAC;IACD,OAAO,OAAO,CAAC,KAAK,CAAC;AACvB,CAAC","sourcesContent":["import { createContext, useContext } from 'react';\nimport { defaultTheme } from './defaultTheme';\nimport { Theme, ThemeContextValue } from './types';\n\n/**\n * Theme context for providing theme to components.\n * Default value is undefined to allow detection of missing provider.\n */\nexport const ThemeContext = createContext<ThemeContextValue | undefined>(undefined);\n\n/**\n * Hook to access the theme context.\n * Throws an error if used outside of a ThemeProvider.\n *\n * @throws Error if no ThemeProvider is found in the component tree\n */\nexport function useTheme(): Theme {\n const context = useContext(ThemeContext);\n if (context === undefined) {\n throw new Error('useTheme must be used within a ThemeProvider');\n }\n return context.theme;\n}\n\n/**\n * Safe hook to access theme with fallback to default.\n * Never throws - returns default theme if no provider is found.\n *\n * This is the recommended hook for component libraries to ensure\n * components work even without an explicit ThemeProvider.\n */\nexport function useThemeSafe(): Theme {\n const context = useContext(ThemeContext);\n if (context === undefined) {\n return defaultTheme;\n }\n return context.theme;\n}\n"]}
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import { Theme } from './types';
3
+ export interface ThemeProviderProps {
4
+ /**
5
+ * The theme to provide to child components.
6
+ * Falls back to default neutral theme if not provided.
7
+ */
8
+ theme?: Theme;
9
+ children: React.ReactNode;
10
+ }
11
+ /**
12
+ * Theme provider component that makes theme available to all child components.
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * import { ThemeProvider } from '@robin-ux/native';
17
+ *
18
+ * const myTheme = {
19
+ * colors: { ... },
20
+ * isDark: false,
21
+ * };
22
+ *
23
+ * function App() {
24
+ * return (
25
+ * <ThemeProvider theme={myTheme}>
26
+ * <MyApp />
27
+ * </ThemeProvider>
28
+ * );
29
+ * }
30
+ * ```
31
+ */
32
+ export declare function ThemeProvider({ theme, children }: ThemeProviderProps): React.JSX.Element;
33
+ //# sourceMappingURL=ThemeProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../src/theme/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAE,KAAK,EAAqB,MAAM,SAAS,CAAC;AAEnD,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,aAAa,CAAC,EAAE,KAAoB,EAAE,QAAQ,EAAE,EAAE,kBAAkB,qBASnF"}
@@ -0,0 +1,31 @@
1
+ import React, { useMemo } from 'react';
2
+ import { ThemeContext } from './ThemeContext';
3
+ import { defaultTheme } from './defaultTheme';
4
+ /**
5
+ * Theme provider component that makes theme available to all child components.
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * import { ThemeProvider } from '@robin-ux/native';
10
+ *
11
+ * const myTheme = {
12
+ * colors: { ... },
13
+ * isDark: false,
14
+ * };
15
+ *
16
+ * function App() {
17
+ * return (
18
+ * <ThemeProvider theme={myTheme}>
19
+ * <MyApp />
20
+ * </ThemeProvider>
21
+ * );
22
+ * }
23
+ * ```
24
+ */
25
+ export function ThemeProvider({ theme = defaultTheme, children }) {
26
+ const value = useMemo(() => ({
27
+ theme,
28
+ }), [theme]);
29
+ return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;
30
+ }
31
+ //# sourceMappingURL=ThemeProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeProvider.js","sourceRoot":"","sources":["../../src/theme/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAY9C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,aAAa,CAAC,EAAE,KAAK,GAAG,YAAY,EAAE,QAAQ,EAAsB;IAClF,MAAM,KAAK,GAAsB,OAAO,CACtC,GAAG,EAAE,CAAC,CAAC;QACL,KAAK;KACN,CAAC,EACF,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;AACjF,CAAC","sourcesContent":["import React, { useMemo } from 'react';\nimport { ThemeContext } from './ThemeContext';\nimport { defaultTheme } from './defaultTheme';\nimport { Theme, ThemeContextValue } from './types';\n\nexport interface ThemeProviderProps {\n /**\n * The theme to provide to child components.\n * Falls back to default neutral theme if not provided.\n */\n theme?: Theme;\n children: React.ReactNode;\n}\n\n/**\n * Theme provider component that makes theme available to all child components.\n *\n * @example\n * ```tsx\n * import { ThemeProvider } from '@robin-ux/native';\n *\n * const myTheme = {\n * colors: { ... },\n * isDark: false,\n * };\n *\n * function App() {\n * return (\n * <ThemeProvider theme={myTheme}>\n * <MyApp />\n * </ThemeProvider>\n * );\n * }\n * ```\n */\nexport function ThemeProvider({ theme = defaultTheme, children }: ThemeProviderProps) {\n const value: ThemeContextValue = useMemo(\n () => ({\n theme,\n }),\n [theme]\n );\n\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;\n}\n"]}
@@ -0,0 +1,18 @@
1
+ import { Theme, ThemeColors } from './types';
2
+ /**
3
+ * Default light theme colors - a neutral, accessible color palette.
4
+ */
5
+ export declare const defaultLightColors: ThemeColors;
6
+ /**
7
+ * Default dark theme colors - a neutral, accessible dark color palette.
8
+ */
9
+ export declare const defaultDarkColors: ThemeColors;
10
+ /**
11
+ * Default light theme - used as fallback when no ThemeProvider is present.
12
+ */
13
+ export declare const defaultTheme: Theme;
14
+ /**
15
+ * Default dark theme variant.
16
+ */
17
+ export declare const defaultDarkTheme: Theme;
18
+ //# sourceMappingURL=defaultTheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultTheme.d.ts","sourceRoot":"","sources":["../../src/theme/defaultTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAgChC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAgC/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,KAG1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAG9B,CAAC"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Default light theme colors - a neutral, accessible color palette.
3
+ */
4
+ export const defaultLightColors = {
5
+ // Backgrounds
6
+ background: '#ffffff',
7
+ backgroundSecondary: '#f5f5f5',
8
+ // Foreground (text)
9
+ foreground: '#1a1a1a',
10
+ foregroundSecondary: '#666666',
11
+ foregroundTertiary: '#999999',
12
+ // Primary brand colors
13
+ primary: '#3b82f6',
14
+ primaryLight: '#60a5fa',
15
+ primaryDark: '#2563eb',
16
+ // Accent colors
17
+ accent: '#8b5cf6',
18
+ accentLight: '#a78bfa',
19
+ // Semantic/status colors
20
+ destructive: '#ef4444',
21
+ destructiveForeground: '#ffffff',
22
+ success: '#10b981',
23
+ warning: '#f59e0b',
24
+ error: '#ef4444',
25
+ info: '#3b82f6',
26
+ // UI element colors
27
+ border: '#e5e5e5',
28
+ muted: '#f5f5f5',
29
+ mutedForeground: '#666666',
30
+ card: '#ffffff',
31
+ };
32
+ /**
33
+ * Default dark theme colors - a neutral, accessible dark color palette.
34
+ */
35
+ export const defaultDarkColors = {
36
+ // Backgrounds
37
+ background: '#0a0a0a',
38
+ backgroundSecondary: '#171717',
39
+ // Foreground (text)
40
+ foreground: '#fafafa',
41
+ foregroundSecondary: '#a3a3a3',
42
+ foregroundTertiary: '#737373',
43
+ // Primary brand colors
44
+ primary: '#60a5fa',
45
+ primaryLight: '#93c5fd',
46
+ primaryDark: '#3b82f6',
47
+ // Accent colors
48
+ accent: '#a78bfa',
49
+ accentLight: '#c4b5fd',
50
+ // Semantic/status colors
51
+ destructive: '#f87171',
52
+ destructiveForeground: '#ffffff',
53
+ success: '#34d399',
54
+ warning: '#fbbf24',
55
+ error: '#f87171',
56
+ info: '#60a5fa',
57
+ // UI element colors
58
+ border: '#262626',
59
+ muted: '#262626',
60
+ mutedForeground: '#a3a3a3',
61
+ card: '#171717',
62
+ };
63
+ /**
64
+ * Default light theme - used as fallback when no ThemeProvider is present.
65
+ */
66
+ export const defaultTheme = {
67
+ colors: defaultLightColors,
68
+ isDark: false,
69
+ };
70
+ /**
71
+ * Default dark theme variant.
72
+ */
73
+ export const defaultDarkTheme = {
74
+ colors: defaultDarkColors,
75
+ isDark: true,
76
+ };
77
+ //# sourceMappingURL=defaultTheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultTheme.js","sourceRoot":"","sources":["../../src/theme/defaultTheme.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAgB;IAC7C,cAAc;IACd,UAAU,EAAE,SAAS;IACrB,mBAAmB,EAAE,SAAS;IAE9B,oBAAoB;IACpB,UAAU,EAAE,SAAS;IACrB,mBAAmB,EAAE,SAAS;IAC9B,kBAAkB,EAAE,SAAS;IAE7B,uBAAuB;IACvB,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,SAAS;IACvB,WAAW,EAAE,SAAS;IAEtB,gBAAgB;IAChB,MAAM,EAAE,SAAS;IACjB,WAAW,EAAE,SAAS;IAEtB,yBAAyB;IACzB,WAAW,EAAE,SAAS;IACtB,qBAAqB,EAAE,SAAS;IAChC,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,SAAS;IAEf,oBAAoB;IACpB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;IAChB,eAAe,EAAE,SAAS;IAC1B,IAAI,EAAE,SAAS;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAgB;IAC5C,cAAc;IACd,UAAU,EAAE,SAAS;IACrB,mBAAmB,EAAE,SAAS;IAE9B,oBAAoB;IACpB,UAAU,EAAE,SAAS;IACrB,mBAAmB,EAAE,SAAS;IAC9B,kBAAkB,EAAE,SAAS;IAE7B,uBAAuB;IACvB,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,SAAS;IACvB,WAAW,EAAE,SAAS;IAEtB,gBAAgB;IAChB,MAAM,EAAE,SAAS;IACjB,WAAW,EAAE,SAAS;IAEtB,yBAAyB;IACzB,WAAW,EAAE,SAAS;IACtB,qBAAqB,EAAE,SAAS;IAChC,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,SAAS;IAEf,oBAAoB;IACpB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;IAChB,eAAe,EAAE,SAAS;IAC1B,IAAI,EAAE,SAAS;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAU;IACjC,MAAM,EAAE,kBAAkB;IAC1B,MAAM,EAAE,KAAK;CACd,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAU;IACrC,MAAM,EAAE,iBAAiB;IACzB,MAAM,EAAE,IAAI;CACb,CAAC","sourcesContent":["import { Theme, ThemeColors } from './types';\n\n/**\n * Default light theme colors - a neutral, accessible color palette.\n */\nexport const defaultLightColors: ThemeColors = {\n // Backgrounds\n background: '#ffffff',\n backgroundSecondary: '#f5f5f5',\n\n // Foreground (text)\n foreground: '#1a1a1a',\n foregroundSecondary: '#666666',\n foregroundTertiary: '#999999',\n\n // Primary brand colors\n primary: '#3b82f6',\n primaryLight: '#60a5fa',\n primaryDark: '#2563eb',\n\n // Accent colors\n accent: '#8b5cf6',\n accentLight: '#a78bfa',\n\n // Semantic/status colors\n destructive: '#ef4444',\n destructiveForeground: '#ffffff',\n success: '#10b981',\n warning: '#f59e0b',\n error: '#ef4444',\n info: '#3b82f6',\n\n // UI element colors\n border: '#e5e5e5',\n muted: '#f5f5f5',\n mutedForeground: '#666666',\n card: '#ffffff',\n};\n\n/**\n * Default dark theme colors - a neutral, accessible dark color palette.\n */\nexport const defaultDarkColors: ThemeColors = {\n // Backgrounds\n background: '#0a0a0a',\n backgroundSecondary: '#171717',\n\n // Foreground (text)\n foreground: '#fafafa',\n foregroundSecondary: '#a3a3a3',\n foregroundTertiary: '#737373',\n\n // Primary brand colors\n primary: '#60a5fa',\n primaryLight: '#93c5fd',\n primaryDark: '#3b82f6',\n\n // Accent colors\n accent: '#a78bfa',\n accentLight: '#c4b5fd',\n\n // Semantic/status colors\n destructive: '#f87171',\n destructiveForeground: '#ffffff',\n success: '#34d399',\n warning: '#fbbf24',\n error: '#f87171',\n info: '#60a5fa',\n\n // UI element colors\n border: '#262626',\n muted: '#262626',\n mutedForeground: '#a3a3a3',\n card: '#171717',\n};\n\n/**\n * Default light theme - used as fallback when no ThemeProvider is present.\n */\nexport const defaultTheme: Theme = {\n colors: defaultLightColors,\n isDark: false,\n};\n\n/**\n * Default dark theme variant.\n */\nexport const defaultDarkTheme: Theme = {\n colors: defaultDarkColors,\n isDark: true,\n};\n"]}
@@ -0,0 +1,6 @@
1
+ export { ThemeContext, useTheme, useThemeSafe } from './ThemeContext';
2
+ export { ThemeProvider } from './ThemeProvider';
3
+ export type { ThemeProviderProps } from './ThemeProvider';
4
+ export { defaultTheme, defaultDarkTheme, defaultLightColors, defaultDarkColors } from './defaultTheme';
5
+ export type { Theme, ThemeColors, ThemeContextValue } from './types';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGtE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAG1D,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGvG,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,7 @@
1
+ // Theme context and hooks
2
+ export { ThemeContext, useTheme, useThemeSafe } from './ThemeContext';
3
+ // Theme provider
4
+ export { ThemeProvider } from './ThemeProvider';
5
+ // Default themes
6
+ export { defaultTheme, defaultDarkTheme, defaultLightColors, defaultDarkColors } from './defaultTheme';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEtE,iBAAiB;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,iBAAiB;AACjB,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["// Theme context and hooks\nexport { ThemeContext, useTheme, useThemeSafe } from './ThemeContext';\n\n// Theme provider\nexport { ThemeProvider } from './ThemeProvider';\nexport type { ThemeProviderProps } from './ThemeProvider';\n\n// Default themes\nexport { defaultTheme, defaultDarkTheme, defaultLightColors, defaultDarkColors } from './defaultTheme';\n\n// Types\nexport type { Theme, ThemeColors, ThemeContextValue } from './types';\n"]}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Theme color definitions for @robin-ux/native components.
3
+ * These define all the semantic colors used by components.
4
+ */
5
+ export interface ThemeColors {
6
+ background: string;
7
+ backgroundSecondary: string;
8
+ foreground: string;
9
+ foregroundSecondary: string;
10
+ foregroundTertiary: string;
11
+ primary: string;
12
+ primaryLight: string;
13
+ primaryDark: string;
14
+ accent: string;
15
+ accentLight: string;
16
+ destructive: string;
17
+ destructiveForeground: string;
18
+ success: string;
19
+ warning: string;
20
+ error: string;
21
+ info: string;
22
+ border: string;
23
+ muted: string;
24
+ mutedForeground: string;
25
+ card: string;
26
+ }
27
+ /**
28
+ * Complete theme object containing colors and mode information.
29
+ */
30
+ export interface Theme {
31
+ colors: ThemeColors;
32
+ isDark: boolean;
33
+ }
34
+ /**
35
+ * Theme context value type.
36
+ */
37
+ export interface ThemeContextValue {
38
+ theme: Theme;
39
+ }
40
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/theme/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,WAAW;IAE1B,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC;IAG5B,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,MAAM,CAAC;IAG3B,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IAGpB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IAGpB,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IAGb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,KAAK,CAAC;CACd"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/theme/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Theme color definitions for @robin-ux/native components.\n * These define all the semantic colors used by components.\n */\nexport interface ThemeColors {\n // Backgrounds\n background: string;\n backgroundSecondary: string;\n\n // Foreground (text)\n foreground: string;\n foregroundSecondary: string;\n foregroundTertiary: string;\n\n // Primary brand colors\n primary: string;\n primaryLight: string;\n primaryDark: string;\n\n // Accent colors\n accent: string;\n accentLight: string;\n\n // Semantic/status colors\n destructive: string;\n destructiveForeground: string;\n success: string;\n warning: string;\n error: string;\n info: string;\n\n // UI element colors\n border: string;\n muted: string;\n mutedForeground: string;\n card: string;\n}\n\n/**\n * Complete theme object containing colors and mode information.\n */\nexport interface Theme {\n colors: ThemeColors;\n isDark: boolean;\n}\n\n/**\n * Theme context value type.\n */\nexport interface ThemeContextValue {\n theme: Theme;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export { spacing, borderRadius, typography, shadows, layouts, useThemedStyles, createThemedStyle, } from './styles';
2
+ export type { SpacingKey, BorderRadiusKey, TypographyVariant, ShadowKey, LayoutKey, } from './styles';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,YAAY,EACZ,UAAU,EACV,OAAO,EACP,OAAO,EACP,eAAe,EACf,iBAAiB,GAClB,MAAM,UAAU,CAAC;AAGlB,YAAY,EACV,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,SAAS,GACV,MAAM,UAAU,CAAC"}
@@ -0,0 +1,3 @@
1
+ // Style utilities
2
+ export { spacing, borderRadius, typography, shadows, layouts, useThemedStyles, createThemedStyle, } from './styles';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAClB,OAAO,EACL,OAAO,EACP,YAAY,EACZ,UAAU,EACV,OAAO,EACP,OAAO,EACP,eAAe,EACf,iBAAiB,GAClB,MAAM,UAAU,CAAC","sourcesContent":["// Style utilities\nexport {\n spacing,\n borderRadius,\n typography,\n shadows,\n layouts,\n useThemedStyles,\n createThemedStyle,\n} from './styles';\n\n// Types\nexport type {\n SpacingKey,\n BorderRadiusKey,\n TypographyVariant,\n ShadowKey,\n LayoutKey,\n} from './styles';\n"]}
@@ -0,0 +1,88 @@
1
+ import { StyleSheet, TextStyle, ViewStyle } from 'react-native';
2
+ import { ThemeColors } from '../theme/types';
3
+ /**
4
+ * Spacing scale for consistent layout.
5
+ */
6
+ export declare const spacing: {
7
+ readonly xs: 4;
8
+ readonly sm: 8;
9
+ readonly md: 16;
10
+ readonly lg: 24;
11
+ readonly xl: 32;
12
+ readonly xxl: 48;
13
+ };
14
+ export type SpacingKey = keyof typeof spacing;
15
+ /**
16
+ * Border radius scale.
17
+ */
18
+ export declare const borderRadius: {
19
+ readonly sm: 4;
20
+ readonly md: 8;
21
+ readonly lg: 12;
22
+ readonly xl: 16;
23
+ readonly full: 9999;
24
+ };
25
+ export type BorderRadiusKey = keyof typeof borderRadius;
26
+ /**
27
+ * Typography presets using system fonts.
28
+ */
29
+ export declare const typography: {
30
+ readonly heading: TextStyle;
31
+ readonly subheading: TextStyle;
32
+ readonly title: TextStyle;
33
+ readonly body: TextStyle;
34
+ readonly bodyMedium: TextStyle;
35
+ readonly bodySemibold: TextStyle;
36
+ readonly caption: TextStyle;
37
+ readonly label: TextStyle;
38
+ };
39
+ export type TypographyVariant = keyof typeof typography;
40
+ /**
41
+ * Common shadow styles.
42
+ */
43
+ export declare const shadows: {
44
+ readonly sm: ViewStyle;
45
+ readonly md: ViewStyle;
46
+ readonly lg: ViewStyle;
47
+ };
48
+ export type ShadowKey = keyof typeof shadows;
49
+ /**
50
+ * Common flex layouts.
51
+ */
52
+ export declare const layouts: {
53
+ readonly row: ViewStyle;
54
+ readonly rowCenter: ViewStyle;
55
+ readonly rowBetween: ViewStyle;
56
+ readonly center: ViewStyle;
57
+ readonly flex1: ViewStyle;
58
+ };
59
+ export type LayoutKey = keyof typeof layouts;
60
+ /**
61
+ * Type for style factory function.
62
+ */
63
+ type StyleFactory<T> = (colors: ThemeColors) => T;
64
+ /**
65
+ * Hook to create themed styles using StyleSheet.create.
66
+ *
67
+ * @example
68
+ * ```tsx
69
+ * const styles = useThemedStyles((colors) => ({
70
+ * container: {
71
+ * backgroundColor: colors.background,
72
+ * padding: spacing.md,
73
+ * },
74
+ * title: {
75
+ * ...typography.heading,
76
+ * color: colors.foreground,
77
+ * },
78
+ * }));
79
+ * ```
80
+ */
81
+ export declare function useThemedStyles<T extends StyleSheet.NamedStyles<T>>(factory: StyleFactory<T>): T;
82
+ /**
83
+ * Create a themed style object without StyleSheet.create.
84
+ * Useful for dynamic styles or when you need to merge with other styles.
85
+ */
86
+ export declare function createThemedStyle<T extends ViewStyle | TextStyle>(factory: StyleFactory<T>, colors: ThemeColors): T;
87
+ export {};
88
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/utils/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,OAAO;;;;;;;CAOV,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,OAAO,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;CAMf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,UAAU;sBAMhB,SAAS;yBAMT,SAAS;oBAMT,SAAS;mBAOT,SAAS;yBAMT,SAAS;2BAMT,SAAS;sBAOT,SAAS;oBAMT,SAAS;CACN,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,UAAU,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,OAAO;iBAOb,SAAS;iBAQT,SAAS;iBAQT,SAAS;CACN,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,OAAO,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,OAAO;kBAGb,SAAS;wBAKT,SAAS;yBAMT,SAAS;qBAKT,SAAS;oBAIT,SAAS;CACN,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,OAAO,CAAC;AAE7C;;GAEG;AACH,KAAK,YAAY,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,KAAK,CAAC,CAAC;AAElD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAGhG;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,EAC/D,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EACxB,MAAM,EAAE,WAAW,GAClB,CAAC,CAEH"}
@@ -0,0 +1,150 @@
1
+ import { StyleSheet } from 'react-native';
2
+ import { useThemeSafe } from '../theme';
3
+ /**
4
+ * Spacing scale for consistent layout.
5
+ */
6
+ export const spacing = {
7
+ xs: 4,
8
+ sm: 8,
9
+ md: 16,
10
+ lg: 24,
11
+ xl: 32,
12
+ xxl: 48,
13
+ };
14
+ /**
15
+ * Border radius scale.
16
+ */
17
+ export const borderRadius = {
18
+ sm: 4,
19
+ md: 8,
20
+ lg: 12,
21
+ xl: 16,
22
+ full: 9999,
23
+ };
24
+ /**
25
+ * Typography presets using system fonts.
26
+ */
27
+ export const typography = {
28
+ // Headings
29
+ heading: {
30
+ fontSize: 32,
31
+ lineHeight: 40,
32
+ fontWeight: '800',
33
+ },
34
+ subheading: {
35
+ fontSize: 24,
36
+ lineHeight: 32,
37
+ fontWeight: '700',
38
+ },
39
+ title: {
40
+ fontSize: 20,
41
+ lineHeight: 28,
42
+ fontWeight: '600',
43
+ },
44
+ // Body text
45
+ body: {
46
+ fontSize: 16,
47
+ lineHeight: 24,
48
+ fontWeight: '400',
49
+ },
50
+ bodyMedium: {
51
+ fontSize: 16,
52
+ lineHeight: 24,
53
+ fontWeight: '500',
54
+ },
55
+ bodySemibold: {
56
+ fontSize: 16,
57
+ lineHeight: 24,
58
+ fontWeight: '600',
59
+ },
60
+ // Small text
61
+ caption: {
62
+ fontSize: 14,
63
+ lineHeight: 20,
64
+ fontWeight: '400',
65
+ },
66
+ label: {
67
+ fontSize: 12,
68
+ lineHeight: 16,
69
+ fontWeight: '500',
70
+ },
71
+ };
72
+ /**
73
+ * Common shadow styles.
74
+ */
75
+ export const shadows = {
76
+ sm: {
77
+ shadowColor: '#000',
78
+ shadowOffset: { width: 0, height: 1 },
79
+ shadowOpacity: 0.05,
80
+ shadowRadius: 2,
81
+ elevation: 1,
82
+ },
83
+ md: {
84
+ shadowColor: '#000',
85
+ shadowOffset: { width: 0, height: 2 },
86
+ shadowOpacity: 0.1,
87
+ shadowRadius: 4,
88
+ elevation: 2,
89
+ },
90
+ lg: {
91
+ shadowColor: '#000',
92
+ shadowOffset: { width: 0, height: 4 },
93
+ shadowOpacity: 0.15,
94
+ shadowRadius: 8,
95
+ elevation: 4,
96
+ },
97
+ };
98
+ /**
99
+ * Common flex layouts.
100
+ */
101
+ export const layouts = {
102
+ row: {
103
+ flexDirection: 'row',
104
+ },
105
+ rowCenter: {
106
+ flexDirection: 'row',
107
+ alignItems: 'center',
108
+ },
109
+ rowBetween: {
110
+ flexDirection: 'row',
111
+ alignItems: 'center',
112
+ justifyContent: 'space-between',
113
+ },
114
+ center: {
115
+ alignItems: 'center',
116
+ justifyContent: 'center',
117
+ },
118
+ flex1: {
119
+ flex: 1,
120
+ },
121
+ };
122
+ /**
123
+ * Hook to create themed styles using StyleSheet.create.
124
+ *
125
+ * @example
126
+ * ```tsx
127
+ * const styles = useThemedStyles((colors) => ({
128
+ * container: {
129
+ * backgroundColor: colors.background,
130
+ * padding: spacing.md,
131
+ * },
132
+ * title: {
133
+ * ...typography.heading,
134
+ * color: colors.foreground,
135
+ * },
136
+ * }));
137
+ * ```
138
+ */
139
+ export function useThemedStyles(factory) {
140
+ const { colors } = useThemeSafe();
141
+ return StyleSheet.create(factory(colors));
142
+ }
143
+ /**
144
+ * Create a themed style object without StyleSheet.create.
145
+ * Useful for dynamic styles or when you need to merge with other styles.
146
+ */
147
+ export function createThemedStyle(factory, colors) {
148
+ return factory(colors);
149
+ }
150
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/utils/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAwB,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,EAAE;IACN,EAAE,EAAE,EAAE;IACN,EAAE,EAAE,EAAE;IACN,GAAG,EAAE,EAAE;CACC,CAAC;AAIX;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,EAAE;IACN,EAAE,EAAE,EAAE;IACN,IAAI,EAAE,IAAI;CACF,CAAC;AAIX;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,WAAW;IACX,OAAO,EAAE;QACP,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,KAAc;KACd;IAEd,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,KAAc;KACd;IAEd,KAAK,EAAE;QACL,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,KAAc;KACd;IAEd,YAAY;IACZ,IAAI,EAAE;QACJ,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,KAAc;KACd;IAEd,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,KAAc;KACd;IAEd,YAAY,EAAE;QACZ,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,KAAc;KACd;IAEd,aAAa;IACb,OAAO,EAAE;QACP,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,KAAc;KACd;IAEd,KAAK,EAAE;QACL,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,KAAc;KACd;CACN,CAAC;AAIX;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,EAAE,EAAE;QACF,WAAW,EAAE,MAAM;QACnB,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;QACrC,aAAa,EAAE,IAAI;QACnB,YAAY,EAAE,CAAC;QACf,SAAS,EAAE,CAAC;KACA;IAEd,EAAE,EAAE;QACF,WAAW,EAAE,MAAM;QACnB,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;QACrC,aAAa,EAAE,GAAG;QAClB,YAAY,EAAE,CAAC;QACf,SAAS,EAAE,CAAC;KACA;IAEd,EAAE,EAAE;QACF,WAAW,EAAE,MAAM;QACnB,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;QACrC,aAAa,EAAE,IAAI;QACnB,YAAY,EAAE,CAAC;QACf,SAAS,EAAE,CAAC;KACA;CACN,CAAC;AAIX;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,GAAG,EAAE;QACH,aAAa,EAAE,KAAK;KACR;IAEd,SAAS,EAAE;QACT,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;KACR;IAEd,UAAU,EAAE;QACV,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,eAAe;KACnB;IAEd,MAAM,EAAE;QACN,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACZ;IAEd,KAAK,EAAE;QACL,IAAI,EAAE,CAAC;KACK;CACN,CAAC;AASX;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,eAAe,CAAsC,OAAwB;IAC3F,MAAM,EAAE,MAAM,EAAE,GAAG,YAAY,EAAE,CAAC;IAClC,OAAO,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AAC5C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAAwB,EACxB,MAAmB;IAEnB,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;AACzB,CAAC","sourcesContent":["import { StyleSheet, TextStyle, ViewStyle } from 'react-native';\nimport { useThemeSafe } from '../theme';\nimport { ThemeColors } from '../theme/types';\n\n/**\n * Spacing scale for consistent layout.\n */\nexport const spacing = {\n xs: 4,\n sm: 8,\n md: 16,\n lg: 24,\n xl: 32,\n xxl: 48,\n} as const;\n\nexport type SpacingKey = keyof typeof spacing;\n\n/**\n * Border radius scale.\n */\nexport const borderRadius = {\n sm: 4,\n md: 8,\n lg: 12,\n xl: 16,\n full: 9999,\n} as const;\n\nexport type BorderRadiusKey = keyof typeof borderRadius;\n\n/**\n * Typography presets using system fonts.\n */\nexport const typography = {\n // Headings\n heading: {\n fontSize: 32,\n lineHeight: 40,\n fontWeight: '800' as const,\n } as TextStyle,\n\n subheading: {\n fontSize: 24,\n lineHeight: 32,\n fontWeight: '700' as const,\n } as TextStyle,\n\n title: {\n fontSize: 20,\n lineHeight: 28,\n fontWeight: '600' as const,\n } as TextStyle,\n\n // Body text\n body: {\n fontSize: 16,\n lineHeight: 24,\n fontWeight: '400' as const,\n } as TextStyle,\n\n bodyMedium: {\n fontSize: 16,\n lineHeight: 24,\n fontWeight: '500' as const,\n } as TextStyle,\n\n bodySemibold: {\n fontSize: 16,\n lineHeight: 24,\n fontWeight: '600' as const,\n } as TextStyle,\n\n // Small text\n caption: {\n fontSize: 14,\n lineHeight: 20,\n fontWeight: '400' as const,\n } as TextStyle,\n\n label: {\n fontSize: 12,\n lineHeight: 16,\n fontWeight: '500' as const,\n } as TextStyle,\n} as const;\n\nexport type TypographyVariant = keyof typeof typography;\n\n/**\n * Common shadow styles.\n */\nexport const shadows = {\n sm: {\n shadowColor: '#000',\n shadowOffset: { width: 0, height: 1 },\n shadowOpacity: 0.05,\n shadowRadius: 2,\n elevation: 1,\n } as ViewStyle,\n\n md: {\n shadowColor: '#000',\n shadowOffset: { width: 0, height: 2 },\n shadowOpacity: 0.1,\n shadowRadius: 4,\n elevation: 2,\n } as ViewStyle,\n\n lg: {\n shadowColor: '#000',\n shadowOffset: { width: 0, height: 4 },\n shadowOpacity: 0.15,\n shadowRadius: 8,\n elevation: 4,\n } as ViewStyle,\n} as const;\n\nexport type ShadowKey = keyof typeof shadows;\n\n/**\n * Common flex layouts.\n */\nexport const layouts = {\n row: {\n flexDirection: 'row',\n } as ViewStyle,\n\n rowCenter: {\n flexDirection: 'row',\n alignItems: 'center',\n } as ViewStyle,\n\n rowBetween: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n } as ViewStyle,\n\n center: {\n alignItems: 'center',\n justifyContent: 'center',\n } as ViewStyle,\n\n flex1: {\n flex: 1,\n } as ViewStyle,\n} as const;\n\nexport type LayoutKey = keyof typeof layouts;\n\n/**\n * Type for style factory function.\n */\ntype StyleFactory<T> = (colors: ThemeColors) => T;\n\n/**\n * Hook to create themed styles using StyleSheet.create.\n *\n * @example\n * ```tsx\n * const styles = useThemedStyles((colors) => ({\n * container: {\n * backgroundColor: colors.background,\n * padding: spacing.md,\n * },\n * title: {\n * ...typography.heading,\n * color: colors.foreground,\n * },\n * }));\n * ```\n */\nexport function useThemedStyles<T extends StyleSheet.NamedStyles<T>>(factory: StyleFactory<T>): T {\n const { colors } = useThemeSafe();\n return StyleSheet.create(factory(colors));\n}\n\n/**\n * Create a themed style object without StyleSheet.create.\n * Useful for dynamic styles or when you need to merge with other styles.\n */\nexport function createThemedStyle<T extends ViewStyle | TextStyle>(\n factory: StyleFactory<T>,\n colors: ThemeColors\n): T {\n return factory(colors);\n}\n"]}