@appolabs/ui 0.1.4 → 0.1.6
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 +181 -0
- package/dist/index.cjs +473 -234
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +59 -8
- package/dist/index.d.ts +59 -8
- package/dist/index.js +465 -235
- package/dist/index.js.map +1 -1
- package/dist/tailwind/preset.cjs +18 -0
- package/dist/tailwind/preset.js +18 -0
- package/package.json +9 -2
- package/src/styles/variables.css +24 -0
- package/tailwind/preset.ts +18 -0
package/README.md
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# @appolabs/ui
|
|
2
|
+
|
|
3
|
+
React UI component library for Appo Labs, built with Radix UI primitives and Tailwind CSS. Features glassmorphism design system with full light/dark mode support.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @appolabs/ui
|
|
9
|
+
# or
|
|
10
|
+
yarn add @appolabs/ui
|
|
11
|
+
# or
|
|
12
|
+
pnpm add @appolabs/ui
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Setup
|
|
16
|
+
|
|
17
|
+
### 1. Import CSS Variables
|
|
18
|
+
|
|
19
|
+
Import the CSS variables in your main stylesheet before Tailwind directives:
|
|
20
|
+
|
|
21
|
+
```css
|
|
22
|
+
/* app.css or globals.css */
|
|
23
|
+
@import '@appolabs/ui/styles/variables.css';
|
|
24
|
+
|
|
25
|
+
@tailwind base;
|
|
26
|
+
@tailwind components;
|
|
27
|
+
@tailwind utilities;
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 2. Configure Tailwind CSS
|
|
31
|
+
|
|
32
|
+
Use the `@appolabs/ui` preset for full theme support including glass utilities:
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
// tailwind.config.js
|
|
36
|
+
import { appolabsUIPreset } from '@appolabs/ui/tailwind';
|
|
37
|
+
|
|
38
|
+
export default {
|
|
39
|
+
presets: [appolabsUIPreset],
|
|
40
|
+
content: [
|
|
41
|
+
// ... your content paths
|
|
42
|
+
'./node_modules/@appolabs/ui/dist/**/*.{js,cjs}',
|
|
43
|
+
],
|
|
44
|
+
// ... rest of your config
|
|
45
|
+
};
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The preset includes:
|
|
49
|
+
- Color system (primary, secondary, muted, accent, destructive)
|
|
50
|
+
- Glass colors and utilities (`bg-glass`, `backdrop-blur-glass`, `shadow-glass`)
|
|
51
|
+
- Appo brand colors
|
|
52
|
+
- Animations (accordion, fade, scale, shimmer, glow-pulse)
|
|
53
|
+
- Border radius tokens
|
|
54
|
+
|
|
55
|
+
### 3. Add Toaster Component
|
|
56
|
+
|
|
57
|
+
Add the `<Toaster />` component at the root of your app for toast notifications:
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
// app.tsx or layout.tsx
|
|
61
|
+
import { Toaster } from '@appolabs/ui';
|
|
62
|
+
|
|
63
|
+
function App({ children }) {
|
|
64
|
+
return (
|
|
65
|
+
<>
|
|
66
|
+
{children}
|
|
67
|
+
<Toaster />
|
|
68
|
+
</>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Usage
|
|
74
|
+
|
|
75
|
+
### Basic Components
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
import { Button, Input, Card } from '@appolabs/ui';
|
|
79
|
+
|
|
80
|
+
function MyForm() {
|
|
81
|
+
return (
|
|
82
|
+
<Card>
|
|
83
|
+
<Input placeholder="Enter your email" />
|
|
84
|
+
<Button>Submit</Button>
|
|
85
|
+
</Card>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Glass Components
|
|
91
|
+
|
|
92
|
+
Glass components provide a frosted glass aesthetic with backdrop blur:
|
|
93
|
+
|
|
94
|
+
```tsx
|
|
95
|
+
import { GlassCard, Input } from '@appolabs/ui';
|
|
96
|
+
|
|
97
|
+
function AuthForm() {
|
|
98
|
+
return (
|
|
99
|
+
<GlassCard variant="auth" padding="lg">
|
|
100
|
+
<Input variant="glass" placeholder="Email" />
|
|
101
|
+
<Input variant="glass" type="password" placeholder="Password" />
|
|
102
|
+
<Button>Sign In</Button>
|
|
103
|
+
</GlassCard>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Toast Notifications
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
import { useToast } from '@appolabs/ui';
|
|
112
|
+
|
|
113
|
+
function MyComponent() {
|
|
114
|
+
const { toast } = useToast();
|
|
115
|
+
|
|
116
|
+
const handleClick = () => {
|
|
117
|
+
toast({
|
|
118
|
+
title: 'Success',
|
|
119
|
+
description: 'Operation completed',
|
|
120
|
+
variant: 'default', // or 'destructive'
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
return <Button onClick={handleClick}>Submit</Button>;
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Components
|
|
129
|
+
|
|
130
|
+
### Core Components
|
|
131
|
+
- Accordion
|
|
132
|
+
- Alert Dialog
|
|
133
|
+
- Avatar
|
|
134
|
+
- Button
|
|
135
|
+
- Card
|
|
136
|
+
- Checkbox
|
|
137
|
+
- Dialog
|
|
138
|
+
- Dropdown Menu
|
|
139
|
+
- Form (with react-hook-form integration)
|
|
140
|
+
- Input (with `glass` variant)
|
|
141
|
+
- Label
|
|
142
|
+
- Popover
|
|
143
|
+
- Progress
|
|
144
|
+
- Radio Group
|
|
145
|
+
- Select
|
|
146
|
+
- Separator (with `glass` variant)
|
|
147
|
+
- Slider
|
|
148
|
+
- Switch
|
|
149
|
+
- Tabs
|
|
150
|
+
- Textarea
|
|
151
|
+
- Toast / Toaster
|
|
152
|
+
- Tooltip
|
|
153
|
+
|
|
154
|
+
### Glass Components
|
|
155
|
+
- GlassCard - Translucent card with backdrop blur
|
|
156
|
+
- Input `variant="glass"` - Glass-styled input field
|
|
157
|
+
- Separator `variant="glass"` - Glass-styled separator
|
|
158
|
+
|
|
159
|
+
## Theme Customization
|
|
160
|
+
|
|
161
|
+
The library uses CSS variables for theming. Override them in your CSS:
|
|
162
|
+
|
|
163
|
+
```css
|
|
164
|
+
:root {
|
|
165
|
+
--primary: 230 100% 77%;
|
|
166
|
+
--primary-foreground: 230 30% 15%;
|
|
167
|
+
/* ... other variables */
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.dark {
|
|
171
|
+
--primary: 230 100% 77%;
|
|
172
|
+
--primary-foreground: 230 30% 10%;
|
|
173
|
+
/* ... dark mode variables */
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
See `@appolabs/ui/styles/variables.css` for all available variables.
|
|
178
|
+
|
|
179
|
+
## License
|
|
180
|
+
|
|
181
|
+
MIT
|