@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 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
- Optional: `@material/material-color-utilities >=0.4` — only needed for `createMaterialTheme`.
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
- Requires: `npm install @material/material-color-utilities`
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
- import { Platform } from "react-native";
17
- var defaultFontFamily = Platform.select({
18
- android: "Roboto",
19
- ios: "System",
20
- web: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',
21
- default: "System"
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,