@metacells/mcellui-core 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.
- package/package.json +1 -1
- package/src/components/ErrorBoundary.tsx +1 -1
- package/src/config/ConfigProvider.tsx +4 -4
- package/src/config/defineConfig.ts +3 -3
- package/src/config/index.ts +4 -4
- package/src/config/types.ts +4 -4
- package/src/constants.ts +1 -1
- package/src/theme/ThemeProvider.tsx +1 -1
- package/src/theme/index.ts +1 -1
- package/src/utils/cn.ts +1 -1
- package/src/utils/expoGo.ts +1 -1
- package/src/utils/haptics.ts +1 -1
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ConfigProvider
|
|
3
3
|
*
|
|
4
|
-
* Wraps ThemeProvider and automatically applies configuration from
|
|
4
|
+
* Wraps ThemeProvider and automatically applies configuration from mcellui.config.ts.
|
|
5
5
|
* This is the recommended way to set up NativeUI in your app.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```tsx
|
|
9
9
|
* // App.tsx - with auto-config (requires metro-plugin)
|
|
10
|
-
* import { ConfigProvider } from '@
|
|
10
|
+
* import { ConfigProvider } from '@metacells/mcellui-core';
|
|
11
11
|
*
|
|
12
12
|
* export default function App() {
|
|
13
13
|
* return (
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* }
|
|
19
19
|
*
|
|
20
20
|
* // App.tsx - with explicit config
|
|
21
|
-
* import { ConfigProvider } from '@
|
|
21
|
+
* import { ConfigProvider } from '@metacells/mcellui-core';
|
|
22
22
|
* import config from './mcellui.config';
|
|
23
23
|
*
|
|
24
24
|
* export default function App() {
|
|
@@ -53,7 +53,7 @@ const ConfigContext = createContext<ResolvedNativeUIConfig | null>(null);
|
|
|
53
53
|
export interface ConfigProviderProps {
|
|
54
54
|
/**
|
|
55
55
|
* NativeUI configuration object.
|
|
56
|
-
* Import from your
|
|
56
|
+
* Import from your mcellui.config.ts file.
|
|
57
57
|
*/
|
|
58
58
|
config?: NativeUIConfig;
|
|
59
59
|
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* defineConfig
|
|
3
3
|
*
|
|
4
4
|
* Helper function to define NativeUI configuration with type safety.
|
|
5
|
-
* Use this in your `
|
|
5
|
+
* Use this in your `mcellui.config.ts` file.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```ts
|
|
9
|
-
* //
|
|
10
|
-
* import { defineConfig } from '@
|
|
9
|
+
* // mcellui.config.ts
|
|
10
|
+
* import { defineConfig } from '@metacells/mcellui-core';
|
|
11
11
|
*
|
|
12
12
|
* export default defineConfig({
|
|
13
13
|
* theme: 'blue',
|
package/src/config/index.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
7
|
* ```ts
|
|
8
|
-
* //
|
|
9
|
-
* import { defineConfig } from '@
|
|
8
|
+
* // mcellui.config.ts
|
|
9
|
+
* import { defineConfig } from '@metacells/mcellui-core';
|
|
10
10
|
*
|
|
11
11
|
* export default defineConfig({
|
|
12
12
|
* theme: 'blue',
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
* @example
|
|
21
21
|
* ```tsx
|
|
22
22
|
* // App.tsx
|
|
23
|
-
* import { ConfigProvider } from '@
|
|
24
|
-
* import config from './
|
|
23
|
+
* import { ConfigProvider } from '@metacells/mcellui-core';
|
|
24
|
+
* import config from './mcellui.config';
|
|
25
25
|
*
|
|
26
26
|
* export default function App() {
|
|
27
27
|
* return (
|
package/src/config/types.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```ts
|
|
9
|
-
* //
|
|
10
|
-
* import { defineConfig } from '@
|
|
9
|
+
* // mcellui.config.ts
|
|
10
|
+
* import { defineConfig } from '@metacells/mcellui-core';
|
|
11
11
|
*
|
|
12
12
|
* export default defineConfig({
|
|
13
13
|
* theme: 'blue',
|
|
@@ -27,7 +27,7 @@ import type { AnimationPreset } from '../theme/animations';
|
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* NativeUI configuration object.
|
|
30
|
-
* Place in `
|
|
30
|
+
* Place in `mcellui.config.ts` at your project root.
|
|
31
31
|
*/
|
|
32
32
|
export interface NativeUIConfig {
|
|
33
33
|
// ============================================
|
|
@@ -113,7 +113,7 @@ export interface NativeUIConfig {
|
|
|
113
113
|
};
|
|
114
114
|
|
|
115
115
|
// ============================================
|
|
116
|
-
// CLI Configuration (used by `npx
|
|
116
|
+
// CLI Configuration (used by `npx mcellui add`)
|
|
117
117
|
// ============================================
|
|
118
118
|
|
|
119
119
|
/**
|
package/src/constants.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ThemeProvider
|
|
3
3
|
*
|
|
4
|
-
* Provides theme context to all
|
|
4
|
+
* Provides theme context to all mcellui components.
|
|
5
5
|
* Automatically detects system color scheme and provides all design tokens.
|
|
6
6
|
*
|
|
7
7
|
* Like shadcn/ui - change tokens here to transform the entire UI.
|
package/src/theme/index.ts
CHANGED
package/src/utils/cn.ts
CHANGED
package/src/utils/expoGo.ts
CHANGED
package/src/utils/haptics.ts
CHANGED
|
@@ -75,7 +75,7 @@ export function isHapticsEnabled(): boolean {
|
|
|
75
75
|
* Respects the global haptics enabled state. Disabled via:
|
|
76
76
|
* - `setHapticsEnabled(false)`
|
|
77
77
|
* - `<ThemeProvider haptics={false}>`
|
|
78
|
-
* - `
|
|
78
|
+
* - `mcellui.config.ts` with `haptics: false`
|
|
79
79
|
*
|
|
80
80
|
* @example
|
|
81
81
|
* ```tsx
|