@campxdev/react-native-blueprint 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 +20 -0
- package/README.md +358 -0
- package/lib/module/app/_layout.js +23 -0
- package/lib/module/app/_layout.js.map +1 -0
- package/lib/module/assets/icons/weather_icons/drizzle.png +0 -0
- package/lib/module/assets/icons/weather_icons/foggy.png +0 -0
- package/lib/module/assets/icons/weather_icons/freezing_rain.png +0 -0
- package/lib/module/assets/icons/weather_icons/partly_cloudy.png +0 -0
- package/lib/module/assets/icons/weather_icons/rainy.png +0 -0
- package/lib/module/assets/icons/weather_icons/showers.png +0 -0
- package/lib/module/assets/icons/weather_icons/sunny_weather.png +0 -0
- package/lib/module/assets/icons/weather_icons/thunderstorm.png +0 -0
- package/lib/module/assets/icons/weather_icons/thunderstorm_hail.png +0 -0
- package/lib/module/components/theme-config.js +265 -0
- package/lib/module/components/theme-config.js.map +1 -0
- package/lib/module/components/ui/Accordion.js +228 -0
- package/lib/module/components/ui/Accordion.js.map +1 -0
- package/lib/module/components/ui/Alert-Dialog.js +266 -0
- package/lib/module/components/ui/Alert-Dialog.js.map +1 -0
- package/lib/module/components/ui/Alert.js +107 -0
- package/lib/module/components/ui/Alert.js.map +1 -0
- package/lib/module/components/ui/AppBar.js +403 -0
- package/lib/module/components/ui/AppBar.js.map +1 -0
- package/lib/module/components/ui/Aspect-Ratio.js +27 -0
- package/lib/module/components/ui/Aspect-Ratio.js.map +1 -0
- package/lib/module/components/ui/Avatar.js +97 -0
- package/lib/module/components/ui/Avatar.js.map +1 -0
- package/lib/module/components/ui/Badge.js +127 -0
- package/lib/module/components/ui/Badge.js.map +1 -0
- package/lib/module/components/ui/Bottom-Sheet.js +144 -0
- package/lib/module/components/ui/Bottom-Sheet.js.map +1 -0
- package/lib/module/components/ui/Button.js +88 -0
- package/lib/module/components/ui/Button.js.map +1 -0
- package/lib/module/components/ui/Card.js +176 -0
- package/lib/module/components/ui/Card.js.map +1 -0
- package/lib/module/components/ui/Checkbox.js +65 -0
- package/lib/module/components/ui/Checkbox.js.map +1 -0
- package/lib/module/components/ui/Collapsible.js +42 -0
- package/lib/module/components/ui/Collapsible.js.map +1 -0
- package/lib/module/components/ui/Context-Menu.js +287 -0
- package/lib/module/components/ui/Context-Menu.js.map +1 -0
- package/lib/module/components/ui/Custom-Card.js +202 -0
- package/lib/module/components/ui/Custom-Card.js.map +1 -0
- package/lib/module/components/ui/Dialog.js +202 -0
- package/lib/module/components/ui/Dialog.js.map +1 -0
- package/lib/module/components/ui/Dropdown-Menu.js +421 -0
- package/lib/module/components/ui/Dropdown-Menu.js.map +1 -0
- package/lib/module/components/ui/Floating-Action.js +50 -0
- package/lib/module/components/ui/Floating-Action.js.map +1 -0
- package/lib/module/components/ui/Greeting-Card.js +392 -0
- package/lib/module/components/ui/Greeting-Card.js.map +1 -0
- package/lib/module/components/ui/Hover-Card.js +96 -0
- package/lib/module/components/ui/Hover-Card.js.map +1 -0
- package/lib/module/components/ui/Icon.js +73 -0
- package/lib/module/components/ui/Icon.js.map +1 -0
- package/lib/module/components/ui/Input.js +74 -0
- package/lib/module/components/ui/Input.js.map +1 -0
- package/lib/module/components/ui/Label.js +44 -0
- package/lib/module/components/ui/Label.js.map +1 -0
- package/lib/module/components/ui/Menubar.js +375 -0
- package/lib/module/components/ui/Menubar.js.map +1 -0
- package/lib/module/components/ui/Native-Only-Animated-View.js +41 -0
- package/lib/module/components/ui/Native-Only-Animated-View.js.map +1 -0
- package/lib/module/components/ui/NavBar.js +352 -0
- package/lib/module/components/ui/NavBar.js.map +1 -0
- package/lib/module/components/ui/Popover.js +101 -0
- package/lib/module/components/ui/Popover.js.map +1 -0
- package/lib/module/components/ui/Progress.js +124 -0
- package/lib/module/components/ui/Progress.js.map +1 -0
- package/lib/module/components/ui/Radio-Group.js +75 -0
- package/lib/module/components/ui/Radio-Group.js.map +1 -0
- package/lib/module/components/ui/Select.js +269 -0
- package/lib/module/components/ui/Select.js.map +1 -0
- package/lib/module/components/ui/Separator.js +58 -0
- package/lib/module/components/ui/Separator.js.map +1 -0
- package/lib/module/components/ui/SizedBox.js +101 -0
- package/lib/module/components/ui/SizedBox.js.map +1 -0
- package/lib/module/components/ui/Skeleton.js +57 -0
- package/lib/module/components/ui/Skeleton.js.map +1 -0
- package/lib/module/components/ui/Slider.js +169 -0
- package/lib/module/components/ui/Slider.js.map +1 -0
- package/lib/module/components/ui/Switch.js +55 -0
- package/lib/module/components/ui/Switch.js.map +1 -0
- package/lib/module/components/ui/Table.js +150 -0
- package/lib/module/components/ui/Table.js.map +1 -0
- package/lib/module/components/ui/Tabs.js +106 -0
- package/lib/module/components/ui/Tabs.js.map +1 -0
- package/lib/module/components/ui/Text.js +69 -0
- package/lib/module/components/ui/Text.js.map +1 -0
- package/lib/module/components/ui/Textarea.js +88 -0
- package/lib/module/components/ui/Textarea.js.map +1 -0
- package/lib/module/components/ui/Theme-Toggle.js +156 -0
- package/lib/module/components/ui/Theme-Toggle.js.map +1 -0
- package/lib/module/components/ui/Toast.js +101 -0
- package/lib/module/components/ui/Toast.js.map +1 -0
- package/lib/module/components/ui/Toggle-Group.js +129 -0
- package/lib/module/components/ui/Toggle-Group.js.map +1 -0
- package/lib/module/components/ui/Toggle.js +106 -0
- package/lib/module/components/ui/Toggle.js.map +1 -0
- package/lib/module/components/ui/Tooltip.js +106 -0
- package/lib/module/components/ui/Tooltip.js.map +1 -0
- package/lib/module/components/ui/index.js +45 -0
- package/lib/module/components/ui/index.js.map +1 -0
- package/lib/module/index.js +19 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/lib/ThemeProvider.js +173 -0
- package/lib/module/lib/ThemeProvider.js.map +1 -0
- package/lib/module/lib/cornerRadius.js +164 -0
- package/lib/module/lib/cornerRadius.js.map +1 -0
- package/lib/module/lib/fonts.js +25 -0
- package/lib/module/lib/fonts.js.map +1 -0
- package/lib/module/lib/theme.js +212 -0
- package/lib/module/lib/theme.js.map +1 -0
- package/lib/module/lib/utils.js +137 -0
- package/lib/module/lib/utils.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/package.json +208 -0
- package/src/app/_layout.tsx +25 -0
- package/src/assets/icons/weather_icons/drizzle.png +0 -0
- package/src/assets/icons/weather_icons/foggy.png +0 -0
- package/src/assets/icons/weather_icons/freezing_rain.png +0 -0
- package/src/assets/icons/weather_icons/partly_cloudy.png +0 -0
- package/src/assets/icons/weather_icons/rainy.png +0 -0
- package/src/assets/icons/weather_icons/showers.png +0 -0
- package/src/assets/icons/weather_icons/sunny_weather.png +0 -0
- package/src/assets/icons/weather_icons/thunderstorm.png +0 -0
- package/src/assets/icons/weather_icons/thunderstorm_hail.png +0 -0
- package/src/components/theme-config.ts +331 -0
- package/src/components/ui/Accordion.tsx +253 -0
- package/src/components/ui/Alert-Dialog.tsx +295 -0
- package/src/components/ui/Alert.tsx +137 -0
- package/src/components/ui/AppBar.tsx +551 -0
- package/src/components/ui/Aspect-Ratio.tsx +25 -0
- package/src/components/ui/Avatar.tsx +103 -0
- package/src/components/ui/Badge.tsx +121 -0
- package/src/components/ui/Bottom-Sheet.tsx +224 -0
- package/src/components/ui/Button.tsx +100 -0
- package/src/components/ui/Card.tsx +185 -0
- package/src/components/ui/Checkbox.tsx +81 -0
- package/src/components/ui/Collapsible.tsx +40 -0
- package/src/components/ui/Context-Menu.tsx +407 -0
- package/src/components/ui/Custom-Card.tsx +226 -0
- package/src/components/ui/Dialog.tsx +240 -0
- package/src/components/ui/Dropdown-Menu.tsx +544 -0
- package/src/components/ui/Floating-Action.tsx +54 -0
- package/src/components/ui/Greeting-Card.tsx +471 -0
- package/src/components/ui/Hover-Card.tsx +101 -0
- package/src/components/ui/Icon.tsx +75 -0
- package/src/components/ui/Input.tsx +90 -0
- package/src/components/ui/Label.tsx +48 -0
- package/src/components/ui/Menubar.tsx +509 -0
- package/src/components/ui/Native-Only-Animated-View.tsx +37 -0
- package/src/components/ui/NavBar.tsx +397 -0
- package/src/components/ui/Popover.tsx +110 -0
- package/src/components/ui/Progress.tsx +138 -0
- package/src/components/ui/Radio-Group.tsx +79 -0
- package/src/components/ui/Select.tsx +344 -0
- package/src/components/ui/Separator.tsx +68 -0
- package/src/components/ui/SizedBox.tsx +116 -0
- package/src/components/ui/Skeleton.tsx +55 -0
- package/src/components/ui/Slider.tsx +222 -0
- package/src/components/ui/Switch.tsx +67 -0
- package/src/components/ui/Table.tsx +170 -0
- package/src/components/ui/Tabs.tsx +119 -0
- package/src/components/ui/Text.tsx +73 -0
- package/src/components/ui/Textarea.tsx +93 -0
- package/src/components/ui/Theme-Toggle.tsx +204 -0
- package/src/components/ui/Toast.tsx +127 -0
- package/src/components/ui/Toggle-Group.tsx +160 -0
- package/src/components/ui/Toggle.tsx +122 -0
- package/src/components/ui/Tooltip.tsx +117 -0
- package/src/components/ui/index.ts +42 -0
- package/src/index.tsx +24 -0
- package/src/lib/ThemeProvider.tsx +204 -0
- package/src/lib/cornerRadius.ts +160 -0
- package/src/lib/fonts.ts +28 -0
- package/src/lib/theme.ts +151 -0
- package/src/lib/utils.ts +146 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 CAMPX
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
# react-native-blueprint
|
|
2
|
+
|
|
3
|
+
A production-ready React Native UI component library built with NativeWind (Tailwind CSS) and shadcn/ui design patterns. Features 35+ fully customizable, accessible components for iOS, Android, and Web.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🎨 **35+ Components** - Complete UI kit including buttons, forms, overlays, navigation, and data display
|
|
8
|
+
- 🌓 **Dark Mode** - Built-in theme support with CSS variables
|
|
9
|
+
- ♿ **Accessible** - ARIA-compliant components with screen reader support
|
|
10
|
+
- 📱 **Cross-Platform** - Works seamlessly on iOS, Android, and Web
|
|
11
|
+
- 🎯 **Type-Safe** - Full TypeScript support with IntelliSense
|
|
12
|
+
- 🚀 **NativeWind** - Tailwind CSS styling for React Native
|
|
13
|
+
- 🔧 **Customizable** - Easy to theme and extend with Tailwind utilities
|
|
14
|
+
- ⚡ **Performant** - Built on React Native Reanimated for smooth animations
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npm install react-native-blueprint
|
|
20
|
+
# or
|
|
21
|
+
yarn add react-native-blueprint
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Peer Dependencies
|
|
25
|
+
|
|
26
|
+
This library requires the following peer dependencies:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
npm install react react-native nativewind tailwindcss react-native-reanimated react-native-gesture-handler react-native-svg
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Setup
|
|
33
|
+
|
|
34
|
+
1. **Configure NativeWind:**
|
|
35
|
+
|
|
36
|
+
Create or update `tailwind.config.js`:
|
|
37
|
+
|
|
38
|
+
```js
|
|
39
|
+
const { hairlineWidth } = require('nativewind/theme');
|
|
40
|
+
|
|
41
|
+
module.exports = {
|
|
42
|
+
darkMode: 'class',
|
|
43
|
+
content: [
|
|
44
|
+
'./src/**/*.{ts,tsx}',
|
|
45
|
+
'./node_modules/react-native-blueprint/src/**/*.{ts,tsx}',
|
|
46
|
+
],
|
|
47
|
+
presets: [require('nativewind/preset')],
|
|
48
|
+
theme: {
|
|
49
|
+
extend: {
|
|
50
|
+
colors: {
|
|
51
|
+
border: 'hsl(var(--border))',
|
|
52
|
+
input: 'hsl(var(--input))',
|
|
53
|
+
ring: 'hsl(var(--ring))',
|
|
54
|
+
background: 'hsl(var(--background))',
|
|
55
|
+
foreground: 'hsl(var(--foreground))',
|
|
56
|
+
primary: {
|
|
57
|
+
DEFAULT: 'hsl(var(--primary))',
|
|
58
|
+
foreground: 'hsl(var(--primary-foreground))',
|
|
59
|
+
},
|
|
60
|
+
secondary: {
|
|
61
|
+
DEFAULT: 'hsl(var(--secondary))',
|
|
62
|
+
foreground: 'hsl(var(--secondary-foreground))',
|
|
63
|
+
},
|
|
64
|
+
destructive: {
|
|
65
|
+
DEFAULT: 'hsl(var(--destructive))',
|
|
66
|
+
foreground: 'hsl(var(--destructive-foreground))',
|
|
67
|
+
},
|
|
68
|
+
muted: {
|
|
69
|
+
DEFAULT: 'hsl(var(--muted))',
|
|
70
|
+
foreground: 'hsl(var(--muted-foreground))',
|
|
71
|
+
},
|
|
72
|
+
accent: {
|
|
73
|
+
DEFAULT: 'hsl(var(--accent))',
|
|
74
|
+
foreground: 'hsl(var(--accent-foreground))',
|
|
75
|
+
},
|
|
76
|
+
popover: {
|
|
77
|
+
DEFAULT: 'hsl(var(--popover))',
|
|
78
|
+
foreground: 'hsl(var(--popover-foreground))',
|
|
79
|
+
},
|
|
80
|
+
card: {
|
|
81
|
+
DEFAULT: 'hsl(var(--card))',
|
|
82
|
+
foreground: 'hsl(var(--card-foreground))',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
borderWidth: {
|
|
86
|
+
hairline: hairlineWidth(),
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
plugins: [require('tailwindcss-animate')],
|
|
91
|
+
};
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
2. **Import global styles:**
|
|
95
|
+
|
|
96
|
+
Create `global.css` and import the theme:
|
|
97
|
+
|
|
98
|
+
```css
|
|
99
|
+
@tailwind base;
|
|
100
|
+
@tailwind components;
|
|
101
|
+
@tailwind utilities;
|
|
102
|
+
|
|
103
|
+
@layer base {
|
|
104
|
+
:root {
|
|
105
|
+
--background: 0 0% 100%;
|
|
106
|
+
--foreground: 240 10% 3.9%;
|
|
107
|
+
--card: 0 0% 100%;
|
|
108
|
+
--card-foreground: 240 10% 3.9%;
|
|
109
|
+
--popover: 0 0% 100%;
|
|
110
|
+
--popover-foreground: 240 10% 3.9%;
|
|
111
|
+
--primary: 240 5.9% 10%;
|
|
112
|
+
--primary-foreground: 0 0% 98%;
|
|
113
|
+
--secondary: 240 4.8% 95.9%;
|
|
114
|
+
--secondary-foreground: 240 5.9% 10%;
|
|
115
|
+
--muted: 240 4.8% 95.9%;
|
|
116
|
+
--muted-foreground: 240 3.8% 46.1%;
|
|
117
|
+
--accent: 240 4.8% 95.9%;
|
|
118
|
+
--accent-foreground: 240 5.9% 10%;
|
|
119
|
+
--destructive: 0 84.2% 60.2%;
|
|
120
|
+
--destructive-foreground: 0 0% 98%;
|
|
121
|
+
--border: 240 5.9% 90%;
|
|
122
|
+
--input: 240 5.9% 90%;
|
|
123
|
+
--ring: 240 5.9% 10%;
|
|
124
|
+
--radius: 0.5rem;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.dark {
|
|
128
|
+
--background: 240 10% 3.9%;
|
|
129
|
+
--foreground: 0 0% 98%;
|
|
130
|
+
--card: 240 10% 3.9%;
|
|
131
|
+
--card-foreground: 0 0% 98%;
|
|
132
|
+
--popover: 240 10% 3.9%;
|
|
133
|
+
--popover-foreground: 0 0% 98%;
|
|
134
|
+
--primary: 0 0% 98%;
|
|
135
|
+
--primary-foreground: 240 5.9% 10%;
|
|
136
|
+
--secondary: 240 3.7% 15.9%;
|
|
137
|
+
--secondary-foreground: 0 0% 98%;
|
|
138
|
+
--muted: 240 3.7% 15.9%;
|
|
139
|
+
--muted-foreground: 240 5% 64.9%;
|
|
140
|
+
--accent: 240 3.7% 15.9%;
|
|
141
|
+
--accent-foreground: 0 0% 98%;
|
|
142
|
+
--destructive: 0 62.8% 30.6%;
|
|
143
|
+
--destructive-foreground: 0 0% 98%;
|
|
144
|
+
--border: 240 3.7% 15.9%;
|
|
145
|
+
--input: 240 3.7% 15.9%;
|
|
146
|
+
--ring: 240 4.9% 83.9%;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
3. **Configure Metro:**
|
|
152
|
+
|
|
153
|
+
Update `metro.config.js`:
|
|
154
|
+
|
|
155
|
+
```js
|
|
156
|
+
const { getDefaultConfig } = require('expo/metro-config');
|
|
157
|
+
const { withNativeWind } = require('nativewind/metro');
|
|
158
|
+
|
|
159
|
+
const config = getDefaultConfig(__dirname);
|
|
160
|
+
|
|
161
|
+
module.exports = withNativeWind(config, { input: './global.css' });
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Usage
|
|
165
|
+
|
|
166
|
+
### Basic Example
|
|
167
|
+
|
|
168
|
+
```tsx
|
|
169
|
+
import { Button, Card, Text, Input, Alert } from 'react-native-blueprint';
|
|
170
|
+
import { View } from 'react-native';
|
|
171
|
+
|
|
172
|
+
function App() {
|
|
173
|
+
return (
|
|
174
|
+
<View className="flex-1 p-4 bg-background">
|
|
175
|
+
<Card>
|
|
176
|
+
<Card.Header>
|
|
177
|
+
<Card.Title>Welcome</Card.Title>
|
|
178
|
+
<Card.Description>Get started with react-native-blueprint</Card.Description>
|
|
179
|
+
</Card.Header>
|
|
180
|
+
<Card.Content>
|
|
181
|
+
<Input placeholder="Enter your name" />
|
|
182
|
+
</Card.Content>
|
|
183
|
+
<Card.Footer>
|
|
184
|
+
<Button>
|
|
185
|
+
<Text>Submit</Text>
|
|
186
|
+
</Button>
|
|
187
|
+
</Card.Footer>
|
|
188
|
+
</Card>
|
|
189
|
+
|
|
190
|
+
<Alert>
|
|
191
|
+
<Alert.Title>Info</Alert.Title>
|
|
192
|
+
<Alert.Description>
|
|
193
|
+
This is a sample alert component.
|
|
194
|
+
</Alert.Description>
|
|
195
|
+
</Alert>
|
|
196
|
+
</View>
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Available Components
|
|
202
|
+
|
|
203
|
+
### Layout & Structure
|
|
204
|
+
- **Button** - Customizable button with variants (default, destructive, outline, ghost, link)
|
|
205
|
+
- **Card** - Container with header, content, and footer sections
|
|
206
|
+
- **Separator** - Horizontal or vertical divider
|
|
207
|
+
- **Skeleton** - Loading placeholder with shimmer effect
|
|
208
|
+
|
|
209
|
+
### Form Components
|
|
210
|
+
- **Input** - Text input field
|
|
211
|
+
- **Textarea** - Multi-line text input
|
|
212
|
+
- **Checkbox** - Checkbox with label support
|
|
213
|
+
- **Radio Group** - Radio button group
|
|
214
|
+
- **Switch** - Toggle switch
|
|
215
|
+
- **Select** - Dropdown select menu
|
|
216
|
+
- **Label** - Form field label
|
|
217
|
+
- **Slider** - Range slider input
|
|
218
|
+
|
|
219
|
+
### Navigation
|
|
220
|
+
- **Tabs** - Tab navigation component
|
|
221
|
+
- **Accordion** - Collapsible content sections
|
|
222
|
+
- **Collapsible** - Expandable/collapsible content
|
|
223
|
+
- **Menubar** - Menu bar with nested items
|
|
224
|
+
|
|
225
|
+
### Overlays & Dialogs
|
|
226
|
+
- **Dialog** - Modal dialog
|
|
227
|
+
- **Alert Dialog** - Alert/confirmation dialog
|
|
228
|
+
- **Popover** - Floating popover
|
|
229
|
+
- **Tooltip** - Hover tooltip
|
|
230
|
+
- **Dropdown Menu** - Context menu dropdown
|
|
231
|
+
- **Context Menu** - Right-click context menu
|
|
232
|
+
- **Hover Card** - Card that appears on hover
|
|
233
|
+
|
|
234
|
+
### Feedback & Status
|
|
235
|
+
- **Alert** - Informational alert box
|
|
236
|
+
- **Toast** - Toast notification
|
|
237
|
+
- **Progress** - Progress bar
|
|
238
|
+
- **Badge** - Status badge
|
|
239
|
+
|
|
240
|
+
### Data Display
|
|
241
|
+
- **Table** - Data table with sorting
|
|
242
|
+
- **Avatar** - User avatar with fallback
|
|
243
|
+
- **Text** - Typography component with variants
|
|
244
|
+
- **Icon** - Icon component (powered by lucide-react-native)
|
|
245
|
+
|
|
246
|
+
### Utilities
|
|
247
|
+
- **Aspect Ratio** - Container with fixed aspect ratio
|
|
248
|
+
- **Toggle** - Toggle button
|
|
249
|
+
- **Toggle Group** - Group of toggle buttons
|
|
250
|
+
|
|
251
|
+
## Theming
|
|
252
|
+
|
|
253
|
+
Components use CSS variables for theming. Customize your app's appearance by modifying the CSS variables in `global.css`:
|
|
254
|
+
|
|
255
|
+
```css
|
|
256
|
+
:root {
|
|
257
|
+
--primary: 220 90% 56%; /* Blue */
|
|
258
|
+
--secondary: 280 70% 60%; /* Purple */
|
|
259
|
+
--destructive: 0 84% 60%; /* Red */
|
|
260
|
+
--radius: 0.75rem; /* Border radius */
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## Dark Mode
|
|
265
|
+
|
|
266
|
+
Toggle dark mode by adding/removing the `dark` class on your root element:
|
|
267
|
+
|
|
268
|
+
```tsx
|
|
269
|
+
import { useColorScheme } from 'react-native';
|
|
270
|
+
|
|
271
|
+
function App() {
|
|
272
|
+
const colorScheme = useColorScheme();
|
|
273
|
+
|
|
274
|
+
return (
|
|
275
|
+
<View className={colorScheme === 'dark' ? 'dark' : ''}>
|
|
276
|
+
{/* Your app */}
|
|
277
|
+
</View>
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
## Example App
|
|
283
|
+
|
|
284
|
+
Check out the `/example` directory for a complete demo app showcasing all components:
|
|
285
|
+
|
|
286
|
+
```sh
|
|
287
|
+
cd example
|
|
288
|
+
npm install
|
|
289
|
+
npm run ios # Run on iOS simulator
|
|
290
|
+
npm run android # Run on Android emulator
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
## TypeScript Support
|
|
294
|
+
|
|
295
|
+
All components are fully typed with TypeScript. Import types as needed:
|
|
296
|
+
|
|
297
|
+
```tsx
|
|
298
|
+
import type { ButtonProps, CardProps } from 'react-native-blueprint';
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
## Contributing
|
|
302
|
+
|
|
303
|
+
Contributions are welcome! Please follow these steps:
|
|
304
|
+
|
|
305
|
+
1. Fork the repository
|
|
306
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
307
|
+
3. Commit your changes (`git commit -m 'feat: add amazing feature'`)
|
|
308
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
309
|
+
5. Open a Pull Request
|
|
310
|
+
|
|
311
|
+
### Development Workflow
|
|
312
|
+
|
|
313
|
+
1. Clone the repo and install dependencies:
|
|
314
|
+
```sh
|
|
315
|
+
git clone https://github.com/campx-org/react-native-blueprint.git
|
|
316
|
+
cd react-native-blueprint
|
|
317
|
+
yarn install
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
2. Run the example app:
|
|
321
|
+
```sh
|
|
322
|
+
yarn example ios
|
|
323
|
+
# or
|
|
324
|
+
yarn example android
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
3. Make your changes in `/src`
|
|
328
|
+
|
|
329
|
+
4. Run type checking and linting:
|
|
330
|
+
```sh
|
|
331
|
+
yarn typecheck
|
|
332
|
+
yarn lint
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
5. Build the library:
|
|
336
|
+
```sh
|
|
337
|
+
yarn prepare
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
## License
|
|
341
|
+
|
|
342
|
+
MIT © [CAMPX](https://github.com/campx-org)
|
|
343
|
+
|
|
344
|
+
## Credits
|
|
345
|
+
|
|
346
|
+
- Built with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
|
|
347
|
+
- Inspired by [shadcn/ui](https://ui.shadcn.com)
|
|
348
|
+
- Styled with [NativeWind](https://nativewind.dev)
|
|
349
|
+
- Primitives from [@rn-primitives](https://github.com/mrzachnugent/react-native-reusables)
|
|
350
|
+
|
|
351
|
+
## Support
|
|
352
|
+
|
|
353
|
+
- GitHub Issues: [Report a bug](https://github.com/campx-org/react-native-blueprint/issues)
|
|
354
|
+
- Discussions: [Ask questions](https://github.com/campx-org/react-native-blueprint/discussions)
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
Made with ❤️ by CAMPX
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import '../../global.css';
|
|
4
|
+
import { PortalHost } from '@rn-primitives/portal';
|
|
5
|
+
import { StatusBar } from 'react-native';
|
|
6
|
+
import { NAV_THEME } from "../lib/theme.js";
|
|
7
|
+
import { ThemeProvider } from '@react-navigation/native';
|
|
8
|
+
import { useColorScheme } from 'nativewind';
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
export default function RootLayout({
|
|
11
|
+
children
|
|
12
|
+
}) {
|
|
13
|
+
const {
|
|
14
|
+
colorScheme
|
|
15
|
+
} = useColorScheme();
|
|
16
|
+
return /*#__PURE__*/_jsxs(ThemeProvider, {
|
|
17
|
+
value: NAV_THEME[colorScheme ?? 'light'],
|
|
18
|
+
children: [/*#__PURE__*/_jsx(StatusBar, {
|
|
19
|
+
barStyle: colorScheme === 'dark' ? 'light-content' : 'dark-content'
|
|
20
|
+
}), children, /*#__PURE__*/_jsx(PortalHost, {})]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=_layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PortalHost","StatusBar","NAV_THEME","ThemeProvider","useColorScheme","jsx","_jsx","jsxs","_jsxs","RootLayout","children","colorScheme","value","barStyle"],"sourceRoot":"../../../src","sources":["app/_layout.tsx"],"mappings":";;AAAA,OAAO,kBAAkB;AACzB,SAASA,UAAU,QAAQ,uBAAuB;AAClD,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,SAAS,QAAQ,iBAAc;AACxC,SAASC,aAAa,QAAQ,0BAA0B;AACxD,SAASC,cAAc,QAAQ,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAO5C,eAAe,SAASC,UAAUA,CAAC;EAAEC;AAA0B,CAAC,EAAE;EAChE,MAAM;IAAEC;EAAY,CAAC,GAAGP,cAAc,CAAC,CAAC;EAExC,oBACEI,KAAA,CAACL,aAAa;IAACS,KAAK,EAAEV,SAAS,CAACS,WAAW,IAAI,OAAO,CAAE;IAAAD,QAAA,gBACtDJ,IAAA,CAACL,SAAS;MACRY,QAAQ,EAAEF,WAAW,KAAK,MAAM,GAAG,eAAe,GAAG;IAAe,CACrE,CAAC,EACDD,QAAQ,eACTJ,IAAA,CAACN,UAAU,IAAE,CAAC;EAAA,CACD,CAAC;AAEpB","ignoreList":[]}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Comprehensive Dark Theme Configuration
|
|
5
|
+
*
|
|
6
|
+
* This file provides complete theme tokens and utilities for consistent
|
|
7
|
+
* dark mode support across all components in the Blueprint library.
|
|
8
|
+
*
|
|
9
|
+
* Best Practices:
|
|
10
|
+
* - Uses HSL color format for better color manipulation
|
|
11
|
+
* - Provides semantic color tokens (not raw colors)
|
|
12
|
+
* - Maintains proper contrast ratios for accessibility (WCAG AA/AAA)
|
|
13
|
+
* - Consistent with Tailwind CSS conventions
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Color tokens for light and dark themes
|
|
18
|
+
* Each token follows the pattern: purpose-variant
|
|
19
|
+
*/
|
|
20
|
+
export const THEME_COLORS = {
|
|
21
|
+
light: {
|
|
22
|
+
// Base colors
|
|
23
|
+
background: 'hsl(0, 0%, 100%)',
|
|
24
|
+
// Pure white
|
|
25
|
+
foreground: 'hsl(0, 0%, 3.9%)',
|
|
26
|
+
// Near black
|
|
27
|
+
|
|
28
|
+
// Card colors
|
|
29
|
+
card: 'hsl(0, 0%, 100%)',
|
|
30
|
+
cardForeground: 'hsl(0, 0%, 3.9%)',
|
|
31
|
+
// Popover colors
|
|
32
|
+
popover: 'hsl(0, 0%, 100%)',
|
|
33
|
+
popoverForeground: 'hsl(0, 0%, 3.9%)',
|
|
34
|
+
// Primary action colors
|
|
35
|
+
primary: 'hsl(0, 0%, 9%)',
|
|
36
|
+
primaryForeground: 'hsl(0, 0%, 98%)',
|
|
37
|
+
// Secondary action colors
|
|
38
|
+
secondary: 'hsl(0, 0%, 96.1%)',
|
|
39
|
+
secondaryForeground: 'hsl(0, 0%, 9%)',
|
|
40
|
+
// Muted/subtle colors
|
|
41
|
+
muted: 'hsl(0, 0%, 96.1%)',
|
|
42
|
+
mutedForeground: 'hsl(0, 0%, 45.1%)',
|
|
43
|
+
// Accent colors
|
|
44
|
+
accent: 'hsl(0, 0%, 96.1%)',
|
|
45
|
+
accentForeground: 'hsl(0, 0%, 9%)',
|
|
46
|
+
// Destructive/error colors
|
|
47
|
+
destructive: 'hsl(0, 84.2%, 60.2%)',
|
|
48
|
+
destructiveForeground: 'hsl(0, 0%, 98%)',
|
|
49
|
+
// Border and input colors
|
|
50
|
+
border: 'hsl(0, 0%, 89.8%)',
|
|
51
|
+
input: 'hsl(0, 0%, 89.8%)',
|
|
52
|
+
ring: 'hsl(0, 0%, 63%)',
|
|
53
|
+
// Success colors
|
|
54
|
+
success: 'hsl(142, 76%, 36%)',
|
|
55
|
+
successForeground: 'hsl(0, 0%, 98%)',
|
|
56
|
+
// Warning colors
|
|
57
|
+
warning: 'hsl(38, 92%, 50%)',
|
|
58
|
+
warningForeground: 'hsl(0, 0%, 9%)',
|
|
59
|
+
// Info colors
|
|
60
|
+
info: 'hsl(199, 89%, 48%)',
|
|
61
|
+
infoForeground: 'hsl(0, 0%, 98%)'
|
|
62
|
+
},
|
|
63
|
+
dark: {
|
|
64
|
+
// Base colors
|
|
65
|
+
background: 'hsl(0, 0%, 3.9%)',
|
|
66
|
+
// Near black
|
|
67
|
+
foreground: 'hsl(0, 0%, 98%)',
|
|
68
|
+
// Near white
|
|
69
|
+
|
|
70
|
+
// Card colors
|
|
71
|
+
card: 'hsl(0, 0%, 3.9%)',
|
|
72
|
+
cardForeground: 'hsl(0, 0%, 98%)',
|
|
73
|
+
// Popover colors
|
|
74
|
+
popover: 'hsl(0, 0%, 3.9%)',
|
|
75
|
+
popoverForeground: 'hsl(0, 0%, 98%)',
|
|
76
|
+
// Primary action colors (inverted from light)
|
|
77
|
+
primary: 'hsl(0, 0%, 98%)',
|
|
78
|
+
primaryForeground: 'hsl(0, 0%, 9%)',
|
|
79
|
+
// Secondary action colors
|
|
80
|
+
secondary: 'hsl(0, 0%, 14.9%)',
|
|
81
|
+
secondaryForeground: 'hsl(0, 0%, 98%)',
|
|
82
|
+
// Muted/subtle colors
|
|
83
|
+
muted: 'hsl(0, 0%, 14.9%)',
|
|
84
|
+
mutedForeground: 'hsl(0, 0%, 63.9%)',
|
|
85
|
+
// Accent colors
|
|
86
|
+
accent: 'hsl(0, 0%, 14.9%)',
|
|
87
|
+
accentForeground: 'hsl(0, 0%, 98%)',
|
|
88
|
+
// Destructive/error colors
|
|
89
|
+
destructive: 'hsl(0, 62.8%, 30.6%)',
|
|
90
|
+
destructiveForeground: 'hsl(0, 0%, 98%)',
|
|
91
|
+
// Border and input colors
|
|
92
|
+
border: 'hsl(0, 0%, 14.9%)',
|
|
93
|
+
input: 'hsl(0, 0%, 14.9%)',
|
|
94
|
+
ring: 'hsl(0, 0%, 45%)',
|
|
95
|
+
// Success colors
|
|
96
|
+
success: 'hsl(142, 76%, 36%)',
|
|
97
|
+
successForeground: 'hsl(0, 0%, 98%)',
|
|
98
|
+
// Warning colors
|
|
99
|
+
warning: 'hsl(38, 92%, 50%)',
|
|
100
|
+
warningForeground: 'hsl(0, 0%, 9%)',
|
|
101
|
+
// Info colors
|
|
102
|
+
info: 'hsl(199, 89%, 48%)',
|
|
103
|
+
infoForeground: 'hsl(0, 0%, 98%)'
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Convert HSL string to React Native ColorValue
|
|
109
|
+
* Useful for native platform styling where HSL needs to be converted
|
|
110
|
+
*/
|
|
111
|
+
export function hslToRgb(hsl) {
|
|
112
|
+
// Extract h, s, l from "hsl(h, s%, l%)" format
|
|
113
|
+
const match = hsl.match(/hsl\((\d+),\s*(\d+(?:\.\d+)?)%,\s*(\d+(?:\.\d+)?)%\)/);
|
|
114
|
+
if (!match || !match[1] || !match[2] || !match[3]) return hsl;
|
|
115
|
+
const h = parseInt(match[1], 10) / 360;
|
|
116
|
+
const s = parseFloat(match[2]) / 100;
|
|
117
|
+
const l = parseFloat(match[3]) / 100;
|
|
118
|
+
let r, g, b;
|
|
119
|
+
if (s === 0) {
|
|
120
|
+
r = g = b = l;
|
|
121
|
+
} else {
|
|
122
|
+
const hue2rgb = (p, q, t) => {
|
|
123
|
+
if (t < 0) t += 1;
|
|
124
|
+
if (t > 1) t -= 1;
|
|
125
|
+
if (t < 1 / 6) return p + (q - p) * 6 * t;
|
|
126
|
+
if (t < 1 / 2) return q;
|
|
127
|
+
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
|
|
128
|
+
return p;
|
|
129
|
+
};
|
|
130
|
+
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
131
|
+
const p = 2 * l - q;
|
|
132
|
+
r = hue2rgb(p, q, h + 1 / 3);
|
|
133
|
+
g = hue2rgb(p, q, h);
|
|
134
|
+
b = hue2rgb(p, q, h - 1 / 3);
|
|
135
|
+
}
|
|
136
|
+
const toHex = x => {
|
|
137
|
+
const hex = Math.round(x * 255).toString(16);
|
|
138
|
+
return hex.length === 1 ? '0' + hex : hex;
|
|
139
|
+
};
|
|
140
|
+
return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Get theme color value based on current theme mode
|
|
145
|
+
* Automatically selects the appropriate color from light/dark theme
|
|
146
|
+
*/
|
|
147
|
+
export function getThemeColorValue(colorKey, isDark, asRgb = false) {
|
|
148
|
+
const color = isDark ? THEME_COLORS.dark[colorKey] : THEME_COLORS.light[colorKey];
|
|
149
|
+
return asRgb ? hslToRgb(color) : color;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Component-specific dark mode class mappings
|
|
154
|
+
* Use these to ensure consistent styling across all components
|
|
155
|
+
*/
|
|
156
|
+
export const DARK_MODE_CLASSES = {
|
|
157
|
+
// Text variants
|
|
158
|
+
text: {
|
|
159
|
+
default: 'dark:text-foreground',
|
|
160
|
+
muted: 'dark:text-muted-foreground',
|
|
161
|
+
primary: 'dark:text-primary-foreground',
|
|
162
|
+
secondary: 'dark:text-secondary-foreground',
|
|
163
|
+
accent: 'dark:text-accent-foreground',
|
|
164
|
+
destructive: 'dark:text-destructive-foreground',
|
|
165
|
+
card: 'dark:text-card-foreground'
|
|
166
|
+
},
|
|
167
|
+
// Background variants
|
|
168
|
+
background: {
|
|
169
|
+
default: 'dark:bg-background',
|
|
170
|
+
card: 'dark:bg-card',
|
|
171
|
+
primary: 'dark:bg-primary',
|
|
172
|
+
secondary: 'dark:bg-secondary',
|
|
173
|
+
muted: 'dark:bg-muted',
|
|
174
|
+
accent: 'dark:bg-accent',
|
|
175
|
+
destructive: 'dark:bg-destructive',
|
|
176
|
+
popover: 'dark:bg-popover'
|
|
177
|
+
},
|
|
178
|
+
// Border variants
|
|
179
|
+
border: {
|
|
180
|
+
default: 'dark:border-border',
|
|
181
|
+
input: 'dark:border-input',
|
|
182
|
+
primary: 'dark:border-primary',
|
|
183
|
+
muted: 'dark:border-muted',
|
|
184
|
+
accent: 'dark:border-accent',
|
|
185
|
+
destructive: 'dark:border-destructive'
|
|
186
|
+
},
|
|
187
|
+
// Interactive states
|
|
188
|
+
state: {
|
|
189
|
+
hover: 'dark:hover:bg-accent',
|
|
190
|
+
active: 'dark:active:bg-accent',
|
|
191
|
+
focus: 'dark:focus:ring-ring',
|
|
192
|
+
disabled: 'dark:disabled:opacity-50'
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Helper to combine base classes with dark mode classes
|
|
198
|
+
* Ensures consistent application of dark mode styles
|
|
199
|
+
*/
|
|
200
|
+
export function withDarkMode(baseClass, darkClass, additionalClasses) {
|
|
201
|
+
return [baseClass, darkClass, additionalClasses].filter(Boolean).join(' ');
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Pre-configured class strings for common component patterns
|
|
206
|
+
* Use these for consistent styling across the library
|
|
207
|
+
*/
|
|
208
|
+
export const THEME_PRESETS = {
|
|
209
|
+
// Card-like containers
|
|
210
|
+
card: 'bg-card text-card-foreground dark:bg-card dark:text-card-foreground border border-border dark:border-border',
|
|
211
|
+
// Input fields
|
|
212
|
+
input: 'bg-background text-foreground dark:bg-background dark:text-foreground border border-input dark:border-input',
|
|
213
|
+
// Buttons - primary
|
|
214
|
+
buttonPrimary: 'bg-primary text-primary-foreground dark:bg-primary dark:text-primary-foreground',
|
|
215
|
+
// Buttons - secondary
|
|
216
|
+
buttonSecondary: 'bg-secondary text-secondary-foreground dark:bg-secondary dark:text-secondary-foreground',
|
|
217
|
+
// Buttons - outline
|
|
218
|
+
buttonOutline: 'bg-background text-foreground dark:bg-background dark:text-foreground border border-input dark:border-input',
|
|
219
|
+
// Buttons - ghost
|
|
220
|
+
buttonGhost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent dark:hover:text-accent-foreground',
|
|
221
|
+
// Destructive elements
|
|
222
|
+
destructive: 'bg-destructive text-destructive-foreground dark:bg-destructive dark:text-destructive-foreground',
|
|
223
|
+
// Muted/subtle elements
|
|
224
|
+
muted: 'bg-muted text-muted-foreground dark:bg-muted dark:text-muted-foreground',
|
|
225
|
+
// Popover/dropdown
|
|
226
|
+
popover: 'bg-popover text-popover-foreground dark:bg-popover dark:text-popover-foreground border border-border dark:border-border'
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Semantic color map for native components
|
|
231
|
+
* Use these for StyleSheet-based styling
|
|
232
|
+
*/
|
|
233
|
+
export function getNativeThemeColors(isDark) {
|
|
234
|
+
return {
|
|
235
|
+
background: hslToRgb(getThemeColorValue('background', isDark)),
|
|
236
|
+
foreground: hslToRgb(getThemeColorValue('foreground', isDark)),
|
|
237
|
+
card: hslToRgb(getThemeColorValue('card', isDark)),
|
|
238
|
+
cardForeground: hslToRgb(getThemeColorValue('cardForeground', isDark)),
|
|
239
|
+
primary: hslToRgb(getThemeColorValue('primary', isDark)),
|
|
240
|
+
primaryForeground: hslToRgb(getThemeColorValue('primaryForeground', isDark)),
|
|
241
|
+
secondary: hslToRgb(getThemeColorValue('secondary', isDark)),
|
|
242
|
+
secondaryForeground: hslToRgb(getThemeColorValue('secondaryForeground', isDark)),
|
|
243
|
+
muted: hslToRgb(getThemeColorValue('muted', isDark)),
|
|
244
|
+
mutedForeground: hslToRgb(getThemeColorValue('mutedForeground', isDark)),
|
|
245
|
+
accent: hslToRgb(getThemeColorValue('accent', isDark)),
|
|
246
|
+
accentForeground: hslToRgb(getThemeColorValue('accentForeground', isDark)),
|
|
247
|
+
destructive: hslToRgb(getThemeColorValue('destructive', isDark)),
|
|
248
|
+
destructiveForeground: hslToRgb(getThemeColorValue('destructiveForeground', isDark)),
|
|
249
|
+
border: hslToRgb(getThemeColorValue('border', isDark)),
|
|
250
|
+
input: hslToRgb(getThemeColorValue('input', isDark)),
|
|
251
|
+
ring: hslToRgb(getThemeColorValue('ring', isDark))
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Type-safe theme color keys
|
|
257
|
+
*/
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Check if a color key exists in the theme
|
|
261
|
+
*/
|
|
262
|
+
export function isValidThemeColor(key) {
|
|
263
|
+
return key in THEME_COLORS.light;
|
|
264
|
+
}
|
|
265
|
+
//# sourceMappingURL=theme-config.js.map
|