@placesapp/appy-ui 0.0.1
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 +242 -0
- package/dist/index.d.ts +784 -0
- package/dist/index.js +6105 -0
- package/dist/styles/base.css +135 -0
- package/dist/styles/index.css +13 -0
- package/dist/styles/ios.css +65 -0
- package/dist/styles/material.css +66 -0
- package/dist/styles/overrides.css +32 -0
- package/package.json +90 -0
package/README.md
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
# appy-ui
|
|
2
|
+
|
|
3
|
+
A React component library with iOS Liquid Glass and Material 3 design system support. Built with Tailwind CSS 4, supporting automatic platform detection and adaptive styling.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install appy-ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Peer Dependencies
|
|
12
|
+
|
|
13
|
+
Make sure you have these peer dependencies installed:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install react react-dom tailwindcss
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Optional Peer Dependencies
|
|
20
|
+
|
|
21
|
+
Some components require additional packages:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# For Calendar component
|
|
25
|
+
npm install react-day-picker
|
|
26
|
+
|
|
27
|
+
# For Carousel component
|
|
28
|
+
npm install embla-carousel-react
|
|
29
|
+
|
|
30
|
+
# For Chart components
|
|
31
|
+
npm install recharts
|
|
32
|
+
|
|
33
|
+
# For Form components
|
|
34
|
+
npm install @tanstack/react-form
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Setup
|
|
38
|
+
|
|
39
|
+
### 1. CSS Configuration
|
|
40
|
+
|
|
41
|
+
Add the following imports to your project's main CSS file (e.g., `globals.css`):
|
|
42
|
+
|
|
43
|
+
```css
|
|
44
|
+
@import "tailwindcss";
|
|
45
|
+
@import "appy-ui/styles.css";
|
|
46
|
+
@source "../node_modules/appy-ui/dist/**/*.js";
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 2. Provider Setup
|
|
50
|
+
|
|
51
|
+
Wrap your app with the `DesignSystemProvider`:
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
import { DesignSystemProvider } from 'appy-ui';
|
|
55
|
+
|
|
56
|
+
function App() {
|
|
57
|
+
return (
|
|
58
|
+
<DesignSystemProvider>
|
|
59
|
+
<YourApp />
|
|
60
|
+
</DesignSystemProvider>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Usage
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
import { Button, Card, CardContent, CardHeader, CardTitle } from 'appy-ui';
|
|
69
|
+
|
|
70
|
+
function MyComponent() {
|
|
71
|
+
return (
|
|
72
|
+
<Card>
|
|
73
|
+
<CardHeader>
|
|
74
|
+
<CardTitle>Welcome</CardTitle>
|
|
75
|
+
</CardHeader>
|
|
76
|
+
<CardContent>
|
|
77
|
+
<Button>Click me</Button>
|
|
78
|
+
</CardContent>
|
|
79
|
+
</Card>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Design System
|
|
85
|
+
|
|
86
|
+
The library automatically detects the user's platform and applies the appropriate design system:
|
|
87
|
+
|
|
88
|
+
- **iOS devices**: iOS Liquid Glass styling (`.ios` class)
|
|
89
|
+
- **Android devices**: Material 3 styling (`.material` class)
|
|
90
|
+
- **Desktop**: Default styling
|
|
91
|
+
|
|
92
|
+
You can also manually set the design system:
|
|
93
|
+
|
|
94
|
+
```tsx
|
|
95
|
+
import { useDesignSystem } from 'appy-ui';
|
|
96
|
+
|
|
97
|
+
function Settings() {
|
|
98
|
+
const { designSystem, setDesignSystem, isAuto } = useDesignSystem();
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<div>
|
|
102
|
+
<p>Current: {designSystem}</p>
|
|
103
|
+
<button onClick={() => setDesignSystem('auto')}>Auto</button>
|
|
104
|
+
<button onClick={() => setDesignSystem('ios')}>iOS</button>
|
|
105
|
+
<button onClick={() => setDesignSystem('material')}>Material</button>
|
|
106
|
+
</div>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Platform-Specific Styling
|
|
112
|
+
|
|
113
|
+
Use Tailwind CSS custom variants for platform-specific styles:
|
|
114
|
+
|
|
115
|
+
```tsx
|
|
116
|
+
<div className="bg-white ios:bg-glass-bg material:bg-m3-surface">
|
|
117
|
+
Content
|
|
118
|
+
</div>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Layout Components
|
|
122
|
+
|
|
123
|
+
### TabBar
|
|
124
|
+
|
|
125
|
+
Adaptive navigation that changes based on platform/form factor:
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
import { TabBar, type TabItem } from 'appy-ui';
|
|
129
|
+
import { Link, useRouterState } from '@tanstack/react-router';
|
|
130
|
+
|
|
131
|
+
const items: TabItem[] = [
|
|
132
|
+
{ id: 'home', label: 'Home', path: '/', icon: HomeIcon, activeIcon: HomeFilledIcon },
|
|
133
|
+
{ id: 'profile', label: 'Profile', path: '/profile', icon: UserIcon, activeIcon: UserFilledIcon },
|
|
134
|
+
];
|
|
135
|
+
|
|
136
|
+
function Navigation() {
|
|
137
|
+
const { location } = useRouterState();
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
<TabBar
|
|
141
|
+
items={items}
|
|
142
|
+
currentPath={location.pathname}
|
|
143
|
+
LinkComponent={Link}
|
|
144
|
+
/>
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Header
|
|
150
|
+
|
|
151
|
+
Adaptive header with scroll animation support:
|
|
152
|
+
|
|
153
|
+
```tsx
|
|
154
|
+
import { Header, SecondaryPageHeader, TabPageHeader } from 'appy-ui';
|
|
155
|
+
|
|
156
|
+
// For secondary pages (with back button)
|
|
157
|
+
<SecondaryPageHeader title="Settings" onBack={() => navigate(-1)} />
|
|
158
|
+
|
|
159
|
+
// For tab pages (with animated title)
|
|
160
|
+
<TabPageHeader title="Home" />
|
|
161
|
+
|
|
162
|
+
// Custom composition
|
|
163
|
+
<Header.Root>
|
|
164
|
+
<Header.BackButton onClick={handleBack} />
|
|
165
|
+
<Header.AnimatedTitle>My Page</Header.AnimatedTitle>
|
|
166
|
+
<Header.TrailingAction>
|
|
167
|
+
<button>Action</button>
|
|
168
|
+
</Header.TrailingAction>
|
|
169
|
+
</Header.Root>
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Components
|
|
173
|
+
|
|
174
|
+
### UI Components (55+)
|
|
175
|
+
|
|
176
|
+
- Accordion
|
|
177
|
+
- Alert, AlertDialog
|
|
178
|
+
- AspectRatio
|
|
179
|
+
- Avatar (with Badge, Group)
|
|
180
|
+
- Badge
|
|
181
|
+
- Breadcrumb
|
|
182
|
+
- Button, ButtonGroup
|
|
183
|
+
- Calendar
|
|
184
|
+
- Card
|
|
185
|
+
- Carousel
|
|
186
|
+
- Chart
|
|
187
|
+
- Checkbox
|
|
188
|
+
- Collapsible
|
|
189
|
+
- Combobox
|
|
190
|
+
- Command
|
|
191
|
+
- ContextMenu
|
|
192
|
+
- Dialog
|
|
193
|
+
- Drawer
|
|
194
|
+
- DropdownMenu
|
|
195
|
+
- Empty
|
|
196
|
+
- Field (form)
|
|
197
|
+
- HoverCard
|
|
198
|
+
- Input, InputGroup, InputOTP
|
|
199
|
+
- Item
|
|
200
|
+
- Kbd
|
|
201
|
+
- Label
|
|
202
|
+
- Menubar
|
|
203
|
+
- NativeSelect
|
|
204
|
+
- NavigationMenu
|
|
205
|
+
- Pagination
|
|
206
|
+
- Popover
|
|
207
|
+
- Progress, ProgressiveBlur
|
|
208
|
+
- RadioGroup
|
|
209
|
+
- Resizable
|
|
210
|
+
- ScrollArea
|
|
211
|
+
- Select
|
|
212
|
+
- Separator
|
|
213
|
+
- Sheet
|
|
214
|
+
- Sidebar
|
|
215
|
+
- Skeleton
|
|
216
|
+
- Slider
|
|
217
|
+
- Sonner (Toast)
|
|
218
|
+
- Spinner
|
|
219
|
+
- Switch
|
|
220
|
+
- Table
|
|
221
|
+
- Tabs
|
|
222
|
+
- Textarea
|
|
223
|
+
- Toggle, ToggleGroup
|
|
224
|
+
- Tooltip
|
|
225
|
+
|
|
226
|
+
### Layout Components
|
|
227
|
+
|
|
228
|
+
- TabBar (iOS, Android, Web variants)
|
|
229
|
+
- Header (with animated title)
|
|
230
|
+
- WebNavBar
|
|
231
|
+
- WebFooter
|
|
232
|
+
|
|
233
|
+
## Hooks
|
|
234
|
+
|
|
235
|
+
- `useDesignSystem()` - Access design system context
|
|
236
|
+
- `useDeviceContext()` - Platform, form factor, keyboard detection
|
|
237
|
+
- `useScrolled()` - Track scroll position
|
|
238
|
+
- `useIsMobile()` - Mobile breakpoint detection
|
|
239
|
+
|
|
240
|
+
## License
|
|
241
|
+
|
|
242
|
+
MIT
|