@vtx-ui/react 0.0.1-beta.13 → 0.0.1-beta.14
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 +58 -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
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ListWidgetData, WidgetTheme, WidgetVariant } from '../types';
|
|
2
|
+
import { ListWidgetData, ListWidgetSettings, WidgetTheme, WidgetVariant } from '../types';
|
|
3
3
|
interface ListWidgetProps {
|
|
4
4
|
data: ListWidgetData;
|
|
5
|
-
|
|
5
|
+
settings?: ListWidgetSettings;
|
|
6
|
+
/** @deprecated Use settings.theme */
|
|
7
|
+
theme?: WidgetTheme;
|
|
8
|
+
/** @deprecated Use settings.variant */
|
|
6
9
|
variant?: WidgetVariant;
|
|
10
|
+
/** @deprecated Use settings.size */
|
|
7
11
|
size?: 'sm' | 'md' | 'lg';
|
|
12
|
+
/** @deprecated Use settings.className */
|
|
8
13
|
className?: string;
|
|
14
|
+
/** @deprecated Use settings.style */
|
|
9
15
|
style?: React.CSSProperties;
|
|
10
16
|
}
|
|
11
17
|
declare const ListWidget: React.FC<ListWidgetProps>;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { MetricWidgetData, WidgetTheme, WidgetVariant } from '../types';
|
|
2
|
+
import { MetricWidgetData, MetricWidgetSettings, WidgetTheme, WidgetVariant } from '../types';
|
|
3
3
|
interface MetricWidgetProps {
|
|
4
4
|
data: MetricWidgetData;
|
|
5
|
-
|
|
5
|
+
settings?: MetricWidgetSettings;
|
|
6
|
+
/** @deprecated Use settings.theme */
|
|
7
|
+
theme?: WidgetTheme;
|
|
8
|
+
/** @deprecated Use settings.variant */
|
|
6
9
|
variant?: WidgetVariant;
|
|
10
|
+
/** @deprecated Use settings.size */
|
|
7
11
|
size?: 'sm' | 'md' | 'lg';
|
|
12
|
+
/** @deprecated Use settings.className */
|
|
8
13
|
className?: string;
|
|
14
|
+
/** @deprecated Use settings.style */
|
|
9
15
|
style?: React.CSSProperties;
|
|
10
16
|
}
|
|
11
17
|
declare const MetricWidget: React.FC<MetricWidgetProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NavbarWidgetData, WidgetTheme, WidgetVariant } from '../types';
|
|
3
|
+
export interface NavbarWidgetSettings {
|
|
4
|
+
variant?: WidgetVariant;
|
|
5
|
+
size?: 'sm' | 'md' | 'lg';
|
|
6
|
+
breakpoint?: number;
|
|
7
|
+
}
|
|
8
|
+
interface NavbarWidgetProps {
|
|
9
|
+
data: NavbarWidgetData;
|
|
10
|
+
settings?: NavbarWidgetSettings;
|
|
11
|
+
theme: WidgetTheme;
|
|
12
|
+
className?: string;
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
}
|
|
15
|
+
declare const NavbarWidget: React.FC<NavbarWidgetProps>;
|
|
16
|
+
export default NavbarWidget;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { OrderWidgetData,
|
|
2
|
+
import { OrderWidgetData, OrderWidgetSettings } from '../types';
|
|
3
3
|
interface OrderWidgetProps {
|
|
4
4
|
data: OrderWidgetData;
|
|
5
|
-
|
|
6
|
-
variant?: WidgetVariant;
|
|
7
|
-
size?: 'sm' | 'md' | 'lg';
|
|
8
|
-
className?: string;
|
|
9
|
-
style?: React.CSSProperties;
|
|
5
|
+
settings?: OrderWidgetSettings;
|
|
10
6
|
}
|
|
11
7
|
declare const OrderWidget: React.FC<OrderWidgetProps>;
|
|
12
8
|
export default OrderWidget;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ProductWidgetData,
|
|
2
|
+
import { ProductWidgetData, ProductWidgetSettings } from '../types';
|
|
3
3
|
interface ProductWidgetProps {
|
|
4
4
|
data: ProductWidgetData;
|
|
5
|
-
|
|
6
|
-
variant?: WidgetVariant;
|
|
7
|
-
size?: 'sm' | 'md' | 'lg';
|
|
8
|
-
className?: string;
|
|
9
|
-
style?: React.CSSProperties;
|
|
5
|
+
settings?: ProductWidgetSettings;
|
|
10
6
|
}
|
|
11
7
|
declare const ProductWidget: React.FC<ProductWidgetProps>;
|
|
12
8
|
export default ProductWidget;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TextWidgetData, WidgetTheme, WidgetVariant } from '../types';
|
|
2
|
+
import { TextWidgetData, TextWidgetSettings, WidgetTheme, WidgetVariant } from '../types';
|
|
3
3
|
interface TextWidgetProps {
|
|
4
4
|
data: TextWidgetData;
|
|
5
|
-
|
|
5
|
+
settings?: TextWidgetSettings;
|
|
6
|
+
/** @deprecated Use settings.theme */
|
|
7
|
+
theme?: WidgetTheme;
|
|
8
|
+
/** @deprecated Use settings.variant */
|
|
6
9
|
variant?: WidgetVariant;
|
|
10
|
+
/** @deprecated Use settings.size */
|
|
7
11
|
size?: 'sm' | 'md' | 'lg';
|
|
12
|
+
/** @deprecated Use settings.className */
|
|
8
13
|
className?: string;
|
|
14
|
+
/** @deprecated Use settings.style */
|
|
9
15
|
style?: React.CSSProperties;
|
|
10
16
|
}
|
|
11
17
|
declare const TextWidget: React.FC<TextWidgetProps>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export type WidgetType = 'metric' | 'info' | 'product' | 'order' | 'list' | 'text' | 'header' | 'carousel' | 'testimonial' | 'gridCarousel';
|
|
3
|
-
|
|
2
|
+
export type WidgetType = 'metric' | 'info' | 'product' | 'order' | 'list' | 'text' | 'header' | 'carousel' | 'image' | 'testimonial' | 'gridCarousel' | 'navbar' | 'contentBlock';
|
|
3
|
+
/**
|
|
4
|
+
* WidgetTheme - all available theme options
|
|
5
|
+
*/
|
|
6
|
+
export type WidgetTheme = 'minimal' | 'modern' | 'professional' | 'compact' | 'detailed' | 'card' | 'inline' | 'hero' | 'base' | 'two-row' | 'centered' | 'editorial' | 'ecommerce' | 'creative' | 'luxury';
|
|
4
7
|
export type GridConfig = {
|
|
5
8
|
mobile?: number;
|
|
6
9
|
tablet?: number;
|
|
@@ -9,7 +12,10 @@ export type GridConfig = {
|
|
|
9
12
|
spacing?: 'none' | 'sm' | 'md' | 'lg';
|
|
10
13
|
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
11
14
|
};
|
|
12
|
-
export type WidgetVariant = 'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info' | 'neutral';
|
|
15
|
+
export type WidgetVariant = 'primary' | 'secondary' | 'success' | 'danger' | 'error' | 'warning' | 'info' | 'neutral';
|
|
16
|
+
/**
|
|
17
|
+
* Base Widget Data - Contains actual content/information to display
|
|
18
|
+
*/
|
|
13
19
|
export interface BaseWidgetData {
|
|
14
20
|
id?: string;
|
|
15
21
|
title?: React.ReactNode;
|
|
@@ -29,6 +35,23 @@ export interface BaseWidgetData {
|
|
|
29
35
|
};
|
|
30
36
|
metadata?: Record<string, React.ReactNode>;
|
|
31
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Base Widget Settings - Contains configuration options and appearance settings
|
|
40
|
+
*/
|
|
41
|
+
export interface BaseWidgetSettings {
|
|
42
|
+
theme?: WidgetTheme;
|
|
43
|
+
variant?: WidgetVariant;
|
|
44
|
+
size?: 'sm' | 'md' | 'lg';
|
|
45
|
+
className?: string;
|
|
46
|
+
style?: React.CSSProperties;
|
|
47
|
+
showDividers?: boolean;
|
|
48
|
+
showIcon?: boolean;
|
|
49
|
+
showBadge?: boolean;
|
|
50
|
+
showActions?: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Metric Widget Data - The actual metric values and content
|
|
54
|
+
*/
|
|
32
55
|
export interface MetricWidgetData extends BaseWidgetData {
|
|
33
56
|
value: React.ReactNode;
|
|
34
57
|
label?: React.ReactNode;
|
|
@@ -43,11 +66,34 @@ export interface MetricWidgetData extends BaseWidgetData {
|
|
|
43
66
|
};
|
|
44
67
|
progress?: number;
|
|
45
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Metric Widget Settings - Display and behavior options
|
|
71
|
+
*/
|
|
72
|
+
export interface MetricWidgetSettings extends BaseWidgetSettings {
|
|
73
|
+
showTrend?: boolean;
|
|
74
|
+
showTarget?: boolean;
|
|
75
|
+
showProgress?: boolean;
|
|
76
|
+
progressType?: 'bar' | 'circular' | 'none';
|
|
77
|
+
animateValue?: boolean;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Info Widget Data - Information content to display
|
|
81
|
+
*/
|
|
46
82
|
export interface InfoWidgetData extends BaseWidgetData {
|
|
47
83
|
text: React.ReactNode;
|
|
48
84
|
subText?: React.ReactNode;
|
|
49
|
-
status?: WidgetVariant;
|
|
50
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Info Widget Settings - Display options
|
|
88
|
+
*/
|
|
89
|
+
export interface InfoWidgetSettings extends BaseWidgetSettings {
|
|
90
|
+
iconVariant?: WidgetVariant;
|
|
91
|
+
layout?: 'horizontal' | 'vertical';
|
|
92
|
+
alignment?: 'left' | 'center' | 'right';
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Product Widget Data - Product information
|
|
96
|
+
*/
|
|
51
97
|
export interface ProductWidgetData extends BaseWidgetData {
|
|
52
98
|
name: string;
|
|
53
99
|
price: number | string;
|
|
@@ -58,6 +104,19 @@ export interface ProductWidgetData extends BaseWidgetData {
|
|
|
58
104
|
inStock?: boolean;
|
|
59
105
|
tags?: string[];
|
|
60
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Product Widget Settings - Display and layout options
|
|
109
|
+
*/
|
|
110
|
+
export interface ProductWidgetSettings extends BaseWidgetSettings {
|
|
111
|
+
showRating?: boolean;
|
|
112
|
+
showCategory?: boolean;
|
|
113
|
+
showTags?: boolean;
|
|
114
|
+
imagePosition?: 'top' | 'left' | 'right';
|
|
115
|
+
cardStyle?: 'elevated' | 'outlined' | 'flat';
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Order Widget Data - Order information
|
|
119
|
+
*/
|
|
61
120
|
export interface OrderWidgetData extends BaseWidgetData {
|
|
62
121
|
id: string;
|
|
63
122
|
total: number | string;
|
|
@@ -72,6 +131,7 @@ export interface OrderWidgetData extends BaseWidgetData {
|
|
|
72
131
|
name: string;
|
|
73
132
|
quantity?: number;
|
|
74
133
|
price?: number | string;
|
|
134
|
+
image?: string;
|
|
75
135
|
}>;
|
|
76
136
|
shippingAddress?: {
|
|
77
137
|
street: string;
|
|
@@ -83,6 +143,9 @@ export interface OrderWidgetData extends BaseWidgetData {
|
|
|
83
143
|
subtotal?: number | string;
|
|
84
144
|
tax?: number | string;
|
|
85
145
|
shipping?: number | string;
|
|
146
|
+
discount?: number | string;
|
|
147
|
+
currency?: string;
|
|
148
|
+
trackingNumber?: string;
|
|
86
149
|
actions?: Array<{
|
|
87
150
|
label: React.ReactNode;
|
|
88
151
|
onClick?: () => void;
|
|
@@ -90,6 +153,19 @@ export interface OrderWidgetData extends BaseWidgetData {
|
|
|
90
153
|
variant?: 'primary' | 'secondary' | 'ghost' | 'outlined';
|
|
91
154
|
}>;
|
|
92
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* Order Widget Settings - Display configuration
|
|
158
|
+
*/
|
|
159
|
+
export interface OrderWidgetSettings extends BaseWidgetSettings {
|
|
160
|
+
showCustomer?: boolean;
|
|
161
|
+
showItems?: boolean;
|
|
162
|
+
showAddress?: boolean;
|
|
163
|
+
showBreakdown?: boolean;
|
|
164
|
+
compact?: boolean;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* List Widget Data - List content
|
|
168
|
+
*/
|
|
93
169
|
export interface ListWidgetData extends BaseWidgetData {
|
|
94
170
|
items: Array<{
|
|
95
171
|
id?: string;
|
|
@@ -113,18 +189,23 @@ export interface ListWidgetData extends BaseWidgetData {
|
|
|
113
189
|
variant?: 'primary' | 'secondary' | 'ghost' | 'outlined';
|
|
114
190
|
}>;
|
|
115
191
|
}>;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* List Widget Settings - Display and layout configuration
|
|
195
|
+
*/
|
|
196
|
+
export interface ListWidgetSettings extends BaseWidgetSettings {
|
|
116
197
|
showDividers?: boolean;
|
|
117
198
|
maxItems?: number;
|
|
199
|
+
itemsPerPage?: number;
|
|
200
|
+
showPagination?: boolean;
|
|
201
|
+
layout?: 'default' | 'compact' | 'comfortable';
|
|
118
202
|
}
|
|
203
|
+
/**
|
|
204
|
+
* Text Widget Data - Text content
|
|
205
|
+
*/
|
|
119
206
|
export interface TextWidgetData extends BaseWidgetData {
|
|
120
207
|
content?: React.ReactNode;
|
|
121
208
|
caption?: React.ReactNode;
|
|
122
|
-
variant?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'body';
|
|
123
|
-
alignment?: 'left' | 'center' | 'right';
|
|
124
|
-
titleColor?: string;
|
|
125
|
-
contentColor?: string;
|
|
126
|
-
captionColor?: string;
|
|
127
|
-
backgroundColor?: string;
|
|
128
209
|
actions?: Array<{
|
|
129
210
|
label: React.ReactNode;
|
|
130
211
|
onClick?: () => void;
|
|
@@ -133,6 +214,20 @@ export interface TextWidgetData extends BaseWidgetData {
|
|
|
133
214
|
type?: 'button' | 'link';
|
|
134
215
|
}>;
|
|
135
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* Text Widget Settings - Typography and styling options
|
|
219
|
+
*/
|
|
220
|
+
export interface TextWidgetSettings extends Omit<BaseWidgetSettings, 'variant'> {
|
|
221
|
+
variant?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'body';
|
|
222
|
+
alignment?: 'left' | 'center' | 'right';
|
|
223
|
+
titleColor?: string;
|
|
224
|
+
contentColor?: string;
|
|
225
|
+
captionColor?: string;
|
|
226
|
+
backgroundColor?: string;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Header Widget Data - Header content
|
|
230
|
+
*/
|
|
136
231
|
export interface HeaderWidgetData extends BaseWidgetData {
|
|
137
232
|
breadcrumbs?: Array<{
|
|
138
233
|
label: React.ReactNode;
|
|
@@ -155,8 +250,20 @@ export interface HeaderWidgetData extends BaseWidgetData {
|
|
|
155
250
|
variant?: WidgetVariant;
|
|
156
251
|
type?: 'button' | 'link';
|
|
157
252
|
}>;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Header Widget Settings - Layout and styling options
|
|
256
|
+
*/
|
|
257
|
+
export interface HeaderWidgetSettings extends BaseWidgetSettings {
|
|
258
|
+
showBreadcrumbs?: boolean;
|
|
259
|
+
showAvatar?: boolean;
|
|
260
|
+
layout?: 'default' | 'centered' | 'split';
|
|
261
|
+
sticky?: boolean;
|
|
158
262
|
backgroundColor?: string;
|
|
159
263
|
}
|
|
264
|
+
/**
|
|
265
|
+
* Carousel Widget Data - Slide content
|
|
266
|
+
*/
|
|
160
267
|
export interface CarouselWidgetData extends BaseWidgetData {
|
|
161
268
|
slides: Array<{
|
|
162
269
|
id: string;
|
|
@@ -179,6 +286,11 @@ export interface CarouselWidgetData extends BaseWidgetData {
|
|
|
179
286
|
structuredData?: Record<string, any>;
|
|
180
287
|
};
|
|
181
288
|
}>;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Carousel Widget Settings - Carousel behavior and appearance
|
|
292
|
+
*/
|
|
293
|
+
export interface CarouselWidgetSettings extends BaseWidgetSettings {
|
|
182
294
|
swiperConfig?: {
|
|
183
295
|
navigation?: {
|
|
184
296
|
enabled: boolean;
|
|
@@ -206,7 +318,36 @@ export interface CarouselWidgetData extends BaseWidgetData {
|
|
|
206
318
|
maxHeight?: string;
|
|
207
319
|
showOverlay?: boolean;
|
|
208
320
|
loadingPlaceholder?: boolean;
|
|
321
|
+
hideNavigationOnMobile?: boolean;
|
|
322
|
+
buttonSize?: 'sm' | 'md' | 'lg';
|
|
323
|
+
buttonVariant?: 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger' | 'success' | 'warning';
|
|
324
|
+
}
|
|
325
|
+
import type { ButtonProps } from '../Button/Button';
|
|
326
|
+
/**
|
|
327
|
+
* Image Widget Data - Image content
|
|
328
|
+
*/
|
|
329
|
+
export interface ImageWidgetData extends BaseWidgetData {
|
|
330
|
+
src: string;
|
|
331
|
+
alt: string;
|
|
332
|
+
heading?: string;
|
|
333
|
+
subHeading?: string;
|
|
334
|
+
description?: string;
|
|
335
|
+
ctaLabel?: string;
|
|
336
|
+
ctaUrl?: string;
|
|
337
|
+
onCtaClick?: () => void;
|
|
209
338
|
}
|
|
339
|
+
/**
|
|
340
|
+
* Image Widget Settings - Display options
|
|
341
|
+
*/
|
|
342
|
+
export interface ImageWidgetSettings extends BaseWidgetSettings {
|
|
343
|
+
overlayTheme?: 'dark' | 'light';
|
|
344
|
+
ctaVariant?: ButtonProps['variant'];
|
|
345
|
+
aspectRatio?: string;
|
|
346
|
+
objectFit?: 'cover' | 'contain' | 'fill' | 'none';
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Testimonial Widget Data - Testimonial content
|
|
350
|
+
*/
|
|
210
351
|
export interface TestimonialWidgetData extends BaseWidgetData {
|
|
211
352
|
testimonials: Array<{
|
|
212
353
|
id?: string;
|
|
@@ -223,8 +364,95 @@ export interface TestimonialWidgetData extends BaseWidgetData {
|
|
|
223
364
|
showNavigation?: boolean;
|
|
224
365
|
showDots?: boolean;
|
|
225
366
|
}
|
|
367
|
+
/**
|
|
368
|
+
* Testimonial Widget Settings - Display configuration
|
|
369
|
+
*/
|
|
370
|
+
export interface TestimonialWidgetSettings extends BaseWidgetSettings {
|
|
371
|
+
showNavigation?: boolean;
|
|
372
|
+
showDots?: boolean;
|
|
373
|
+
autoplay?: boolean;
|
|
374
|
+
autoplayDelay?: number;
|
|
375
|
+
slidesPerView?: number;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Navbar Widget Data - Navigation content
|
|
379
|
+
*/
|
|
380
|
+
export interface NavbarWidgetData extends BaseWidgetData {
|
|
381
|
+
logo?: React.ReactNode;
|
|
382
|
+
navItems?: Array<{
|
|
383
|
+
id: string;
|
|
384
|
+
label: React.ReactNode;
|
|
385
|
+
href?: string;
|
|
386
|
+
icon?: React.ReactNode;
|
|
387
|
+
children?: Array<{
|
|
388
|
+
id: string;
|
|
389
|
+
label: React.ReactNode;
|
|
390
|
+
href?: string;
|
|
391
|
+
badge?: React.ReactNode;
|
|
392
|
+
onClick?: () => void;
|
|
393
|
+
active?: boolean;
|
|
394
|
+
disabled?: boolean;
|
|
395
|
+
description?: React.ReactNode;
|
|
396
|
+
icon?: React.ReactNode;
|
|
397
|
+
}>;
|
|
398
|
+
onClick?: () => void;
|
|
399
|
+
active?: boolean;
|
|
400
|
+
disabled?: boolean;
|
|
401
|
+
badge?: React.ReactNode;
|
|
402
|
+
megaMenu?: boolean;
|
|
403
|
+
megaMenuColumns?: Array<{
|
|
404
|
+
title?: React.ReactNode;
|
|
405
|
+
items: Array<{
|
|
406
|
+
id: string;
|
|
407
|
+
label: React.ReactNode;
|
|
408
|
+
description?: React.ReactNode;
|
|
409
|
+
href?: string;
|
|
410
|
+
icon?: React.ReactNode;
|
|
411
|
+
badge?: React.ReactNode;
|
|
412
|
+
onClick?: () => void;
|
|
413
|
+
active?: boolean;
|
|
414
|
+
}>;
|
|
415
|
+
}>;
|
|
416
|
+
}>;
|
|
417
|
+
actions?: React.ReactNode;
|
|
418
|
+
topBar?: {
|
|
419
|
+
content?: React.ReactNode;
|
|
420
|
+
leftContent?: React.ReactNode;
|
|
421
|
+
rightContent?: React.ReactNode;
|
|
422
|
+
variant?: 'subtle' | 'bold' | 'accent' | 'dark' | 'gradient';
|
|
423
|
+
dismissible?: boolean;
|
|
424
|
+
onDismiss?: () => void;
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Navbar Widget Settings - Layout and behavior options
|
|
429
|
+
*/
|
|
430
|
+
export interface NavbarWidgetSettings extends BaseWidgetSettings {
|
|
431
|
+
searchEnabled?: boolean;
|
|
432
|
+
searchPlaceholder?: string;
|
|
433
|
+
onSearch?: (query: string) => void;
|
|
434
|
+
onLogoClick?: () => void;
|
|
435
|
+
elevated?: boolean;
|
|
436
|
+
sticky?: boolean;
|
|
437
|
+
fullWidth?: boolean;
|
|
438
|
+
layout?: 'single-row' | 'two-row' | 'centered';
|
|
439
|
+
twoRowBottomStyle?: 'default' | 'divider' | 'dark-bottom' | 'gradient-bottom' | 'elevated-bottom';
|
|
440
|
+
scrollBehavior?: 'transparent-to-solid';
|
|
441
|
+
scrollThreshold?: number;
|
|
442
|
+
onScrollStateChange?: (scrolled: boolean) => void;
|
|
443
|
+
responsive?: boolean;
|
|
444
|
+
mobileOnly?: boolean;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Grid Carousel Widget Data - Carousel items
|
|
448
|
+
*/
|
|
226
449
|
export interface GridCarouselWidgetData {
|
|
227
450
|
items: React.ReactNode[];
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Grid Carousel Widget Settings - Carousel configuration
|
|
454
|
+
*/
|
|
455
|
+
export interface GridCarouselWidgetSettings {
|
|
228
456
|
itemsPerView?: {
|
|
229
457
|
mobile?: number;
|
|
230
458
|
tablet?: number;
|
|
@@ -237,19 +465,165 @@ export interface GridCarouselWidgetData {
|
|
|
237
465
|
showPagination?: boolean;
|
|
238
466
|
scrollBehavior?: 'page' | 'item';
|
|
239
467
|
borderRadius?: boolean;
|
|
468
|
+
className?: string;
|
|
469
|
+
style?: React.CSSProperties;
|
|
240
470
|
}
|
|
471
|
+
export interface ContentBlockWidgetData extends Omit<BaseWidgetData, 'metadata'> {
|
|
472
|
+
media?: {
|
|
473
|
+
type?: 'image' | 'avatar' | 'icon' | 'video' | 'gallery' | 'logo' | 'illustration';
|
|
474
|
+
src?: string;
|
|
475
|
+
alt?: string;
|
|
476
|
+
items?: Array<{
|
|
477
|
+
src: string;
|
|
478
|
+
alt: string;
|
|
479
|
+
caption?: React.ReactNode;
|
|
480
|
+
}>;
|
|
481
|
+
icon?: React.ReactNode;
|
|
482
|
+
iconSize?: 'sm' | 'md' | 'lg' | 'xl';
|
|
483
|
+
videoUrl?: string;
|
|
484
|
+
poster?: string;
|
|
485
|
+
aspectRatio?: '1:1' | '4:3' | '16:9' | '3:2' | '21:9' | 'auto';
|
|
486
|
+
objectFit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
|
|
487
|
+
rounded?: boolean | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
488
|
+
shadow?: boolean | 'sm' | 'md' | 'lg' | 'xl';
|
|
489
|
+
border?: boolean | 'sm' | 'md' | 'lg';
|
|
490
|
+
zoom?: boolean;
|
|
491
|
+
};
|
|
492
|
+
content?: {
|
|
493
|
+
eyebrow?: React.ReactNode;
|
|
494
|
+
heading?: React.ReactNode;
|
|
495
|
+
subheading?: React.ReactNode;
|
|
496
|
+
body?: React.ReactNode;
|
|
497
|
+
caption?: React.ReactNode;
|
|
498
|
+
footnote?: React.ReactNode;
|
|
499
|
+
eyebrowVariant?: 'overline' | 'caption' | 'body2';
|
|
500
|
+
headingVariant?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
501
|
+
subheadingVariant?: 'h3' | 'h4' | 'h5' | 'h6' | 'subtitle1' | 'subtitle2';
|
|
502
|
+
bodyVariant?: 'body1' | 'body2';
|
|
503
|
+
list?: Array<{
|
|
504
|
+
text: React.ReactNode;
|
|
505
|
+
icon?: React.ReactNode;
|
|
506
|
+
checked?: boolean;
|
|
507
|
+
}>;
|
|
508
|
+
listType?: 'bullet' | 'number' | 'check' | 'icon' | 'none';
|
|
509
|
+
};
|
|
510
|
+
product?: {
|
|
511
|
+
price?: number | string;
|
|
512
|
+
comparePrice?: number | string;
|
|
513
|
+
currency?: string;
|
|
514
|
+
sku?: string;
|
|
515
|
+
stock?: number | 'in-stock' | 'out-of-stock' | 'limited';
|
|
516
|
+
rating?: number;
|
|
517
|
+
reviewCount?: number;
|
|
518
|
+
discount?: string;
|
|
519
|
+
};
|
|
520
|
+
tags?: Array<{
|
|
521
|
+
text: string;
|
|
522
|
+
variant?: WidgetVariant;
|
|
523
|
+
icon?: React.ReactNode;
|
|
524
|
+
href?: string;
|
|
525
|
+
}>;
|
|
526
|
+
stats?: Array<{
|
|
527
|
+
value: React.ReactNode;
|
|
528
|
+
label: React.ReactNode;
|
|
529
|
+
icon?: React.ReactNode;
|
|
530
|
+
variant?: WidgetVariant;
|
|
531
|
+
}>;
|
|
532
|
+
author?: {
|
|
533
|
+
name: string;
|
|
534
|
+
role?: string;
|
|
535
|
+
company?: string;
|
|
536
|
+
avatar?: string;
|
|
537
|
+
social?: Array<{
|
|
538
|
+
platform: string;
|
|
539
|
+
url: string;
|
|
540
|
+
icon?: React.ReactNode;
|
|
541
|
+
}>;
|
|
542
|
+
};
|
|
543
|
+
metadata?: Array<{
|
|
544
|
+
label: string;
|
|
545
|
+
value: React.ReactNode;
|
|
546
|
+
icon?: React.ReactNode;
|
|
547
|
+
}>;
|
|
548
|
+
actions?: Array<{
|
|
549
|
+
label: React.ReactNode;
|
|
550
|
+
onClick?: () => void;
|
|
551
|
+
href?: string;
|
|
552
|
+
variant?: WidgetVariant | 'outline' | 'ghost';
|
|
553
|
+
type?: 'button' | 'link' | 'icon';
|
|
554
|
+
icon?: React.ReactNode;
|
|
555
|
+
iconPosition?: 'left' | 'right';
|
|
556
|
+
size?: 'sm' | 'md' | 'lg';
|
|
557
|
+
fullWidth?: boolean;
|
|
558
|
+
}>;
|
|
559
|
+
colors?: {
|
|
560
|
+
eyebrow?: string;
|
|
561
|
+
heading?: string;
|
|
562
|
+
subheading?: string;
|
|
563
|
+
body?: string;
|
|
564
|
+
caption?: string;
|
|
565
|
+
background?: string;
|
|
566
|
+
accent?: string;
|
|
567
|
+
};
|
|
568
|
+
quote?: {
|
|
569
|
+
text: React.ReactNode;
|
|
570
|
+
author?: string;
|
|
571
|
+
};
|
|
572
|
+
timeline?: {
|
|
573
|
+
date?: string;
|
|
574
|
+
icon?: React.ReactNode;
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Grid Widget Data - Collection of widgets
|
|
579
|
+
*/
|
|
241
580
|
export interface GridWidgetData {
|
|
242
581
|
widgets: WidgetConfig[];
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* Grid Widget Settings - Grid layout configuration
|
|
585
|
+
*/
|
|
586
|
+
export interface GridWidgetSettings {
|
|
243
587
|
gap?: 'none' | 'sm' | 'md' | 'lg';
|
|
588
|
+
grid?: GridConfig;
|
|
244
589
|
}
|
|
245
|
-
export type WidgetData = MetricWidgetData | InfoWidgetData | ProductWidgetData | OrderWidgetData | ListWidgetData | TextWidgetData | HeaderWidgetData | CarouselWidgetData | TestimonialWidgetData | GridCarouselWidgetData;
|
|
590
|
+
export type WidgetData = MetricWidgetData | InfoWidgetData | ProductWidgetData | OrderWidgetData | ListWidgetData | TextWidgetData | HeaderWidgetData | CarouselWidgetData | ImageWidgetData | TestimonialWidgetData | GridCarouselWidgetData | NavbarWidgetData | ContentBlockWidgetData | GridWidgetData;
|
|
591
|
+
export type WidgetSettings = MetricWidgetSettings | InfoWidgetSettings | ProductWidgetSettings | OrderWidgetSettings | ListWidgetSettings | TextWidgetSettings | HeaderWidgetSettings | CarouselWidgetSettings | ImageWidgetSettings | TestimonialWidgetSettings | GridCarouselWidgetSettings | NavbarWidgetSettings | GridWidgetSettings | BaseWidgetSettings;
|
|
592
|
+
/**
|
|
593
|
+
* Widget Configuration - Combines type, data, and settings
|
|
594
|
+
*
|
|
595
|
+
* @example
|
|
596
|
+
* // Metric widget with data and settings separated
|
|
597
|
+
* const metricWidget: WidgetConfig = {
|
|
598
|
+
* type: 'metric',
|
|
599
|
+
* data: {
|
|
600
|
+
* value: '$12,345',
|
|
601
|
+
* label: 'Total Revenue',
|
|
602
|
+
* trend: { direction: 'up', value: 12.5 }
|
|
603
|
+
* },
|
|
604
|
+
* settings: {
|
|
605
|
+
* theme: 'modern',
|
|
606
|
+
* variant: 'success',
|
|
607
|
+
* size: 'lg',
|
|
608
|
+
* showTrend: true,
|
|
609
|
+
* animateValue: true
|
|
610
|
+
* }
|
|
611
|
+
* };
|
|
612
|
+
*/
|
|
246
613
|
export interface WidgetConfig {
|
|
247
614
|
type: WidgetType | 'grid';
|
|
248
|
-
|
|
615
|
+
data: WidgetData;
|
|
616
|
+
settings?: WidgetSettings;
|
|
617
|
+
/** @deprecated Use settings.theme */
|
|
618
|
+
theme?: WidgetTheme;
|
|
619
|
+
/** @deprecated Use settings.variant */
|
|
249
620
|
variant?: WidgetVariant;
|
|
621
|
+
/** @deprecated Use settings.size */
|
|
250
622
|
size?: 'sm' | 'md' | 'lg';
|
|
251
|
-
|
|
252
|
-
grid?: GridConfig;
|
|
623
|
+
/** @deprecated Use settings.className */
|
|
253
624
|
className?: string;
|
|
625
|
+
/** @deprecated Use settings.style */
|
|
254
626
|
style?: React.CSSProperties;
|
|
627
|
+
/** @deprecated Use settings */
|
|
628
|
+
grid?: GridConfig;
|
|
255
629
|
}
|
|
@@ -54,3 +54,6 @@ export declare const ArrowDownIcon: import("react-icons/lib").IconType;
|
|
|
54
54
|
export declare const FilterIcon: import("react-icons/lib").IconType;
|
|
55
55
|
export declare const ChevronsLeftIcon: import("react-icons/lib").IconType;
|
|
56
56
|
export declare const ChevronsRightIcon: import("react-icons/lib").IconType;
|
|
57
|
+
export declare const BuildingIcon: import("react-icons/lib").IconType;
|
|
58
|
+
export declare const DollarSignIcon: import("react-icons/lib").IconType;
|
|
59
|
+
export declare const ActivityIcon: import("react-icons/lib").IconType;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { Autocomplete } from './components/Autocomplete';
|
|
2
|
+
export type { AutocompleteOption, AutocompleteProps } from './components/Autocomplete';
|
|
1
3
|
export { Button } from './components/Button';
|
|
2
4
|
export type { ButtonProps } from './components/Button';
|
|
3
5
|
export { Checkbox } from './components/Checkbox';
|
|
@@ -39,7 +41,7 @@ export type { ToastContainerProps, ToastOptions, ToastProps, ToastVariant, Toast
|
|
|
39
41
|
export { Tooltip } from './components/Tooltip';
|
|
40
42
|
export type { TooltipProps } from './components/Tooltip';
|
|
41
43
|
export { Widget } from './components/Widget';
|
|
42
|
-
export type { WidgetProps, WidgetConfig, WidgetTheme, WidgetVariant, MetricWidgetData, InfoWidgetData, ProductWidgetData, OrderWidgetData, ListWidgetData, TextWidgetData, HeaderWidgetData, GridWidgetData, IntelligentGridProps } from './components/Widget';
|
|
44
|
+
export type { WidgetProps, WidgetConfig, WidgetTheme, WidgetVariant, MetricWidgetData, MetricWidgetSettings, InfoWidgetData, ProductWidgetData, ProductWidgetSettings, OrderWidgetData, ListWidgetData, TextWidgetData, HeaderWidgetData, GridWidgetData, IntelligentGridProps } from './components/Widget';
|
|
43
45
|
export { AdminHeader } from './components/AdminHeader';
|
|
44
46
|
export type { AdminHeaderProps, NotificationItem as AdminNotificationItem, UserMenuItem, QuickAction, SearchSuggestion } from './components/AdminHeader';
|
|
45
47
|
export { Avatar } from './components/Avatar';
|
|
@@ -54,8 +56,6 @@ export { DataGrid } from './components/DataGrid';
|
|
|
54
56
|
export type { DataGridColumn, DataGridProps, GridFilterItem, GridFilterModel, GridFilterOperator, GridRowSelectionModel, } from './components/DataGrid';
|
|
55
57
|
export { Divider } from './components/Divider';
|
|
56
58
|
export type { DividerProps } from './components/Divider';
|
|
57
|
-
export { Header } from './components/Header';
|
|
58
|
-
export type { HeaderProps, NotificationItem } from './components/Header';
|
|
59
59
|
export { Link } from './components/Link';
|
|
60
60
|
export type { LinkProps } from './components/Link';
|
|
61
61
|
export { SideMenu } from './components/SideMenu';
|
|
@@ -85,12 +85,16 @@ export type { InfoTextBaseProps, InfoTextStatProps, InfoTextFeatureProps, InfoTe
|
|
|
85
85
|
export { ProductCard } from './widgets/ProductCard';
|
|
86
86
|
export type { ProductCardProps, ProductCardWideProps } from './widgets/ProductCard';
|
|
87
87
|
export { OrderCard } from './widgets/OrderCard';
|
|
88
|
-
export type {
|
|
88
|
+
export type { OrderItem } from './widgets/OrderCard';
|
|
89
89
|
export { InfoListCard } from './widgets/InfoListCard';
|
|
90
90
|
export type { InfoListCardProps, InfoListItem } from './widgets/InfoListCard';
|
|
91
91
|
export { OrderConfirmation } from './widgets/OrderConfirmation';
|
|
92
92
|
export type { OrderConfirmationProps, OrderConfirmationItem, OrderConfirmationAddress } from './widgets/OrderConfirmation';
|
|
93
93
|
export { OrderDetails } from './widgets/OrderDetails';
|
|
94
94
|
export type { OrderDetailsProps, OrderDetailsItem, OrderDetailsAddress } from './widgets/OrderDetails';
|
|
95
|
-
export {
|
|
96
|
-
export type {
|
|
95
|
+
export { DashboardCard } from './widgets/DashboardCard';
|
|
96
|
+
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 './widgets/DashboardCard';
|
|
97
|
+
export { Navbar } from './components/Navbar';
|
|
98
|
+
export type { NavigationItem, MegaMenuColumn, TopBarConfig, NavbarDesktopProps, NavbarMobileProps, NavbarResponsiveProps } from './components/Navbar';
|
|
99
|
+
export { Navbar as Header } from './components/Navbar';
|
|
100
|
+
export type { NavbarDesktopProps as HeaderDesktopProps, NavbarMobileProps as HeaderMobileProps, NavbarResponsiveProps as HeaderResponsiveProps } from './components/Navbar';
|