@react-native-rethemed/shadcn-ui-tokens 0.1.0 → 0.1.1

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
@@ -1,5 +1,7 @@
1
1
  # @react-native-rethemed/shadcn-ui-tokens
2
2
 
3
+ [![npm](https://img.shields.io/npm/v/@react-native-rethemed/shadcn-ui-tokens.svg)](https://www.npmjs.com/package/@react-native-rethemed/shadcn-ui-tokens)
4
+
3
5
  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
6
 
5
7
  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`.
package/dist/index.cjs ADDED
@@ -0,0 +1,35 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_tokens_gen = require("./tokens.gen.cjs");
3
+ let _react_native_rethemed_core_config = require("@react-native-rethemed/core/config");
4
+ let _react_native_rethemed_tailwind_css_tokens = require("@react-native-rethemed/tailwind-css-tokens");
5
+ //#region src/index.ts
6
+ /** The default base color's semantic colors (`neutral`). */
7
+ const semanticColors = require_tokens_gen.baseColors.neutral;
8
+ /**
9
+ * shadcn/ui's default theme (base color `neutral`), converted for React
10
+ * Native. shadcn/ui is Tailwind CSS plus CSS variables, so this is
11
+ * `tailwindCssTheme` (spacing, typography, shadows, the color palette) with
12
+ * shadcn/ui's colors and radii on top, the same layering as a shadcn/ui
13
+ * project's `globals.css`.
14
+ *
15
+ * - Semantic colors use shadcn/ui's names as top-level colors, so styles
16
+ * read like the class names: `bg-primary text-primary-foreground` is
17
+ * `themed.view({ backgroundColor: 'primary' })` /
18
+ * `themed.text({ color: 'primary-foreground' })`. oklch is converted to
19
+ * hex; translucent dark-mode borders become 8-digit hex.
20
+ * - `radii`: `--radius` (10) and the `radius-sm`…`radius-4xl` scale derived
21
+ * from it replace Tailwind's, like shadcn/ui's `@theme inline`.
22
+ * - Other base colors: `baseColors.zinc`, … — switch with
23
+ * `extendTheme(shadcnUiTheme, { semanticTokens: { colors: baseColors.zinc } })`.
24
+ * - Values come from the shadcn/ui registry snapshot in `scripts/registry/`
25
+ * (`pnpm sync`), converted by `scripts/generate.ts`.
26
+ */
27
+ const shadcnUiTheme = (0, _react_native_rethemed_core_config.extendTheme)(_react_native_rethemed_tailwind_css_tokens.tailwindCssTheme, {
28
+ tokens: { radii: require_tokens_gen.radii },
29
+ semanticTokens: { colors: semanticColors }
30
+ });
31
+ //#endregion
32
+ exports.baseColors = require_tokens_gen.baseColors;
33
+ exports.radii = require_tokens_gen.radii;
34
+ exports.semanticColors = semanticColors;
35
+ exports.shadcnUiTheme = shadcnUiTheme;
@@ -0,0 +1,153 @@
1
+ import { baseColors, radii } from "./tokens.gen.cjs";
2
+ //#region src/index.d.ts
3
+ /** A shadcn/ui base color: `neutral` (the default), `stone`, `zinc`, … */
4
+ export type BaseColor = keyof typeof baseColors;
5
+ /** The default base color's semantic colors (`neutral`). */
6
+ export declare const semanticColors: {
7
+ readonly background: {
8
+ readonly light: "#ffffff";
9
+ readonly dark: "#0a0a0a";
10
+ };
11
+ readonly foreground: {
12
+ readonly light: "#0a0a0a";
13
+ readonly dark: "#fafafa";
14
+ };
15
+ readonly card: {
16
+ readonly light: "#ffffff";
17
+ readonly dark: "#171717";
18
+ };
19
+ readonly 'card-foreground': {
20
+ readonly light: "#0a0a0a";
21
+ readonly dark: "#fafafa";
22
+ };
23
+ readonly popover: {
24
+ readonly light: "#ffffff";
25
+ readonly dark: "#171717";
26
+ };
27
+ readonly 'popover-foreground': {
28
+ readonly light: "#0a0a0a";
29
+ readonly dark: "#fafafa";
30
+ };
31
+ readonly primary: {
32
+ readonly light: "#171717";
33
+ readonly dark: "#e5e5e5";
34
+ };
35
+ readonly 'primary-foreground': {
36
+ readonly light: "#fafafa";
37
+ readonly dark: "#171717";
38
+ };
39
+ readonly secondary: {
40
+ readonly light: "#f5f5f5";
41
+ readonly dark: "#262626";
42
+ };
43
+ readonly 'secondary-foreground': {
44
+ readonly light: "#171717";
45
+ readonly dark: "#fafafa";
46
+ };
47
+ readonly muted: {
48
+ readonly light: "#f5f5f5";
49
+ readonly dark: "#262626";
50
+ };
51
+ readonly 'muted-foreground': {
52
+ readonly light: "#737373";
53
+ readonly dark: "#a1a1a1";
54
+ };
55
+ readonly accent: {
56
+ readonly light: "#f5f5f5";
57
+ readonly dark: "#262626";
58
+ };
59
+ readonly 'accent-foreground': {
60
+ readonly light: "#171717";
61
+ readonly dark: "#fafafa";
62
+ };
63
+ readonly destructive: {
64
+ readonly light: "#e7000b";
65
+ readonly dark: "#ff6467";
66
+ };
67
+ readonly border: {
68
+ readonly light: "#e5e5e5";
69
+ readonly dark: "#ffffff1a";
70
+ };
71
+ readonly input: {
72
+ readonly light: "#e5e5e5";
73
+ readonly dark: "#ffffff26";
74
+ };
75
+ readonly ring: {
76
+ readonly light: "#a1a1a1";
77
+ readonly dark: "#737373";
78
+ };
79
+ readonly 'chart-1': {
80
+ readonly light: "#d4d4d4";
81
+ readonly dark: "#d4d4d4";
82
+ };
83
+ readonly 'chart-2': {
84
+ readonly light: "#737373";
85
+ readonly dark: "#737373";
86
+ };
87
+ readonly 'chart-3': {
88
+ readonly light: "#525252";
89
+ readonly dark: "#525252";
90
+ };
91
+ readonly 'chart-4': {
92
+ readonly light: "#404040";
93
+ readonly dark: "#404040";
94
+ };
95
+ readonly 'chart-5': {
96
+ readonly light: "#262626";
97
+ readonly dark: "#262626";
98
+ };
99
+ readonly sidebar: {
100
+ readonly light: "#fafafa";
101
+ readonly dark: "#171717";
102
+ };
103
+ readonly 'sidebar-foreground': {
104
+ readonly light: "#0a0a0a";
105
+ readonly dark: "#fafafa";
106
+ };
107
+ readonly 'sidebar-primary': {
108
+ readonly light: "#171717";
109
+ readonly dark: "#1447e6";
110
+ };
111
+ readonly 'sidebar-primary-foreground': {
112
+ readonly light: "#fafafa";
113
+ readonly dark: "#fafafa";
114
+ };
115
+ readonly 'sidebar-accent': {
116
+ readonly light: "#f5f5f5";
117
+ readonly dark: "#262626";
118
+ };
119
+ readonly 'sidebar-accent-foreground': {
120
+ readonly light: "#171717";
121
+ readonly dark: "#fafafa";
122
+ };
123
+ readonly 'sidebar-border': {
124
+ readonly light: "#e5e5e5";
125
+ readonly dark: "#ffffff1a";
126
+ };
127
+ readonly 'sidebar-ring': {
128
+ readonly light: "#a1a1a1";
129
+ readonly dark: "#737373";
130
+ };
131
+ };
132
+ /**
133
+ * shadcn/ui's default theme (base color `neutral`), converted for React
134
+ * Native. shadcn/ui is Tailwind CSS plus CSS variables, so this is
135
+ * `tailwindCssTheme` (spacing, typography, shadows, the color palette) with
136
+ * shadcn/ui's colors and radii on top, the same layering as a shadcn/ui
137
+ * project's `globals.css`.
138
+ *
139
+ * - Semantic colors use shadcn/ui's names as top-level colors, so styles
140
+ * read like the class names: `bg-primary text-primary-foreground` is
141
+ * `themed.view({ backgroundColor: 'primary' })` /
142
+ * `themed.text({ color: 'primary-foreground' })`. oklch is converted to
143
+ * hex; translucent dark-mode borders become 8-digit hex.
144
+ * - `radii`: `--radius` (10) and the `radius-sm`…`radius-4xl` scale derived
145
+ * from it replace Tailwind's, like shadcn/ui's `@theme inline`.
146
+ * - Other base colors: `baseColors.zinc`, … — switch with
147
+ * `extendTheme(shadcnUiTheme, { semanticTokens: { colors: baseColors.zinc } })`.
148
+ * - Values come from the shadcn/ui registry snapshot in `scripts/registry/`
149
+ * (`pnpm sync`), converted by `scripts/generate.ts`.
150
+ */
151
+ export declare const shadcnUiTheme: import("@react-native-rethemed/core/config").ThemeConfig;
152
+ //#endregion
153
+ export { baseColors, radii };
@@ -0,0 +1,153 @@
1
+ import { baseColors, radii } from "./tokens.gen.mjs";
2
+ //#region src/index.d.ts
3
+ /** A shadcn/ui base color: `neutral` (the default), `stone`, `zinc`, … */
4
+ export type BaseColor = keyof typeof baseColors;
5
+ /** The default base color's semantic colors (`neutral`). */
6
+ export declare const semanticColors: {
7
+ readonly background: {
8
+ readonly light: "#ffffff";
9
+ readonly dark: "#0a0a0a";
10
+ };
11
+ readonly foreground: {
12
+ readonly light: "#0a0a0a";
13
+ readonly dark: "#fafafa";
14
+ };
15
+ readonly card: {
16
+ readonly light: "#ffffff";
17
+ readonly dark: "#171717";
18
+ };
19
+ readonly 'card-foreground': {
20
+ readonly light: "#0a0a0a";
21
+ readonly dark: "#fafafa";
22
+ };
23
+ readonly popover: {
24
+ readonly light: "#ffffff";
25
+ readonly dark: "#171717";
26
+ };
27
+ readonly 'popover-foreground': {
28
+ readonly light: "#0a0a0a";
29
+ readonly dark: "#fafafa";
30
+ };
31
+ readonly primary: {
32
+ readonly light: "#171717";
33
+ readonly dark: "#e5e5e5";
34
+ };
35
+ readonly 'primary-foreground': {
36
+ readonly light: "#fafafa";
37
+ readonly dark: "#171717";
38
+ };
39
+ readonly secondary: {
40
+ readonly light: "#f5f5f5";
41
+ readonly dark: "#262626";
42
+ };
43
+ readonly 'secondary-foreground': {
44
+ readonly light: "#171717";
45
+ readonly dark: "#fafafa";
46
+ };
47
+ readonly muted: {
48
+ readonly light: "#f5f5f5";
49
+ readonly dark: "#262626";
50
+ };
51
+ readonly 'muted-foreground': {
52
+ readonly light: "#737373";
53
+ readonly dark: "#a1a1a1";
54
+ };
55
+ readonly accent: {
56
+ readonly light: "#f5f5f5";
57
+ readonly dark: "#262626";
58
+ };
59
+ readonly 'accent-foreground': {
60
+ readonly light: "#171717";
61
+ readonly dark: "#fafafa";
62
+ };
63
+ readonly destructive: {
64
+ readonly light: "#e7000b";
65
+ readonly dark: "#ff6467";
66
+ };
67
+ readonly border: {
68
+ readonly light: "#e5e5e5";
69
+ readonly dark: "#ffffff1a";
70
+ };
71
+ readonly input: {
72
+ readonly light: "#e5e5e5";
73
+ readonly dark: "#ffffff26";
74
+ };
75
+ readonly ring: {
76
+ readonly light: "#a1a1a1";
77
+ readonly dark: "#737373";
78
+ };
79
+ readonly 'chart-1': {
80
+ readonly light: "#d4d4d4";
81
+ readonly dark: "#d4d4d4";
82
+ };
83
+ readonly 'chart-2': {
84
+ readonly light: "#737373";
85
+ readonly dark: "#737373";
86
+ };
87
+ readonly 'chart-3': {
88
+ readonly light: "#525252";
89
+ readonly dark: "#525252";
90
+ };
91
+ readonly 'chart-4': {
92
+ readonly light: "#404040";
93
+ readonly dark: "#404040";
94
+ };
95
+ readonly 'chart-5': {
96
+ readonly light: "#262626";
97
+ readonly dark: "#262626";
98
+ };
99
+ readonly sidebar: {
100
+ readonly light: "#fafafa";
101
+ readonly dark: "#171717";
102
+ };
103
+ readonly 'sidebar-foreground': {
104
+ readonly light: "#0a0a0a";
105
+ readonly dark: "#fafafa";
106
+ };
107
+ readonly 'sidebar-primary': {
108
+ readonly light: "#171717";
109
+ readonly dark: "#1447e6";
110
+ };
111
+ readonly 'sidebar-primary-foreground': {
112
+ readonly light: "#fafafa";
113
+ readonly dark: "#fafafa";
114
+ };
115
+ readonly 'sidebar-accent': {
116
+ readonly light: "#f5f5f5";
117
+ readonly dark: "#262626";
118
+ };
119
+ readonly 'sidebar-accent-foreground': {
120
+ readonly light: "#171717";
121
+ readonly dark: "#fafafa";
122
+ };
123
+ readonly 'sidebar-border': {
124
+ readonly light: "#e5e5e5";
125
+ readonly dark: "#ffffff1a";
126
+ };
127
+ readonly 'sidebar-ring': {
128
+ readonly light: "#a1a1a1";
129
+ readonly dark: "#737373";
130
+ };
131
+ };
132
+ /**
133
+ * shadcn/ui's default theme (base color `neutral`), converted for React
134
+ * Native. shadcn/ui is Tailwind CSS plus CSS variables, so this is
135
+ * `tailwindCssTheme` (spacing, typography, shadows, the color palette) with
136
+ * shadcn/ui's colors and radii on top, the same layering as a shadcn/ui
137
+ * project's `globals.css`.
138
+ *
139
+ * - Semantic colors use shadcn/ui's names as top-level colors, so styles
140
+ * read like the class names: `bg-primary text-primary-foreground` is
141
+ * `themed.view({ backgroundColor: 'primary' })` /
142
+ * `themed.text({ color: 'primary-foreground' })`. oklch is converted to
143
+ * hex; translucent dark-mode borders become 8-digit hex.
144
+ * - `radii`: `--radius` (10) and the `radius-sm`…`radius-4xl` scale derived
145
+ * from it replace Tailwind's, like shadcn/ui's `@theme inline`.
146
+ * - Other base colors: `baseColors.zinc`, … — switch with
147
+ * `extendTheme(shadcnUiTheme, { semanticTokens: { colors: baseColors.zinc } })`.
148
+ * - Values come from the shadcn/ui registry snapshot in `scripts/registry/`
149
+ * (`pnpm sync`), converted by `scripts/generate.ts`.
150
+ */
151
+ export declare const shadcnUiTheme: import("@react-native-rethemed/core/config").ThemeConfig;
152
+ //#endregion
153
+ export { baseColors, radii };
package/dist/index.mjs ADDED
@@ -0,0 +1,31 @@
1
+ import { baseColors, radii } from "./tokens.gen.mjs";
2
+ import { extendTheme } from "@react-native-rethemed/core/config";
3
+ import { tailwindCssTheme } from "@react-native-rethemed/tailwind-css-tokens";
4
+ //#region src/index.ts
5
+ /** The default base color's semantic colors (`neutral`). */
6
+ const semanticColors = baseColors.neutral;
7
+ /**
8
+ * shadcn/ui's default theme (base color `neutral`), converted for React
9
+ * Native. shadcn/ui is Tailwind CSS plus CSS variables, so this is
10
+ * `tailwindCssTheme` (spacing, typography, shadows, the color palette) with
11
+ * shadcn/ui's colors and radii on top, the same layering as a shadcn/ui
12
+ * project's `globals.css`.
13
+ *
14
+ * - Semantic colors use shadcn/ui's names as top-level colors, so styles
15
+ * read like the class names: `bg-primary text-primary-foreground` is
16
+ * `themed.view({ backgroundColor: 'primary' })` /
17
+ * `themed.text({ color: 'primary-foreground' })`. oklch is converted to
18
+ * hex; translucent dark-mode borders become 8-digit hex.
19
+ * - `radii`: `--radius` (10) and the `radius-sm`…`radius-4xl` scale derived
20
+ * from it replace Tailwind's, like shadcn/ui's `@theme inline`.
21
+ * - Other base colors: `baseColors.zinc`, … — switch with
22
+ * `extendTheme(shadcnUiTheme, { semanticTokens: { colors: baseColors.zinc } })`.
23
+ * - Values come from the shadcn/ui registry snapshot in `scripts/registry/`
24
+ * (`pnpm sync`), converted by `scripts/generate.ts`.
25
+ */
26
+ const shadcnUiTheme = extendTheme(tailwindCssTheme, {
27
+ tokens: { radii },
28
+ semanticTokens: { colors: semanticColors }
29
+ });
30
+ //#endregion
31
+ export { baseColors, radii, semanticColors, shadcnUiTheme };