@campxdev/react-native-blueprint 0.1.11 → 0.1.12

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 CHANGED
@@ -23,6 +23,22 @@ This library requires **NativeWind v4+** to be configured in your React Native p
23
23
 
24
24
  This library works with **both Expo and Bare React Native CLI** projects. Choose the installation method for your project type.
25
25
 
26
+ ### Quick Start
27
+
28
+ ```bash
29
+ # Install the package
30
+ npm install @campxdev/react-native-blueprint
31
+ # or
32
+ yarn add @campxdev/react-native-blueprint
33
+
34
+ # Install required peer dependencies (minimum)
35
+ npm install @rn-primitives/slot @rn-primitives/types nativewind tailwindcss tailwindcss-animate
36
+ # or
37
+ yarn add @rn-primitives/slot @rn-primitives/types nativewind tailwindcss tailwindcss-animate
38
+ ```
39
+
40
+ **Note:** Only install the `@rn-primitives` packages for components you actually use. See the [Component Dependencies](#component-dependencies) table below.
41
+
26
42
  ### For Bare React Native CLI Projects (Recommended)
27
43
 
28
44
  Perfect for apps like **CampxMobileApp** using React Native CLI without Expo.
@@ -241,7 +257,11 @@ If you want to use Re.Pack in your project:
241
257
 
242
258
  ## Usage
243
259
 
244
- ### Basic Example
260
+ The library supports two import methods:
261
+
262
+ ### Option 1: Main Package Import (Default)
263
+
264
+ Import all components from the main package. You only need to install the `@rn-primitives` packages for components you actually use.
245
265
 
246
266
  ```tsx
247
267
  // Import CSS at the top of your app entry point (do this ONCE)
@@ -285,6 +305,50 @@ function App() {
285
305
  }
286
306
  ```
287
307
 
308
+ ### Option 2: Tree-Shakeable Imports (Recommended for Production)
309
+
310
+ Import components individually for better tree-shaking and smaller bundle sizes. This ensures you only bundle what you use.
311
+
312
+ ```tsx
313
+ // Import CSS at the top of your app entry point (do this ONCE)
314
+ import '@campxdev/react-native-blueprint/global.css';
315
+
316
+ import { Button } from '@campxdev/react-native-blueprint/Button';
317
+ import { Card } from '@campxdev/react-native-blueprint/Card';
318
+ import { Text } from '@campxdev/react-native-blueprint/Text';
319
+ import { Input } from '@campxdev/react-native-blueprint/Input';
320
+ import { Alert } from '@campxdev/react-native-blueprint/Alert';
321
+ import { View } from 'react-native';
322
+
323
+ function App() {
324
+ return (
325
+ <View className="flex-1 p-4 bg-background">
326
+ <Card>
327
+ <Card.Header>
328
+ <Card.Title>Welcome</Card.Title>
329
+ <Card.Description>
330
+ Get started with react-native-blueprint
331
+ </Card.Description>
332
+ </Card.Header>
333
+ <Card.Content>
334
+ <Input placeholder="Enter your name" />
335
+ </Card.Content>
336
+ <Card.Footer>
337
+ <Button>
338
+ <Text>Submit</Text>
339
+ </Button>
340
+ </Card.Footer>
341
+ </Card>
342
+
343
+ <Alert>
344
+ <Alert.Title>Info</Alert.Title>
345
+ <Alert.Description>This is a sample alert component.</Alert.Description>
346
+ </Alert>
347
+ </View>
348
+ );
349
+ }
350
+ ```
351
+
288
352
  ## Available Components
289
353
 
290
354
  ### Layout & Structure
@@ -342,6 +406,72 @@ function App() {
342
406
  - **Toggle** - Toggle button
343
407
  - **Toggle Group** - Group of toggle buttons
344
408
 
409
+ ## Component Dependencies
410
+
411
+ All peer dependencies are **optional** - only install what you need based on the components you use.
412
+
413
+ ### Core Dependencies (Required for Most Components)
414
+
415
+ ```bash
416
+ npm install @rn-primitives/slot @rn-primitives/types
417
+ ```
418
+
419
+ ### Component-Specific Dependencies
420
+
421
+ | Component | Required Packages | Notes |
422
+ |-----------|------------------|-------|
423
+ | **Accordion** | `@rn-primitives/accordion`<br/>`@rn-primitives/collapsible` | Collapsible content sections |
424
+ | **Alert** | None | Always available |
425
+ | **Alert-Dialog** | `@rn-primitives/alert-dialog`<br/>`@rn-primitives/portal` | Confirmation dialogs |
426
+ | **AppBar** | None | Always available |
427
+ | **Aspect-Ratio** | `@rn-primitives/aspect-ratio` | Fixed aspect ratio containers |
428
+ | **Avatar** | `@rn-primitives/avatar` | User avatars with fallback |
429
+ | **Badge** | None | Always available |
430
+ | **Bottom-Sheet** | `@gorhom/bottom-sheet`<br/>`react-native-reanimated`<br/>`react-native-gesture-handler` | Bottom sheet modals |
431
+ | **Button** | `@rn-primitives/slot` | Always available with slot |
432
+ | **Card** | None | Always available |
433
+ | **Checkbox** | `@rn-primitives/checkbox` | Checkbox inputs |
434
+ | **Collapsible** | `@rn-primitives/collapsible` | Expandable content |
435
+ | **Context-Menu** | `@rn-primitives/context-menu` | Right-click menus |
436
+ | **Custom-Card** | None | Always available |
437
+ | **Dialog** | `@rn-primitives/dialog`<br/>`@rn-primitives/portal` | Modal dialogs |
438
+ | **Dropdown-Menu** | `@rn-primitives/dropdown-menu` | Dropdown menus |
439
+ | **Floating-Action** | `react-native-floating-action` | Floating action button |
440
+ | **Greeting-Card** | None | Always available |
441
+ | **Hover-Card** | `@rn-primitives/hover-card` | Hover-triggered cards |
442
+ | **Icon** | `lucide-react-native`<br/>`react-native-svg` | Icon library |
443
+ | **Input** | None | Always available |
444
+ | **Label** | `@rn-primitives/label` | Form labels |
445
+ | **Menubar** | `@rn-primitives/menubar` | Menu bars |
446
+ | **Native-Only-Animated-View** | `react-native-reanimated` | Animated views |
447
+ | **NavBar** | None | Always available |
448
+ | **Popover** | `@rn-primitives/popover` | Floating popovers |
449
+ | **Progress** | `@rn-primitives/progress` | Progress bars |
450
+ | **Radio-Group** | `@rn-primitives/radio-group` | Radio button groups |
451
+ | **Select** | `@rn-primitives/select` | Dropdown selects |
452
+ | **Separator** | None | Always available |
453
+ | **SizedBox** | None | Always available |
454
+ | **Skeleton** | None | Always available (loading states) |
455
+ | **Slider** | `@rn-primitives/slider` | Range sliders |
456
+ | **Switch** | `@rn-primitives/switch` | Toggle switches |
457
+ | **Table** | None | Always available |
458
+ | **Tabs** | `@rn-primitives/tabs` | Tab navigation |
459
+ | **Text** | None | Always available |
460
+ | **Textarea** | None | Always available |
461
+ | **Theme-Toggle** | None | Always available |
462
+ | **Toast** | Custom implementation | Toast notifications |
463
+ | **Toggle** | `@rn-primitives/toggle` | Toggle buttons |
464
+ | **Toggle-Group** | `@rn-primitives/toggle-group` | Toggle button groups |
465
+ | **Tooltip** | `@rn-primitives/tooltip` | Hover tooltips |
466
+
467
+ ### Install All Optional Dependencies (For All Components)
468
+
469
+ If you want to use all components without worrying about individual dependencies:
470
+
471
+ ```bash
472
+ npm install @rn-primitives/accordion @rn-primitives/alert-dialog @rn-primitives/aspect-ratio @rn-primitives/avatar @rn-primitives/checkbox @rn-primitives/collapsible @rn-primitives/context-menu @rn-primitives/dialog @rn-primitives/dropdown-menu @rn-primitives/hover-card @rn-primitives/label @rn-primitives/menubar @rn-primitives/popover @rn-primitives/portal @rn-primitives/progress @rn-primitives/radio-group @rn-primitives/select @rn-primitives/separator @rn-primitives/slider @rn-primitives/slot @rn-primitives/switch @rn-primitives/tabs @rn-primitives/toggle @rn-primitives/toggle-group @rn-primitives/tooltip @rn-primitives/types @gorhom/bottom-sheet react-native-worklets
473
+ ```
474
+
345
475
  ## Theming
346
476
 
347
477
  Components use CSS variables for theming. Customize your app's appearance by modifying the CSS variables in `global.css`: