@vtx-ui/react 0.0.1-beta.12 → 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/DatePicker/Calendar.d.ts +15 -0
- package/dist/types/components/DatePicker/DatePicker.d.ts +99 -0
- package/dist/types/components/DatePicker/DateRangePicker.d.ts +114 -0
- package/dist/types/components/DatePicker/index.d.ts +6 -0
- package/dist/types/components/FormControl/FormControl.d.ts +77 -0
- package/dist/types/components/FormControl/index.d.ts +3 -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/RichTextEditor/RichTextEditor.d.ts +153 -0
- package/dist/types/components/RichTextEditor/index.d.ts +2 -0
- package/dist/types/components/Text/Text.d.ts +9 -3
- package/dist/types/components/Textarea/Textarea.d.ts +81 -0
- package/dist/types/components/Textarea/index.d.ts +3 -0
- package/dist/types/components/Widget/IntelligentGrid.d.ts +15 -0
- package/dist/types/components/Widget/Widget.d.ts +9 -0
- package/dist/types/components/Widget/index.d.ts +16 -0
- package/dist/types/components/Widget/renderers/CarouselWidget.d.ts +40 -0
- 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/GridCarouselWidget.d.ts +35 -0
- package/dist/types/components/Widget/renderers/HeaderWidget.d.ts +18 -0
- 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 +18 -0
- package/dist/types/components/Widget/renderers/ListWidget.d.ts +18 -0
- package/dist/types/components/Widget/renderers/MetricWidget.d.ts +18 -0
- package/dist/types/components/Widget/renderers/NavbarWidget.d.ts +16 -0
- package/dist/types/components/Widget/renderers/OrderWidget.d.ts +8 -0
- package/dist/types/components/Widget/renderers/ProductWidget.d.ts +8 -0
- package/dist/types/components/Widget/renderers/TestimonialWidget.d.ts +14 -0
- package/dist/types/components/Widget/renderers/TextWidget.d.ts +18 -0
- package/dist/types/components/Widget/types.d.ts +629 -0
- package/dist/types/icons/IconComponents.d.ts +4 -0
- package/dist/types/index.d.ts +19 -5
- package/dist/types/stories/components/Autocomplete.stories.d.ts +20 -0
- package/dist/types/stories/components/CarouselWidget.stories.d.ts +11 -0
- package/dist/types/stories/components/ContentBlockWidget.stories.d.ts +24 -0
- package/dist/types/stories/components/DatePicker.stories.d.ts +69 -0
- package/dist/types/stories/components/FormControl.stories.d.ts +57 -0
- package/dist/types/stories/components/GridCarouselWidget.stories.d.ts +17 -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/RichTextEditor.stories.d.ts +22 -0
- package/dist/types/stories/components/TestimonialWidget.stories.d.ts +47 -0
- package/dist/types/stories/components/TextWidget.stories.d.ts +10 -0
- package/dist/types/stories/components/Textarea.stories.d.ts +21 -0
- package/dist/types/stories/components/Toast.stories.d.ts +56 -13
- package/dist/types/stories/components/Widget.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 +14 -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 +2 -1
|
@@ -1,30 +1,12 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
title: string;
|
|
3
|
-
component: import("react").FC<import("../..").
|
|
4
|
-
subcomponents: {
|
|
5
|
-
Base: import("react").FC<import("../..").InfoTextBaseProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
-
Stat: import("react").FC<import("../..").InfoTextStatProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
|
-
Feature: import("react").FC<import("../..").InfoTextFeatureProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
-
Compact: import("react").FC<import("../..").InfoTextCompactProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
|
-
Vertical: import("react").FC<import("../..").InfoTextVerticalProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
10
|
-
};
|
|
3
|
+
component: import("react").FC<import("../..").WidgetProps>;
|
|
11
4
|
};
|
|
12
5
|
export default _default;
|
|
13
6
|
export declare const Base: () => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export declare const BaseVariants: () => import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export declare const BaseWithoutSubtext: () => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export declare const BaseWithoutCircle: () => import("react/jsx-runtime").JSX.Element;
|
|
17
7
|
export declare const Stat: () => import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export declare const StatVariants: () => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export declare const StatWithoutIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
export declare const StatWithoutCircle: () => import("react/jsx-runtime").JSX.Element;
|
|
21
8
|
export declare const Feature: () => import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export declare const FeatureVariants: () => import("react/jsx-runtime").JSX.Element;
|
|
23
9
|
export declare const Compact: () => import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
export declare const CompactVariants: () => import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
export declare const Vertical: () => import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
export declare const VerticalVariants: () => import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
export declare const AllIconVariants: () => import("react/jsx-runtime").JSX.Element;
|
|
28
10
|
export declare const MixedUsage: () => import("react/jsx-runtime").JSX.Element;
|
|
29
11
|
export declare const GridLayout: () => import("react/jsx-runtime").JSX.Element;
|
|
30
12
|
export declare const FeatureGrid: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Widget } from '../../components/Widget';
|
|
3
|
+
declare const meta: Meta<typeof Widget>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Widget>;
|
|
6
|
+
export declare const Base: Story;
|
|
7
|
+
export declare const BaseWithIcon: Story;
|
|
8
|
+
export declare const BaseNoTrend: Story;
|
|
9
|
+
export declare const CompactPrimary: Story;
|
|
10
|
+
export declare const CompactSuccess: Story;
|
|
11
|
+
export declare const CompactWarning: Story;
|
|
12
|
+
export declare const CompactDanger: Story;
|
|
13
|
+
export declare const DetailedWithProgress: Story;
|
|
14
|
+
export declare const DetailedWithIcon: Story;
|
|
15
|
+
export declare const DetailedComplete: Story;
|
|
16
|
+
export declare const ChartLine: Story;
|
|
17
|
+
export declare const ChartBar: Story;
|
|
18
|
+
export declare const ChartSecondary: Story;
|
|
19
|
+
export declare const ChartDanger: Story;
|
|
20
|
+
export declare const FilledStyles: Story;
|
|
21
|
+
export declare const FilledDetailed: Story;
|
|
22
|
+
export declare const FilledCharts: Story;
|
|
23
|
+
export declare const AdminDashboard: Story;
|
|
24
|
+
export declare const DetailedDashboard: Story;
|
|
25
|
+
export declare const ChartDashboard: Story;
|
|
26
|
+
export declare const MixedDashboard: Story;
|
|
27
|
+
export declare const MixedDashboardWithoutTrend: Story;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import
|
|
3
|
-
declare const meta: Meta<typeof
|
|
2
|
+
import Widget from '../../components/Widget/Widget';
|
|
3
|
+
declare const meta: Meta<typeof Widget>;
|
|
4
4
|
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof
|
|
5
|
+
type Story = StoryObj<typeof Widget>;
|
|
6
6
|
export declare const Delivered: Story;
|
|
7
|
-
export declare const Processing: Story;
|
|
8
|
-
export declare const Cancelled: Story;
|
|
9
|
-
export declare const LongProductName: Story;
|
|
10
|
-
export declare const Pending: Story;
|
|
11
|
-
export declare const NoImage: Story;
|
|
12
|
-
export declare const MultipleItems: Story;
|
|
13
7
|
export declare const OrdersList: Story;
|
|
@@ -1,36 +1,13 @@
|
|
|
1
1
|
import type { StoryObj } from '@storybook/react';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: import("react").FC<import("../..").
|
|
4
|
+
component: import("react").FC<import("../..").WidgetProps>;
|
|
5
5
|
parameters: {
|
|
6
6
|
layout: string;
|
|
7
7
|
};
|
|
8
8
|
tags: string[];
|
|
9
|
-
argTypes: {
|
|
10
|
-
onDownloadInvoice: {
|
|
11
|
-
action: string;
|
|
12
|
-
};
|
|
13
|
-
onContinueShopping: {
|
|
14
|
-
action: string;
|
|
15
|
-
};
|
|
16
|
-
onTrackOrder: {
|
|
17
|
-
action: string;
|
|
18
|
-
};
|
|
19
|
-
onViewDetails: {
|
|
20
|
-
action: string;
|
|
21
|
-
};
|
|
22
|
-
onContactSupport: {
|
|
23
|
-
action: string;
|
|
24
|
-
};
|
|
25
|
-
onShareOrder: {
|
|
26
|
-
action: string;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
9
|
};
|
|
30
10
|
export default meta;
|
|
31
11
|
type Story = StoryObj<typeof meta>;
|
|
32
12
|
export declare const Default: Story;
|
|
33
13
|
export declare const WithDiscount: Story;
|
|
34
|
-
export declare const MultipleItems: Story;
|
|
35
|
-
export declare const MinimalInfo: Story;
|
|
36
|
-
export declare const Delivered: Story;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import
|
|
3
|
-
declare const meta: Meta<typeof
|
|
2
|
+
import Widget from '../../components/Widget/Widget';
|
|
3
|
+
declare const meta: Meta<typeof Widget>;
|
|
4
4
|
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof
|
|
5
|
+
type Story = StoryObj<typeof Widget>;
|
|
6
6
|
export declare const Processing: Story;
|
|
7
|
-
export declare const Shipped: Story;
|
|
8
7
|
export declare const Delivered: Story;
|
|
9
|
-
export declare const Pending: Story;
|
|
10
|
-
export declare const Cancelled: Story;
|
|
11
|
-
export declare const MultipleItems: Story;
|
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component:
|
|
5
|
-
Base: React.FC<import("../..").ProductCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
-
Wide: React.FC<import("../..").ProductCardWideProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
-
Minimal: React.FC<import("../..").ProductCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
-
};
|
|
4
|
+
component: React.FC<import("../..").WidgetProps>;
|
|
9
5
|
};
|
|
10
6
|
export default _default;
|
|
11
7
|
export declare const Basic: () => import("react/jsx-runtime").JSX.Element;
|
|
12
8
|
export declare const WithWishlist: () => import("react/jsx-runtime").JSX.Element;
|
|
13
9
|
export declare const FeaturedProduct: () => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export declare const WithQuickView: () => import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export declare const WithInitialQuantity: () => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export declare const Loading: () => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export declare const WithoutCategory: () => import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export declare const WithoutWeight: () => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export declare const WithoutRating: () => import("react/jsx-runtime").JSX.Element;
|
|
20
10
|
export declare const ProductGrid: () => import("react/jsx-runtime").JSX.Element;
|
|
21
11
|
export declare const Interactive: () => import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export declare const WideVariant: () => import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
export declare const WideVariantImageRight: () => import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
export declare const MinimalVariant: () => import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
export declare const AllVariants: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Tokens, CustomTokens } from './tokens';
|
|
3
|
+
import type { ToastPosition } from '../components/Toast/types';
|
|
3
4
|
export type Size = 'sm' | 'md' | 'lg';
|
|
4
5
|
export type ColorContrast = 'light' | 'dark';
|
|
5
6
|
export interface ColorContrastConfig {
|
|
@@ -10,12 +11,15 @@ export interface ColorContrastConfig {
|
|
|
10
11
|
danger?: ColorContrast;
|
|
11
12
|
success?: ColorContrast;
|
|
12
13
|
warning?: ColorContrast;
|
|
14
|
+
info?: ColorContrast;
|
|
13
15
|
}
|
|
14
16
|
export interface Theme {
|
|
15
17
|
tokens: Tokens;
|
|
16
18
|
mode: 'light' | 'dark';
|
|
17
19
|
defaultSize: Size;
|
|
18
20
|
colorContrast: ColorContrastConfig;
|
|
21
|
+
linkComponent?: React.ElementType;
|
|
22
|
+
imageComponent?: React.ElementType;
|
|
19
23
|
}
|
|
20
24
|
export interface ThemeContextValue {
|
|
21
25
|
theme: Theme;
|
|
@@ -33,6 +37,16 @@ export interface ThemeProviderProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
33
37
|
defaultSize?: Size;
|
|
34
38
|
/** Color contrast configuration - specify if variant backgrounds are light or dark */
|
|
35
39
|
colorContrast?: ColorContrastConfig;
|
|
40
|
+
/** Toast container position */
|
|
41
|
+
toastPosition?: ToastPosition;
|
|
42
|
+
/** Maximum number of toasts to display at once */
|
|
43
|
+
toastLimit?: number;
|
|
44
|
+
/** Disable toast notifications globally */
|
|
45
|
+
disableToasts?: boolean;
|
|
46
|
+
/** Default link component for routing (e.g., React Router Link, Next.js Link) */
|
|
47
|
+
linkComponent?: React.ElementType;
|
|
48
|
+
/** Default image component for images (e.g., Next.js Image, native img) */
|
|
49
|
+
imageComponent?: React.ElementType;
|
|
36
50
|
}
|
|
37
51
|
declare const ThemeProvider: React.ForwardRefExoticComponent<ThemeProviderProps & React.RefAttributes<HTMLDivElement>>;
|
|
38
52
|
export { ThemeProvider };
|
|
@@ -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;
|