@nerds-with-charisma/revit-ui 0.2.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
@@ -10,6 +10,19 @@ pnpm add @nerds-with-charisma/revit-ui
10
10
 
11
11
  Peer: React 19.
12
12
 
13
+ ## Documentation
14
+
15
+ Browse components locally:
16
+
17
+ ```bash
18
+ pnpm install
19
+ pnpm dev
20
+ ```
21
+
22
+ Opens **Storybook** at `http://localhost:6006` with live examples, props tables, and usage notes.
23
+
24
+ Build static docs: `pnpm build-storybook` → `storybook-static/`
25
+
13
26
  ## Use
14
27
 
15
28
  ```tsx
@@ -114,7 +127,112 @@ const myTokens: RevitThemeTokens = {
114
127
 
115
128
  Tokens only: `import { revitTokens } from '@nerds-with-charisma/revit-ui/theme/revit'`
116
129
 
117
- ## Forms (`RevitForm`)
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
+
208
+ ## Components
209
+
210
+ | Category | Components |
211
+ |----------|------------|
212
+ | **Typography** | `Heading`, `Text`, `Link` |
213
+ | **Actions** | `Button`, `Badge`, `Toggle` |
214
+ | **Forms** | `Field`, `RevitForm`, `Input`, `PasswordInput`, `Textarea`, `Checkbox`, `Switch`, `Select`, `RadioGroup`, `Label` |
215
+ | **Layout** | `Card`, `Separator`, `AspectRatio`, `ScrollArea` |
216
+ | **Feedback** | `Alert`, `Progress`, `Skeleton`, `toast` / `Toaster` |
217
+ | **Overlays** | `Dialog`, `Sheet`, `Popover`, `Tooltip`, `DropdownMenu`, `AlertDialog` |
218
+ | **Navigation** | `Tabs`, `Breadcrumb`, `Pagination`, `NavigationMenu` |
219
+ | **Revit surfaces** | `FrostPanel`, `FrostNav`, `FrostTile`, `SearchBar`, `BrandGradient` |
220
+
221
+ See Storybook for examples. Low-level `Form*` primitives remain available for custom fields.
222
+
223
+ ### Single field
224
+
225
+ ```tsx
226
+ <Field description="We'll never share your email." label="Email">
227
+ <Input type="email" placeholder="you@example.com" />
228
+ </Field>
229
+ ```
230
+
231
+ ### Low-level escape hatch
232
+
233
+ `Form`, `FormField`, `FormItem`, `FormLabel`, `FormControl`, `FormMessage`, and `useForm` are still exported for custom fields that don't fit the config shape.
234
+
235
+ ## Forms
118
236
 
119
237
  Config-driven forms — pass a `fields` array, `RevitForm` handles react-hook-form + labels, validation messages, and wiring.
120
238
 
package/dist/index.d.ts CHANGED
@@ -419,6 +419,41 @@ declare const FormDescription: ({ className, ...props }: FormDescriptionProps) =
419
419
  type FormMessageProps = HTMLAttributes<HTMLParagraphElement>;
420
420
  declare const FormMessage: ({ className, children, ...props }: FormMessageProps) => react.JSX.Element | null;
421
421
 
422
+ type FieldProps = {
423
+ children: ReactNode;
424
+ className?: string;
425
+ description?: string;
426
+ error?: string;
427
+ htmlFor?: string;
428
+ label: string;
429
+ required?: boolean;
430
+ };
431
+ declare const Field: ({ children, className, description, error, htmlFor, label, required, }: FieldProps) => react.JSX.Element;
432
+
433
+ declare const headingVariants: (props?: ({
434
+ variant?: "title" | "page" | "section" | "eyebrow" | "subtitle" | null | undefined;
435
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
436
+ type HeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p';
437
+ type HeadingProps = HTMLAttributes<HTMLElement> & VariantProps<typeof headingVariants> & {
438
+ as?: HeadingTag;
439
+ };
440
+ declare const Heading: ({ as, className, variant, ...props }: HeadingProps) => react.JSX.Element;
441
+
442
+ declare const linkVariants: (props?: ({
443
+ variant?: "default" | "muted" | "primary" | null | undefined;
444
+ size?: "default" | "sm" | "base" | null | undefined;
445
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
446
+ type LinkProps = ComponentProps<'a'> & VariantProps<typeof linkVariants> & {
447
+ asChild?: boolean;
448
+ };
449
+ declare const Link: ({ asChild, className, size, variant, ...props }: LinkProps) => react.JSX.Element;
450
+
451
+ declare const textVariants: (props?: ({
452
+ variant?: "sm" | "label" | "body" | "muted" | "lead" | null | undefined;
453
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
454
+ type TextProps = HTMLAttributes<HTMLParagraphElement> & VariantProps<typeof textVariants>;
455
+ declare const Text: ({ className, variant, ...props }: TextProps) => react.JSX.Element;
456
+
422
457
  type ToasterProps = ComponentProps<typeof Toaster$1>;
423
458
  declare const Toaster: ({ ...props }: ToasterProps) => react.JSX.Element;
424
459
 
@@ -701,4 +736,4 @@ declare const tokensToCssVars: (tokens: RevitThemeTokens) => {
701
736
  };
702
737
  declare const tokensToStylesheet: (tokens: RevitThemeTokens) => string;
703
738
 
704
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, BrandGradient, Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, Checkbox, type CheckboxProps, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, type ComboboxOption, type ComboboxProps, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, ConfirmDialog, ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuTrigger, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Drawer, DrawerContent, DrawerDescription, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FrostFab, FrostNav, FrostPanel, FrostTile, HoverCard, HoverCardContent, HoverCardTrigger, ImageScrim, Input, InputOTP, InputOTPGroup, InputOTPSlot, type InputProps, Label, type LabelProps, Menubar, MenubarContent, MenubarItem, MenubarMenu, MenubarSeparator, MenubarTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, Pagination, PaginationBar, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PasswordInput, type PasswordInputProps, Popover, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, RevitForm, type RevitFormField, type RevitFormForgotPassword, type RevitFormOption, type RevitFormProps, RevitThemeTokens, RevitUIProvider, ScrollArea, ScrollBar, SearchBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarProvider, SidebarTrigger, Skeleton, Slider, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, alertVariants, badgeVariants, buttonVariants, cardVariants, cn, inputVariants, labelVariants, selectTriggerVariants, surfaces, textareaVariants, toggleVariants, tokensToCssVars, tokensToStylesheet, useFormField, useSidebar };
739
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, BrandGradient, Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, Checkbox, type CheckboxProps, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, type ComboboxOption, type ComboboxProps, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, ConfirmDialog, ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuTrigger, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Drawer, DrawerContent, DrawerDescription, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, Field, type FieldProps, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FrostFab, FrostNav, FrostPanel, FrostTile, Heading, type HeadingProps, HoverCard, HoverCardContent, HoverCardTrigger, ImageScrim, Input, InputOTP, InputOTPGroup, InputOTPSlot, type InputProps, Label, type LabelProps, Link, type LinkProps, Menubar, MenubarContent, MenubarItem, MenubarMenu, MenubarSeparator, MenubarTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, Pagination, PaginationBar, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PasswordInput, type PasswordInputProps, Popover, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, RevitForm, type RevitFormField, type RevitFormForgotPassword, type RevitFormOption, type RevitFormProps, RevitThemeTokens, RevitUIProvider, ScrollArea, ScrollBar, SearchBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarProvider, SidebarTrigger, Skeleton, Slider, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, type TextProps, Textarea, type TextareaProps, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, alertVariants, badgeVariants, buttonVariants, cardVariants, cn, headingVariants, inputVariants, labelVariants, linkVariants, selectTriggerVariants, surfaces, textVariants, textareaVariants, toggleVariants, tokensToCssVars, tokensToStylesheet, useFormField, useSidebar };