@campxdev/react-native-blueprint 0.1.1 → 0.1.2

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 (74) hide show
  1. package/global.css +417 -0
  2. package/lib/module/components/ui/index.js +1 -0
  3. package/lib/module/components/ui/index.js.map +1 -1
  4. package/lib/module/types/global.d.js +6 -0
  5. package/lib/module/types/global.d.js.map +1 -0
  6. package/lib/module/types/rn-primitives.d.js +6 -0
  7. package/lib/module/types/rn-primitives.d.js.map +1 -0
  8. package/lib/typescript/src/app/_layout.d.ts +7 -8
  9. package/lib/typescript/src/components/ui/Accordion.d.ts +103 -11
  10. package/lib/typescript/src/components/ui/Alert-Dialog.d.ts +167 -10
  11. package/lib/typescript/src/components/ui/Alert-Dialog.d.ts.map +1 -1
  12. package/lib/typescript/src/components/ui/Alert.d.ts +59 -10
  13. package/lib/typescript/src/components/ui/Avatar.d.ts +1350 -10
  14. package/lib/typescript/src/components/ui/Badge.d.ts +203 -10
  15. package/lib/typescript/src/components/ui/Bottom-Sheet.d.ts +43 -11
  16. package/lib/typescript/src/components/ui/Button.d.ts +175 -10
  17. package/lib/typescript/src/components/ui/Card.d.ts +853 -10
  18. package/lib/typescript/src/components/ui/Checkbox.d.ts +36 -11
  19. package/lib/typescript/src/components/ui/Collapsible.d.ts +1 -147
  20. package/lib/typescript/src/components/ui/Collapsible.d.ts.map +1 -1
  21. package/lib/typescript/src/components/ui/Context-Menu.d.ts +149 -10
  22. package/lib/typescript/src/components/ui/Context-Menu.d.ts.map +1 -1
  23. package/lib/typescript/src/components/ui/Custom-Card.d.ts +863 -10
  24. package/lib/typescript/src/components/ui/Dialog.d.ts +125 -10
  25. package/lib/typescript/src/components/ui/Dialog.d.ts.map +1 -1
  26. package/lib/typescript/src/components/ui/Dropdown-Menu.d.ts +283 -10
  27. package/lib/typescript/src/components/ui/Dropdown-Menu.d.ts.map +1 -1
  28. package/lib/typescript/src/components/ui/Greeting-Card.d.ts +152 -10
  29. package/lib/typescript/src/components/ui/Hover-Card.d.ts +67 -10
  30. package/lib/typescript/src/components/ui/Hover-Card.d.ts.map +1 -1
  31. package/lib/typescript/src/components/ui/Icon.d.ts +43 -11
  32. package/lib/typescript/src/components/ui/Input.d.ts +51 -10
  33. package/lib/typescript/src/components/ui/Label.d.ts +104 -10
  34. package/lib/typescript/src/components/ui/Menubar.d.ts +174 -10
  35. package/lib/typescript/src/components/ui/NavBar.d.ts +271 -9
  36. package/lib/typescript/src/components/ui/Popover.d.ts +70 -10
  37. package/lib/typescript/src/components/ui/Popover.d.ts.map +1 -1
  38. package/lib/typescript/src/components/ui/Progress.d.ts +27 -11
  39. package/lib/typescript/src/components/ui/Radio-Group.d.ts +47 -11
  40. package/lib/typescript/src/components/ui/Select.d.ts +106 -10
  41. package/lib/typescript/src/components/ui/Separator.d.ts +165 -10
  42. package/lib/typescript/src/components/ui/Skeleton.d.ts +40 -11
  43. package/lib/typescript/src/components/ui/Slider.d.ts +52 -8
  44. package/lib/typescript/src/components/ui/Switch.d.ts +34 -11
  45. package/lib/typescript/src/components/ui/Table.d.ts +69 -10
  46. package/lib/typescript/src/components/ui/Tabs.d.ts +51 -11
  47. package/lib/typescript/src/components/ui/Text.d.ts +115 -10
  48. package/lib/typescript/src/components/ui/Textarea.d.ts +60 -10
  49. package/lib/typescript/src/components/ui/Theme-Toggle.d.ts +193 -10
  50. package/lib/typescript/src/components/ui/Toast.d.ts +54 -10
  51. package/lib/typescript/src/components/ui/Toggle-Group.d.ts +48 -10
  52. package/lib/typescript/src/components/ui/Toggle.d.ts +52 -10
  53. package/lib/typescript/src/components/ui/Tooltip.d.ts +70 -10
  54. package/lib/typescript/src/components/ui/Tooltip.d.ts.map +1 -1
  55. package/lib/typescript/src/components/ui/index.d.ts +7 -2
  56. package/lib/typescript/src/components/ui/index.d.ts.map +1 -1
  57. package/lib/typescript/src/index.d.ts +7 -93
  58. package/lib/typescript/src/lib/ThemeProvider.d.ts +136 -13
  59. package/lib/typescript/src/lib/cornerRadius.d.ts +112 -21
  60. package/lib/typescript/src/lib/fonts.d.ts +21 -30
  61. package/lib/typescript/src/lib/theme.d.ts +86 -8
  62. package/lib/typescript/src/lib/utils.d.ts +111 -1
  63. package/package.json +3 -9
  64. package/src/components/ui/index.ts +1 -0
  65. package/src/types/global.d.ts +44 -0
  66. package/src/types/rn-primitives.d.ts +70 -0
  67. package/lib/typescript/babel.config.d.ts +0 -13
  68. package/lib/typescript/babel.config.d.ts.map +0 -1
  69. package/lib/typescript/metro.config.d.ts +0 -3
  70. package/lib/typescript/metro.config.d.ts.map +0 -1
  71. package/lib/typescript/src/components/ui/Floating-Action-Button.d.ts +0 -11
  72. package/lib/typescript/src/components/ui.d.ts +0 -49
  73. package/lib/typescript/tailwind.config.d.ts +0 -3
  74. package/lib/typescript/tailwind.config.d.ts.map +0 -1
@@ -1,9 +1,87 @@
1
- export const THEME: {
2
- light: Record<string, string>;
3
- dark: Record<string, string>;
4
- };
5
-
6
- export const NAV_THEME: {
7
- light: Record<string, string>;
8
- dark: Record<string, string>;
1
+ import { type Theme } from '@react-navigation/native';
2
+ /**
3
+ * Custom theme colors based on your Figma design tokens
4
+ * Using your categorized color system:
5
+ * 1. Surfaces - Page and card backgrounds
6
+ * 2. Text - All text colors with opacity variants
7
+ * 3. Primary - Main buttons and CTAs
8
+ * 4. Secondary - Secondary buttons
9
+ * 5. Tertiary/Accent - Highlights and selections
10
+ * 6. Borders - All borders and dividers
11
+ * 7. Highlights - Status/semantic colors
12
+ * 8. Brand - Brand accent colors (use sparingly)
13
+ */
14
+ export declare const THEME: {
15
+ light: {
16
+ background: string;
17
+ card: string;
18
+ popover: string;
19
+ muted: string;
20
+ foreground: string;
21
+ cardForeground: string;
22
+ popoverForeground: string;
23
+ mutedForeground: string;
24
+ primary: string;
25
+ primaryForeground: string;
26
+ secondary: string;
27
+ secondaryForeground: string;
28
+ accent: string;
29
+ accentForeground: string;
30
+ border: string;
31
+ input: string;
32
+ ring: string;
33
+ destructive: string;
34
+ destructiveForeground: string;
35
+ success: string;
36
+ info: string;
37
+ warning: string;
38
+ brand1: string;
39
+ brand2: string;
40
+ brand3: string;
41
+ chart1: string;
42
+ chart2: string;
43
+ chart3: string;
44
+ chart4: string;
45
+ chart5: string;
46
+ radius: string;
47
+ };
48
+ dark: {
49
+ background: string;
50
+ card: string;
51
+ popover: string;
52
+ muted: string;
53
+ foreground: string;
54
+ cardForeground: string;
55
+ popoverForeground: string;
56
+ mutedForeground: string;
57
+ primary: string;
58
+ primaryForeground: string;
59
+ secondary: string;
60
+ secondaryForeground: string;
61
+ accent: string;
62
+ accentForeground: string;
63
+ border: string;
64
+ input: string;
65
+ ring: string;
66
+ destructive: string;
67
+ destructiveForeground: string;
68
+ success: string;
69
+ info: string;
70
+ warning: string;
71
+ brand1: string;
72
+ brand2: string;
73
+ brand3: string;
74
+ chart1: string;
75
+ chart2: string;
76
+ chart3: string;
77
+ chart4: string;
78
+ chart5: string;
79
+ radius: string;
80
+ };
9
81
  };
82
+ /**
83
+ * React Navigation theme configuration
84
+ * Maps our custom theme to React Navigation's theme structure
85
+ */
86
+ export declare const NAV_THEME: Record<'light' | 'dark', Theme>;
87
+ //# sourceMappingURL=theme.d.ts.map
@@ -1 +1,111 @@
1
- export function cn(...inputs: any[]): string;
1
+ import { type ClassValue } from 'clsx';
2
+ /**
3
+ * Utility function to merge Tailwind CSS classes with proper precedence
4
+ *
5
+ * Combines clsx (for conditional classes) and tailwind-merge (for deduplication)
6
+ * to create a single, optimized class string. Later classes override earlier ones.
7
+ *
8
+ * @param {...ClassValue[]} inputs - Class values to merge (strings, objects, arrays)
9
+ * @returns {string} Merged and deduplicated class string
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * // Basic usage
14
+ * cn('px-2 py-1', 'px-4') // => 'py-1 px-4'
15
+ *
16
+ * // With conditionals
17
+ * cn('text-base', isDark && 'text-white', 'font-bold')
18
+ * // => 'text-base text-white font-bold' (if isDark is true)
19
+ *
20
+ * // With objects
21
+ * cn({
22
+ * 'bg-primary': isPrimary,
23
+ * 'bg-secondary': !isPrimary
24
+ * })
25
+ *
26
+ * // Common component pattern
27
+ * cn('base-classes', variant === 'large' && 'large-classes', className)
28
+ * ```
29
+ */
30
+ export declare function cn(...inputs: ClassValue[]): string;
31
+ /**
32
+ * Applies dark mode classes with optional runtime control
33
+ *
34
+ * Provides three modes of operation:
35
+ * 1. Static mode (darkMode undefined): Returns classes with `dark:` prefix for automatic switching
36
+ * 2. Dark mode (darkMode true): Strips `dark:` prefix and returns only dark classes
37
+ * 3. Light mode (darkMode false): Returns only base classes
38
+ *
39
+ * This function is useful when you need to programmatically control dark mode
40
+ * instead of relying on Tailwind's automatic dark mode detection.
41
+ *
42
+ * @param {string} baseClasses - Classes to apply in light mode
43
+ * @param {string} darkClasses - Classes to apply in dark mode (with or without `dark:` prefix)
44
+ * @param {boolean} [darkMode] - Optional dark mode override (true/false/undefined)
45
+ * @returns {string} Merged class string based on mode
46
+ *
47
+ * @example
48
+ * ```tsx
49
+ * // Static mode - use Tailwind's automatic detection
50
+ * cnWithDark('bg-white', 'dark:bg-black')
51
+ * // => 'bg-white dark:bg-black'
52
+ *
53
+ * // Programmatic dark mode
54
+ * const { isDark } = useTheme();
55
+ * cnWithDark('bg-white', 'dark:bg-black', isDark)
56
+ * // => 'bg-black' (if isDark is true)
57
+ * // => 'bg-white' (if isDark is false)
58
+ *
59
+ * // With multiple classes
60
+ * cnWithDark(
61
+ * 'bg-white text-black border-gray-200',
62
+ * 'dark:bg-black dark:text-white dark:border-gray-800',
63
+ * isDark
64
+ * )
65
+ * ```
66
+ *
67
+ * @see {@link cn} for basic class merging
68
+ * @see {@link useTheme} for accessing theme state
69
+ */
70
+ export declare function cnWithDark(baseClasses: string, darkClasses: string, darkMode?: boolean): string;
71
+ /**
72
+ * Get color value based on theme mode
73
+ *
74
+ * Simple utility to select between light and dark color values based on the
75
+ * current theme. Primarily used for native platforms where Tailwind CSS
76
+ * classes don't work with inline styles.
77
+ *
78
+ * @param {string} lightColor - Color value for light mode (CSS color, HSL, RGB, hex)
79
+ * @param {string} darkColor - Color value for dark mode (CSS color, HSL, RGB, hex)
80
+ * @param {boolean} [darkMode] - Whether dark mode is active (defaults to light if undefined)
81
+ * @returns {string} The appropriate color value for the current mode
82
+ *
83
+ * @example
84
+ * ```tsx
85
+ * import { useTheme } from './ThemeProvider';
86
+ *
87
+ * function MyComponent() {
88
+ * const { isDark } = useTheme();
89
+ *
90
+ * // Get color for inline styles
91
+ * const textColor = getThemeColor('#000000', '#ffffff', isDark);
92
+ * const bgColor = getThemeColor('hsl(0, 0%, 100%)', 'hsl(0, 0%, 10%)', isDark);
93
+ *
94
+ * return (
95
+ * <View style={{ backgroundColor: bgColor }}>
96
+ * <NativeText style={{ color: textColor }}>
97
+ * Theme-aware text
98
+ * </NativeText>
99
+ * </View>
100
+ * );
101
+ * }
102
+ *
103
+ * // Without theme context (defaults to light)
104
+ * const color = getThemeColor('#000', '#fff'); // => '#000'
105
+ * ```
106
+ *
107
+ * @see {@link useTheme} for accessing theme state
108
+ * @see {@link getThemeColorValue} from theme-config for more advanced usage
109
+ */
110
+ export declare function getThemeColor(lightColor: string, darkColor: string, darkMode?: boolean): string;
111
+ //# sourceMappingURL=utils.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/react-native-blueprint",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "This is a react-native package for mobile apps",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -20,6 +20,7 @@
20
20
  "cpp",
21
21
  "*.podspec",
22
22
  "react-native.config.js",
23
+ "global.css",
23
24
  "!ios/build",
24
25
  "!android/build",
25
26
  "!android/gradle",
@@ -37,8 +38,7 @@
37
38
  "typecheck": "tsc",
38
39
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
39
40
  "clean": "del-cli lib",
40
- "prepare": "bob build --target module",
41
- "build:full": "bob build",
41
+ "prepare": "bob build",
42
42
  "release": "release-it --only-version"
43
43
  },
44
44
  "keywords": [
@@ -141,12 +141,6 @@
141
141
  {
142
142
  "esm": true
143
143
  }
144
- ],
145
- [
146
- "typescript",
147
- {
148
- "project": "tsconfig.build.json"
149
- }
150
144
  ]
151
145
  ]
152
146
  },
@@ -21,6 +21,7 @@ export * from './Icon';
21
21
  export * from './Input';
22
22
  export * from './Label';
23
23
  export * from './Menubar';
24
+ export * from './Native-Only-Animated-View';
24
25
  export * from './NavBar';
25
26
  export * from './Popover';
26
27
  export * from './Progress';
@@ -0,0 +1,44 @@
1
+ import 'react-native';
2
+ import 'react-native-reanimated';
3
+
4
+ declare module 'react-native' {
5
+ interface ViewProps {
6
+ className?: string;
7
+ }
8
+
9
+ interface TextProps {
10
+ className?: string;
11
+ }
12
+
13
+ interface ImageProps {
14
+ className?: string;
15
+ }
16
+
17
+ interface ScrollViewProps {
18
+ className?: string;
19
+ }
20
+
21
+ interface PressableProps {
22
+ className?: string;
23
+ }
24
+ }
25
+
26
+ declare module 'react-native-reanimated' {
27
+ namespace Animated {
28
+ interface AnimatedProps {
29
+ children?: React.ReactNode;
30
+ className?: string;
31
+ }
32
+ }
33
+ }
34
+
35
+ declare global {
36
+ namespace JSX {
37
+ interface IntrinsicAttributes {
38
+ children?: React.ReactNode;
39
+ className?: string;
40
+ }
41
+ }
42
+ }
43
+
44
+ export {};
@@ -0,0 +1,70 @@
1
+ declare module '@rn-primitives/*' {
2
+ import type { ReactNode } from 'react';
3
+ import type { ViewProps } from 'react-native';
4
+
5
+ export interface PrimitiveProps extends ViewProps {
6
+ children?: ReactNode;
7
+ className?: string;
8
+ asChild?: boolean;
9
+ }
10
+
11
+ export interface PrimitiveComponentProps {
12
+ children?: ReactNode;
13
+ className?: string;
14
+ }
15
+ }
16
+
17
+ // Augment specific primitive modules
18
+ declare module '@rn-primitives/accordion' {
19
+ import type { ReactNode } from 'react';
20
+ export namespace Accordion {
21
+ interface RootProps {
22
+ children?: ReactNode;
23
+ className?: string;
24
+ }
25
+ interface ItemProps {
26
+ children?: ReactNode;
27
+ className?: string;
28
+ }
29
+ interface HeaderProps {
30
+ children?: ReactNode;
31
+ className?: string;
32
+ }
33
+ interface TriggerProps {
34
+ children?: ReactNode;
35
+ className?: string;
36
+ }
37
+ interface ContentProps {
38
+ children?: ReactNode;
39
+ className?: string;
40
+ }
41
+ }
42
+ }
43
+
44
+ declare module '@rn-primitives/dialog' {
45
+ import type { ReactNode } from 'react';
46
+ export namespace Dialog {
47
+ interface OverlayProps {
48
+ children?: ReactNode;
49
+ className?: string;
50
+ }
51
+ interface ContentProps {
52
+ children?: ReactNode;
53
+ className?: string;
54
+ }
55
+ interface TitleProps {
56
+ children?: ReactNode;
57
+ className?: string;
58
+ }
59
+ interface DescriptionProps {
60
+ children?: ReactNode;
61
+ className?: string;
62
+ }
63
+ interface CloseProps {
64
+ children?: ReactNode;
65
+ className?: string;
66
+ }
67
+ }
68
+ }
69
+
70
+ export {};
@@ -1,13 +0,0 @@
1
- export let presets: (string | {
2
- jsxImportSource: string;
3
- })[][];
4
- export let overrides: ({
5
- exclude: RegExp;
6
- presets: string[];
7
- include?: undefined;
8
- } | {
9
- include: RegExp;
10
- presets: string[];
11
- exclude?: undefined;
12
- })[];
13
- //# sourceMappingURL=babel.config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"babel.config.d.ts","sourceRoot":"","sources":["../../babel.config.js"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- declare const _exports: import("metro-config").InputConfigT;
2
- export = _exports;
3
- //# sourceMappingURL=metro.config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"metro.config.d.ts","sourceRoot":"","sources":["../../metro.config.js"],"names":[],"mappings":""}
@@ -1,11 +0,0 @@
1
- import * as React from 'react';
2
- import { ViewProps } from 'react-native';
3
-
4
- export interface Floating-Action-ButtonProps extends ViewProps {
5
- className?: string;
6
- children?: React.ReactNode;
7
- [key: string]: any;
8
- }
9
-
10
- export const Floating-Action-Button: React.ComponentType<Floating-Action-ButtonProps>;
11
- export default Floating-Action-Button;
@@ -1,49 +0,0 @@
1
- // UI Components type declarations
2
- import * as React from 'react';
3
- import { ViewProps, TextProps, TouchableOpacityProps, ScrollViewProps } from 'react-native';
4
-
5
- // Generic component props
6
- export interface ComponentProps extends ViewProps {
7
- className?: string;
8
- children?: React.ReactNode;
9
- }
10
-
11
- // Export all UI components
12
- export * from './ui/Accordion';
13
- export * from './ui/Alert';
14
- export * from './ui/Alert-Dialog';
15
- export * from './ui/Avatar';
16
- export * from './ui/Badge';
17
- export * from './ui/Bottom-Sheet';
18
- export * from './ui/Button';
19
- export * from './ui/Card';
20
- export * from './ui/Checkbox';
21
- export * from './ui/Context-Menu';
22
- export * from './ui/Custom-Card';
23
- export * from './ui/Dialog';
24
- export * from './ui/Dropdown-Menu';
25
- export * from './ui/Floating-Action-Button';
26
- export * from './ui/Greeting-Card';
27
- export * from './ui/Hover-Card';
28
- export * from './ui/Icon';
29
- export * from './ui/Input';
30
- export * from './ui/Label';
31
- export * from './ui/Menubar';
32
- export * from './ui/NavBar';
33
- export * from './ui/Popover';
34
- export * from './ui/Progress';
35
- export * from './ui/Radio-Group';
36
- export * from './ui/Select';
37
- export * from './ui/Separator';
38
- export * from './ui/Skeleton';
39
- export * from './ui/Slider';
40
- export * from './ui/Switch';
41
- export * from './ui/Table';
42
- export * from './ui/Tabs';
43
- export * from './ui/Text';
44
- export * from './ui/Textarea';
45
- export * from './ui/Theme-Toggle';
46
- export * from './ui/Toast';
47
- export * from './ui/Toggle';
48
- export * from './ui/Toggle-Group';
49
- export * from './ui/Tooltip';
@@ -1,3 +0,0 @@
1
- declare const _exports: import("tailwindcss").Config;
2
- export = _exports;
3
- //# sourceMappingURL=tailwind.config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tailwind.config.d.ts","sourceRoot":"","sources":["../../tailwind.config.js"],"names":[],"mappings":"wBAEW,OAAO,aAAa,EAAE,MAAM"}