@react-native-rethemed/material-ui-tokens 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 manato
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # @react-native-rethemed/material-ui-tokens
2
+
3
+ Material UI's default theme (palette, colors, typography) for React Native, ready for [react-native-rethemed](https://github.com/manakuro/react-native-rethemed).
4
+
5
+ Material UI's default theme (`createTheme()`, Material Design 2): palette in light and dark mode with Material UI's names (`'primary.main'`, `'text.secondary'`), `@mui/material/colors`, the 13 typography variants as text presets (`button` / `overline` keep `textTransform: 'uppercase'`), spacing, shape and elevations 0–24.
6
+
7
+ ## Installation
8
+
9
+ ```sh
10
+ npm install @react-native-rethemed/core @react-native-rethemed/material-ui-tokens
11
+ npm install --save-dev @react-native-rethemed/cli
12
+ ```
13
+
14
+ `react` and `react-native` are peer dependencies of `@react-native-rethemed/core`.
15
+
16
+ ## Usage
17
+
18
+ ```ts
19
+ // src/theme/theme.ts
20
+ import { materialUiTheme } from '@react-native-rethemed/material-ui-tokens';
21
+
22
+ export const themeConfig = materialUiTheme;
23
+
24
+ // themed.view({ backgroundColor: 'background.paper', padding: 2 })
25
+ // themed.text.h6({ color: 'text.secondary' })
26
+ ```
27
+
28
+ Then generate the typed bindings (and the token reference for AI agents):
29
+
30
+ ```sh
31
+ npx @react-native-rethemed/cli codegen src/theme/theme.ts --docs docs/themed.md
32
+ ```
33
+
34
+ and use them in components:
35
+
36
+ ```tsx
37
+ import { useThemed } from './theme/themed.gen';
38
+
39
+ const { themed } = useThemed();
40
+ ```
41
+
42
+ See the [main README](https://github.com/manakuro/react-native-rethemed#readme) for the full setup (`ThemedProvider`, color mode, `extendTheme`).
43
+
44
+ ## Exports
45
+
46
+ | Export | Description |
47
+ | --- | --- |
48
+ | `materialUiTheme` | The full theme |
49
+ | `semanticColors` | The light/dark `palette` |
50
+ | `colors` | `@mui/material/colors` (`'deepPurple.A200'`) |
51
+ | `typography` | The 13 variants (`h1`…`overline`) as text presets |
52
+ | `spacing`, `radii`, `fontWeights`, `shadows`, `zIndices` | Individual token scales |
53
+
54
+ [`example/`](https://github.com/manakuro/react-native-rethemed/tree/main/packages/react-native-rethemed/material-ui/example) shows what the CLI generates for `materialUiTheme` (`themed.gen.ts`, `themed.md`).
55
+
56
+ ## License
57
+
58
+ MIT. Token values are converted from [Material UI](https://github.com/mui/material-ui) (MIT).
@@ -0,0 +1,25 @@
1
+ import { colors, fontWeights, radii, semanticColors, shadows, spacing, typography, zIndices } from './tokens.gen';
2
+ /**
3
+ * Material UI's default theme (`createTheme()` from `@mui/material`, which
4
+ * follows Material Design 2), converted for React Native. Values are
5
+ * generated by `scripts/generate.ts`; see `src/tokens.gen.ts`.
6
+ *
7
+ * - `semanticColors`: the default `palette` in light and dark mode, as
8
+ * `'<group>.<key>'` with Material UI's own names: `'primary.main'`,
9
+ * `'primary.contrastText'`, `'text.secondary'`, `'background.paper'`,
10
+ * `'action.hover'`, `'divider.default'`.
11
+ * - `colors`: `@mui/material/colors` as `'<hue>.<shade>'` (`'red.500'`,
12
+ * `'deepPurple.A200'`), plus `black` and `white`. Fixed in both schemes.
13
+ * - `typography`: the 13 variants (`h1`…`overline`) as text presets,
14
+ * `themed.text.h1()`. rem/em → points at `htmlFontSize` (16); line heights
15
+ * absolute; `button` / `overline` keep `textTransform: 'uppercase'`.
16
+ * - `spacing`: `theme.spacing(n)`, so `padding: 2` is 16. `radii`: multiples
17
+ * of `shape.borderRadius`, so `borderRadius: 2` is 8 — both like `sx`.
18
+ * - `shadows`: elevations 0–24, first layer only; `elevation` matches the
19
+ * Material elevation on Android exactly.
20
+ * - Not included (no RN equivalent): `fontFamily` (Roboto, Android's default
21
+ * anyway), breakpoints, transitions, mixins, component overrides, the
22
+ * `action.*Opacity` numbers and dark mode's `text.icon`.
23
+ */
24
+ export declare const materialUiTheme: import("@react-native-rethemed/core/config").ThemeConfig;
25
+ export { colors, fontWeights, radii, semanticColors, shadows, spacing, typography, zIndices, };
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.zIndices = exports.typography = exports.spacing = exports.shadows = exports.semanticColors = exports.radii = exports.fontWeights = exports.colors = exports.materialUiTheme = void 0;
4
+ const config_1 = require("@react-native-rethemed/core/config");
5
+ const tokens_gen_1 = require("./tokens.gen");
6
+ Object.defineProperty(exports, "colors", { enumerable: true, get: function () { return tokens_gen_1.colors; } });
7
+ Object.defineProperty(exports, "fontWeights", { enumerable: true, get: function () { return tokens_gen_1.fontWeights; } });
8
+ Object.defineProperty(exports, "radii", { enumerable: true, get: function () { return tokens_gen_1.radii; } });
9
+ Object.defineProperty(exports, "semanticColors", { enumerable: true, get: function () { return tokens_gen_1.semanticColors; } });
10
+ Object.defineProperty(exports, "shadows", { enumerable: true, get: function () { return tokens_gen_1.shadows; } });
11
+ Object.defineProperty(exports, "spacing", { enumerable: true, get: function () { return tokens_gen_1.spacing; } });
12
+ Object.defineProperty(exports, "typography", { enumerable: true, get: function () { return tokens_gen_1.typography; } });
13
+ Object.defineProperty(exports, "zIndices", { enumerable: true, get: function () { return tokens_gen_1.zIndices; } });
14
+ /**
15
+ * Material UI's default theme (`createTheme()` from `@mui/material`, which
16
+ * follows Material Design 2), converted for React Native. Values are
17
+ * generated by `scripts/generate.ts`; see `src/tokens.gen.ts`.
18
+ *
19
+ * - `semanticColors`: the default `palette` in light and dark mode, as
20
+ * `'<group>.<key>'` with Material UI's own names: `'primary.main'`,
21
+ * `'primary.contrastText'`, `'text.secondary'`, `'background.paper'`,
22
+ * `'action.hover'`, `'divider.default'`.
23
+ * - `colors`: `@mui/material/colors` as `'<hue>.<shade>'` (`'red.500'`,
24
+ * `'deepPurple.A200'`), plus `black` and `white`. Fixed in both schemes.
25
+ * - `typography`: the 13 variants (`h1`…`overline`) as text presets,
26
+ * `themed.text.h1()`. rem/em → points at `htmlFontSize` (16); line heights
27
+ * absolute; `button` / `overline` keep `textTransform: 'uppercase'`.
28
+ * - `spacing`: `theme.spacing(n)`, so `padding: 2` is 16. `radii`: multiples
29
+ * of `shape.borderRadius`, so `borderRadius: 2` is 8 — both like `sx`.
30
+ * - `shadows`: elevations 0–24, first layer only; `elevation` matches the
31
+ * Material elevation on Android exactly.
32
+ * - Not included (no RN equivalent): `fontFamily` (Roboto, Android's default
33
+ * anyway), breakpoints, transitions, mixins, component overrides, the
34
+ * `action.*Opacity` numbers and dark mode's `text.icon`.
35
+ */
36
+ exports.materialUiTheme = (0, config_1.defineTheme)({
37
+ tokens: {
38
+ colors: tokens_gen_1.colors,
39
+ radii: tokens_gen_1.radii,
40
+ spacing: tokens_gen_1.spacing,
41
+ fontWeights: tokens_gen_1.fontWeights,
42
+ zIndices: tokens_gen_1.zIndices,
43
+ shadows: tokens_gen_1.shadows,
44
+ },
45
+ semanticTokens: {
46
+ colors: tokens_gen_1.semanticColors,
47
+ text: tokens_gen_1.typography,
48
+ },
49
+ });
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}