@rayvelez/findash-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/README.md +286 -0
- package/dist/index.d.mts +527 -0
- package/dist/index.d.ts +527 -0
- package/dist/index.js +1058 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1042 -0
- package/dist/index.mjs.map +1 -0
- package/dist/theme.css +188 -0
- package/package.json +66 -0
- package/tailwind.preset.js +97 -0
package/README.md
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
# @findash/ui
|
|
2
|
+
|
|
3
|
+
A modern financial dashboard design system built with React and Tailwind CSS. Features a vibrant green and purple color palette with dark mode support, liquid glass effects, and beautifully crafted dashboard components.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @findash/ui
|
|
9
|
+
# or
|
|
10
|
+
yarn add @findash/ui
|
|
11
|
+
# or
|
|
12
|
+
pnpm add @findash/ui
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Setup
|
|
16
|
+
|
|
17
|
+
### 1. Import the CSS
|
|
18
|
+
|
|
19
|
+
Add the theme CSS to your application's entry point:
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
// In your main.tsx or App.tsx
|
|
23
|
+
import "@findash/ui/styles";
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 2. Configure Tailwind
|
|
27
|
+
|
|
28
|
+
Add the preset to your `tailwind.config.ts`:
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import type { Config } from "tailwindcss";
|
|
32
|
+
import findashPreset from "@findash/ui/tailwind.preset";
|
|
33
|
+
|
|
34
|
+
export default {
|
|
35
|
+
presets: [findashPreset],
|
|
36
|
+
content: [
|
|
37
|
+
"./src/**/*.{ts,tsx}",
|
|
38
|
+
"./node_modules/@findash/ui/dist/**/*.{js,mjs}",
|
|
39
|
+
],
|
|
40
|
+
// ... rest of your config
|
|
41
|
+
} satisfies Config;
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 3. Add Google Fonts (Required)
|
|
45
|
+
|
|
46
|
+
Add to your `index.html`:
|
|
47
|
+
|
|
48
|
+
```html
|
|
49
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
50
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
51
|
+
<link
|
|
52
|
+
href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap"
|
|
53
|
+
rel="stylesheet"
|
|
54
|
+
/>
|
|
55
|
+
<link
|
|
56
|
+
href="https://fonts.googleapis.com/icon?family=Material+Icons+Round|Material+Icons+Outlined"
|
|
57
|
+
rel="stylesheet"
|
|
58
|
+
/>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Usage
|
|
62
|
+
|
|
63
|
+
### Complete Dashboard Template
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
import {
|
|
67
|
+
DashboardTemplate,
|
|
68
|
+
type DashboardData,
|
|
69
|
+
} from "@findash/ui";
|
|
70
|
+
|
|
71
|
+
const dashboardData: DashboardData = {
|
|
72
|
+
user: {
|
|
73
|
+
name: "Alex Morgan",
|
|
74
|
+
role: "Premium User",
|
|
75
|
+
avatarUrl: "https://example.com/avatar.jpg",
|
|
76
|
+
},
|
|
77
|
+
balance: {
|
|
78
|
+
currentBalance: 15368,
|
|
79
|
+
percentageChange: 14,
|
|
80
|
+
averageScore: 18324,
|
|
81
|
+
},
|
|
82
|
+
investmentGrowth: {
|
|
83
|
+
percentage: 8.2,
|
|
84
|
+
monthlyAverage: 12450,
|
|
85
|
+
totalValue: 24890,
|
|
86
|
+
},
|
|
87
|
+
btcPrice: {
|
|
88
|
+
price: 21105,
|
|
89
|
+
changePercentage: 28.21,
|
|
90
|
+
},
|
|
91
|
+
marketCap: {
|
|
92
|
+
value: "1,3trln$",
|
|
93
|
+
},
|
|
94
|
+
salesStatistics: {
|
|
95
|
+
visitors: 2025,
|
|
96
|
+
updatedDaysAgo: 1,
|
|
97
|
+
},
|
|
98
|
+
portfolio: [
|
|
99
|
+
{ asset: "Bitcoin", symbol: "BTC", percentage: 45, color: "bg-primary" },
|
|
100
|
+
{ asset: "Ethereum", symbol: "ETH", percentage: 30, color: "bg-secondary" },
|
|
101
|
+
{ asset: "Solana", symbol: "SOL", percentage: 15, color: "bg-foreground" },
|
|
102
|
+
{ asset: "Others", symbol: "---", percentage: 10, color: "bg-muted" },
|
|
103
|
+
],
|
|
104
|
+
watchlist: [
|
|
105
|
+
{ name: "Cardano", symbol: "ADA", price: "0.58", change: "+5.2%", positive: true },
|
|
106
|
+
{ name: "Polkadot", symbol: "DOT", price: "7.23", change: "-2.1%", positive: false },
|
|
107
|
+
],
|
|
108
|
+
forecasts: [
|
|
109
|
+
{ year: "2023", description: "Explosive growth of DeFi", completed: false },
|
|
110
|
+
{ year: "2024", description: "Mainstream adoption of CBDCs", completed: false },
|
|
111
|
+
],
|
|
112
|
+
transactions: {
|
|
113
|
+
summary: "12,53 ETH/1 BTC",
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
function App() {
|
|
118
|
+
return (
|
|
119
|
+
<DashboardTemplate
|
|
120
|
+
data={dashboardData}
|
|
121
|
+
onThemeToggle={() => console.log("Toggle theme")}
|
|
122
|
+
onNavItemClick={(item) => console.log("Clicked:", item)}
|
|
123
|
+
onActionClick={(action) => console.log("Action:", action)}
|
|
124
|
+
/>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Individual Components
|
|
130
|
+
|
|
131
|
+
```tsx
|
|
132
|
+
import {
|
|
133
|
+
SalesStatisticsCard,
|
|
134
|
+
CurrentBalanceCard,
|
|
135
|
+
BtcPriceCard,
|
|
136
|
+
PortfolioAllocationCard,
|
|
137
|
+
WatchlistCard,
|
|
138
|
+
FloatingNavBar,
|
|
139
|
+
Sidebar,
|
|
140
|
+
MobileNav,
|
|
141
|
+
} from "@findash/ui";
|
|
142
|
+
|
|
143
|
+
// Sales Statistics Card
|
|
144
|
+
<SalesStatisticsCard
|
|
145
|
+
visitors={2025}
|
|
146
|
+
updatedDaysAgo={1}
|
|
147
|
+
onPeriodChange={(period) => console.log(period)}
|
|
148
|
+
/>
|
|
149
|
+
|
|
150
|
+
// Current Balance Card
|
|
151
|
+
<CurrentBalanceCard
|
|
152
|
+
balance={15368}
|
|
153
|
+
percentageChange={14}
|
|
154
|
+
averageScore={18324}
|
|
155
|
+
onPrevious={() => {}}
|
|
156
|
+
onNext={() => {}}
|
|
157
|
+
/>
|
|
158
|
+
|
|
159
|
+
// BTC Price Card
|
|
160
|
+
<BtcPriceCard
|
|
161
|
+
price={21105}
|
|
162
|
+
changePercentage={28.21}
|
|
163
|
+
/>
|
|
164
|
+
|
|
165
|
+
// Portfolio Allocation Card
|
|
166
|
+
<PortfolioAllocationCard
|
|
167
|
+
allocations={[
|
|
168
|
+
{ asset: "Bitcoin", symbol: "BTC", percentage: 45, color: "bg-primary" },
|
|
169
|
+
{ asset: "Ethereum", symbol: "ETH", percentage: 30, color: "bg-secondary" },
|
|
170
|
+
]}
|
|
171
|
+
onOptionsClick={() => {}}
|
|
172
|
+
/>
|
|
173
|
+
|
|
174
|
+
// Watchlist Card
|
|
175
|
+
<WatchlistCard
|
|
176
|
+
items={[
|
|
177
|
+
{ name: "Cardano", symbol: "ADA", price: "0.58", change: "+5.2%", positive: true },
|
|
178
|
+
]}
|
|
179
|
+
onViewAll={() => {}}
|
|
180
|
+
/>
|
|
181
|
+
|
|
182
|
+
// Floating Nav Bar
|
|
183
|
+
<FloatingNavBar
|
|
184
|
+
actions={[
|
|
185
|
+
{ icon: "add_circle", label: "Buy" },
|
|
186
|
+
{ icon: "remove_circle", label: "Sell" },
|
|
187
|
+
]}
|
|
188
|
+
onActionClick={(action) => console.log(action)}
|
|
189
|
+
/>
|
|
190
|
+
|
|
191
|
+
// Sidebar (Desktop)
|
|
192
|
+
<Sidebar
|
|
193
|
+
navItems={[
|
|
194
|
+
{ icon: "dashboard", label: "Dashboard", active: true },
|
|
195
|
+
{ icon: "analytics", label: "Analytics", active: false },
|
|
196
|
+
]}
|
|
197
|
+
user={{ name: "Alex", role: "Premium", avatarUrl: "..." }}
|
|
198
|
+
onToggleTheme={() => {}}
|
|
199
|
+
isCollapsed={false}
|
|
200
|
+
onToggleCollapse={() => {}}
|
|
201
|
+
/>
|
|
202
|
+
|
|
203
|
+
// Mobile Nav
|
|
204
|
+
<MobileNav
|
|
205
|
+
navItems={[...]}
|
|
206
|
+
user={{ name: "Alex", role: "Premium", avatarUrl: "..." }}
|
|
207
|
+
onToggleTheme={() => {}}
|
|
208
|
+
/>
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## Components Reference
|
|
212
|
+
|
|
213
|
+
### Dashboard Cards
|
|
214
|
+
|
|
215
|
+
| Component | Description | Props |
|
|
216
|
+
|-----------|-------------|-------|
|
|
217
|
+
| `SalesStatisticsCard` | Displays visitor stats with decorative bar chart | `visitors`, `updatedDaysAgo`, `onPeriodChange` |
|
|
218
|
+
| `CurrentBalanceCard` | Shows balance with gauge visualization | `balance`, `percentageChange`, `averageScore` |
|
|
219
|
+
| `InvestmentGrowthCard` | Investment metrics with gauge | `percentage`, `monthlyAverage`, `totalValue` |
|
|
220
|
+
| `BtcPriceCard` | Bitcoin price display with progress bar | `price`, `changePercentage` |
|
|
221
|
+
| `MarketCapCard` | Market cap with line chart | `value` |
|
|
222
|
+
| `MarketForecastCard` | Timeline of market predictions | `forecasts` |
|
|
223
|
+
| `PortfolioAllocationCard` | Portfolio breakdown with progress bar | `allocations` |
|
|
224
|
+
| `WatchlistCard` | Cryptocurrency watchlist | `items`, `onViewAll` |
|
|
225
|
+
| `RecentTransactionsCard` | Transaction summary | `summary`, `users` |
|
|
226
|
+
| `QuickActionsCard` | Quick action buttons | `actions`, `scheduledTransfer` |
|
|
227
|
+
|
|
228
|
+
### Navigation
|
|
229
|
+
|
|
230
|
+
| Component | Description | Props |
|
|
231
|
+
|-----------|-------------|-------|
|
|
232
|
+
| `Sidebar` | Desktop sidebar navigation | `navItems`, `user`, `isCollapsed`, `onToggleTheme`, `onToggleCollapse` |
|
|
233
|
+
| `MobileNav` | Mobile/tablet top navigation with slide-out menu | `navItems`, `user`, `onToggleTheme` |
|
|
234
|
+
| `FloatingNavBar` | Floating action bar with liquid glass effect | `actions`, `onActionClick` |
|
|
235
|
+
|
|
236
|
+
### Template
|
|
237
|
+
|
|
238
|
+
| Component | Description | Props |
|
|
239
|
+
|-----------|-------------|-------|
|
|
240
|
+
| `DashboardTemplate` | Complete dashboard layout | `data`, `isLoading`, `onThemeToggle`, `onNavItemClick`, `onActionClick` |
|
|
241
|
+
|
|
242
|
+
## Theme Customization
|
|
243
|
+
|
|
244
|
+
The design system uses CSS custom properties. Override them in your CSS:
|
|
245
|
+
|
|
246
|
+
```css
|
|
247
|
+
:root {
|
|
248
|
+
/* Primary - Vibrant Green */
|
|
249
|
+
--primary: 120 100% 81%;
|
|
250
|
+
--primary-foreground: 220 13% 13%;
|
|
251
|
+
|
|
252
|
+
/* Secondary - Light Purple */
|
|
253
|
+
--secondary: 243 100% 85%;
|
|
254
|
+
--secondary-foreground: 220 13% 13%;
|
|
255
|
+
|
|
256
|
+
/* ... see theme.css for all variables */
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
## Dark Mode
|
|
261
|
+
|
|
262
|
+
Toggle dark mode by adding the `dark` class to your root element:
|
|
263
|
+
|
|
264
|
+
```tsx
|
|
265
|
+
document.documentElement.classList.toggle("dark");
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
## TypeScript Support
|
|
269
|
+
|
|
270
|
+
All components are fully typed. Import types as needed:
|
|
271
|
+
|
|
272
|
+
```tsx
|
|
273
|
+
import type {
|
|
274
|
+
DashboardData,
|
|
275
|
+
NavItem,
|
|
276
|
+
WatchlistItem,
|
|
277
|
+
PortfolioAllocation,
|
|
278
|
+
ForecastItem,
|
|
279
|
+
ActionItem,
|
|
280
|
+
UserInfo,
|
|
281
|
+
} from "@findash/ui";
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
## License
|
|
285
|
+
|
|
286
|
+
MIT
|