@thewhileloop/whileui 0.2.4 → 0.2.5
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/README.md +26 -40
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
# WhileUI Native
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Copy-paste components for React Native. You own the code.
|
|
4
4
|
|
|
5
|
-
Beautiful, accessible, themeable
|
|
6
|
-
|
|
7
|
-
Current version: **0.2.1**
|
|
5
|
+
Beautiful, accessible, themeable components built with [Uniwind](https://uniwind.dev) + Tailwind CSS v4.
|
|
8
6
|
|
|
9
7
|
## Installation
|
|
10
8
|
|
|
@@ -165,6 +163,15 @@ function MyScreen() {
|
|
|
165
163
|
- **Accessible** — Proper ARIA roles, keyboard support, controlled/uncontrolled state.
|
|
166
164
|
- **Tree-Shakeable** — Only imports what you use. `sideEffects: false`.
|
|
167
165
|
|
|
166
|
+
## Quick Reference (AI / Code Generation)
|
|
167
|
+
|
|
168
|
+
- **Full-screen:** `AppShell` + `Header` in `header` + `BottomNav` in `bottomNav` + content in `children`
|
|
169
|
+
- **Layout:** `Stack` (vertical), `Row` (horizontal) — both support `gap`, `align`, `justify`
|
|
170
|
+
- **Auth callbacks:** Auth blocks use objects: `onSubmit({ email, password })`, `onSubmit({ firstName, lastName, email, password })`, etc. Wire to your auth service.
|
|
171
|
+
- **PortalHost:** Add `<PortalHost />` at app root for Select, Popover, Tooltip, HoverCard.
|
|
172
|
+
- **Uniwind:** `withUniwindConfig` must wrap metro config. `global.css` at app root, imported in `App.tsx`.
|
|
173
|
+
- **Reference:** Block props in `packages/ui/src/blocks`; flow patterns in README "Flow Patterns" section.
|
|
174
|
+
|
|
168
175
|
## Components
|
|
169
176
|
|
|
170
177
|
### Primitives
|
|
@@ -276,6 +283,9 @@ function MyScreen() {
|
|
|
276
283
|
| **ErrorState** | Error display with retry |
|
|
277
284
|
| **LoadingScreen** | Full-screen loading indicator |
|
|
278
285
|
| **OnboardingScreen** | Onboarding flow screen |
|
|
286
|
+
| **SplashScreen** | Branded splash (fade/scale/slide variants) |
|
|
287
|
+
| **MinimalSplash** | Minimal monochrome splash |
|
|
288
|
+
| **BrandedSplash** | Splash with brand imagery |
|
|
279
289
|
|
|
280
290
|
### Profile & Settings
|
|
281
291
|
|
|
@@ -304,17 +314,6 @@ function MyScreen() {
|
|
|
304
314
|
| **CheckoutSummary** | Cart summary with line items |
|
|
305
315
|
| **MetricCard** | Stats/progress card for dashboards |
|
|
306
316
|
|
|
307
|
-
### Splash & States
|
|
308
|
-
|
|
309
|
-
| Block | Description |
|
|
310
|
-
| -------------------- | ------------------------------ |
|
|
311
|
-
| **SplashScreen** | Branded splash screen |
|
|
312
|
-
| **MinimalSplash** | Minimal monochrome splash |
|
|
313
|
-
| **BrandedSplash** | Splash with brand imagery |
|
|
314
|
-
| **OnboardingScreen** | Paged onboarding with slides |
|
|
315
|
-
| **LoadingScreen** | Full-screen loading state |
|
|
316
|
-
| **EmptyState** | Placeholder empty/content-less |
|
|
317
|
-
| **ErrorState** | Error message with action |
|
|
318
317
|
|
|
319
318
|
### Media
|
|
320
319
|
|
|
@@ -373,24 +372,24 @@ import { AppShell, Header, BottomNav, ScrollView } from '@thewhileloop/whileui';
|
|
|
373
372
|
</AppShell>
|
|
374
373
|
```
|
|
375
374
|
|
|
376
|
-
|
|
375
|
+
### Flow Patterns
|
|
376
|
+
|
|
377
|
+
| Flow | Blocks |
|
|
378
|
+
| ---------- | ------------------------------------------------------------------------------ |
|
|
379
|
+
| Auth | SignInForm → SignUpForm → ForgotPasswordForm → VerifyEmailForm → ResetPasswordForm |
|
|
380
|
+
| Settings | ProfileHeader + SettingsSection + SettingsItem (+ FormModalScreen for edits) |
|
|
381
|
+
| E-commerce | ProductCard list → CheckoutSummary + ActionBar |
|
|
382
|
+
| App shell | AppShell + Header + BottomNav + content |
|
|
383
|
+
|
|
384
|
+
Block props: see TypeScript interfaces in `packages/ui/src/blocks`.
|
|
377
385
|
|
|
378
386
|
## Quick Start
|
|
379
387
|
|
|
380
388
|
```bash
|
|
381
|
-
# Install dependencies
|
|
382
389
|
bun install
|
|
383
|
-
|
|
384
|
-
# Run the starter app (minimal composable template)
|
|
385
|
-
cd apps/starter
|
|
386
|
-
npx expo start
|
|
387
|
-
|
|
388
|
-
# Or run the full showcase
|
|
389
390
|
cd apps/showcase
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
# Run on web (React Native Web)
|
|
393
|
-
npx expo start --web
|
|
391
|
+
bun run dev
|
|
392
|
+
# Or: npx expo start --web
|
|
394
393
|
```
|
|
395
394
|
|
|
396
395
|
## Project Structure
|
|
@@ -509,19 +508,6 @@ const adapter: ThemeBridgeAdapter = {
|
|
|
509
508
|
const { mode, resolvedTheme, setMode, cycleMode } = useThemeBridge({ adapter });
|
|
510
509
|
```
|
|
511
510
|
|
|
512
|
-
## Using Components
|
|
513
|
-
|
|
514
|
-
Copy any component folder from `packages/ui/src/components/` into your project:
|
|
515
|
-
|
|
516
|
-
```tsx
|
|
517
|
-
import { cn } from './lib/cn';
|
|
518
|
-
import { tv, type VariantProps } from './lib/tv';
|
|
519
|
-
|
|
520
|
-
// Use the component with className overrides
|
|
521
|
-
<Button className="mt-4">
|
|
522
|
-
<ButtonText>Get Started</ButtonText>
|
|
523
|
-
</Button>;
|
|
524
|
-
```
|
|
525
511
|
|
|
526
512
|
## Tech Stack
|
|
527
513
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thewhileloop/whileui",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "WhileUI Native —
|
|
3
|
+
"version": "0.2.5",
|
|
4
|
+
"description": "WhileUI Native — Copy-paste components for React Native. You own the code.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
"ui",
|
|
14
14
|
"components",
|
|
15
15
|
"tailwind",
|
|
16
|
-
"uniwind"
|
|
17
|
-
"shadcn"
|
|
16
|
+
"uniwind"
|
|
18
17
|
],
|
|
19
18
|
"type": "module",
|
|
20
19
|
"main": "dist/index.js",
|