@nerds-with-charisma/revit-ui 0.3.0 → 0.4.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/CHANGELOG.md ADDED
@@ -0,0 +1,21 @@
1
+ # Changelog
2
+
3
+ ## 0.4.0
4
+
5
+ ### Added
6
+
7
+ - **React Native entry** (`@nerds-with-charisma/revit-ui/native`) — Phase 1 components for Expo / React Native apps.
8
+ - **Native theme helpers** (`@nerds-with-charisma/revit-ui/native/theme`) — `RevitThemeProvider`, `useRevitTheme()`, `tokensToStyleSheet()`.
9
+ - Phase 1 native components: `Button`, `Input`, `Label`, `Heading`, `Text`, `Card` (+ header/title/description/content), `Alert` (+ title/description), `Tabs` (+ list/trigger).
10
+ - Storybook **Native** section — previews native components via `react-native-web` (`pnpm dev` → sidebar **Native**).
11
+ - `react-native` optional peer dependency; `react-dom` marked optional for native-only consumers.
12
+
13
+ ### Notes
14
+
15
+ - Web entry (`@nerds-with-charisma/revit-ui`) is unchanged.
16
+ - Native components use `revitTokens` via `StyleSheet` — no Radix, Tailwind, or CSS.
17
+ - **EMESH Epic 8.6**: after bumping to `^0.4.0`, swap native login primitives for `@nerds-with-charisma/revit-ui/native`.
18
+
19
+ ## 0.3.0
20
+
21
+ Initial published release — web design system with Revit tokens, shadcn/Radix components, and Tailwind v4 styling.
package/README.md CHANGED
@@ -127,6 +127,84 @@ const myTokens: RevitThemeTokens = {
127
127
 
128
128
  Tokens only: `import { revitTokens } from '@nerds-with-charisma/revit-ui/theme/revit'`
129
129
 
130
+ ## React Native
131
+
132
+ Expo / React Native apps import from a separate entry — web bundles stay unchanged.
133
+
134
+ ```tsx
135
+ import {
136
+ Button,
137
+ Card,
138
+ CardContent,
139
+ CardHeader,
140
+ CardTitle,
141
+ Input,
142
+ Label,
143
+ RevitThemeProvider,
144
+ } from '@nerds-with-charisma/revit-ui/native'
145
+
146
+ export const SignInScreen = () => (
147
+ <RevitThemeProvider>
148
+ <Card variant="elevated">
149
+ <CardHeader>
150
+ <CardTitle>Sign in</CardTitle>
151
+ </CardHeader>
152
+ <CardContent>
153
+ <Label>Email</Label>
154
+ <Input placeholder="you@example.com" autoCapitalize="none" />
155
+ <Button onPress={() => {}}>Continue</Button>
156
+ </CardContent>
157
+ </Card>
158
+ </RevitThemeProvider>
159
+ )
160
+ ```
161
+
162
+ Theme helpers only:
163
+
164
+ ```tsx
165
+ import { tokensToStyleSheet, useRevitTheme } from '@nerds-with-charisma/revit-ui/native/theme'
166
+ import { revitTokens } from '@nerds-with-charisma/revit-ui/theme/revit'
167
+ ```
168
+
169
+ ### Metro (Expo)
170
+
171
+ Enable package exports and the `react-native` condition so `./native` and `./theme/revit` resolve:
172
+
173
+ ```js
174
+ // metro.config.js
175
+ const { getDefaultConfig } = require('expo/metro-config')
176
+
177
+ const config = getDefaultConfig(__dirname)
178
+
179
+ config.resolver.unstable_enablePackageExports = true
180
+ config.resolver.unstable_conditionNames = ['react-native', 'require', 'import']
181
+
182
+ module.exports = config
183
+ ```
184
+
185
+ ### Import paths
186
+
187
+ | Path | Use |
188
+ |------|-----|
189
+ | `@nerds-with-charisma/revit-ui` | Web — Radix + Tailwind components + `styles.css` |
190
+ | `@nerds-with-charisma/revit-ui/theme/revit` | Shared tokens (web + native) |
191
+ | `@nerds-with-charisma/revit-ui/native` | React Native components (Phase 1) |
192
+ | `@nerds-with-charisma/revit-ui/native/theme` | `RevitThemeProvider`, `useRevitTheme`, `tokensToStyleSheet` |
193
+
194
+ Peers: `react` + `react-native` (no `react-dom` required for native).
195
+
196
+ ### Phase 1 native components
197
+
198
+ `Button`, `Input`, `Label`, `Heading`, `Text`, `Card` (+ `CardHeader`, `CardTitle`, `CardDescription`, `CardContent`), `Alert` (+ `AlertTitle`, `AlertDescription`), `Tabs` (+ `TabsList`, `TabsTrigger`).
199
+
200
+ Browse them in Storybook under **Native** (rendered via `react-native-web` in the browser).
201
+
202
+ Variant names match web CVA (`variant="outline"`, `variant="elevated"`, etc.). Use RN idioms: `onPress`, `style`, optional `testID` (like web `data-id`).
203
+
204
+ ### Web-only (not in native yet)
205
+
206
+ `RevitForm`, `Select`, `Dialog`, charts, `Sonner`, and the full Radix primitive set remain web-only. Phase 2 will add native form helpers and `Select`.
207
+
130
208
  ## Components
131
209
 
132
210
  | Category | Components |