feat: React Native support via shared design tokens (hightide-native)#251
Open
felixevers wants to merge 1 commit into
Open
feat: React Native support via shared design tokens (hightide-native)#251felixevers wants to merge 1 commit into
felixevers wants to merge 1 commit into
Conversation
…ive) Extend hightide from a web-only library into a hybrid React + React Native design system, without touching the existing web library, build, or pipeline. New packages under packages/: - @helpwave/hightide-tokens: platform-agnostic design tokens (single source of truth) — palette, light/dark semantic colors, typography, spacing/sizing, radii, elevation, motion, the role x treatment coloring model, plus a Tailwind/NativeWind preset and a CSS-variables generator. Zero runtime deps. - @helpwave/hightide-native: React Native component library with the basic app building blocks (Text, Button, IconButton, Card/ActionCard, Chip/ChipList, Avatar/Group/WithStatus, Switch, Checkbox, Badge, Spinner, Divider), a theme provider with light/dark, and a themed-StyleSheet styling core that exactly reproduces the web coloring semantics. NativeWind-ready but not required. Desktop-web patterns (AppPage, Carousel, Table, ...) are intentionally excluded. Also: - Storybook (react-native-web-vite) config + stories for every component. - docs/native/ARCHITECTURE.md (strategy, library comparison, npm packaging & lockstep versioning) and COMPONENT-INVENTORY.md (ported/planned/web-only). - scripts/sync-versions.mjs to keep the family on one version. - Root README + packages/README overview; .gitignore updates. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HGBywE1t7jTwSbkyB34S1d
Deploying hightide with
|
| Latest commit: |
48aa3e3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://8a15c67e.hightide-7id.pages.dev |
| Branch Preview URL: | https://claude-hightide-react-native.hightide-7id.pages.dev |
02499d3 to
c2390e3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
This turns hightide into a hybrid design system that serves both React (web) and React Native, sharing one design language. It is purely additive — the existing web library, its build, lint, tests and publish pipeline are untouched.
📖 Read first:
docs/native/ARCHITECTURE.md— the rationale, the survey of how other hybrid libraries do it, and the npm/versioning model.Architecture (the short version)
Three packages, one repo, single source of truth for design at the center:
@helpwave/hightide-tokens— platform-agnostic tokens (pure TS, no React/DOM/RN), transcribed from the web CSS theme. Feeds web Tailwind, NativeWind and RNStyleSheetalike, so the platforms can't drift.@helpwave/hightide-native— the React Native components (basic app building blocks).Why this shape (decisions documented in the ADR)
react-native/nativewind, web needsreact-dom; merging forces each platform's installs/bundlers to carry the other's deps. The ecosystem (gluestack, Tamagui) ships coordinated packages, not one.StyleSheetcore, NativeWind-ready not NativeWind-required — a foundational library should render with zero build setup (the Rename Package #1 friction teams hit with NativeWind-only libs). We still ship the NativeWind preset +global.css+ forwardclassName, so utility-class styling is an opt-in layer. The webcoloring-{solid,tonal,outline,text,tonal-outline}semantics are reproduced exactly.scripts/sync-versions.mjs; npm workspaces are a documented one-line opt-in (kept out of this PR so the webnpm ciis unaffected).What's in the box
hightide-nativecomponents:Text(typography primitive),Button,IconButton,Card/ActionCard,Chip/ChipList,Avatar/AvatarGroup/AvatarWithStatus,Switch,Checkbox,Badge,Spinner,Divider— plusHightideThemeProvider(light/dark) and the styling layer (resolveColoring,resolveElement).Explicitly excluded (desktop-web):
AppPage,Carousel,Table, navigation, data-grid filtering, date pickers, process-model, markdown, … SeeCOMPONENT-INVENTORY.mdfor the full ported / planned / web-only breakdown.Storybook:
react-native-web-viteconfig + stories for every component (same Vite-based approach as the web Storybook).Verification done
@helpwave/hightide-tokens:tsc --noEmit✅ andtsupbuild (cjs+esm+dts) ✅; token outputs spot-checked.@helpwave/hightide-native:tsc --noEmit✅ (againstreact-nativetypes) andtsupbuild ✅;global.cssgenerated from tokens.packages/**is already ESLint-ignored; the roottsup/tsconfig only buildsrc/.Review pointers
docs/native/ARCHITECTURE.mdanddocs/native/COMPONENT-INVENTORY.mdfirst.packages/hightide-tokens/src/— the token model (start atsemantic.ts,coloring.ts).packages/hightide-native/src/styling/coloring.ts— the web→native coloring port.🤖 Generated with Claude Code
Generated by Claude Code