@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,173 @@
|
|
|
1
|
+
import React, { InputHTMLAttributes } from 'react';
|
|
2
|
+
import { Size } from '../../theme';
|
|
3
|
+
import './Autocomplete.css';
|
|
4
|
+
export interface AutocompleteOption {
|
|
5
|
+
/**
|
|
6
|
+
* Value of the option
|
|
7
|
+
*/
|
|
8
|
+
value: string;
|
|
9
|
+
/**
|
|
10
|
+
* Display label for the option
|
|
11
|
+
*/
|
|
12
|
+
label: string;
|
|
13
|
+
/**
|
|
14
|
+
* Optional description or secondary text
|
|
15
|
+
*/
|
|
16
|
+
description?: string;
|
|
17
|
+
/**
|
|
18
|
+
* If true, option cannot be selected
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Icon to display before label
|
|
24
|
+
*/
|
|
25
|
+
icon?: React.ReactNode;
|
|
26
|
+
}
|
|
27
|
+
export interface AutocompleteProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'onChange' | 'onSelect'> {
|
|
28
|
+
/**
|
|
29
|
+
* Label text displayed above the input
|
|
30
|
+
*/
|
|
31
|
+
label?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Helper text displayed below the input
|
|
34
|
+
* Provides additional context or instructions
|
|
35
|
+
*/
|
|
36
|
+
helperText?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Error message - when provided, input is shown in error state
|
|
39
|
+
* Takes precedence over helperText when both are present
|
|
40
|
+
*/
|
|
41
|
+
error?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Success message - when provided, input is shown in success state
|
|
44
|
+
*/
|
|
45
|
+
success?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Size of the input
|
|
48
|
+
* @default theme.defaultSize
|
|
49
|
+
*/
|
|
50
|
+
size?: Size;
|
|
51
|
+
/**
|
|
52
|
+
* If true, input will take full width of its container
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
fullWidth?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Options to display in the autocomplete dropdown
|
|
58
|
+
*/
|
|
59
|
+
options: any[];
|
|
60
|
+
/**
|
|
61
|
+
* Property name or function to extract the display label from each option
|
|
62
|
+
* @default 'label'
|
|
63
|
+
* @example
|
|
64
|
+
* getOptionLabel="productName" // uses option.productName
|
|
65
|
+
* getOptionLabel={(option) => option.firstName + ' ' + option.lastName}
|
|
66
|
+
*/
|
|
67
|
+
getOptionLabel?: string | ((option: any) => string);
|
|
68
|
+
/**
|
|
69
|
+
* Property name or function to extract the value from each option
|
|
70
|
+
* @default 'value'
|
|
71
|
+
* @example
|
|
72
|
+
* getOptionValue="id" // uses option.id
|
|
73
|
+
* getOptionValue={(option) => option.uuid}
|
|
74
|
+
*/
|
|
75
|
+
getOptionValue?: string | ((option: any) => string);
|
|
76
|
+
/**
|
|
77
|
+
* Property name or function to determine if an option is disabled
|
|
78
|
+
* @default 'disabled'
|
|
79
|
+
* @example
|
|
80
|
+
* getOptionDisabled="isInactive" // uses option.isInactive
|
|
81
|
+
* getOptionDisabled={(option) => option.stock === 0}
|
|
82
|
+
*/
|
|
83
|
+
getOptionDisabled?: string | ((option: any) => boolean);
|
|
84
|
+
/**
|
|
85
|
+
* Property name or function to extract the description from each option
|
|
86
|
+
* @default 'description'
|
|
87
|
+
*/
|
|
88
|
+
getOptionDescription?: string | ((option: any) => string | undefined);
|
|
89
|
+
/**
|
|
90
|
+
* Property name or function to extract the icon from each option
|
|
91
|
+
* @default 'icon'
|
|
92
|
+
*/
|
|
93
|
+
getOptionIcon?: string | ((option: any) => React.ReactNode);
|
|
94
|
+
/**
|
|
95
|
+
* Message to display when no options are available
|
|
96
|
+
* @default 'No options'
|
|
97
|
+
*/
|
|
98
|
+
noOptionsMessage?: string;
|
|
99
|
+
/**
|
|
100
|
+
* If true, shows a loading spinner
|
|
101
|
+
* @default false
|
|
102
|
+
*/
|
|
103
|
+
loading?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Loading message to display
|
|
106
|
+
* @default 'Loading...'
|
|
107
|
+
*/
|
|
108
|
+
loadingMessage?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Callback fired when input value changes
|
|
111
|
+
*/
|
|
112
|
+
onChange?: (value: string) => void;
|
|
113
|
+
/**
|
|
114
|
+
* Callback fired when an option is selected
|
|
115
|
+
* Provides the selected option and its value
|
|
116
|
+
*/
|
|
117
|
+
onSelect?: (value: string, option: any) => void;
|
|
118
|
+
/**
|
|
119
|
+
* If true, shows search icon on the left
|
|
120
|
+
* @default false
|
|
121
|
+
*/
|
|
122
|
+
showSearchIcon?: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* If true, shows a clear button when input has value
|
|
125
|
+
* @default false
|
|
126
|
+
*/
|
|
127
|
+
clearable?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Callback fired when clear button is clicked
|
|
130
|
+
*/
|
|
131
|
+
onClear?: () => void;
|
|
132
|
+
/**
|
|
133
|
+
* Custom class name for the wrapper element
|
|
134
|
+
*/
|
|
135
|
+
wrapperClassName?: string;
|
|
136
|
+
/**
|
|
137
|
+
* Custom class name for the label element
|
|
138
|
+
*/
|
|
139
|
+
labelClassName?: string;
|
|
140
|
+
/**
|
|
141
|
+
* Custom class name for the input element itself
|
|
142
|
+
*/
|
|
143
|
+
inputClassName?: string;
|
|
144
|
+
/**
|
|
145
|
+
* Custom class name for the dropdown element
|
|
146
|
+
*/
|
|
147
|
+
dropdownClassName?: string;
|
|
148
|
+
/**
|
|
149
|
+
* Custom render function for options
|
|
150
|
+
*/
|
|
151
|
+
renderOption?: (option: any, index: number) => React.ReactNode;
|
|
152
|
+
/**
|
|
153
|
+
* Input value (controlled)
|
|
154
|
+
*/
|
|
155
|
+
value?: string;
|
|
156
|
+
/**
|
|
157
|
+
* If true, opens dropdown on focus even if input is empty
|
|
158
|
+
* @default true
|
|
159
|
+
*/
|
|
160
|
+
openOnFocus?: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* Minimum characters to type before showing options
|
|
163
|
+
* @default 0
|
|
164
|
+
*/
|
|
165
|
+
minSearchLength?: number;
|
|
166
|
+
}
|
|
167
|
+
declare const AutocompleteWithParsedClasses: {
|
|
168
|
+
(props: AutocompleteProps & React.RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
|
|
169
|
+
displayName: string;
|
|
170
|
+
};
|
|
171
|
+
declare const _default: React.FC<AutocompleteProps & React.RefAttributes<HTMLInputElement>>;
|
|
172
|
+
export default _default;
|
|
173
|
+
export { AutocompleteWithParsedClasses as Autocomplete };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {
|
|
3
|
+
/**
|
|
4
|
+
* If true, always use native <img> even if a custom imageComponent is provided in ThemeProvider
|
|
5
|
+
* @default false
|
|
6
|
+
*/
|
|
7
|
+
forceNative?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Custom image component to use (overrides ThemeProvider)
|
|
10
|
+
*/
|
|
11
|
+
imageComponent?: React.ElementType;
|
|
12
|
+
}
|
|
13
|
+
export declare const Image: React.FC<ImageProps>;
|
|
14
|
+
export default Image;
|
|
@@ -52,6 +52,11 @@ export interface LinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>,
|
|
|
52
52
|
* @default false
|
|
53
53
|
*/
|
|
54
54
|
external?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* If true or string, triggers browser download
|
|
57
|
+
* @default false
|
|
58
|
+
*/
|
|
59
|
+
download?: boolean | string;
|
|
55
60
|
children?: React.ReactNode;
|
|
56
61
|
}
|
|
57
62
|
declare const LinkWithParsedClasses: {
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Navbar.css';
|
|
3
|
+
/**
|
|
4
|
+
* Navigation item configuration
|
|
5
|
+
*/
|
|
6
|
+
export interface NavigationItem {
|
|
7
|
+
/**
|
|
8
|
+
* Label to display
|
|
9
|
+
*/
|
|
10
|
+
label: string;
|
|
11
|
+
/**
|
|
12
|
+
* Link URL
|
|
13
|
+
*/
|
|
14
|
+
href?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Click handler (alternative to href)
|
|
17
|
+
*/
|
|
18
|
+
onClick?: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Icon to display before label
|
|
21
|
+
*/
|
|
22
|
+
icon?: React.ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Badge to display next to label
|
|
25
|
+
*/
|
|
26
|
+
badge?: string | number;
|
|
27
|
+
/**
|
|
28
|
+
* Badge variant
|
|
29
|
+
*/
|
|
30
|
+
badgeVariant?: 'neutral' | 'primary' | 'success' | 'warning' | 'error' | 'info';
|
|
31
|
+
/**
|
|
32
|
+
* If true, item is marked as active
|
|
33
|
+
*/
|
|
34
|
+
active?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* If true, item is disabled
|
|
37
|
+
*/
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Submenu items (for dropdown menus)
|
|
41
|
+
*/
|
|
42
|
+
children?: NavigationItem[];
|
|
43
|
+
/**
|
|
44
|
+
* Mega menu columns (for large dropdown menus)
|
|
45
|
+
*/
|
|
46
|
+
megaMenu?: MegaMenuColumn[];
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Mega menu column configuration
|
|
50
|
+
*/
|
|
51
|
+
export interface MegaMenuColumn {
|
|
52
|
+
/**
|
|
53
|
+
* Column title
|
|
54
|
+
*/
|
|
55
|
+
title?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Items in this column
|
|
58
|
+
*/
|
|
59
|
+
items: NavigationItem[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Top bar configuration (above main navbar)
|
|
63
|
+
*/
|
|
64
|
+
export interface TopBarConfig {
|
|
65
|
+
/**
|
|
66
|
+
* Left side content/links
|
|
67
|
+
*/
|
|
68
|
+
left?: React.ReactNode | NavigationItem[];
|
|
69
|
+
/**
|
|
70
|
+
* Right side content/links
|
|
71
|
+
*/
|
|
72
|
+
right?: React.ReactNode | NavigationItem[];
|
|
73
|
+
/**
|
|
74
|
+
* Background color
|
|
75
|
+
*/
|
|
76
|
+
backgroundColor?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Text color
|
|
79
|
+
*/
|
|
80
|
+
textColor?: string;
|
|
81
|
+
}
|
|
82
|
+
interface NavbarBaseProps {
|
|
83
|
+
/**
|
|
84
|
+
* Logo image source
|
|
85
|
+
*/
|
|
86
|
+
logo?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Logo alt text
|
|
89
|
+
*/
|
|
90
|
+
logoAlt?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Logo click handler
|
|
93
|
+
*/
|
|
94
|
+
onLogoClick?: () => void;
|
|
95
|
+
/**
|
|
96
|
+
* Brand text (shown if no logo)
|
|
97
|
+
*/
|
|
98
|
+
brandText?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Main navigation items
|
|
101
|
+
*/
|
|
102
|
+
navigationItems?: NavigationItem[];
|
|
103
|
+
/**
|
|
104
|
+
* If true, navbar will be sticky at the top
|
|
105
|
+
* @default false
|
|
106
|
+
*/
|
|
107
|
+
sticky?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* If true, navbar has a shadow
|
|
110
|
+
* @default true
|
|
111
|
+
*/
|
|
112
|
+
shadow?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Background color
|
|
115
|
+
*/
|
|
116
|
+
backgroundColor?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Custom class name
|
|
119
|
+
*/
|
|
120
|
+
className?: string;
|
|
121
|
+
/**
|
|
122
|
+
* Top bar configuration
|
|
123
|
+
*/
|
|
124
|
+
topBar?: TopBarConfig;
|
|
125
|
+
/**
|
|
126
|
+
* User profile section
|
|
127
|
+
*/
|
|
128
|
+
user?: {
|
|
129
|
+
name?: string;
|
|
130
|
+
email?: string;
|
|
131
|
+
avatar?: string;
|
|
132
|
+
menuItems?: NavigationItem[];
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Search configuration
|
|
136
|
+
*/
|
|
137
|
+
search?: {
|
|
138
|
+
placeholder?: string;
|
|
139
|
+
onSearch?: (query: string) => void;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Search options for autocomplete
|
|
143
|
+
*/
|
|
144
|
+
searchOptions?: any[];
|
|
145
|
+
/**
|
|
146
|
+
* Function to get label from search option
|
|
147
|
+
*/
|
|
148
|
+
searchGetOptionLabel?: string | ((option: any) => string);
|
|
149
|
+
/**
|
|
150
|
+
* Function to get value from search option
|
|
151
|
+
*/
|
|
152
|
+
searchGetOptionValue?: string | ((option: any) => string);
|
|
153
|
+
/**
|
|
154
|
+
* Function to get description from search option
|
|
155
|
+
*/
|
|
156
|
+
searchGetOptionDescription?: string | ((option: any) => string | undefined);
|
|
157
|
+
/**
|
|
158
|
+
* Function to get icon from search option
|
|
159
|
+
*/
|
|
160
|
+
searchGetOptionIcon?: string | ((option: any) => React.ReactNode);
|
|
161
|
+
/**
|
|
162
|
+
* No options message for search
|
|
163
|
+
*/
|
|
164
|
+
searchNoOptionsMessage?: string;
|
|
165
|
+
/**
|
|
166
|
+
* If true, search is in loading state
|
|
167
|
+
*/
|
|
168
|
+
searchLoading?: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* Callback when search option is selected
|
|
171
|
+
*/
|
|
172
|
+
onSearchSelect?: (value: string, option: any) => void;
|
|
173
|
+
/**
|
|
174
|
+
* Notifications badge count
|
|
175
|
+
*/
|
|
176
|
+
notificationCount?: number;
|
|
177
|
+
/**
|
|
178
|
+
* Notification click handler
|
|
179
|
+
*/
|
|
180
|
+
onNotificationClick?: () => void;
|
|
181
|
+
/**
|
|
182
|
+
* Shopping cart badge count
|
|
183
|
+
*/
|
|
184
|
+
cartCount?: number;
|
|
185
|
+
/**
|
|
186
|
+
* Cart click handler
|
|
187
|
+
*/
|
|
188
|
+
onCartClick?: () => void;
|
|
189
|
+
/**
|
|
190
|
+
* Action buttons (e.g., Login, Sign Up)
|
|
191
|
+
*/
|
|
192
|
+
actions?: React.ReactNode;
|
|
193
|
+
/**
|
|
194
|
+
* If true, uses container for content width
|
|
195
|
+
* @default true
|
|
196
|
+
*/
|
|
197
|
+
containerized?: boolean;
|
|
198
|
+
}
|
|
199
|
+
export interface NavbarDesktopProps extends NavbarBaseProps {
|
|
200
|
+
/**
|
|
201
|
+
* Layout variant
|
|
202
|
+
* - single-row: Logo, nav, search, and actions in one row
|
|
203
|
+
* - two-row: Logo/search in first row, nav in second row
|
|
204
|
+
* - centered: Logo/nav/actions centered
|
|
205
|
+
* @default 'single-row'
|
|
206
|
+
*/
|
|
207
|
+
layout?: 'single-row' | 'two-row' | 'centered';
|
|
208
|
+
}
|
|
209
|
+
export interface NavbarMobileProps extends NavbarBaseProps {
|
|
210
|
+
/**
|
|
211
|
+
* If true, drawer is open
|
|
212
|
+
*/
|
|
213
|
+
isOpen?: boolean;
|
|
214
|
+
/**
|
|
215
|
+
* Callback when drawer state changes
|
|
216
|
+
*/
|
|
217
|
+
onOpenChange?: (open: boolean) => void;
|
|
218
|
+
}
|
|
219
|
+
export interface NavbarResponsiveProps extends NavbarBaseProps {
|
|
220
|
+
/**
|
|
221
|
+
* Layout variant for desktop
|
|
222
|
+
* @default 'single-row'
|
|
223
|
+
*/
|
|
224
|
+
desktopLayout?: 'single-row' | 'two-row' | 'centered';
|
|
225
|
+
/**
|
|
226
|
+
* Breakpoint for switching to mobile view (px)
|
|
227
|
+
* @default 768
|
|
228
|
+
*/
|
|
229
|
+
mobileBreakpoint?: number;
|
|
230
|
+
}
|
|
231
|
+
export declare const Navbar: React.FC<NavbarResponsiveProps> & {
|
|
232
|
+
Desktop: React.FC<NavbarDesktopProps>;
|
|
233
|
+
Mobile: React.FC<NavbarMobileProps>;
|
|
234
|
+
Responsive: React.FC<NavbarResponsiveProps>;
|
|
235
|
+
};
|
|
236
|
+
export default Navbar;
|
|
@@ -22,10 +22,16 @@ export interface TextProps extends Omit<React.HTMLAttributes<HTMLElement>, 'colo
|
|
|
22
22
|
*/
|
|
23
23
|
align?: TextAlign;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
* Examples: 'primary
|
|
25
|
+
* Semantic text color - applies predefined theme colors via CSS classes
|
|
26
|
+
* Examples: 'primary', 'secondary', 'success', 'error', 'warning', 'info'
|
|
27
27
|
*/
|
|
28
|
-
color?:
|
|
28
|
+
color?: 'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info' | 'inherit';
|
|
29
|
+
/**
|
|
30
|
+
* Direct text color override - accepts any CSS color value
|
|
31
|
+
* Examples: '#000', 'rgb(0,0,0)', '#primary.500'
|
|
32
|
+
* Overrides semantic color if both are provided
|
|
33
|
+
*/
|
|
34
|
+
textColor?: string;
|
|
29
35
|
/**
|
|
30
36
|
* Font weight override
|
|
31
37
|
*/
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { CarouselWidgetData } from '../types';
|
|
2
|
+
import type { CarouselWidgetData, CarouselWidgetSettings } from '../types';
|
|
3
3
|
interface CarouselWidgetProps {
|
|
4
4
|
data: CarouselWidgetData;
|
|
5
|
+
settings?: CarouselWidgetSettings;
|
|
5
6
|
className?: string;
|
|
6
7
|
theme?: any;
|
|
7
8
|
variant?: any;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ContentBlockWidgetData, WidgetTheme } from '../types';
|
|
3
|
+
export type ContentBlockLayout = 'media-left' | 'media-right' | 'split-equal' | 'media-top' | 'media-bottom' | 'media-background' | 'centered' | 'centered-media-top' | 'grid-2col' | 'grid-3col' | 'sidebar-left' | 'sidebar-right';
|
|
4
|
+
export interface ContentBlockWidgetSettings {
|
|
5
|
+
layout?: ContentBlockLayout;
|
|
6
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
7
|
+
mediaWidth?: '20%' | '30%' | '40%' | '50%' | '60%' | '70%' | 'auto';
|
|
8
|
+
contentWidth?: 'narrow' | 'medium' | 'wide' | 'full';
|
|
9
|
+
gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
10
|
+
padding?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
11
|
+
contentAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
12
|
+
verticalAlign?: 'start' | 'center' | 'end' | 'stretch';
|
|
13
|
+
variant?: 'minimal' | 'card' | 'bordered' | 'elevated' | 'outlined' | 'flat';
|
|
14
|
+
rounded?: boolean | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
15
|
+
shadow?: boolean | 'sm' | 'md' | 'lg' | 'xl' | 'inner';
|
|
16
|
+
border?: boolean | 'all' | 'left' | 'right' | 'top' | 'bottom';
|
|
17
|
+
background?: {
|
|
18
|
+
color?: string;
|
|
19
|
+
gradient?: string;
|
|
20
|
+
opacity?: number;
|
|
21
|
+
};
|
|
22
|
+
overlay?: {
|
|
23
|
+
enabled: boolean;
|
|
24
|
+
color?: string;
|
|
25
|
+
opacity?: number;
|
|
26
|
+
blur?: number;
|
|
27
|
+
gradient?: 'top' | 'bottom' | 'center' | 'none';
|
|
28
|
+
};
|
|
29
|
+
grid?: {
|
|
30
|
+
columns?: number;
|
|
31
|
+
gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
32
|
+
minItemWidth?: string;
|
|
33
|
+
};
|
|
34
|
+
responsive?: {
|
|
35
|
+
stackOnMobile?: boolean;
|
|
36
|
+
stackOnTablet?: boolean;
|
|
37
|
+
reverseOnMobile?: boolean;
|
|
38
|
+
hideMediaOnMobile?: boolean;
|
|
39
|
+
};
|
|
40
|
+
hover?: {
|
|
41
|
+
enabled?: boolean;
|
|
42
|
+
effect?: 'lift' | 'glow' | 'scale' | 'none';
|
|
43
|
+
mediaZoom?: boolean;
|
|
44
|
+
};
|
|
45
|
+
animate?: boolean;
|
|
46
|
+
animationType?: 'fade' | 'slide-up' | 'slide-left' | 'slide-right' | 'zoom' | 'none';
|
|
47
|
+
}
|
|
48
|
+
export interface ContentBlockWidgetProps {
|
|
49
|
+
data: ContentBlockWidgetData;
|
|
50
|
+
settings?: ContentBlockWidgetSettings;
|
|
51
|
+
theme?: WidgetTheme;
|
|
52
|
+
className?: string;
|
|
53
|
+
style?: React.CSSProperties;
|
|
54
|
+
}
|
|
55
|
+
declare const ContentBlockWidget: React.FC<ContentBlockWidgetProps>;
|
|
56
|
+
export default ContentBlockWidget;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import Widget from '../Widget';
|
|
3
|
+
declare const meta: Meta<typeof Widget>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Widget>;
|
|
6
|
+
export declare const EcommerceProductShowcase: Story;
|
|
7
|
+
export declare const EcommerceProductGrid: Story;
|
|
8
|
+
export declare const EcommerceCategoryBanner: Story;
|
|
9
|
+
export declare const BlogFeaturedPost: Story;
|
|
10
|
+
export declare const BlogQuoteBlock: Story;
|
|
11
|
+
export declare const ServiceFeatureHighlight: Story;
|
|
12
|
+
export declare const ServiceTeamMember: Story;
|
|
13
|
+
export declare const ServiceAboutUs: Story;
|
|
14
|
+
export declare const ServiceProcessStep: Story;
|
|
15
|
+
export declare const SaaSFeature: Story;
|
|
16
|
+
export declare const SaaSPricingCard: Story;
|
|
17
|
+
export declare const SaaSCustomerTestimonial: Story;
|
|
18
|
+
export declare const PortfolioProject: Story;
|
|
19
|
+
export declare const CTABanner: Story;
|
|
20
|
+
export declare const SplitLayoutFeature: Story;
|
|
21
|
+
export declare const SidebarLayout: Story;
|
|
22
|
+
export declare const RealEstateProperty: Story;
|
|
23
|
+
export declare const MinimalInfoCard: Story;
|
|
24
|
+
export declare const CompactFeatureList: Story;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { HeaderWidgetData, WidgetTheme, WidgetVariant } from '../types';
|
|
2
|
+
import { HeaderWidgetData, HeaderWidgetSettings, WidgetTheme, WidgetVariant } from '../types';
|
|
3
3
|
interface HeaderWidgetProps {
|
|
4
4
|
data: HeaderWidgetData;
|
|
5
|
-
|
|
5
|
+
settings?: HeaderWidgetSettings;
|
|
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 HeaderWidget: React.FC<HeaderWidgetProps>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ImageWidgetData } from '../types';
|
|
3
|
+
import { ButtonProps } from '../../Button';
|
|
4
|
+
import './ImageWidget.css';
|
|
5
|
+
import { TextVariant } from '../../Text';
|
|
6
|
+
export interface ImageWidgetSettings {
|
|
7
|
+
/**
|
|
8
|
+
* Overlay theme: 'dark' (light text) or 'light' (dark text)
|
|
9
|
+
*/
|
|
10
|
+
overlayTheme?: 'dark' | 'light';
|
|
11
|
+
/**
|
|
12
|
+
* CTA button variant (uses ButtonProps['variant'] for type safety)
|
|
13
|
+
*/
|
|
14
|
+
ctaVariant?: ButtonProps['variant'];
|
|
15
|
+
/**
|
|
16
|
+
* If true, always use native <img>
|
|
17
|
+
*/
|
|
18
|
+
forceNative?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Custom image component to use
|
|
21
|
+
*/
|
|
22
|
+
imageComponent?: React.ElementType;
|
|
23
|
+
/**
|
|
24
|
+
* Height of the image widget
|
|
25
|
+
*/
|
|
26
|
+
height?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Minimum height of the image widget
|
|
29
|
+
*/
|
|
30
|
+
minHeight?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Object fit property for the image
|
|
33
|
+
*/
|
|
34
|
+
objectFit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
|
|
35
|
+
/**
|
|
36
|
+
* Text alignment: 'left', 'center', or 'right'
|
|
37
|
+
*/
|
|
38
|
+
textAlign?: 'left' | 'center' | 'right';
|
|
39
|
+
/**
|
|
40
|
+
* Overlay horizontal alignment: 'left', 'center', or 'right'
|
|
41
|
+
*/
|
|
42
|
+
overlayAlign?: 'left' | 'center' | 'right';
|
|
43
|
+
/**
|
|
44
|
+
* Text variant for heading
|
|
45
|
+
*/
|
|
46
|
+
headingVariant?: TextVariant;
|
|
47
|
+
/**
|
|
48
|
+
* Text variant for subHeading
|
|
49
|
+
*/
|
|
50
|
+
subHeadingVariant?: TextVariant;
|
|
51
|
+
/**
|
|
52
|
+
* Text variant for description
|
|
53
|
+
*/
|
|
54
|
+
descriptionVariant?: TextVariant;
|
|
55
|
+
}
|
|
56
|
+
export interface ImageWidgetProps {
|
|
57
|
+
/**
|
|
58
|
+
* Image widget data to display
|
|
59
|
+
*/
|
|
60
|
+
data: ImageWidgetData;
|
|
61
|
+
/**
|
|
62
|
+
* Optional settings for additional features
|
|
63
|
+
*/
|
|
64
|
+
settings?: ImageWidgetSettings;
|
|
65
|
+
className?: string;
|
|
66
|
+
style?: React.CSSProperties;
|
|
67
|
+
}
|
|
68
|
+
declare const ImageWidget: React.FC<ImageWidgetProps>;
|
|
69
|
+
export default ImageWidget;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ImageWidgetProps } from './ImageWidget';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
declare const meta: Meta<ImageWidgetProps>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<ImageWidgetProps>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const LightOverlay: Story;
|
|
8
|
+
export declare const NoCTA: Story;
|
|
9
|
+
export declare const LeftAligned: Story;
|
|
10
|
+
export declare const RightAligned: Story;
|
|
11
|
+
export declare const CustomTextVariants: Story;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { InfoWidgetData, WidgetTheme, WidgetVariant } from '../types';
|
|
2
|
+
import { InfoWidgetData, InfoWidgetSettings, WidgetTheme, WidgetVariant } from '../types';
|
|
3
3
|
interface InfoWidgetProps {
|
|
4
4
|
data: InfoWidgetData;
|
|
5
|
-
|
|
5
|
+
settings?: InfoWidgetSettings;
|
|
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 InfoWidget: React.FC<InfoWidgetProps>;
|