@rootnative/core 0.0.0-alpha.12 → 0.0.0-alpha.14
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 +6 -2
- package/dist/{chunk-QQ3ME6R7.mjs → chunk-HMQZLDPN.mjs} +32 -7
- package/dist/create-theme/index.mjs +5151 -19
- package/dist/index.mjs +1 -1
- package/llms.txt +44 -5
- package/package.json +4 -10
package/README.md
CHANGED
|
@@ -20,7 +20,9 @@ Peer dependencies: `react >=18`, `react-native >=0.72`, `@rootnative/inertia >=0
|
|
|
20
20
|
npm and pnpm install required peers automatically; Yarn classic does not, so add
|
|
21
21
|
it by hand there.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
`createMaterialTheme` needs no extra install — its MD3 color engine
|
|
24
|
+
(`@material/material-color-utilities`) is bundled behind the
|
|
25
|
+
`@rootnative/core/create-theme` subpath.
|
|
24
26
|
|
|
25
27
|
## Quick start (Material Design 3)
|
|
26
28
|
|
|
@@ -96,7 +98,9 @@ const { lightTheme, darkTheme } = createMaterialTheme('#006A6A')
|
|
|
96
98
|
<ThemeProvider theme={lightTheme}>{children}</ThemeProvider>
|
|
97
99
|
```
|
|
98
100
|
|
|
99
|
-
|
|
101
|
+
No extra install is needed, and the subpath imports nothing from
|
|
102
|
+
`react-native`, so it also runs in plain Node — print a palette from a script
|
|
103
|
+
or check a theme in CI.
|
|
100
104
|
|
|
101
105
|
### applyRoundness(roundness)
|
|
102
106
|
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
+
});
|
|
7
|
+
|
|
1
8
|
// src/theme/topAppBar.ts
|
|
2
9
|
var defaultTopAppBarTokens = {
|
|
3
10
|
horizontalPadding: 4,
|
|
@@ -13,13 +20,31 @@ var defaultTopAppBarTokens = {
|
|
|
13
20
|
};
|
|
14
21
|
|
|
15
22
|
// src/theme/typography.ts
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
var webFontFamily = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif';
|
|
24
|
+
function resolveDefaultFontFamily() {
|
|
25
|
+
var _a;
|
|
26
|
+
if (typeof process !== "undefined" && ((_a = process.env) == null ? void 0 : _a.EXPO_OS)) {
|
|
27
|
+
return process.env.EXPO_OS === "web" ? webFontFamily : "System";
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
if (typeof __require === "function") {
|
|
31
|
+
const { Platform } = __require("react-native");
|
|
32
|
+
const selected = Platform.select({
|
|
33
|
+
android: "Roboto",
|
|
34
|
+
ios: "System",
|
|
35
|
+
web: webFontFamily,
|
|
36
|
+
default: "System"
|
|
37
|
+
});
|
|
38
|
+
if (selected) return selected;
|
|
39
|
+
}
|
|
40
|
+
} catch {
|
|
41
|
+
}
|
|
42
|
+
if (typeof navigator !== "undefined" && navigator.product === "ReactNative") {
|
|
43
|
+
return "System";
|
|
44
|
+
}
|
|
45
|
+
return webFontFamily;
|
|
46
|
+
}
|
|
47
|
+
var defaultFontFamily = resolveDefaultFontFamily();
|
|
23
48
|
var defaultTypography = {
|
|
24
49
|
displayLarge: {
|
|
25
50
|
fontFamily: defaultFontFamily,
|