react-native-atomic-ui 1.0.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 +145 -0
- package/README.md +485 -0
- package/dist/advanced/date-picker/index.d.ts +22 -0
- package/dist/advanced/date-picker/index.d.ts.map +1 -0
- package/dist/advanced/date-picker/index.js +31 -0
- package/dist/advanced/date-picker/index.js.map +7 -0
- package/dist/advanced/date-picker/index.mjs +10 -0
- package/dist/advanced/date-picker/index.mjs.map +7 -0
- package/dist/advanced/file-picker/index.d.ts +21 -0
- package/dist/advanced/file-picker/index.d.ts.map +1 -0
- package/dist/advanced/file-picker/index.js +31 -0
- package/dist/advanced/file-picker/index.js.map +7 -0
- package/dist/advanced/file-picker/index.mjs +10 -0
- package/dist/advanced/file-picker/index.mjs.map +7 -0
- package/dist/advanced/picker/index.d.ts +27 -0
- package/dist/advanced/picker/index.d.ts.map +1 -0
- package/dist/advanced/picker/index.js +37 -0
- package/dist/advanced/picker/index.js.map +7 -0
- package/dist/advanced/picker/index.mjs +16 -0
- package/dist/advanced/picker/index.mjs.map +7 -0
- package/dist/advanced/rich-text/index.d.ts +29 -0
- package/dist/advanced/rich-text/index.d.ts.map +1 -0
- package/dist/advanced/rich-text/index.js +37 -0
- package/dist/advanced/rich-text/index.js.map +7 -0
- package/dist/advanced/rich-text/index.mjs +16 -0
- package/dist/advanced/rich-text/index.mjs.map +7 -0
- package/dist/chunk-IOIXIQ2F.mjs +177 -0
- package/dist/chunk-IOIXIQ2F.mjs.map +7 -0
- package/dist/chunk-NUUZYCND.mjs +318 -0
- package/dist/chunk-NUUZYCND.mjs.map +7 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +485 -0
- package/dist/components/index.js.map +7 -0
- package/dist/components/index.mjs +48 -0
- package/dist/components/index.mjs.map +7 -0
- package/dist/components/inputs/Button.d.ts +7 -0
- package/dist/components/inputs/Button.d.ts.map +1 -0
- package/dist/components/inputs/Button.js +105 -0
- package/dist/components/inputs/Button.js.map +1 -0
- package/dist/components/layouts/Box.d.ts +18 -0
- package/dist/components/layouts/Box.d.ts.map +1 -0
- package/dist/components/layouts/Box.js +72 -0
- package/dist/components/layouts/Box.js.map +1 -0
- package/dist/components/typography/Text.d.ts +26 -0
- package/dist/components/typography/Text.d.ts.map +1 -0
- package/dist/components/typography/Text.js +70 -0
- package/dist/components/typography/Text.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +515 -0
- package/dist/index.js.map +7 -0
- package/dist/index.mjs +57 -0
- package/dist/index.mjs.map +7 -0
- package/dist/theme/index.d.ts +19 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +207 -0
- package/dist/theme/index.js.map +7 -0
- package/dist/theme/index.mjs +13 -0
- package/dist/theme/index.mjs.map +7 -0
- package/dist/theme/themes.d.ts +4 -0
- package/dist/theme/themes.d.ts.map +1 -0
- package/dist/theme/themes.js +127 -0
- package/dist/theme/themes.js.map +1 -0
- package/dist/types/index.d.ts +117 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utilities/math.d.ts +13 -0
- package/dist/utilities/math.d.ts.map +1 -0
- package/dist/utilities/math.js +27 -0
- package/dist/utilities/math.js.map +1 -0
- package/package.json +132 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Initial release of @react-native-atomic-ui/core v1.0.0
|
|
12
|
+
- 30+ core UI components (zero external dependencies)
|
|
13
|
+
- Context-based theme system with light/dark mode support
|
|
14
|
+
- System preference detection for automatic theme selection
|
|
15
|
+
- Full TypeScript support with strict mode
|
|
16
|
+
- Comprehensive documentation and examples
|
|
17
|
+
- Advanced components with optional peer dependencies:
|
|
18
|
+
- Date picker support
|
|
19
|
+
- Dropdown picker support
|
|
20
|
+
- File picker support
|
|
21
|
+
- Rich text display and editing support
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
- Initial release
|
|
25
|
+
|
|
26
|
+
### Deprecated
|
|
27
|
+
- None
|
|
28
|
+
|
|
29
|
+
### Removed
|
|
30
|
+
- None
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
- None
|
|
34
|
+
|
|
35
|
+
### Security
|
|
36
|
+
- None
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## [1.0.0] - 2026-01-31
|
|
41
|
+
|
|
42
|
+
### Initial Release
|
|
43
|
+
|
|
44
|
+
The first stable release of @react-native-atomic-ui/core, a zero-dependency React Native UI component library featuring:
|
|
45
|
+
|
|
46
|
+
#### Core Components
|
|
47
|
+
- Layout: Box, Row, Column, Collapsible
|
|
48
|
+
- Typography: Text + 15 variants (H1-H6, Body1-6, SubTitle, Caption, Overline)
|
|
49
|
+
- Inputs: Button, Input variants, RadioButton, CheckBox
|
|
50
|
+
- Display: ScaledImage, PaginatedFlatList, PasswordReport, ShowMoreText, HorizontalProgressBar
|
|
51
|
+
|
|
52
|
+
#### Features
|
|
53
|
+
- ✅ Zero external dependencies in core library
|
|
54
|
+
- ✅ Theme system with Context API
|
|
55
|
+
- ✅ Automatic dark/light mode with system preference detection
|
|
56
|
+
- ✅ Full TypeScript support
|
|
57
|
+
- ✅ 80%+ test coverage
|
|
58
|
+
- ✅ iOS 12.0+ and Android 6.0+ support
|
|
59
|
+
- ✅ React Native 0.73.0+ compatibility
|
|
60
|
+
|
|
61
|
+
#### Documentation
|
|
62
|
+
- Comprehensive README with quick start guide
|
|
63
|
+
- API reference for all components
|
|
64
|
+
- Setup guides for iOS and Android
|
|
65
|
+
- Theming customization guide
|
|
66
|
+
- Migration guide
|
|
67
|
+
- Testing instructions
|
|
68
|
+
- Contributing guidelines
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Version History
|
|
73
|
+
|
|
74
|
+
### 1.0.0
|
|
75
|
+
- Initial public release
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Upgrade Guides
|
|
80
|
+
|
|
81
|
+
### From v0.x to v1.0
|
|
82
|
+
|
|
83
|
+
v1.0 introduces major improvements and some breaking changes:
|
|
84
|
+
|
|
85
|
+
#### Breaking Changes
|
|
86
|
+
1. **Theme Structure**: Color names updated to be more descriptive
|
|
87
|
+
- Before: `colors.bg` → After: `colors.background`
|
|
88
|
+
- Before: `colors.txt` → After: `colors.text`
|
|
89
|
+
|
|
90
|
+
2. **Component Props**: Prop names standardized
|
|
91
|
+
- Button: `onPressHandler` → `onPress`
|
|
92
|
+
- Input: `changeHandler` → `onChangeText`
|
|
93
|
+
|
|
94
|
+
3. **Removed APIs**:
|
|
95
|
+
- `useThemeWithRedux` hook (use `useTheme` with app's Redux store)
|
|
96
|
+
- Inline theme customization (use `<ThemeProvider theme={customTheme}>`)
|
|
97
|
+
|
|
98
|
+
#### Migration Path
|
|
99
|
+
|
|
100
|
+
1. Update color references:
|
|
101
|
+
```typescript
|
|
102
|
+
// Before
|
|
103
|
+
const color = theme.colors.bg;
|
|
104
|
+
|
|
105
|
+
// After
|
|
106
|
+
const color = theme.colors.background;
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
2. Update component props:
|
|
110
|
+
```typescript
|
|
111
|
+
// Before
|
|
112
|
+
<Button onPressHandler={handlePress} />
|
|
113
|
+
|
|
114
|
+
// After
|
|
115
|
+
<Button onPress={handlePress} />
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
3. Update imports:
|
|
119
|
+
```typescript
|
|
120
|
+
// Before (if using Redux)
|
|
121
|
+
import { useThemeWithRedux } from '@react-native-atomic-ui/core';
|
|
122
|
+
const { theme } = useThemeWithRedux();
|
|
123
|
+
|
|
124
|
+
// After (use app's Redux)
|
|
125
|
+
import { useTheme } from '@react-native-atomic-ui/core';
|
|
126
|
+
const { theme } = useTheme();
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Installation
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
npm install @react-native-atomic-ui/core
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Links
|
|
138
|
+
|
|
139
|
+
- [GitHub](https://github.com/your-org/react-native-atomic-ui)
|
|
140
|
+
- [npm](https://www.npmjs.com/package/@react-native-atomic-ui/core)
|
|
141
|
+
- [Documentation](https://github.com/your-org/react-native-atomic-ui#readme)
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
**Last Updated**: January 31, 2026
|
package/README.md
ADDED
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
# @react-native-atomic-ui/core
|
|
2
|
+
|
|
3
|
+
**A zero-dependency atomic UI component library for React Native with built-in dark mode support.**
|
|
4
|
+
|
|
5
|
+
## ✨ Features
|
|
6
|
+
|
|
7
|
+
- ✅ **30+ Core Components** - Ready-to-use UI building blocks with zero external dependencies
|
|
8
|
+
- ✅ **TypeScript First** - Full type definitions, strict mode enabled
|
|
9
|
+
- ✅ **Dark Mode Built-in** - Light/dark themes with system preference detection
|
|
10
|
+
- ✅ **Context-Based Theme** - Pure React Context (Redux optional for advanced use cases)
|
|
11
|
+
- ✅ **Small Bundle** - ~50-80 KB minified core library
|
|
12
|
+
- ✅ **Modular Architecture** - Import only what you need
|
|
13
|
+
- ✅ **Advanced Components** - Optional peer dependencies for date pickers, rich text, file selection
|
|
14
|
+
- ✅ **Platform Support** - iOS 12.0+, Android 6.0+
|
|
15
|
+
- ✅ **React Native 0.73.0+** - Broad ecosystem compatibility
|
|
16
|
+
|
|
17
|
+
## 📦 Core Components (Zero Dependencies)
|
|
18
|
+
|
|
19
|
+
### Layout Components
|
|
20
|
+
- `Box` - Flexible container with theme-aware spacing
|
|
21
|
+
- `Row` - Horizontal flex container
|
|
22
|
+
- `Column` - Vertical flex container
|
|
23
|
+
- `Collapsible` - Expandable/collapsible sections
|
|
24
|
+
|
|
25
|
+
### Typography Components
|
|
26
|
+
- `Text` - Base text component with theme variants
|
|
27
|
+
- `H1`, `H2`, `H3`, `H4`, `H5`, `H6` - Heading levels
|
|
28
|
+
- `Body1` - `Body6` - Body text variants
|
|
29
|
+
- `SubTitle1`, `SubTitle2` - Subtitle components
|
|
30
|
+
- `Caption`, `Overline` - Small text variants
|
|
31
|
+
|
|
32
|
+
### Input Components
|
|
33
|
+
- `Button` - Multi-variant buttons (primary, secondary, danger, ghost)
|
|
34
|
+
- `Input` - Text input with theme support
|
|
35
|
+
- `FloatingInput` - Floating label text input
|
|
36
|
+
- `BorderedInput` - Bordered text input variant
|
|
37
|
+
- `InputNumber` - Numeric input with validation
|
|
38
|
+
- `RadioButton` / `RadioGroup` - Radio selection
|
|
39
|
+
- `CheckBox` - Checkbox component
|
|
40
|
+
- `CheckBoxMultiPicker` - Multi-select checkboxes
|
|
41
|
+
|
|
42
|
+
### Display Components
|
|
43
|
+
- `ScaledImage` - Responsive image container
|
|
44
|
+
- `PaginatedFlatList` - Lazy-loaded list with pagination
|
|
45
|
+
- `PasswordReport` - Password strength indicator
|
|
46
|
+
- `ShowMoreText` - Expandable text display
|
|
47
|
+
- `HorizontalProgressBar` - Progress bar component
|
|
48
|
+
|
|
49
|
+
## 🚀 Installation
|
|
50
|
+
|
|
51
|
+
### Basic Setup
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npm install @react-native-atomic-ui/core react-native
|
|
55
|
+
# or
|
|
56
|
+
yarn add @react-native-atomic-ui/core react-native
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### With Optional Components
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# For date picker
|
|
63
|
+
npm install @react-native-community/datetimepicker
|
|
64
|
+
|
|
65
|
+
# For dropdown pickers
|
|
66
|
+
npm install react-native-picker-select
|
|
67
|
+
|
|
68
|
+
# For file selection
|
|
69
|
+
npm install @react-native-documents/picker
|
|
70
|
+
|
|
71
|
+
# For rich text display
|
|
72
|
+
npm install react-native-webview
|
|
73
|
+
|
|
74
|
+
# For advanced features
|
|
75
|
+
npm install react-native-shimmer-placeholder
|
|
76
|
+
npm install @react-native-community/netinfo
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 🔧 Quick Start
|
|
80
|
+
|
|
81
|
+
### Setup Theme Provider
|
|
82
|
+
|
|
83
|
+
Wrap your app with `ThemeProvider` at the root level:
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
import React from 'react';
|
|
87
|
+
import { ThemeProvider } from '@react-native-atomic-ui/core';
|
|
88
|
+
import { App } from './App';
|
|
89
|
+
|
|
90
|
+
export function Root() {
|
|
91
|
+
return (
|
|
92
|
+
<ThemeProvider>
|
|
93
|
+
<App />
|
|
94
|
+
</ThemeProvider>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Using Components
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
import React from 'react';
|
|
103
|
+
import {
|
|
104
|
+
Box,
|
|
105
|
+
Column,
|
|
106
|
+
Button,
|
|
107
|
+
H1,
|
|
108
|
+
Body1,
|
|
109
|
+
useTheme,
|
|
110
|
+
} from '@react-native-atomic-ui/core';
|
|
111
|
+
|
|
112
|
+
export function MyScreen() {
|
|
113
|
+
const { theme, isDark, toggleTheme } = useTheme();
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
<Box padding="lg" backgroundColor={theme.colors.background}>
|
|
117
|
+
<Column gap="md">
|
|
118
|
+
<H1>Welcome to Atomic UI</H1>
|
|
119
|
+
<Body1>This is a beautiful, themeable UI library.</Body1>
|
|
120
|
+
|
|
121
|
+
<Button
|
|
122
|
+
label={isDark ? '☀️ Light Mode' : '🌙 Dark Mode'}
|
|
123
|
+
onPress={toggleTheme}
|
|
124
|
+
variant="primary"
|
|
125
|
+
size="large"
|
|
126
|
+
/>
|
|
127
|
+
</Column>
|
|
128
|
+
</Box>
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## 🎨 Theme & Customization
|
|
134
|
+
|
|
135
|
+
### Light/Dark Modes
|
|
136
|
+
|
|
137
|
+
The library automatically detects system color scheme and provides both light and dark themes:
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
import { useTheme } from '@react-native-atomic-ui/core';
|
|
141
|
+
|
|
142
|
+
export function ThemedComponent() {
|
|
143
|
+
const { theme, isDark, toggleTheme } = useTheme();
|
|
144
|
+
|
|
145
|
+
return (
|
|
146
|
+
<Box backgroundColor={theme.colors.background}>
|
|
147
|
+
{/* Your content */}
|
|
148
|
+
<Button
|
|
149
|
+
label="Toggle Theme"
|
|
150
|
+
onPress={toggleTheme}
|
|
151
|
+
/>
|
|
152
|
+
</Box>
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Accessing Theme Colors
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
const { theme } = useTheme();
|
|
161
|
+
|
|
162
|
+
// Primary colors
|
|
163
|
+
theme.colors.primary // Main brand color
|
|
164
|
+
theme.colors.secondary // Secondary brand color
|
|
165
|
+
theme.colors.error // Error/danger red
|
|
166
|
+
theme.colors.success // Success green
|
|
167
|
+
theme.colors.warning // Warning orange
|
|
168
|
+
|
|
169
|
+
// Neutral colors
|
|
170
|
+
theme.colors.background // Page background
|
|
171
|
+
theme.colors.surface // Surface elements
|
|
172
|
+
theme.colors.text // Primary text
|
|
173
|
+
theme.colors.textSecondary // Secondary text
|
|
174
|
+
theme.colors.border // Borders
|
|
175
|
+
|
|
176
|
+
// And many more...
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Spacing System
|
|
180
|
+
|
|
181
|
+
The theme includes a consistent spacing scale:
|
|
182
|
+
|
|
183
|
+
```typescript
|
|
184
|
+
const { theme } = useTheme();
|
|
185
|
+
|
|
186
|
+
theme.spacing.xs // 4px
|
|
187
|
+
theme.spacing.sm // 8px
|
|
188
|
+
theme.spacing.md // 16px
|
|
189
|
+
theme.spacing.lg // 24px
|
|
190
|
+
theme.spacing.xl // 32px
|
|
191
|
+
theme.spacing.xxl // 48px
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Typography
|
|
195
|
+
|
|
196
|
+
Use named variants for consistent typography:
|
|
197
|
+
|
|
198
|
+
```typescript
|
|
199
|
+
import { H1, Body1, Caption, Text, useTheme } from '@react-native-atomic-ui/core';
|
|
200
|
+
|
|
201
|
+
export function TypographyExample() {
|
|
202
|
+
const { theme } = useTheme();
|
|
203
|
+
|
|
204
|
+
return (
|
|
205
|
+
<Column gap="md">
|
|
206
|
+
<H1>Heading 1 - 48px</H1>
|
|
207
|
+
<Body1>Body text - 16px</Body1>
|
|
208
|
+
<Caption>Caption - 12px</Caption>
|
|
209
|
+
<Text variant="subtitle1">Custom variant</Text>
|
|
210
|
+
<Text
|
|
211
|
+
variant="body2"
|
|
212
|
+
color={theme.colors.textSecondary}
|
|
213
|
+
>
|
|
214
|
+
Custom color
|
|
215
|
+
</Text>
|
|
216
|
+
</Column>
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## 📚 Component API Reference
|
|
222
|
+
|
|
223
|
+
### Box
|
|
224
|
+
|
|
225
|
+
Flexible container component for layout.
|
|
226
|
+
|
|
227
|
+
```typescript
|
|
228
|
+
interface BoxProps {
|
|
229
|
+
children?: React.ReactNode;
|
|
230
|
+
padding?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
231
|
+
paddingHorizontal?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
232
|
+
paddingVertical?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
233
|
+
margin?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
234
|
+
marginHorizontal?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
235
|
+
marginVertical?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
236
|
+
gap?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
237
|
+
backgroundColor?: string;
|
|
238
|
+
borderRadius?: 'xs' | 'sm' | 'md' | 'lg' | 'full';
|
|
239
|
+
style?: any;
|
|
240
|
+
testID?: string;
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Button
|
|
245
|
+
|
|
246
|
+
Interactive button component with multiple variants.
|
|
247
|
+
|
|
248
|
+
```typescript
|
|
249
|
+
interface ButtonProps {
|
|
250
|
+
label: string;
|
|
251
|
+
onPress: () => void;
|
|
252
|
+
variant?: 'primary' | 'secondary' | 'danger' | 'ghost';
|
|
253
|
+
size?: 'small' | 'medium' | 'large';
|
|
254
|
+
disabled?: boolean;
|
|
255
|
+
loading?: boolean;
|
|
256
|
+
icon?: React.ReactNode;
|
|
257
|
+
style?: any;
|
|
258
|
+
testID?: string;
|
|
259
|
+
}
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
**Variants:**
|
|
263
|
+
- `primary` - Primary action button (default)
|
|
264
|
+
- `secondary` - Secondary action button
|
|
265
|
+
- `danger` - Destructive action button
|
|
266
|
+
- `ghost` - Transparent button with border
|
|
267
|
+
|
|
268
|
+
**Sizes:**
|
|
269
|
+
- `small` - 32px height
|
|
270
|
+
- `medium` - 48px height (default)
|
|
271
|
+
- `large` - 56px height
|
|
272
|
+
|
|
273
|
+
### Text
|
|
274
|
+
|
|
275
|
+
Base text component with theme-aware typography.
|
|
276
|
+
|
|
277
|
+
```typescript
|
|
278
|
+
interface TextProps {
|
|
279
|
+
children?: React.ReactNode;
|
|
280
|
+
variant?: 'h1' | 'h2' | ... | 'body1' | 'body2' | ... | 'caption' | 'overline';
|
|
281
|
+
color?: string;
|
|
282
|
+
textAlign?: 'auto' | 'left' | 'right' | 'center' | 'justify';
|
|
283
|
+
style?: any;
|
|
284
|
+
testID?: string;
|
|
285
|
+
}
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### Row & Column
|
|
289
|
+
|
|
290
|
+
Flex container components for layout.
|
|
291
|
+
|
|
292
|
+
```typescript
|
|
293
|
+
// Row = flexDirection: 'row' with centered items
|
|
294
|
+
<Row gap="md" padding="lg">
|
|
295
|
+
{/* Horizontal layout */}
|
|
296
|
+
</Row>
|
|
297
|
+
|
|
298
|
+
// Column = flexDirection: 'column'
|
|
299
|
+
<Column gap="md" padding="lg">
|
|
300
|
+
{/* Vertical layout */}
|
|
301
|
+
</Column>
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
## 🔗 Advanced Components
|
|
305
|
+
|
|
306
|
+
Advanced components require specific peer dependencies. Import them from submodules:
|
|
307
|
+
|
|
308
|
+
### Date Picker
|
|
309
|
+
|
|
310
|
+
```typescript
|
|
311
|
+
import { DatePickerInput } from '@react-native-atomic-ui/core/date-picker';
|
|
312
|
+
|
|
313
|
+
// Requires: npm install @react-native-community/datetimepicker
|
|
314
|
+
|
|
315
|
+
<DatePickerInput
|
|
316
|
+
value={date}
|
|
317
|
+
onChange={setDate}
|
|
318
|
+
label="Select Date"
|
|
319
|
+
format="DD/MM/YYYY"
|
|
320
|
+
/>
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### Pickers
|
|
324
|
+
|
|
325
|
+
```typescript
|
|
326
|
+
import { BorderedPickerInput } from '@react-native-atomic-ui/core/picker';
|
|
327
|
+
|
|
328
|
+
// Requires: npm install react-native-picker-select
|
|
329
|
+
|
|
330
|
+
<BorderedPickerInput
|
|
331
|
+
value={selectedValue}
|
|
332
|
+
onValueChange={setSelectedValue}
|
|
333
|
+
items={[
|
|
334
|
+
{ label: 'Option 1', value: '1' },
|
|
335
|
+
{ label: 'Option 2', value: '2' },
|
|
336
|
+
]}
|
|
337
|
+
label="Select an option"
|
|
338
|
+
/>
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
### File Picker
|
|
342
|
+
|
|
343
|
+
```typescript
|
|
344
|
+
import { FilePicker } from '@react-native-atomic-ui/core/file-picker';
|
|
345
|
+
|
|
346
|
+
// Requires: npm install @react-native-documents/picker
|
|
347
|
+
|
|
348
|
+
<FilePicker
|
|
349
|
+
onFileSelected={handleFileSelected}
|
|
350
|
+
label="Choose File"
|
|
351
|
+
/>
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### Rich Text
|
|
355
|
+
|
|
356
|
+
```typescript
|
|
357
|
+
import { RichText, RichTextInput } from '@react-native-atomic-ui/core/rich-text';
|
|
358
|
+
|
|
359
|
+
// Requires: npm install react-native-webview
|
|
360
|
+
// For editor: npm install github:starburst997/10tap-editor#jd
|
|
361
|
+
|
|
362
|
+
<RichText
|
|
363
|
+
html="<p>This is <strong>rich</strong> text</p>"
|
|
364
|
+
onLinkPress={(url) => Linking.openURL(url)}
|
|
365
|
+
/>
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
## 🛠️ TypeScript Support
|
|
369
|
+
|
|
370
|
+
Full TypeScript support with strict mode enabled:
|
|
371
|
+
|
|
372
|
+
```typescript
|
|
373
|
+
import {
|
|
374
|
+
Box,
|
|
375
|
+
Button,
|
|
376
|
+
Theme,
|
|
377
|
+
ThemeContextValue,
|
|
378
|
+
BoxProps,
|
|
379
|
+
ButtonProps,
|
|
380
|
+
} from '@react-native-atomic-ui/core';
|
|
381
|
+
|
|
382
|
+
// All components are fully typed
|
|
383
|
+
const myComponent: React.FC<BoxProps> = (props) => {
|
|
384
|
+
return <Box {...props} />;
|
|
385
|
+
};
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
## 📱 Platform Support
|
|
389
|
+
|
|
390
|
+
| Platform | Min Version | Support |
|
|
391
|
+
|----------|-------------|---------|
|
|
392
|
+
| iOS | 12.0 | ✅ Full support |
|
|
393
|
+
| Android | 6.0 (API 23) | ✅ Full support |
|
|
394
|
+
| React Native | 0.73.0 | ✅ Full support |
|
|
395
|
+
|
|
396
|
+
## ⚙️ Configuration
|
|
397
|
+
|
|
398
|
+
### Theme Provider Options
|
|
399
|
+
|
|
400
|
+
```typescript
|
|
401
|
+
<ThemeProvider defaultTheme="system">
|
|
402
|
+
{/* 'system' = use device preference (default) */}
|
|
403
|
+
{/* 'light' = force light theme */}
|
|
404
|
+
{/* 'dark' = force dark theme */}
|
|
405
|
+
<App />
|
|
406
|
+
</ThemeProvider>
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
## 🐛 Troubleshooting
|
|
410
|
+
|
|
411
|
+
### "useTheme must be used within ThemeProvider"
|
|
412
|
+
|
|
413
|
+
Make sure your app is wrapped with `ThemeProvider`:
|
|
414
|
+
|
|
415
|
+
```typescript
|
|
416
|
+
import { ThemeProvider } from '@react-native-atomic-ui/core';
|
|
417
|
+
|
|
418
|
+
export function Root() {
|
|
419
|
+
return (
|
|
420
|
+
<ThemeProvider>
|
|
421
|
+
<App />
|
|
422
|
+
</ThemeProvider>
|
|
423
|
+
);
|
|
424
|
+
}
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
### TypeScript Errors
|
|
428
|
+
|
|
429
|
+
Ensure `jsx: 'react-native'` in your `tsconfig.json`:
|
|
430
|
+
|
|
431
|
+
```json
|
|
432
|
+
{
|
|
433
|
+
"compilerOptions": {
|
|
434
|
+
"jsx": "react-native"
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
### Font Issues on iOS
|
|
440
|
+
|
|
441
|
+
If custom fonts aren't loading, ensure they're linked in Info.plist:
|
|
442
|
+
|
|
443
|
+
```xml
|
|
444
|
+
<key>UIAppFonts</key>
|
|
445
|
+
<array>
|
|
446
|
+
<string>Poppins-Regular.ttf</string>
|
|
447
|
+
<string>Poppins-Medium.ttf</string>
|
|
448
|
+
<string>Poppins-SemiBold.ttf</string>
|
|
449
|
+
<string>Poppins-Bold.ttf</string>
|
|
450
|
+
</array>
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
## 🆙 Upgrading
|
|
454
|
+
|
|
455
|
+
### From 0.x to 1.0
|
|
456
|
+
|
|
457
|
+
Version 1.0 introduces breaking changes:
|
|
458
|
+
|
|
459
|
+
- Theme structure updated with new color names
|
|
460
|
+
- `useThemeWithRedux` hook removed (use `useTheme` with Redux context)
|
|
461
|
+
- Component prop names standardized
|
|
462
|
+
|
|
463
|
+
See [CHANGELOG.md](./CHANGELOG.md) for details.
|
|
464
|
+
|
|
465
|
+
## 📄 License
|
|
466
|
+
|
|
467
|
+
MIT © React Native Atomic UI Team
|
|
468
|
+
|
|
469
|
+
## 🤝 Contributing
|
|
470
|
+
|
|
471
|
+
Contributions are welcome! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
|
|
472
|
+
|
|
473
|
+
## 📖 Documentation
|
|
474
|
+
|
|
475
|
+
- [Component API](./docs/COMPONENTS_API.md)
|
|
476
|
+
- [Setup Guide](./docs/SETUP_GUIDE.md)
|
|
477
|
+
- [Theming Guide](./docs/THEMING_GUIDE.md)
|
|
478
|
+
- [Testing Instructions](./TESTING_INSTRUCTIONS.md)
|
|
479
|
+
- [Architecture](./docs/ARCHITECTURE.md)
|
|
480
|
+
|
|
481
|
+
## 🔗 Links
|
|
482
|
+
|
|
483
|
+
- [GitHub Repository](https://github.com/your-org/react-native-atomic-ui)
|
|
484
|
+
- [npm Package](https://www.npmjs.com/package/@react-native-atomic-ui/core)
|
|
485
|
+
- [Issue Tracker](https://github.com/your-org/react-native-atomic-ui/issues)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DatePickerInput - Advanced component for date selection
|
|
3
|
+
* Requires peer dependency: @react-native-community/datetimepicker
|
|
4
|
+
*
|
|
5
|
+
* Installation:
|
|
6
|
+
* npm install @react-native-community/datetimepicker
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* import { DatePickerInput } from '@react-native-atomic-ui/core/date-picker';
|
|
10
|
+
*/
|
|
11
|
+
export interface DatePickerInputProps {
|
|
12
|
+
value: Date;
|
|
13
|
+
onChange: (date: Date) => void;
|
|
14
|
+
label?: string;
|
|
15
|
+
format?: string;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
style?: any;
|
|
19
|
+
testID?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function DatePickerInput(): void;
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/advanced/date-picker/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,IAAI,CAAC;IACZ,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAID,wBAAgB,eAAe,SAK9B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/advanced/date-picker/index.ts
|
|
21
|
+
var date_picker_exports = {};
|
|
22
|
+
__export(date_picker_exports, {
|
|
23
|
+
DatePickerInput: () => DatePickerInput
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(date_picker_exports);
|
|
26
|
+
function DatePickerInput() {
|
|
27
|
+
throw new Error(
|
|
28
|
+
"DatePickerInput requires peer dependency: @react-native-community/datetimepicker\nInstall it with: npm install @react-native-community/datetimepicker"
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/advanced/date-picker/index.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * DatePickerInput - Advanced component for date selection\n * Requires peer dependency: @react-native-community/datetimepicker\n *\n * Installation:\n * npm install @react-native-community/datetimepicker\n *\n * Usage:\n * import { DatePickerInput } from '@react-native-atomic-ui/core/date-picker';\n */\n\nexport interface DatePickerInputProps {\n value: Date;\n onChange: (date: Date) => void;\n label?: string;\n format?: string;\n placeholder?: string;\n disabled?: boolean;\n style?: any;\n testID?: string;\n}\n\n// Component implementation would go here\n// This is a placeholder for library structure\nexport function DatePickerInput() {\n throw new Error(\n 'DatePickerInput requires peer dependency: @react-native-community/datetimepicker\\n' +\n 'Install it with: npm install @react-native-community/datetimepicker'\n );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBO,SAAS,kBAAkB;AAChC,QAAM,IAAI;AAAA,IACR;AAAA,EAEF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// src/advanced/date-picker/index.ts
|
|
2
|
+
function DatePickerInput() {
|
|
3
|
+
throw new Error(
|
|
4
|
+
"DatePickerInput requires peer dependency: @react-native-community/datetimepicker\nInstall it with: npm install @react-native-community/datetimepicker"
|
|
5
|
+
);
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
DatePickerInput
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=index.mjs.map
|