@rootnative/core 0.0.0-alpha.21 → 0.0.0-alpha.22
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/README.md +1 -1
- package/dist/index.d.mts +5 -5
- package/llms.txt +3 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ Provides the theme context to all child components. Works with any design system
|
|
|
49
49
|
| Prop | Type | Default | Description |
|
|
50
50
|
|------|------|---------|-------------|
|
|
51
51
|
| `theme` | `BaseTheme` | `lightTheme` (MD3) | Theme object |
|
|
52
|
-
| `iconResolver` | `IconResolver` |
|
|
52
|
+
| `iconResolver` | `IconResolver` | none | Resolves string icon names (`leadingIcon="check"`) to icon nodes. Set once at the app root to use Lucide, SF Symbols, custom SVGs, etc. Pre-built adapters: [`@rootnative/icons`](https://www.npmjs.com/package/@rootnative/icons) |
|
|
53
53
|
| `children` | `ReactNode` | — | App content |
|
|
54
54
|
|
|
55
55
|
### useTheme()
|
package/dist/index.d.mts
CHANGED
|
@@ -89,8 +89,8 @@ type IconResolver = (name: string, props: IconRenderProps) => React.ReactNode;
|
|
|
89
89
|
* Anything a component will accept for an icon prop:
|
|
90
90
|
*
|
|
91
91
|
* - **string** — a name resolved via the `iconResolver` registered on
|
|
92
|
-
* `ThemeProvider`.
|
|
93
|
-
* resolver is set
|
|
92
|
+
* `ThemeProvider`. Renders nothing, with one warning, when no
|
|
93
|
+
* resolver is set.
|
|
94
94
|
* - **ReactElement** — a pre-rendered icon. The caller is responsible for
|
|
95
95
|
* passing size and color; the component will not override them.
|
|
96
96
|
* - **(props) => ReactNode** — a render function that receives the
|
|
@@ -208,7 +208,7 @@ interface ThemeProviderProps {
|
|
|
208
208
|
/**
|
|
209
209
|
* Resolves string icon names (e.g. `leadingIcon="check"`) to icon nodes.
|
|
210
210
|
* Set this once at the app root to use SF Symbols, Lucide, custom SVGs,
|
|
211
|
-
* etc.
|
|
211
|
+
* etc. `mdiResolver` from `@rootnative/components/mdi` gives MaterialDesignIcons.
|
|
212
212
|
*
|
|
213
213
|
* @example
|
|
214
214
|
* import { Check, ArrowRight } from 'lucide-react-native'
|
|
@@ -291,8 +291,8 @@ declare function useThemeMode(): ThemeModeContextValue;
|
|
|
291
291
|
|
|
292
292
|
/**
|
|
293
293
|
* Returns the icon resolver registered on the nearest `ThemeProvider`,
|
|
294
|
-
* or `null` if none was provided.
|
|
295
|
-
*
|
|
294
|
+
* or `null` if none was provided. A string icon renders nothing and logs one
|
|
295
|
+
* warning when no resolver is set.
|
|
296
296
|
*/
|
|
297
297
|
declare function useIconResolver(): IconResolver | null;
|
|
298
298
|
|
package/llms.txt
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @rootnative/core — Theme System for React Native
|
|
2
2
|
|
|
3
|
-
> Version: 0.0.0-alpha.
|
|
4
|
-
> Peer deps: react >=19.2.3 <20.0.0, react-native >=0.83.0 <0.87.0, @rootnative/inertia >=0.0.
|
|
3
|
+
> Version: 0.0.0-alpha.22
|
|
4
|
+
> Peer deps: react >=19.2.3 <20.0.0, react-native >=0.83.0 <0.87.0, @rootnative/inertia >=0.0.17 <0.1.0 (required — every animation runs on it)
|
|
5
5
|
> createMaterialTheme needs no extra install — its color engine (@material/material-color-utilities) is bundled behind the create-theme subpath
|
|
6
6
|
|
|
7
7
|
## Quick Start
|
|
@@ -79,7 +79,7 @@ Props:
|
|
|
79
79
|
- `defaultMode?: 'system' | 'light' | 'dark'` — Initial mode when uncontrolled. Default: `'system'`
|
|
80
80
|
- `onModeChange?: (mode: ThemeMode) => void`
|
|
81
81
|
- `storage?: { getItem, setItem }` — Persists the mode. Any AsyncStorage-shaped object; sync or async. Nothing is persisted unless you pass this
|
|
82
|
-
- `iconResolver?: IconResolver`
|
|
82
|
+
- `iconResolver?: IconResolver` — Renders string icon names. Pass `mdiResolver` from `@rootnative/components/mdi` for MaterialDesignIcons, or your own. Without it a string name renders nothing and logs one warning
|
|
83
83
|
- `children: ReactNode`
|
|
84
84
|
|
|
85
85
|
### useThemeMode()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rootnative/core",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.22",
|
|
4
4
|
"description": "Design-system agnostic theme engine for RootNative UI — a React Native component library. Ships with Material Design 3 out of the box.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"md3"
|
|
54
54
|
],
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@rootnative/inertia": ">=0.0.
|
|
56
|
+
"@rootnative/inertia": ">=0.0.17 <0.1.0",
|
|
57
57
|
"react": ">=19.2.3 <20.0.0",
|
|
58
58
|
"react-native": ">=0.83.0 <0.87.0"
|
|
59
59
|
},
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@material/material-color-utilities": "^0.4.0",
|
|
62
62
|
"@react-native/babel-preset": "^0.86.3",
|
|
63
63
|
"@react-native/jest-preset": "^0.86.3",
|
|
64
|
-
"@rootnative/inertia": "0.0.
|
|
64
|
+
"@rootnative/inertia": "0.0.17",
|
|
65
65
|
"@testing-library/react-native": "^13.3.3",
|
|
66
66
|
"@types/jest": "^29.5.14",
|
|
67
67
|
"@types/react": "^19.0.0",
|