@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
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Navbar.css';
|
|
3
|
+
export interface TopBarConfig {
|
|
4
|
+
/**
|
|
5
|
+
* Content to display in the top bar
|
|
6
|
+
*/
|
|
7
|
+
content?: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Left-aligned content
|
|
10
|
+
*/
|
|
11
|
+
leftContent?: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Right-aligned content
|
|
14
|
+
*/
|
|
15
|
+
rightContent?: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Top bar styling variant
|
|
18
|
+
* @default 'subtle'
|
|
19
|
+
*/
|
|
20
|
+
variant?: 'subtle' | 'bold' | 'accent' | 'dark' | 'gradient';
|
|
21
|
+
/**
|
|
22
|
+
* If true, shows a dismiss button
|
|
23
|
+
*/
|
|
24
|
+
dismissible?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Callback when dismiss button is clicked
|
|
27
|
+
*/
|
|
28
|
+
onDismiss?: () => void;
|
|
29
|
+
}
|
|
30
|
+
export interface MegaMenuColumn {
|
|
31
|
+
/**
|
|
32
|
+
* Column title
|
|
33
|
+
*/
|
|
34
|
+
title?: React.ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Column items
|
|
37
|
+
*/
|
|
38
|
+
items: NavigationItem[];
|
|
39
|
+
}
|
|
40
|
+
export interface NavigationItem {
|
|
41
|
+
/**
|
|
42
|
+
* Unique identifier for the navigation item
|
|
43
|
+
*/
|
|
44
|
+
id: string;
|
|
45
|
+
/**
|
|
46
|
+
* Label text to display
|
|
47
|
+
*/
|
|
48
|
+
label: React.ReactNode;
|
|
49
|
+
/**
|
|
50
|
+
* URL or path for navigation
|
|
51
|
+
*/
|
|
52
|
+
href?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Icon to display before label
|
|
55
|
+
*/
|
|
56
|
+
icon?: React.ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* Nested child items for dropdown menus
|
|
59
|
+
*/
|
|
60
|
+
children?: NavigationItem[];
|
|
61
|
+
/**
|
|
62
|
+
* Click handler
|
|
63
|
+
*/
|
|
64
|
+
onClick?: () => void;
|
|
65
|
+
/**
|
|
66
|
+
* If true, marks this item as active/selected
|
|
67
|
+
*/
|
|
68
|
+
active?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* If true, disables the item
|
|
71
|
+
*/
|
|
72
|
+
disabled?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Badge content to display (e.g., notification count)
|
|
75
|
+
*/
|
|
76
|
+
badge?: React.ReactNode;
|
|
77
|
+
/**
|
|
78
|
+
* If true, renders as a mega menu with columns
|
|
79
|
+
*/
|
|
80
|
+
megaMenu?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Mega menu columns (when megaMenu is true)
|
|
83
|
+
*/
|
|
84
|
+
megaMenuColumns?: MegaMenuColumn[];
|
|
85
|
+
/**
|
|
86
|
+
* Description text for mega menu items
|
|
87
|
+
*/
|
|
88
|
+
description?: React.ReactNode;
|
|
89
|
+
/**
|
|
90
|
+
* Featured image for mega menu
|
|
91
|
+
*/
|
|
92
|
+
image?: string;
|
|
93
|
+
}
|
|
94
|
+
export interface NavbarDesktopProps extends React.HTMLAttributes<HTMLElement> {
|
|
95
|
+
/**
|
|
96
|
+
* Logo element or brand name
|
|
97
|
+
*/
|
|
98
|
+
logo?: React.ReactNode;
|
|
99
|
+
/**
|
|
100
|
+
* Array of navigation items
|
|
101
|
+
*/
|
|
102
|
+
navItems?: NavigationItem[];
|
|
103
|
+
/**
|
|
104
|
+
* Action buttons or elements to display on the right
|
|
105
|
+
*/
|
|
106
|
+
actions?: React.ReactNode;
|
|
107
|
+
/**
|
|
108
|
+
* Visual theme variant
|
|
109
|
+
* @default 'primary'
|
|
110
|
+
*/
|
|
111
|
+
variant?: 'primary' | 'secondary' | 'dark' | 'light' | 'transparent' | 'gradient';
|
|
112
|
+
/**
|
|
113
|
+
* If true, navbar has a shadow effect
|
|
114
|
+
* @default false
|
|
115
|
+
*/
|
|
116
|
+
elevated?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* If true, navbar sticks to top on scroll
|
|
119
|
+
* @default false
|
|
120
|
+
*/
|
|
121
|
+
sticky?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* If true, makes navbar full bleed (no max-width)
|
|
124
|
+
* @default false
|
|
125
|
+
*/
|
|
126
|
+
fullWidth?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* If true, enables search functionality
|
|
129
|
+
* @default false
|
|
130
|
+
*/
|
|
131
|
+
searchEnabled?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Search placeholder text
|
|
134
|
+
*/
|
|
135
|
+
searchPlaceholder?: string;
|
|
136
|
+
/**
|
|
137
|
+
* Search input handler
|
|
138
|
+
*/
|
|
139
|
+
onSearch?: (query: string) => void;
|
|
140
|
+
/**
|
|
141
|
+
* Search suggestions/options for autocomplete
|
|
142
|
+
*/
|
|
143
|
+
searchOptions?: any[];
|
|
144
|
+
/**
|
|
145
|
+
* Property name or function to extract the display label from search option
|
|
146
|
+
* @default 'label'
|
|
147
|
+
*/
|
|
148
|
+
searchGetOptionLabel?: string | ((option: any) => string);
|
|
149
|
+
/**
|
|
150
|
+
* Property name or function to extract the value from search option
|
|
151
|
+
* @default 'value'
|
|
152
|
+
*/
|
|
153
|
+
searchGetOptionValue?: string | ((option: any) => string);
|
|
154
|
+
/**
|
|
155
|
+
* Message to display when no search options are available
|
|
156
|
+
* @default 'No options'
|
|
157
|
+
*/
|
|
158
|
+
searchNoOptionsMessage?: string;
|
|
159
|
+
/**
|
|
160
|
+
* If true, shows loading state in search autocomplete
|
|
161
|
+
* @default false
|
|
162
|
+
*/
|
|
163
|
+
searchLoading?: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Callback fired when a search option is selected
|
|
166
|
+
*/
|
|
167
|
+
onSearchSelect?: (value: string, option: any) => void;
|
|
168
|
+
/**
|
|
169
|
+
* Custom logo click handler
|
|
170
|
+
*/
|
|
171
|
+
onLogoClick?: () => void;
|
|
172
|
+
/**
|
|
173
|
+
* Layout style for the navbar
|
|
174
|
+
* @default 'single-row'
|
|
175
|
+
*/
|
|
176
|
+
layout?: 'single-row' | 'two-row' | 'centered';
|
|
177
|
+
/**
|
|
178
|
+
* Two-row bottom styling variant (only applicable when layout='two-row')
|
|
179
|
+
* @default 'default'
|
|
180
|
+
*/
|
|
181
|
+
twoRowBottomStyle?: 'default' | 'divider' | 'dark-bottom' | 'gradient-bottom' | 'elevated-bottom';
|
|
182
|
+
/**
|
|
183
|
+
* Top bar configuration (displays above main navbar)
|
|
184
|
+
*/
|
|
185
|
+
topBar?: TopBarConfig;
|
|
186
|
+
/**
|
|
187
|
+
* Scroll behavior - 'transparent-to-solid' makes navbar transparent initially and solid on scroll
|
|
188
|
+
* @default undefined
|
|
189
|
+
*/
|
|
190
|
+
scrollBehavior?: 'transparent-to-solid';
|
|
191
|
+
/**
|
|
192
|
+
* Scroll threshold in pixels before applying scroll effect
|
|
193
|
+
* @default 50
|
|
194
|
+
*/
|
|
195
|
+
scrollThreshold?: number;
|
|
196
|
+
/**
|
|
197
|
+
* Callback fired when scroll state changes
|
|
198
|
+
* @param scrolled - true if user has scrolled past threshold, false otherwise
|
|
199
|
+
*/
|
|
200
|
+
onScrollStateChange?: (scrolled: boolean) => void;
|
|
201
|
+
className?: string;
|
|
202
|
+
style?: React.CSSProperties;
|
|
203
|
+
}
|
|
204
|
+
export interface NavbarMobileProps extends React.HTMLAttributes<HTMLElement> {
|
|
205
|
+
/**
|
|
206
|
+
* Logo element or brand name
|
|
207
|
+
*/
|
|
208
|
+
logo?: React.ReactNode;
|
|
209
|
+
/**
|
|
210
|
+
* Array of navigation items
|
|
211
|
+
*/
|
|
212
|
+
navItems?: NavigationItem[];
|
|
213
|
+
/**
|
|
214
|
+
* Action buttons or elements to display on the right
|
|
215
|
+
*/
|
|
216
|
+
actions?: React.ReactNode;
|
|
217
|
+
/**
|
|
218
|
+
* Visual theme variant
|
|
219
|
+
* @default 'primary'
|
|
220
|
+
*/
|
|
221
|
+
variant?: 'primary' | 'secondary' | 'dark' | 'light' | 'transparent' | 'gradient';
|
|
222
|
+
/**
|
|
223
|
+
* If true, navbar has a shadow effect
|
|
224
|
+
* @default false
|
|
225
|
+
*/
|
|
226
|
+
elevated?: boolean;
|
|
227
|
+
/**
|
|
228
|
+
* If true, navbar sticks to top on scroll
|
|
229
|
+
* @default false
|
|
230
|
+
*/
|
|
231
|
+
sticky?: boolean;
|
|
232
|
+
/**
|
|
233
|
+
* If true, enables search functionality in mobile menu
|
|
234
|
+
* @default false
|
|
235
|
+
*/
|
|
236
|
+
searchEnabled?: boolean;
|
|
237
|
+
/**
|
|
238
|
+
* Search placeholder text
|
|
239
|
+
*/
|
|
240
|
+
searchPlaceholder?: string;
|
|
241
|
+
/**
|
|
242
|
+
* Search input handler
|
|
243
|
+
*/
|
|
244
|
+
onSearch?: (query: string) => void;
|
|
245
|
+
/**
|
|
246
|
+
* Search suggestions/options for autocomplete
|
|
247
|
+
*/
|
|
248
|
+
searchOptions?: any[];
|
|
249
|
+
/**
|
|
250
|
+
* Property name or function to extract the display label from search option
|
|
251
|
+
* @default 'label'
|
|
252
|
+
*/
|
|
253
|
+
searchGetOptionLabel?: string | ((option: any) => string);
|
|
254
|
+
/**
|
|
255
|
+
* Property name or function to extract the value from search option
|
|
256
|
+
* @default 'value'
|
|
257
|
+
*/
|
|
258
|
+
searchGetOptionValue?: string | ((option: any) => string);
|
|
259
|
+
/**
|
|
260
|
+
* Message to display when no search options are available
|
|
261
|
+
* @default 'No options'
|
|
262
|
+
*/
|
|
263
|
+
searchNoOptionsMessage?: string;
|
|
264
|
+
/**
|
|
265
|
+
* If true, shows loading state in search autocomplete
|
|
266
|
+
* @default false
|
|
267
|
+
*/
|
|
268
|
+
searchLoading?: boolean;
|
|
269
|
+
/**
|
|
270
|
+
* Callback fired when a search option is selected
|
|
271
|
+
*/
|
|
272
|
+
onSearchSelect?: (value: string, option: any) => void;
|
|
273
|
+
/**
|
|
274
|
+
* Custom logo click handler
|
|
275
|
+
*/
|
|
276
|
+
onLogoClick?: () => void;
|
|
277
|
+
/**
|
|
278
|
+
* Menu open state (controlled)
|
|
279
|
+
*/
|
|
280
|
+
menuOpen?: boolean;
|
|
281
|
+
/**
|
|
282
|
+
* Menu open change handler (controlled)
|
|
283
|
+
*/
|
|
284
|
+
onMenuOpenChange?: (open: boolean) => void;
|
|
285
|
+
className?: string;
|
|
286
|
+
style?: React.CSSProperties;
|
|
287
|
+
}
|
|
288
|
+
export interface NavbarResponsiveProps {
|
|
289
|
+
/**
|
|
290
|
+
* Props for desktop navbar
|
|
291
|
+
*/
|
|
292
|
+
desktopProps: NavbarDesktopProps;
|
|
293
|
+
/**
|
|
294
|
+
* Props for mobile navbar
|
|
295
|
+
*/
|
|
296
|
+
mobileProps: NavbarMobileProps;
|
|
297
|
+
/**
|
|
298
|
+
* Breakpoint in pixels to switch between desktop and mobile
|
|
299
|
+
* @default 768
|
|
300
|
+
*/
|
|
301
|
+
breakpoint?: number;
|
|
302
|
+
}
|
|
303
|
+
export declare const Navbar: {
|
|
304
|
+
Desktop: React.FC<NavbarDesktopProps & React.RefAttributes<HTMLElement>>;
|
|
305
|
+
Mobile: React.FC<NavbarMobileProps & React.RefAttributes<HTMLElement>>;
|
|
306
|
+
Responsive: React.FC<NavbarResponsiveProps>;
|
|
307
|
+
};
|
|
308
|
+
export default Navbar;
|
|
@@ -0,0 +1,23 @@
|
|
|
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 Primary: Story;
|
|
7
|
+
export declare const WithSearch: Story;
|
|
8
|
+
export declare const WithActions: Story;
|
|
9
|
+
export declare const NestedMenu: Story;
|
|
10
|
+
export declare const FullFeatured: Story;
|
|
11
|
+
export declare const TwoRowLayout: Story;
|
|
12
|
+
export declare const WithMegaMenu: Story;
|
|
13
|
+
export declare const AdvancedSearchAutocomplete: Story;
|
|
14
|
+
export declare const SearchWithCustomMessages: Story;
|
|
15
|
+
export declare const MobilePrimary: Story;
|
|
16
|
+
export declare const MobileDark: Story;
|
|
17
|
+
export declare const MobileNested: Story;
|
|
18
|
+
export declare const MobileWithSearch: Story;
|
|
19
|
+
export declare const MobileWithActions: Story;
|
|
20
|
+
export declare const ResponsiveBasic: Story;
|
|
21
|
+
export declare const ResponsiveTwoRowWithMegaMenu: Story;
|
|
22
|
+
export declare const ScrollTransparentToSolid: Story;
|
|
23
|
+
export declare const ScrollTwoRowTransparent: Story;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vtx-ui/react",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.14",
|
|
4
4
|
"description": "A production-ready React + TypeScript UI library with enterprise-grade components",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -107,6 +107,7 @@
|
|
|
107
107
|
"vitest": "^4.0.16"
|
|
108
108
|
},
|
|
109
109
|
"dependencies": {
|
|
110
|
+
"date-fns": "^4.1.0",
|
|
110
111
|
"react-icons": "^5.5.0",
|
|
111
112
|
"tslib": "^2.8.1"
|
|
112
113
|
}
|