@react-native-rethemed/shadcn-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/shadcn-ui-tokens
2
+
3
+ shadcn/ui's theme (semantic colors, radii, all base colors) for React Native, ready for [react-native-rethemed](https://github.com/manakuro/react-native-rethemed).
4
+
5
+ shadcn/ui is Tailwind CSS plus CSS variables, so `shadcnUiTheme` is `tailwindCssTheme` with shadcn/ui's light/dark semantic colors (named like the class names: `'primary'`, `'muted-foreground'`) and `--radius` scale on top. All seven base colors are exported as `baseColors`.
6
+
7
+ ## Installation
8
+
9
+ ```sh
10
+ npm install @react-native-rethemed/core @react-native-rethemed/shadcn-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 { shadcnUiTheme } from '@react-native-rethemed/shadcn-ui-tokens';
21
+
22
+ export const themeConfig = shadcnUiTheme;
23
+
24
+ // bg-primary text-primary-foreground rounded-md px-4
25
+ // themed.view({ backgroundColor: 'primary', borderRadius: 'md', paddingHorizontal: 4 })
26
+ // themed.text.sm({ color: 'primary-foreground' })
27
+ ```
28
+
29
+ Then generate the typed bindings (and the token reference for AI agents):
30
+
31
+ ```sh
32
+ npx @react-native-rethemed/cli codegen src/theme/theme.ts --docs docs/themed.md
33
+ ```
34
+
35
+ and use them in components:
36
+
37
+ ```tsx
38
+ import { useThemed } from './theme/themed.gen';
39
+
40
+ const { themed } = useThemed();
41
+ ```
42
+
43
+ See the [main README](https://github.com/manakuro/react-native-rethemed#readme) for the full setup (`ThemedProvider`, color mode, `extendTheme`).
44
+
45
+ ## Exports
46
+
47
+ | Export | Description |
48
+ | --- | --- |
49
+ | `shadcnUiTheme` | The full theme (base color `neutral`) |
50
+ | `semanticColors` | The `neutral` semantic colors |
51
+ | `baseColors` | Semantic colors for every base color (`baseColors.zinc`, …) |
52
+ | `radii` | The `--radius` scale |
53
+
54
+ [`example/`](https://github.com/manakuro/react-native-rethemed/tree/main/packages/react-native-rethemed/shadcn-ui/example) shows what the CLI generates for `shadcnUiTheme` (`themed.gen.ts`, `themed.md`).
55
+
56
+ ## License
57
+
58
+ MIT. Token values are converted from [shadcn/ui](https://github.com/shadcn-ui/ui) (MIT).
@@ -0,0 +1,151 @@
1
+ import { baseColors, radii } from './tokens.gen';
2
+ /** A shadcn/ui base color: `neutral` (the default), `stone`, `zinc`, … */
3
+ export type BaseColor = keyof typeof baseColors;
4
+ /** The default base color's semantic colors (`neutral`). */
5
+ export declare const semanticColors: {
6
+ readonly background: {
7
+ readonly light: "#ffffff";
8
+ readonly dark: "#0a0a0a";
9
+ };
10
+ readonly foreground: {
11
+ readonly light: "#0a0a0a";
12
+ readonly dark: "#fafafa";
13
+ };
14
+ readonly card: {
15
+ readonly light: "#ffffff";
16
+ readonly dark: "#171717";
17
+ };
18
+ readonly 'card-foreground': {
19
+ readonly light: "#0a0a0a";
20
+ readonly dark: "#fafafa";
21
+ };
22
+ readonly popover: {
23
+ readonly light: "#ffffff";
24
+ readonly dark: "#171717";
25
+ };
26
+ readonly 'popover-foreground': {
27
+ readonly light: "#0a0a0a";
28
+ readonly dark: "#fafafa";
29
+ };
30
+ readonly primary: {
31
+ readonly light: "#171717";
32
+ readonly dark: "#e5e5e5";
33
+ };
34
+ readonly 'primary-foreground': {
35
+ readonly light: "#fafafa";
36
+ readonly dark: "#171717";
37
+ };
38
+ readonly secondary: {
39
+ readonly light: "#f5f5f5";
40
+ readonly dark: "#262626";
41
+ };
42
+ readonly 'secondary-foreground': {
43
+ readonly light: "#171717";
44
+ readonly dark: "#fafafa";
45
+ };
46
+ readonly muted: {
47
+ readonly light: "#f5f5f5";
48
+ readonly dark: "#262626";
49
+ };
50
+ readonly 'muted-foreground': {
51
+ readonly light: "#737373";
52
+ readonly dark: "#a1a1a1";
53
+ };
54
+ readonly accent: {
55
+ readonly light: "#f5f5f5";
56
+ readonly dark: "#262626";
57
+ };
58
+ readonly 'accent-foreground': {
59
+ readonly light: "#171717";
60
+ readonly dark: "#fafafa";
61
+ };
62
+ readonly destructive: {
63
+ readonly light: "#e7000b";
64
+ readonly dark: "#ff6467";
65
+ };
66
+ readonly border: {
67
+ readonly light: "#e5e5e5";
68
+ readonly dark: "#ffffff1a";
69
+ };
70
+ readonly input: {
71
+ readonly light: "#e5e5e5";
72
+ readonly dark: "#ffffff26";
73
+ };
74
+ readonly ring: {
75
+ readonly light: "#a1a1a1";
76
+ readonly dark: "#737373";
77
+ };
78
+ readonly 'chart-1': {
79
+ readonly light: "#d4d4d4";
80
+ readonly dark: "#d4d4d4";
81
+ };
82
+ readonly 'chart-2': {
83
+ readonly light: "#737373";
84
+ readonly dark: "#737373";
85
+ };
86
+ readonly 'chart-3': {
87
+ readonly light: "#525252";
88
+ readonly dark: "#525252";
89
+ };
90
+ readonly 'chart-4': {
91
+ readonly light: "#404040";
92
+ readonly dark: "#404040";
93
+ };
94
+ readonly 'chart-5': {
95
+ readonly light: "#262626";
96
+ readonly dark: "#262626";
97
+ };
98
+ readonly sidebar: {
99
+ readonly light: "#fafafa";
100
+ readonly dark: "#171717";
101
+ };
102
+ readonly 'sidebar-foreground': {
103
+ readonly light: "#0a0a0a";
104
+ readonly dark: "#fafafa";
105
+ };
106
+ readonly 'sidebar-primary': {
107
+ readonly light: "#171717";
108
+ readonly dark: "#1447e6";
109
+ };
110
+ readonly 'sidebar-primary-foreground': {
111
+ readonly light: "#fafafa";
112
+ readonly dark: "#fafafa";
113
+ };
114
+ readonly 'sidebar-accent': {
115
+ readonly light: "#f5f5f5";
116
+ readonly dark: "#262626";
117
+ };
118
+ readonly 'sidebar-accent-foreground': {
119
+ readonly light: "#171717";
120
+ readonly dark: "#fafafa";
121
+ };
122
+ readonly 'sidebar-border': {
123
+ readonly light: "#e5e5e5";
124
+ readonly dark: "#ffffff1a";
125
+ };
126
+ readonly 'sidebar-ring': {
127
+ readonly light: "#a1a1a1";
128
+ readonly dark: "#737373";
129
+ };
130
+ };
131
+ /**
132
+ * shadcn/ui's default theme (base color `neutral`), converted for React
133
+ * Native. shadcn/ui is Tailwind CSS plus CSS variables, so this is
134
+ * `tailwindCssTheme` (spacing, typography, shadows, the color palette) with
135
+ * shadcn/ui's colors and radii on top, the same layering as a shadcn/ui
136
+ * project's `globals.css`.
137
+ *
138
+ * - Semantic colors use shadcn/ui's names as top-level colors, so styles
139
+ * read like the class names: `bg-primary text-primary-foreground` is
140
+ * `themed.view({ backgroundColor: 'primary' })` /
141
+ * `themed.text({ color: 'primary-foreground' })`. oklch is converted to
142
+ * hex; translucent dark-mode borders become 8-digit hex.
143
+ * - `radii`: `--radius` (10) and the `radius-sm`…`radius-4xl` scale derived
144
+ * from it replace Tailwind's, like shadcn/ui's `@theme inline`.
145
+ * - Other base colors: `baseColors.zinc`, … — switch with
146
+ * `extendTheme(shadcnUiTheme, { semanticTokens: { colors: baseColors.zinc } })`.
147
+ * - Values come from the shadcn/ui registry snapshot in `scripts/registry/`
148
+ * (`pnpm sync`), converted by `scripts/generate.ts`.
149
+ */
150
+ export declare const shadcnUiTheme: import("@react-native-rethemed/core/config").ThemeConfig;
151
+ export { baseColors, radii };
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.radii = exports.baseColors = exports.shadcnUiTheme = exports.semanticColors = void 0;
4
+ const config_1 = require("@react-native-rethemed/core/config");
5
+ const tailwind_css_tokens_1 = require("@react-native-rethemed/tailwind-css-tokens");
6
+ const tokens_gen_1 = require("./tokens.gen");
7
+ Object.defineProperty(exports, "baseColors", { enumerable: true, get: function () { return tokens_gen_1.baseColors; } });
8
+ Object.defineProperty(exports, "radii", { enumerable: true, get: function () { return tokens_gen_1.radii; } });
9
+ /** The default base color's semantic colors (`neutral`). */
10
+ exports.semanticColors = tokens_gen_1.baseColors.neutral;
11
+ /**
12
+ * shadcn/ui's default theme (base color `neutral`), converted for React
13
+ * Native. shadcn/ui is Tailwind CSS plus CSS variables, so this is
14
+ * `tailwindCssTheme` (spacing, typography, shadows, the color palette) with
15
+ * shadcn/ui's colors and radii on top, the same layering as a shadcn/ui
16
+ * project's `globals.css`.
17
+ *
18
+ * - Semantic colors use shadcn/ui's names as top-level colors, so styles
19
+ * read like the class names: `bg-primary text-primary-foreground` is
20
+ * `themed.view({ backgroundColor: 'primary' })` /
21
+ * `themed.text({ color: 'primary-foreground' })`. oklch is converted to
22
+ * hex; translucent dark-mode borders become 8-digit hex.
23
+ * - `radii`: `--radius` (10) and the `radius-sm`…`radius-4xl` scale derived
24
+ * from it replace Tailwind's, like shadcn/ui's `@theme inline`.
25
+ * - Other base colors: `baseColors.zinc`, … — switch with
26
+ * `extendTheme(shadcnUiTheme, { semanticTokens: { colors: baseColors.zinc } })`.
27
+ * - Values come from the shadcn/ui registry snapshot in `scripts/registry/`
28
+ * (`pnpm sync`), converted by `scripts/generate.ts`.
29
+ */
30
+ exports.shadcnUiTheme = (0, config_1.extendTheme)(tailwind_css_tokens_1.tailwindCssTheme, {
31
+ tokens: { radii: tokens_gen_1.radii },
32
+ semanticTokens: { colors: exports.semanticColors },
33
+ });
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}