@vtx-ui/react 0.0.1-beta.13 → 0.0.1-beta.15
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 +865 -103
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/types/components/Autocomplete/Autocomplete.d.ts +173 -0
- package/dist/types/components/Autocomplete/index.d.ts +2 -0
- package/dist/types/components/Image/Image.d.ts +14 -0
- package/dist/types/components/Image/index.d.ts +2 -0
- package/dist/types/components/Link/Link.d.ts +5 -0
- package/dist/types/components/Navbar/Navbar.d.ts +236 -0
- package/dist/types/components/Navbar/index.d.ts +2 -0
- package/dist/types/components/Text/Text.d.ts +9 -3
- package/dist/types/components/Widget/renderers/CarouselWidget.d.ts +2 -1
- package/dist/types/components/Widget/renderers/ContentBlockWidget.d.ts +56 -0
- package/dist/types/components/Widget/renderers/ContentBlockWidget.stories.d.ts +24 -0
- package/dist/types/components/Widget/renderers/HeaderWidget.d.ts +8 -2
- package/dist/types/components/Widget/renderers/ImageWidget.d.ts +69 -0
- package/dist/types/components/Widget/renderers/ImageWidget.stories.d.ts +11 -0
- package/dist/types/components/Widget/renderers/InfoWidget.d.ts +8 -2
- package/dist/types/components/Widget/renderers/ListWidget.d.ts +8 -2
- package/dist/types/components/Widget/renderers/MetricWidget.d.ts +8 -2
- package/dist/types/components/Widget/renderers/NavbarWidget.d.ts +16 -0
- package/dist/types/components/Widget/renderers/OrderWidget.d.ts +2 -6
- package/dist/types/components/Widget/renderers/ProductWidget.d.ts +2 -6
- package/dist/types/components/Widget/renderers/TextWidget.d.ts +8 -2
- package/dist/types/components/Widget/types.d.ts +388 -14
- package/dist/types/icons/IconComponents.d.ts +3 -0
- package/dist/types/index.d.ts +10 -6
- package/dist/types/stories/components/Autocomplete.stories.d.ts +20 -0
- package/dist/types/stories/components/ContentBlockWidget.stories.d.ts +24 -0
- package/dist/types/stories/components/HeaderWidget.stories.d.ts +10 -0
- package/dist/types/stories/components/InfoWidget.stories.d.ts +24 -0
- package/dist/types/stories/components/ListWidget.stories.d.ts +10 -0
- package/dist/types/stories/components/MetricWidget.stories.d.ts +12 -0
- package/dist/types/stories/components/OrderWidget.stories.d.ts +12 -0
- package/dist/types/stories/components/ProductWidget.stories.d.ts +13 -0
- package/dist/types/stories/components/TextWidget.stories.d.ts +10 -0
- package/dist/types/stories/widgets/DashboardCard.stories.d.ts +59 -0
- package/dist/types/stories/widgets/InfoCard.stories.d.ts +1 -4
- package/dist/types/stories/widgets/InfoListCard.stories.d.ts +3 -15
- package/dist/types/stories/widgets/InfoText.stories.d.ts +1 -19
- package/dist/types/stories/widgets/MetricCard.stories.d.ts +27 -0
- package/dist/types/stories/widgets/OrderCard.stories.d.ts +3 -9
- package/dist/types/stories/widgets/OrderConfirmation.stories.d.ts +1 -24
- package/dist/types/stories/widgets/OrderDetails.stories.d.ts +3 -7
- package/dist/types/stories/widgets/ProductCard.stories.d.ts +1 -15
- package/dist/types/theme/ThemeProvider.d.ts +7 -0
- package/dist/types/utils/parseClass.d.ts +2 -0
- package/dist/types/widgets/DashboardCard/DashboardCard.d.ts +275 -0
- package/dist/types/widgets/DashboardCard/index.d.ts +2 -0
- package/dist/types/widgets/MetricCard/MetricCard.d.ts +106 -0
- package/dist/types/widgets/MetricCard/index.d.ts +2 -0
- package/dist/types/widgets/Navbar/Navbar.d.ts +308 -0
- package/dist/types/widgets/Navbar/Navbar.stories.d.ts +23 -0
- package/dist/types/widgets/Navbar/index.d.ts +2 -0
- package/dist/types/widgets/OrderCard/OrderCard.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './DashboardCard.css';
|
|
3
|
+
export type DashboardCardTheme = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
|
|
4
|
+
export type DashboardCardSize = 'sm' | 'md' | 'lg';
|
|
5
|
+
interface BaseDashboardCardProps {
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
size?: DashboardCardSize;
|
|
11
|
+
variant?: 'outlined' | 'filled';
|
|
12
|
+
}
|
|
13
|
+
interface TrendData {
|
|
14
|
+
value: number;
|
|
15
|
+
label?: string;
|
|
16
|
+
isPositive?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface StatCardData {
|
|
19
|
+
value: string | number;
|
|
20
|
+
label: string;
|
|
21
|
+
icon?: React.ReactNode;
|
|
22
|
+
trend?: TrendData;
|
|
23
|
+
subtitle?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface StatCardSettings {
|
|
26
|
+
theme?: DashboardCardTheme;
|
|
27
|
+
variant?: 'outlined' | 'filled';
|
|
28
|
+
showIcon?: boolean;
|
|
29
|
+
showTrend?: boolean;
|
|
30
|
+
valueSize?: 'sm' | 'md' | 'lg';
|
|
31
|
+
layout?: 'horizontal' | 'vertical';
|
|
32
|
+
}
|
|
33
|
+
export interface StatCardProps extends BaseDashboardCardProps {
|
|
34
|
+
type: 'stat';
|
|
35
|
+
data: StatCardData;
|
|
36
|
+
settings?: StatCardSettings;
|
|
37
|
+
}
|
|
38
|
+
export interface ProgressCardData {
|
|
39
|
+
current: number;
|
|
40
|
+
target: number;
|
|
41
|
+
label: string;
|
|
42
|
+
icon?: React.ReactNode;
|
|
43
|
+
unit?: string;
|
|
44
|
+
subtitle?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface ProgressCardSettings {
|
|
47
|
+
theme?: DashboardCardTheme;
|
|
48
|
+
variant?: 'outlined' | 'filled';
|
|
49
|
+
showPercentage?: boolean;
|
|
50
|
+
showValues?: boolean;
|
|
51
|
+
progressType?: 'bar' | 'circle';
|
|
52
|
+
status?: 'on-track' | 'at-risk' | 'exceeded' | 'behind';
|
|
53
|
+
}
|
|
54
|
+
export interface ProgressCardProps extends BaseDashboardCardProps {
|
|
55
|
+
type: 'progress';
|
|
56
|
+
data: ProgressCardData;
|
|
57
|
+
settings?: ProgressCardSettings;
|
|
58
|
+
}
|
|
59
|
+
export interface ComparisonCardData {
|
|
60
|
+
label: string;
|
|
61
|
+
items: Array<{
|
|
62
|
+
label: string;
|
|
63
|
+
value: string | number;
|
|
64
|
+
trend?: TrendData;
|
|
65
|
+
icon?: React.ReactNode;
|
|
66
|
+
}>;
|
|
67
|
+
}
|
|
68
|
+
export interface ComparisonCardSettings {
|
|
69
|
+
theme?: DashboardCardTheme;
|
|
70
|
+
variant?: 'outlined' | 'filled';
|
|
71
|
+
layout?: 'horizontal' | 'vertical';
|
|
72
|
+
showTrends?: boolean;
|
|
73
|
+
showDivider?: boolean;
|
|
74
|
+
}
|
|
75
|
+
export interface ComparisonCardProps extends BaseDashboardCardProps {
|
|
76
|
+
type: 'comparison';
|
|
77
|
+
data: ComparisonCardData;
|
|
78
|
+
settings?: ComparisonCardSettings;
|
|
79
|
+
}
|
|
80
|
+
export interface ActivityCardData {
|
|
81
|
+
title: string;
|
|
82
|
+
onViewAll?: () => void;
|
|
83
|
+
activities: Array<{
|
|
84
|
+
id: string;
|
|
85
|
+
label: string;
|
|
86
|
+
value?: string | number;
|
|
87
|
+
timestamp?: string;
|
|
88
|
+
icon?: React.ReactNode;
|
|
89
|
+
status?: 'success' | 'warning' | 'danger' | 'info';
|
|
90
|
+
}>;
|
|
91
|
+
}
|
|
92
|
+
export interface ActivityCardSettings {
|
|
93
|
+
theme?: DashboardCardTheme;
|
|
94
|
+
variant?: 'outlined' | 'filled';
|
|
95
|
+
maxItems?: number;
|
|
96
|
+
showTimestamps?: boolean;
|
|
97
|
+
showIcons?: boolean;
|
|
98
|
+
compact?: boolean;
|
|
99
|
+
}
|
|
100
|
+
export interface ActivityCardProps extends BaseDashboardCardProps {
|
|
101
|
+
type: 'activity';
|
|
102
|
+
data: ActivityCardData;
|
|
103
|
+
settings?: ActivityCardSettings;
|
|
104
|
+
}
|
|
105
|
+
export interface OrderCardData {
|
|
106
|
+
orderId: string;
|
|
107
|
+
status: 'pending' | 'processing' | 'shipped' | 'delivered' | 'cancelled';
|
|
108
|
+
amount: number;
|
|
109
|
+
currency?: string;
|
|
110
|
+
customer?: string;
|
|
111
|
+
items?: number;
|
|
112
|
+
date?: string;
|
|
113
|
+
icon?: React.ReactNode;
|
|
114
|
+
}
|
|
115
|
+
export interface OrderCardSettings {
|
|
116
|
+
theme?: DashboardCardTheme;
|
|
117
|
+
variant?: 'outlined' | 'filled';
|
|
118
|
+
showCustomer?: boolean;
|
|
119
|
+
showItems?: boolean;
|
|
120
|
+
showDate?: boolean;
|
|
121
|
+
layout?: 'compact' | 'detailed';
|
|
122
|
+
}
|
|
123
|
+
export interface OrderCardProps extends BaseDashboardCardProps {
|
|
124
|
+
type: 'order';
|
|
125
|
+
data: OrderCardData;
|
|
126
|
+
settings?: OrderCardSettings;
|
|
127
|
+
}
|
|
128
|
+
export interface UserCardData {
|
|
129
|
+
name: string;
|
|
130
|
+
role?: string;
|
|
131
|
+
department?: string;
|
|
132
|
+
avatar?: React.ReactNode;
|
|
133
|
+
status?: 'active' | 'away' | 'offline';
|
|
134
|
+
metrics?: Array<{
|
|
135
|
+
label: string;
|
|
136
|
+
value: string | number;
|
|
137
|
+
}>;
|
|
138
|
+
}
|
|
139
|
+
export interface UserCardSettings {
|
|
140
|
+
theme?: DashboardCardTheme;
|
|
141
|
+
variant?: 'outlined' | 'filled';
|
|
142
|
+
showStatus?: boolean;
|
|
143
|
+
showMetrics?: boolean;
|
|
144
|
+
layout?: 'horizontal' | 'vertical';
|
|
145
|
+
avatarSize?: 'sm' | 'md' | 'lg';
|
|
146
|
+
}
|
|
147
|
+
export interface UserCardProps extends BaseDashboardCardProps {
|
|
148
|
+
type: 'user';
|
|
149
|
+
data: UserCardData;
|
|
150
|
+
settings?: UserCardSettings;
|
|
151
|
+
}
|
|
152
|
+
export interface RevenueCardData {
|
|
153
|
+
amount: number;
|
|
154
|
+
currency?: string;
|
|
155
|
+
label: string;
|
|
156
|
+
period?: string;
|
|
157
|
+
trend?: TrendData;
|
|
158
|
+
icon?: React.ReactNode;
|
|
159
|
+
breakdown?: Array<{
|
|
160
|
+
label: string;
|
|
161
|
+
value: number;
|
|
162
|
+
percentage?: number;
|
|
163
|
+
}>;
|
|
164
|
+
}
|
|
165
|
+
export interface RevenueCardSettings {
|
|
166
|
+
theme?: DashboardCardTheme;
|
|
167
|
+
variant?: 'outlined' | 'filled';
|
|
168
|
+
showTrend?: boolean;
|
|
169
|
+
showBreakdown?: boolean;
|
|
170
|
+
showPeriod?: boolean;
|
|
171
|
+
format?: 'compact' | 'detailed';
|
|
172
|
+
}
|
|
173
|
+
export interface RevenueCardProps extends BaseDashboardCardProps {
|
|
174
|
+
type: 'revenue';
|
|
175
|
+
data: RevenueCardData;
|
|
176
|
+
settings?: RevenueCardSettings;
|
|
177
|
+
}
|
|
178
|
+
export interface AlertCardData {
|
|
179
|
+
title: string;
|
|
180
|
+
message: string;
|
|
181
|
+
severity: 'info' | 'warning' | 'error' | 'success';
|
|
182
|
+
icon?: React.ReactNode;
|
|
183
|
+
timestamp?: string;
|
|
184
|
+
actionLabel?: string;
|
|
185
|
+
onAction?: () => void;
|
|
186
|
+
}
|
|
187
|
+
export interface AlertCardSettings {
|
|
188
|
+
theme?: DashboardCardTheme;
|
|
189
|
+
variant?: 'outlined' | 'filled';
|
|
190
|
+
showIcon?: boolean;
|
|
191
|
+
showTimestamp?: boolean;
|
|
192
|
+
dismissible?: boolean;
|
|
193
|
+
onDismiss?: () => void;
|
|
194
|
+
}
|
|
195
|
+
export interface AlertCardProps extends BaseDashboardCardProps {
|
|
196
|
+
type: 'alert';
|
|
197
|
+
data: AlertCardData;
|
|
198
|
+
settings?: AlertCardSettings;
|
|
199
|
+
}
|
|
200
|
+
export interface RankingCardData {
|
|
201
|
+
title: string;
|
|
202
|
+
items: Array<{
|
|
203
|
+
rank: number;
|
|
204
|
+
label: string;
|
|
205
|
+
value: string | number;
|
|
206
|
+
icon?: React.ReactNode;
|
|
207
|
+
percentage?: number;
|
|
208
|
+
}>;
|
|
209
|
+
}
|
|
210
|
+
export interface RankingCardSettings {
|
|
211
|
+
theme?: DashboardCardTheme;
|
|
212
|
+
variant?: 'outlined' | 'filled';
|
|
213
|
+
maxItems?: number;
|
|
214
|
+
showPercentages?: boolean;
|
|
215
|
+
showBars?: boolean;
|
|
216
|
+
highlightTop?: number;
|
|
217
|
+
}
|
|
218
|
+
export interface RankingCardProps extends BaseDashboardCardProps {
|
|
219
|
+
type: 'ranking';
|
|
220
|
+
data: RankingCardData;
|
|
221
|
+
settings?: RankingCardSettings;
|
|
222
|
+
}
|
|
223
|
+
export interface MetricCardData {
|
|
224
|
+
value: string | number;
|
|
225
|
+
label: string;
|
|
226
|
+
icon?: React.ReactNode;
|
|
227
|
+
trend?: TrendData;
|
|
228
|
+
subtitle?: string;
|
|
229
|
+
chartData?: Array<number>;
|
|
230
|
+
chartType?: 'line' | 'bar';
|
|
231
|
+
targetValue?: number;
|
|
232
|
+
comparisonValue?: string | number;
|
|
233
|
+
comparisonLabel?: string;
|
|
234
|
+
}
|
|
235
|
+
export interface MetricCardSettings {
|
|
236
|
+
theme?: DashboardCardTheme;
|
|
237
|
+
variant?: 'outlined' | 'filled';
|
|
238
|
+
showChart?: boolean;
|
|
239
|
+
showTrend?: boolean;
|
|
240
|
+
showComparison?: boolean;
|
|
241
|
+
chartHeight?: number;
|
|
242
|
+
valueSize?: 'sm' | 'md' | 'lg';
|
|
243
|
+
}
|
|
244
|
+
export interface MetricCardProps extends BaseDashboardCardProps {
|
|
245
|
+
type: 'metric';
|
|
246
|
+
data: MetricCardData;
|
|
247
|
+
settings?: MetricCardSettings;
|
|
248
|
+
}
|
|
249
|
+
export interface StatusCardData {
|
|
250
|
+
service: string;
|
|
251
|
+
status: 'online' | 'offline' | 'degraded' | 'maintenance';
|
|
252
|
+
icon?: React.ReactNode;
|
|
253
|
+
uptime?: string;
|
|
254
|
+
lastChecked?: string;
|
|
255
|
+
metrics?: Array<{
|
|
256
|
+
label: string;
|
|
257
|
+
value: string | number;
|
|
258
|
+
}>;
|
|
259
|
+
}
|
|
260
|
+
export interface StatusCardSettings {
|
|
261
|
+
theme?: DashboardCardTheme;
|
|
262
|
+
variant?: 'outlined' | 'filled';
|
|
263
|
+
showMetrics?: boolean;
|
|
264
|
+
showUptime?: boolean;
|
|
265
|
+
showLastChecked?: boolean;
|
|
266
|
+
layout?: 'compact' | 'detailed';
|
|
267
|
+
}
|
|
268
|
+
export interface StatusCardProps extends BaseDashboardCardProps {
|
|
269
|
+
type: 'status';
|
|
270
|
+
data: StatusCardData;
|
|
271
|
+
settings?: StatusCardSettings;
|
|
272
|
+
}
|
|
273
|
+
export type DashboardCardProps = StatCardProps | ProgressCardProps | ComparisonCardProps | ActivityCardProps | OrderCardProps | UserCardProps | RevenueCardProps | AlertCardProps | RankingCardProps | MetricCardProps | StatusCardProps;
|
|
274
|
+
export declare const DashboardCard: <T extends DashboardCardProps>(props: T & React.RefAttributes<HTMLDivElement>) => React.ReactElement;
|
|
275
|
+
export default DashboardCard;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { DashboardCard, default } from './DashboardCard';
|
|
2
|
+
export type { DashboardCardProps, DashboardCardTheme, DashboardCardSize, StatCardProps, StatCardData, StatCardSettings, ProgressCardProps, ProgressCardData, ProgressCardSettings, ComparisonCardProps, ComparisonCardData, ComparisonCardSettings, ActivityCardProps, ActivityCardData, ActivityCardSettings, OrderCardProps, OrderCardData, OrderCardSettings, UserCardProps, UserCardData, UserCardSettings, RevenueCardProps, RevenueCardData, RevenueCardSettings, AlertCardProps, AlertCardData, AlertCardSettings, RankingCardProps, RankingCardData, RankingCardSettings, StatusCardProps, StatusCardData, StatusCardSettings, } from './DashboardCard';
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './MetricCard.css';
|
|
3
|
+
export interface TrendData {
|
|
4
|
+
direction: 'up' | 'down';
|
|
5
|
+
value: number;
|
|
6
|
+
label?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface TargetData {
|
|
9
|
+
value: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ChartData {
|
|
13
|
+
data: number[];
|
|
14
|
+
variant?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
|
|
15
|
+
type?: 'line' | 'bar';
|
|
16
|
+
}
|
|
17
|
+
export interface MetricCardBaseProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
18
|
+
/**
|
|
19
|
+
* Primary value/metric to display
|
|
20
|
+
*/
|
|
21
|
+
value: React.ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Label for the metric
|
|
24
|
+
*/
|
|
25
|
+
label: React.ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Optional icon
|
|
28
|
+
*/
|
|
29
|
+
icon?: React.ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Trend information
|
|
32
|
+
*/
|
|
33
|
+
trend?: TrendData;
|
|
34
|
+
/**
|
|
35
|
+
* Optional description text
|
|
36
|
+
*/
|
|
37
|
+
description?: React.ReactNode;
|
|
38
|
+
/**
|
|
39
|
+
* Color variant for filled style
|
|
40
|
+
*/
|
|
41
|
+
variant?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
|
|
42
|
+
/**
|
|
43
|
+
* If true, applies filled background style with variant color
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
filled?: boolean;
|
|
47
|
+
className?: string;
|
|
48
|
+
style?: React.CSSProperties;
|
|
49
|
+
}
|
|
50
|
+
export interface MetricCardCompactProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
51
|
+
value: React.ReactNode;
|
|
52
|
+
label: React.ReactNode;
|
|
53
|
+
trend?: TrendData;
|
|
54
|
+
variant?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
|
|
55
|
+
/**
|
|
56
|
+
* If true, applies filled background style with variant color
|
|
57
|
+
* @default false
|
|
58
|
+
*/
|
|
59
|
+
filled?: boolean;
|
|
60
|
+
className?: string;
|
|
61
|
+
style?: React.CSSProperties;
|
|
62
|
+
}
|
|
63
|
+
export interface MetricCardDetailedProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
64
|
+
value: React.ReactNode;
|
|
65
|
+
label: React.ReactNode;
|
|
66
|
+
icon?: React.ReactNode;
|
|
67
|
+
trend?: TrendData;
|
|
68
|
+
target?: TargetData;
|
|
69
|
+
progress?: number;
|
|
70
|
+
description?: React.ReactNode;
|
|
71
|
+
/**
|
|
72
|
+
* Color variant for filled style
|
|
73
|
+
*/
|
|
74
|
+
variant?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
|
|
75
|
+
/**
|
|
76
|
+
* If true, applies filled background style with variant color
|
|
77
|
+
* @default false
|
|
78
|
+
*/
|
|
79
|
+
filled?: boolean;
|
|
80
|
+
className?: string;
|
|
81
|
+
style?: React.CSSProperties;
|
|
82
|
+
}
|
|
83
|
+
export interface MetricCardChartProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
84
|
+
value: React.ReactNode;
|
|
85
|
+
label: React.ReactNode;
|
|
86
|
+
trend?: TrendData;
|
|
87
|
+
chart: ChartData;
|
|
88
|
+
/**
|
|
89
|
+
* Color variant for filled style
|
|
90
|
+
*/
|
|
91
|
+
variant?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
|
|
92
|
+
/**
|
|
93
|
+
* If true, applies filled background style with variant color
|
|
94
|
+
* @default false
|
|
95
|
+
*/
|
|
96
|
+
filled?: boolean;
|
|
97
|
+
className?: string;
|
|
98
|
+
style?: React.CSSProperties;
|
|
99
|
+
}
|
|
100
|
+
export declare const MetricCard: {
|
|
101
|
+
Base: React.FC<MetricCardBaseProps & React.RefAttributes<HTMLDivElement>>;
|
|
102
|
+
Compact: React.FC<MetricCardCompactProps & React.RefAttributes<HTMLDivElement>>;
|
|
103
|
+
Detailed: React.FC<MetricCardDetailedProps & React.RefAttributes<HTMLDivElement>>;
|
|
104
|
+
Chart: React.FC<MetricCardChartProps & React.RefAttributes<HTMLDivElement>>;
|
|
105
|
+
};
|
|
106
|
+
export default MetricCard;
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Navbar.css';
|
|
3
|
+
export interface TopBarConfig {
|
|
4
|
+
/**
|
|
5
|
+
* Content to display in the top bar
|
|
6
|
+
*/
|
|
7
|
+
content?: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Left-aligned content
|
|
10
|
+
*/
|
|
11
|
+
leftContent?: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Right-aligned content
|
|
14
|
+
*/
|
|
15
|
+
rightContent?: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Top bar styling variant
|
|
18
|
+
* @default 'subtle'
|
|
19
|
+
*/
|
|
20
|
+
variant?: 'subtle' | 'bold' | 'accent' | 'dark' | 'gradient';
|
|
21
|
+
/**
|
|
22
|
+
* If true, shows a dismiss button
|
|
23
|
+
*/
|
|
24
|
+
dismissible?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Callback when dismiss button is clicked
|
|
27
|
+
*/
|
|
28
|
+
onDismiss?: () => void;
|
|
29
|
+
}
|
|
30
|
+
export interface MegaMenuColumn {
|
|
31
|
+
/**
|
|
32
|
+
* Column title
|
|
33
|
+
*/
|
|
34
|
+
title?: React.ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Column items
|
|
37
|
+
*/
|
|
38
|
+
items: NavigationItem[];
|
|
39
|
+
}
|
|
40
|
+
export interface NavigationItem {
|
|
41
|
+
/**
|
|
42
|
+
* Unique identifier for the navigation item
|
|
43
|
+
*/
|
|
44
|
+
id: string;
|
|
45
|
+
/**
|
|
46
|
+
* Label text to display
|
|
47
|
+
*/
|
|
48
|
+
label: React.ReactNode;
|
|
49
|
+
/**
|
|
50
|
+
* URL or path for navigation
|
|
51
|
+
*/
|
|
52
|
+
href?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Icon to display before label
|
|
55
|
+
*/
|
|
56
|
+
icon?: React.ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* Nested child items for dropdown menus
|
|
59
|
+
*/
|
|
60
|
+
children?: NavigationItem[];
|
|
61
|
+
/**
|
|
62
|
+
* Click handler
|
|
63
|
+
*/
|
|
64
|
+
onClick?: () => void;
|
|
65
|
+
/**
|
|
66
|
+
* If true, marks this item as active/selected
|
|
67
|
+
*/
|
|
68
|
+
active?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* If true, disables the item
|
|
71
|
+
*/
|
|
72
|
+
disabled?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Badge content to display (e.g., notification count)
|
|
75
|
+
*/
|
|
76
|
+
badge?: React.ReactNode;
|
|
77
|
+
/**
|
|
78
|
+
* If true, renders as a mega menu with columns
|
|
79
|
+
*/
|
|
80
|
+
megaMenu?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Mega menu columns (when megaMenu is true)
|
|
83
|
+
*/
|
|
84
|
+
megaMenuColumns?: MegaMenuColumn[];
|
|
85
|
+
/**
|
|
86
|
+
* Description text for mega menu items
|
|
87
|
+
*/
|
|
88
|
+
description?: React.ReactNode;
|
|
89
|
+
/**
|
|
90
|
+
* Featured image for mega menu
|
|
91
|
+
*/
|
|
92
|
+
image?: string;
|
|
93
|
+
}
|
|
94
|
+
export interface NavbarDesktopProps extends React.HTMLAttributes<HTMLElement> {
|
|
95
|
+
/**
|
|
96
|
+
* Logo element or brand name
|
|
97
|
+
*/
|
|
98
|
+
logo?: React.ReactNode;
|
|
99
|
+
/**
|
|
100
|
+
* Array of navigation items
|
|
101
|
+
*/
|
|
102
|
+
navItems?: NavigationItem[];
|
|
103
|
+
/**
|
|
104
|
+
* Action buttons or elements to display on the right
|
|
105
|
+
*/
|
|
106
|
+
actions?: React.ReactNode;
|
|
107
|
+
/**
|
|
108
|
+
* Visual theme variant
|
|
109
|
+
* @default 'primary'
|
|
110
|
+
*/
|
|
111
|
+
variant?: 'primary' | 'secondary' | 'dark' | 'light' | 'transparent' | 'gradient';
|
|
112
|
+
/**
|
|
113
|
+
* If true, navbar has a shadow effect
|
|
114
|
+
* @default false
|
|
115
|
+
*/
|
|
116
|
+
elevated?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* If true, navbar sticks to top on scroll
|
|
119
|
+
* @default false
|
|
120
|
+
*/
|
|
121
|
+
sticky?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* If true, makes navbar full bleed (no max-width)
|
|
124
|
+
* @default false
|
|
125
|
+
*/
|
|
126
|
+
fullWidth?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* If true, enables search functionality
|
|
129
|
+
* @default false
|
|
130
|
+
*/
|
|
131
|
+
searchEnabled?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Search placeholder text
|
|
134
|
+
*/
|
|
135
|
+
searchPlaceholder?: string;
|
|
136
|
+
/**
|
|
137
|
+
* Search input handler
|
|
138
|
+
*/
|
|
139
|
+
onSearch?: (query: string) => void;
|
|
140
|
+
/**
|
|
141
|
+
* Search suggestions/options for autocomplete
|
|
142
|
+
*/
|
|
143
|
+
searchOptions?: any[];
|
|
144
|
+
/**
|
|
145
|
+
* Property name or function to extract the display label from search option
|
|
146
|
+
* @default 'label'
|
|
147
|
+
*/
|
|
148
|
+
searchGetOptionLabel?: string | ((option: any) => string);
|
|
149
|
+
/**
|
|
150
|
+
* Property name or function to extract the value from search option
|
|
151
|
+
* @default 'value'
|
|
152
|
+
*/
|
|
153
|
+
searchGetOptionValue?: string | ((option: any) => string);
|
|
154
|
+
/**
|
|
155
|
+
* Message to display when no search options are available
|
|
156
|
+
* @default 'No options'
|
|
157
|
+
*/
|
|
158
|
+
searchNoOptionsMessage?: string;
|
|
159
|
+
/**
|
|
160
|
+
* If true, shows loading state in search autocomplete
|
|
161
|
+
* @default false
|
|
162
|
+
*/
|
|
163
|
+
searchLoading?: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Callback fired when a search option is selected
|
|
166
|
+
*/
|
|
167
|
+
onSearchSelect?: (value: string, option: any) => void;
|
|
168
|
+
/**
|
|
169
|
+
* Custom logo click handler
|
|
170
|
+
*/
|
|
171
|
+
onLogoClick?: () => void;
|
|
172
|
+
/**
|
|
173
|
+
* Layout style for the navbar
|
|
174
|
+
* @default 'single-row'
|
|
175
|
+
*/
|
|
176
|
+
layout?: 'single-row' | 'two-row' | 'centered';
|
|
177
|
+
/**
|
|
178
|
+
* Two-row bottom styling variant (only applicable when layout='two-row')
|
|
179
|
+
* @default 'default'
|
|
180
|
+
*/
|
|
181
|
+
twoRowBottomStyle?: 'default' | 'divider' | 'dark-bottom' | 'gradient-bottom' | 'elevated-bottom';
|
|
182
|
+
/**
|
|
183
|
+
* Top bar configuration (displays above main navbar)
|
|
184
|
+
*/
|
|
185
|
+
topBar?: TopBarConfig;
|
|
186
|
+
/**
|
|
187
|
+
* Scroll behavior - 'transparent-to-solid' makes navbar transparent initially and solid on scroll
|
|
188
|
+
* @default undefined
|
|
189
|
+
*/
|
|
190
|
+
scrollBehavior?: 'transparent-to-solid';
|
|
191
|
+
/**
|
|
192
|
+
* Scroll threshold in pixels before applying scroll effect
|
|
193
|
+
* @default 50
|
|
194
|
+
*/
|
|
195
|
+
scrollThreshold?: number;
|
|
196
|
+
/**
|
|
197
|
+
* Callback fired when scroll state changes
|
|
198
|
+
* @param scrolled - true if user has scrolled past threshold, false otherwise
|
|
199
|
+
*/
|
|
200
|
+
onScrollStateChange?: (scrolled: boolean) => void;
|
|
201
|
+
className?: string;
|
|
202
|
+
style?: React.CSSProperties;
|
|
203
|
+
}
|
|
204
|
+
export interface NavbarMobileProps extends React.HTMLAttributes<HTMLElement> {
|
|
205
|
+
/**
|
|
206
|
+
* Logo element or brand name
|
|
207
|
+
*/
|
|
208
|
+
logo?: React.ReactNode;
|
|
209
|
+
/**
|
|
210
|
+
* Array of navigation items
|
|
211
|
+
*/
|
|
212
|
+
navItems?: NavigationItem[];
|
|
213
|
+
/**
|
|
214
|
+
* Action buttons or elements to display on the right
|
|
215
|
+
*/
|
|
216
|
+
actions?: React.ReactNode;
|
|
217
|
+
/**
|
|
218
|
+
* Visual theme variant
|
|
219
|
+
* @default 'primary'
|
|
220
|
+
*/
|
|
221
|
+
variant?: 'primary' | 'secondary' | 'dark' | 'light' | 'transparent' | 'gradient';
|
|
222
|
+
/**
|
|
223
|
+
* If true, navbar has a shadow effect
|
|
224
|
+
* @default false
|
|
225
|
+
*/
|
|
226
|
+
elevated?: boolean;
|
|
227
|
+
/**
|
|
228
|
+
* If true, navbar sticks to top on scroll
|
|
229
|
+
* @default false
|
|
230
|
+
*/
|
|
231
|
+
sticky?: boolean;
|
|
232
|
+
/**
|
|
233
|
+
* If true, enables search functionality in mobile menu
|
|
234
|
+
* @default false
|
|
235
|
+
*/
|
|
236
|
+
searchEnabled?: boolean;
|
|
237
|
+
/**
|
|
238
|
+
* Search placeholder text
|
|
239
|
+
*/
|
|
240
|
+
searchPlaceholder?: string;
|
|
241
|
+
/**
|
|
242
|
+
* Search input handler
|
|
243
|
+
*/
|
|
244
|
+
onSearch?: (query: string) => void;
|
|
245
|
+
/**
|
|
246
|
+
* Search suggestions/options for autocomplete
|
|
247
|
+
*/
|
|
248
|
+
searchOptions?: any[];
|
|
249
|
+
/**
|
|
250
|
+
* Property name or function to extract the display label from search option
|
|
251
|
+
* @default 'label'
|
|
252
|
+
*/
|
|
253
|
+
searchGetOptionLabel?: string | ((option: any) => string);
|
|
254
|
+
/**
|
|
255
|
+
* Property name or function to extract the value from search option
|
|
256
|
+
* @default 'value'
|
|
257
|
+
*/
|
|
258
|
+
searchGetOptionValue?: string | ((option: any) => string);
|
|
259
|
+
/**
|
|
260
|
+
* Message to display when no search options are available
|
|
261
|
+
* @default 'No options'
|
|
262
|
+
*/
|
|
263
|
+
searchNoOptionsMessage?: string;
|
|
264
|
+
/**
|
|
265
|
+
* If true, shows loading state in search autocomplete
|
|
266
|
+
* @default false
|
|
267
|
+
*/
|
|
268
|
+
searchLoading?: boolean;
|
|
269
|
+
/**
|
|
270
|
+
* Callback fired when a search option is selected
|
|
271
|
+
*/
|
|
272
|
+
onSearchSelect?: (value: string, option: any) => void;
|
|
273
|
+
/**
|
|
274
|
+
* Custom logo click handler
|
|
275
|
+
*/
|
|
276
|
+
onLogoClick?: () => void;
|
|
277
|
+
/**
|
|
278
|
+
* Menu open state (controlled)
|
|
279
|
+
*/
|
|
280
|
+
menuOpen?: boolean;
|
|
281
|
+
/**
|
|
282
|
+
* Menu open change handler (controlled)
|
|
283
|
+
*/
|
|
284
|
+
onMenuOpenChange?: (open: boolean) => void;
|
|
285
|
+
className?: string;
|
|
286
|
+
style?: React.CSSProperties;
|
|
287
|
+
}
|
|
288
|
+
export interface NavbarResponsiveProps {
|
|
289
|
+
/**
|
|
290
|
+
* Props for desktop navbar
|
|
291
|
+
*/
|
|
292
|
+
desktopProps: NavbarDesktopProps;
|
|
293
|
+
/**
|
|
294
|
+
* Props for mobile navbar
|
|
295
|
+
*/
|
|
296
|
+
mobileProps: NavbarMobileProps;
|
|
297
|
+
/**
|
|
298
|
+
* Breakpoint in pixels to switch between desktop and mobile
|
|
299
|
+
* @default 768
|
|
300
|
+
*/
|
|
301
|
+
breakpoint?: number;
|
|
302
|
+
}
|
|
303
|
+
export declare const Navbar: {
|
|
304
|
+
Desktop: React.FC<NavbarDesktopProps & React.RefAttributes<HTMLElement>>;
|
|
305
|
+
Mobile: React.FC<NavbarMobileProps & React.RefAttributes<HTMLElement>>;
|
|
306
|
+
Responsive: React.FC<NavbarResponsiveProps>;
|
|
307
|
+
};
|
|
308
|
+
export default Navbar;
|