|
| 1 | +# @fictjs/radix-ui-themes |
| 2 | + |
| 3 | +Radix Themes for Fict, built on top of `@fictjs/radix-ui`. |
| 4 | + |
| 5 | +This package ports the upstream `@radix-ui/themes` design-token and styled component layer into |
| 6 | +the `ui-primitives` workspace for Fict consumers. It keeps the CSS-first distribution model from |
| 7 | +Radix Themes while swapping the runtime primitives to `@fictjs/radix-ui`. |
| 8 | + |
| 9 | +## Install |
| 10 | + |
| 11 | +```bash |
| 12 | +pnpm add @fictjs/radix-ui-themes @fictjs/radix-ui fict |
| 13 | +``` |
| 14 | + |
| 15 | +## CSS |
| 16 | + |
| 17 | +Import the full stylesheet once near your app root: |
| 18 | + |
| 19 | +```ts |
| 20 | +import '@fictjs/radix-ui-themes/styles.css' |
| 21 | +``` |
| 22 | + |
| 23 | +Available CSS entrypoints: |
| 24 | + |
| 25 | +- `@fictjs/radix-ui-themes/styles.css` |
| 26 | +- `@fictjs/radix-ui-themes/components.css` |
| 27 | +- `@fictjs/radix-ui-themes/utilities.css` |
| 28 | +- `@fictjs/radix-ui-themes/tokens.css` |
| 29 | +- `@fictjs/radix-ui-themes/tokens/base.css` |
| 30 | +- `@fictjs/radix-ui-themes/layout.css` |
| 31 | +- `@fictjs/radix-ui-themes/layout/tokens.css` |
| 32 | +- `@fictjs/radix-ui-themes/layout/components.css` |
| 33 | +- `@fictjs/radix-ui-themes/layout/utilities.css` |
| 34 | + |
| 35 | +## Usage |
| 36 | + |
| 37 | +```tsx |
| 38 | +/** @jsxImportSource fict */ |
| 39 | + |
| 40 | +import '@fictjs/radix-ui-themes/styles.css' |
| 41 | + |
| 42 | +import { Button, Card, Flex, Text, Theme } from '@fictjs/radix-ui-themes' |
| 43 | + |
| 44 | +export function App() { |
| 45 | + return ( |
| 46 | + <Theme accentColor="teal" grayColor="slate" radius="large"> |
| 47 | + <Card> |
| 48 | + <Flex direction="column" gap="3"> |
| 49 | + <Text size="3">Hello from Fict Radix Themes.</Text> |
| 50 | + <Button>Continue</Button> |
| 51 | + </Flex> |
| 52 | + </Card> |
| 53 | + </Theme> |
| 54 | + ) |
| 55 | +} |
| 56 | +``` |
| 57 | + |
| 58 | +## Theme |
| 59 | + |
| 60 | +`Theme` is the root provider for tokens and component styling. |
| 61 | + |
| 62 | +Supported theme props mirror the upstream package surface: |
| 63 | + |
| 64 | +- `appearance` |
| 65 | +- `accentColor` |
| 66 | +- `grayColor` |
| 67 | +- `panelBackground` |
| 68 | +- `radius` |
| 69 | +- `scaling` |
| 70 | +- `hasBackground` |
| 71 | + |
| 72 | +Nested themes are supported for localized overrides. |
| 73 | + |
| 74 | +## Included Components |
| 75 | + |
| 76 | +The package re-exports the same public component groups as the local ported source tree, including: |
| 77 | + |
| 78 | +- layout: `Box`, `Flex`, `Grid`, `Container`, `Inset`, `Section` |
| 79 | +- typography: `Text`, `Heading`, `Code`, `Kbd`, `Link`, `Quote`, `Blockquote`, `Em`, `Strong` |
| 80 | +- controls: `Button`, `IconButton`, `TextField`, `TextArea`, `Checkbox`, `Radio`, `Switch`, `Select`, `Slider` |
| 81 | +- overlays and menus: `Dialog`, `AlertDialog`, `Popover`, `HoverCard`, `ContextMenu`, `DropdownMenu`, `Tooltip` |
| 82 | +- data display: `Badge`, `Avatar`, `Card`, `Table`, `DataList`, `Progress`, `Skeleton`, `Spinner` |
| 83 | +- navigation: `Tabs`, `TabNav`, `SegmentedControl`, `CheckboxCards`, `RadioCards`, `CheckboxGroup`, `RadioGroup` |
| 84 | +- utilities: `Portal`, `Slot`, `ScrollArea`, `Separator`, `Reset`, `VisuallyHidden`, `ThemePanel` |
| 85 | + |
| 86 | +## Verification |
| 87 | + |
| 88 | +Run from `ui-primitives/`: |
| 89 | + |
| 90 | +```bash |
| 91 | +pnpm --filter @fictjs/radix-ui-themes lint |
| 92 | +pnpm --filter @fictjs/radix-ui-themes typecheck |
| 93 | +pnpm --filter @fictjs/radix-ui-themes test |
| 94 | +pnpm --filter @fictjs/radix-ui-themes build |
| 95 | +``` |
| 96 | + |
| 97 | +## Notes |
| 98 | + |
| 99 | +- `@radix-ui/colors` and `classnames` stay as production dependencies. |
| 100 | +- The primitive layer is swapped from `radix-ui` to `@fictjs/radix-ui`. |
| 101 | +- The package publishes compiled JS plus the generated CSS entrypoints listed above. |
0 commit comments