@rayvelez/findash-ui 1.1.1 → 2.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 +72 -169
- package/dist/index.d.mts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +89 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +90 -39
- package/dist/index.mjs.map +1 -1
- package/dist/theme.css +2 -188
- package/package.json +5 -3
- package/tailwind.preset.js +20 -2
package/README.md
CHANGED
|
@@ -1,74 +1,47 @@
|
|
|
1
1
|
# @rayvelez/findash-ui
|
|
2
2
|
|
|
3
|
-
A modern financial dashboard design system built with React
|
|
3
|
+
A modern financial dashboard design system built with React. Features a vibrant green and purple color palette with dark mode support, liquid glass effects, and beautifully crafted dashboard components.
|
|
4
|
+
|
|
5
|
+
**Zero-config** - Just install, import, and use. No Tailwind setup required.
|
|
4
6
|
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
10
|
npm install @rayvelez/findash-ui
|
|
9
|
-
# or
|
|
10
|
-
yarn add @rayvelez/findash-ui
|
|
11
|
-
# or
|
|
12
|
-
pnpm add @rayvelez/findash-ui
|
|
13
11
|
```
|
|
14
12
|
|
|
15
|
-
##
|
|
16
|
-
|
|
17
|
-
### 1. Import the CSS
|
|
18
|
-
|
|
19
|
-
Add the theme CSS to your application's entry point:
|
|
13
|
+
## Quick Start
|
|
20
14
|
|
|
21
15
|
```tsx
|
|
22
|
-
|
|
16
|
+
import { DashboardTemplate } from "@rayvelez/findash-ui";
|
|
23
17
|
import "@rayvelez/findash-ui/styles";
|
|
18
|
+
|
|
19
|
+
function App() {
|
|
20
|
+
return <DashboardTemplate />;
|
|
21
|
+
}
|
|
24
22
|
```
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
That's it! The styles are pre-compiled and bundled.
|
|
27
25
|
|
|
28
|
-
|
|
26
|
+
## Dark Mode
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
import type { Config } from "tailwindcss";
|
|
32
|
-
import findashPreset from "@rayvelez/findash-ui/tailwind.preset";
|
|
28
|
+
Toggle dark mode by adding the `dark` class to your root element:
|
|
33
29
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"./src/**/*.{ts,tsx}",
|
|
38
|
-
"./node_modules/@rayvelez/findash-ui/dist/**/*.{js,mjs}",
|
|
39
|
-
],
|
|
40
|
-
// ... rest of your config
|
|
41
|
-
} satisfies Config;
|
|
42
|
-
```
|
|
30
|
+
```tsx
|
|
31
|
+
// Enable dark mode
|
|
32
|
+
document.documentElement.classList.add("dark");
|
|
43
33
|
|
|
44
|
-
|
|
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
|
-
/>
|
|
34
|
+
// Toggle
|
|
35
|
+
document.documentElement.classList.toggle("dark");
|
|
59
36
|
```
|
|
60
37
|
|
|
61
|
-
##
|
|
62
|
-
|
|
63
|
-
### Complete Dashboard Template
|
|
38
|
+
## Complete Example
|
|
64
39
|
|
|
65
40
|
```tsx
|
|
66
|
-
import {
|
|
67
|
-
|
|
68
|
-
type DashboardData,
|
|
69
|
-
} from "@rayvelez/findash-ui";
|
|
41
|
+
import { DashboardTemplate, type DashboardData } from "@rayvelez/findash-ui";
|
|
42
|
+
import "@rayvelez/findash-ui/styles";
|
|
70
43
|
|
|
71
|
-
const
|
|
44
|
+
const data: DashboardData = {
|
|
72
45
|
user: {
|
|
73
46
|
name: "Alex Morgan",
|
|
74
47
|
role: "Premium User",
|
|
@@ -106,8 +79,8 @@ const dashboardData: DashboardData = {
|
|
|
106
79
|
{ name: "Polkadot", symbol: "DOT", price: "7.23", change: "-2.1%", positive: false },
|
|
107
80
|
],
|
|
108
81
|
forecasts: [
|
|
109
|
-
{ year: "
|
|
110
|
-
{ year: "
|
|
82
|
+
{ year: "2024", description: "Mainstream adoption", completed: false },
|
|
83
|
+
{ year: "2025", description: "1 BTC reaches $500K", completed: false },
|
|
111
84
|
],
|
|
112
85
|
transactions: {
|
|
113
86
|
summary: "12,53 ETH/1 BTC",
|
|
@@ -117,16 +90,16 @@ const dashboardData: DashboardData = {
|
|
|
117
90
|
function App() {
|
|
118
91
|
return (
|
|
119
92
|
<DashboardTemplate
|
|
120
|
-
data={
|
|
121
|
-
onThemeToggle={() =>
|
|
122
|
-
onNavItemClick={(item) => console.log("
|
|
93
|
+
data={data}
|
|
94
|
+
onThemeToggle={() => document.documentElement.classList.toggle("dark")}
|
|
95
|
+
onNavItemClick={(item) => console.log("Nav:", item)}
|
|
123
96
|
onActionClick={(action) => console.log("Action:", action)}
|
|
124
97
|
/>
|
|
125
98
|
);
|
|
126
99
|
}
|
|
127
100
|
```
|
|
128
101
|
|
|
129
|
-
|
|
102
|
+
## Individual Components
|
|
130
103
|
|
|
131
104
|
```tsx
|
|
132
105
|
import {
|
|
@@ -139,135 +112,48 @@ import {
|
|
|
139
112
|
Sidebar,
|
|
140
113
|
MobileNav,
|
|
141
114
|
} from "@rayvelez/findash-ui";
|
|
115
|
+
import "@rayvelez/findash-ui/styles";
|
|
142
116
|
|
|
143
|
-
//
|
|
144
|
-
<SalesStatisticsCard
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
/>
|
|
117
|
+
// Use any component individually
|
|
118
|
+
<SalesStatisticsCard visitors={2025} updatedDaysAgo={1} />
|
|
119
|
+
<CurrentBalanceCard balance={15368} percentageChange={14} />
|
|
120
|
+
<BtcPriceCard price={21105} changePercentage={28.21} />
|
|
209
121
|
```
|
|
210
122
|
|
|
211
|
-
## Components
|
|
123
|
+
## Components
|
|
212
124
|
|
|
213
125
|
### Dashboard Cards
|
|
214
126
|
|
|
215
|
-
| Component | Description |
|
|
216
|
-
|
|
217
|
-
| `SalesStatisticsCard` |
|
|
218
|
-
| `CurrentBalanceCard` |
|
|
219
|
-
| `InvestmentGrowthCard` | Investment metrics with gauge |
|
|
220
|
-
| `BtcPriceCard` | Bitcoin price
|
|
221
|
-
| `MarketCapCard` | Market cap with line chart |
|
|
222
|
-
| `MarketForecastCard` | Timeline of
|
|
223
|
-
| `PortfolioAllocationCard` | Portfolio breakdown
|
|
224
|
-
| `WatchlistCard` | Cryptocurrency watchlist |
|
|
225
|
-
| `RecentTransactionsCard` | Transaction summary |
|
|
226
|
-
| `QuickActionsCard` | Quick action buttons |
|
|
127
|
+
| Component | Description |
|
|
128
|
+
|-----------|-------------|
|
|
129
|
+
| `SalesStatisticsCard` | Visitor stats with bar chart |
|
|
130
|
+
| `CurrentBalanceCard` | Balance with gauge visualization |
|
|
131
|
+
| `InvestmentGrowthCard` | Investment metrics with gauge |
|
|
132
|
+
| `BtcPriceCard` | Bitcoin price with progress bar |
|
|
133
|
+
| `MarketCapCard` | Market cap with line chart |
|
|
134
|
+
| `MarketForecastCard` | Timeline of predictions |
|
|
135
|
+
| `PortfolioAllocationCard` | Portfolio breakdown |
|
|
136
|
+
| `WatchlistCard` | Cryptocurrency watchlist |
|
|
137
|
+
| `RecentTransactionsCard` | Transaction summary |
|
|
138
|
+
| `QuickActionsCard` | Quick action buttons |
|
|
227
139
|
|
|
228
140
|
### Navigation
|
|
229
141
|
|
|
230
|
-
| Component | Description |
|
|
231
|
-
|
|
232
|
-
| `Sidebar` | Desktop sidebar navigation |
|
|
233
|
-
| `MobileNav` | Mobile
|
|
234
|
-
| `FloatingNavBar` | Floating action bar with
|
|
142
|
+
| Component | Description |
|
|
143
|
+
|-----------|-------------|
|
|
144
|
+
| `Sidebar` | Desktop sidebar navigation |
|
|
145
|
+
| `MobileNav` | Mobile top navigation with slide-out menu |
|
|
146
|
+
| `FloatingNavBar` | Floating action bar with glass effect |
|
|
235
147
|
|
|
236
148
|
### Template
|
|
237
149
|
|
|
238
|
-
| Component | Description |
|
|
239
|
-
|
|
240
|
-
| `DashboardTemplate` | Complete dashboard layout |
|
|
150
|
+
| Component | Description |
|
|
151
|
+
|-----------|-------------|
|
|
152
|
+
| `DashboardTemplate` | Complete dashboard layout |
|
|
241
153
|
|
|
242
|
-
##
|
|
154
|
+
## TypeScript
|
|
243
155
|
|
|
244
|
-
|
|
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:
|
|
156
|
+
All components are fully typed:
|
|
271
157
|
|
|
272
158
|
```tsx
|
|
273
159
|
import type {
|
|
@@ -281,6 +167,23 @@ import type {
|
|
|
281
167
|
} from "@rayvelez/findash-ui";
|
|
282
168
|
```
|
|
283
169
|
|
|
170
|
+
## Advanced: Custom Tailwind Setup
|
|
171
|
+
|
|
172
|
+
If you want to customize the theme via Tailwind, you can use the preset:
|
|
173
|
+
|
|
174
|
+
```ts
|
|
175
|
+
// tailwind.config.ts
|
|
176
|
+
import type { Config } from "tailwindcss";
|
|
177
|
+
|
|
178
|
+
export default {
|
|
179
|
+
presets: [require("@rayvelez/findash-ui/tailwind.preset")],
|
|
180
|
+
content: [
|
|
181
|
+
"./src/**/*.{ts,tsx}",
|
|
182
|
+
"./node_modules/@rayvelez/findash-ui/dist/**/*.{js,mjs}",
|
|
183
|
+
],
|
|
184
|
+
} satisfies Config;
|
|
185
|
+
```
|
|
186
|
+
|
|
284
187
|
## License
|
|
285
188
|
|
|
286
189
|
MIT
|
package/dist/index.d.mts
CHANGED
|
@@ -524,4 +524,15 @@ declare function MobileNav({ navItems, user, onToggleTheme, onNavItemClick, }: M
|
|
|
524
524
|
*/
|
|
525
525
|
declare function DashboardTemplate({ data, isLoading, onThemeToggle, onNavItemClick, onActionClick, className, }: DashboardTemplateProps): react_jsx_runtime.JSX.Element;
|
|
526
526
|
|
|
527
|
-
|
|
527
|
+
type IconName = "add_circle" | "remove_circle" | "swap_horiz" | "send" | "account_balance_wallet" | "bar_chart" | "arrow_back" | "arrow_forward" | "show_chart" | "trending_up" | "dark_mode" | "menu" | "grid_view" | "close" | "more_horiz" | "more_vert" | "bolt" | "schedule" | "bubble_chart" | "expand_more" | "dashboard" | "analytics" | "chevron_right" | "arrow_outward" | "north_east" | "arrow_upward" | "timeline" | "pie_chart" | "visibility" | "chevron_left";
|
|
528
|
+
interface IconProps {
|
|
529
|
+
name: IconName;
|
|
530
|
+
className?: string;
|
|
531
|
+
size?: number;
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Icon component - Inline SVG icons (no external dependencies)
|
|
535
|
+
*/
|
|
536
|
+
declare function Icon({ name, className, size }: IconProps): react_jsx_runtime.JSX.Element;
|
|
537
|
+
|
|
538
|
+
export { type ActionItem, BtcPriceCard, type BtcPriceCardProps, CurrentBalanceCard, type CurrentBalanceCardProps, type DashboardData, DashboardTemplate, type DashboardTemplateProps, FloatingNavBar, type FloatingNavBarProps, type ForecastItem, Icon, type IconName, InvestmentGrowthCard, type InvestmentGrowthCardProps, MarketCapCard, type MarketCapCardProps, MarketForecastCard, type MarketForecastCardProps, MobileNav, type MobileNavProps, type NavItem, type PortfolioAllocation, PortfolioAllocationCard, type PortfolioAllocationCardProps, QuickActionsCard, type QuickActionsCardProps, RecentTransactionsCard, type RecentTransactionsCardProps, SalesStatisticsCard, type SalesStatisticsCardProps, type ScheduledTransfer, Sidebar, type SidebarProps, type TransactionUser, type UserInfo, WatchlistCard, type WatchlistCardProps, type WatchlistItem, cn };
|
package/dist/index.d.ts
CHANGED
|
@@ -524,4 +524,15 @@ declare function MobileNav({ navItems, user, onToggleTheme, onNavItemClick, }: M
|
|
|
524
524
|
*/
|
|
525
525
|
declare function DashboardTemplate({ data, isLoading, onThemeToggle, onNavItemClick, onActionClick, className, }: DashboardTemplateProps): react_jsx_runtime.JSX.Element;
|
|
526
526
|
|
|
527
|
-
|
|
527
|
+
type IconName = "add_circle" | "remove_circle" | "swap_horiz" | "send" | "account_balance_wallet" | "bar_chart" | "arrow_back" | "arrow_forward" | "show_chart" | "trending_up" | "dark_mode" | "menu" | "grid_view" | "close" | "more_horiz" | "more_vert" | "bolt" | "schedule" | "bubble_chart" | "expand_more" | "dashboard" | "analytics" | "chevron_right" | "arrow_outward" | "north_east" | "arrow_upward" | "timeline" | "pie_chart" | "visibility" | "chevron_left";
|
|
528
|
+
interface IconProps {
|
|
529
|
+
name: IconName;
|
|
530
|
+
className?: string;
|
|
531
|
+
size?: number;
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Icon component - Inline SVG icons (no external dependencies)
|
|
535
|
+
*/
|
|
536
|
+
declare function Icon({ name, className, size }: IconProps): react_jsx_runtime.JSX.Element;
|
|
537
|
+
|
|
538
|
+
export { type ActionItem, BtcPriceCard, type BtcPriceCardProps, CurrentBalanceCard, type CurrentBalanceCardProps, type DashboardData, DashboardTemplate, type DashboardTemplateProps, FloatingNavBar, type FloatingNavBarProps, type ForecastItem, Icon, type IconName, InvestmentGrowthCard, type InvestmentGrowthCardProps, MarketCapCard, type MarketCapCardProps, MarketForecastCard, type MarketForecastCardProps, MobileNav, type MobileNavProps, type NavItem, type PortfolioAllocation, PortfolioAllocationCard, type PortfolioAllocationCardProps, QuickActionsCard, type QuickActionsCardProps, RecentTransactionsCard, type RecentTransactionsCardProps, SalesStatisticsCard, type SalesStatisticsCardProps, type ScheduledTransfer, Sidebar, type SidebarProps, type TransactionUser, type UserInfo, WatchlistCard, type WatchlistCardProps, type WatchlistItem, cn };
|