@veevarts/design-system 0.1.23 → 1.0.0-alpha.4

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.
@@ -5,5 +5,5 @@
5
5
  * Ensures exclusive selection (preset OR custom).
6
6
  */
7
7
  export { DonationAmounts } from './DonationAmounts';
8
- export type { DonationAmount, SelectedDonation, DonationLabels, DonationAmountsProps, } from './types';
8
+ export type { DonationAmount, SelectedDonation, DonationLabels, DonationAmountsProps } from './types';
9
9
  export { formatCurrency, parseCurrency } from './utils/currency';
@@ -0,0 +1,37 @@
1
+ import { JSX } from 'react';
2
+ /**
3
+ * @interface EventDetailsProps
4
+ * @description Defines the properties required to render event details in a card layout.
5
+ */
6
+ export interface EventDetailsProps {
7
+ /** @property {string} name - The name/title of the event. */
8
+ name: string;
9
+ /** @property {string} [imageUrl] - Optional URL for the event's background image. */
10
+ imageUrl?: string;
11
+ /** @property {string} eventDate - The date of the event (e.g., 'July 10, 2025'). */
12
+ eventDate: string;
13
+ /** @property {string} [eventTime] - Optional time of the event (e.g., '10:00 AM'). */
14
+ eventTime?: string;
15
+ /** @property {string} [location] - Optional location where the event takes place. */
16
+ location?: string;
17
+ /** @property {string} [description] - Optional description or details about the event. */
18
+ description?: string;
19
+ /** @property {string} [classes] - Optional Tailwind CSS utility classes for custom styling. */
20
+ classes?: string;
21
+ /** @property {boolean} [showImage] - Optional flag to show or hide the event image. Defaults to true. */
22
+ showImage?: boolean;
23
+ /** @property {string} [showMoreButtonClassName] - Optional Tailwind CSS utility classes for the 'Show more/less' button. */
24
+ showMoreButtonClassName?: string;
25
+ /** @property {Object} labels - Labels for the event details, used for localization. */
26
+ labels: {
27
+ eventInformation: string;
28
+ showMore?: string;
29
+ showLess?: string;
30
+ };
31
+ }
32
+ /**
33
+ * @function EventDetails
34
+ * @description Displays a card with event information such as name, image, date, time, location, and description.
35
+ */
36
+ declare const EventDetails: ({ classes, name, imageUrl, eventDate, eventTime, location, description, showImage, showMoreButtonClassName, labels, }: EventDetailsProps) => JSX.Element;
37
+ export default EventDetails;
@@ -0,0 +1,2 @@
1
+ export { default } from './EventDetails';
2
+ export * from './EventDetails';
@@ -0,0 +1,249 @@
1
+ import { default as React, ComponentProps } from 'react';
2
+ import { LucideIcon } from 'lucide-react';
3
+ /**
4
+ * Props for the ExpireCartTimer component
5
+ *
6
+ * @interface ExpireCartTimerProps
7
+ * @extends {React.HTMLAttributes<HTMLDivElement>}
8
+ */
9
+ export interface ExpireCartTimerProps extends Omit<ComponentProps<'div'>, 'children'> {
10
+ /**
11
+ * The current time left in seconds (controlled mode).
12
+ * When provided, the component is controlled and will not manage its own state.
13
+ *
14
+ * @controlled
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * const [time, setTime] = useState(1200);
19
+ * <ExpireCartTimer timeLeft={time} onTimeChange={setTime} />
20
+ * ```
21
+ */
22
+ timeLeft?: number;
23
+ /**
24
+ * The initial time left in seconds (uncontrolled mode).
25
+ * Used when `timeLeft` is not provided.
26
+ *
27
+ * @default 1200 (20 minutes)
28
+ * @uncontrolled
29
+ *
30
+ * @example
31
+ * ```tsx
32
+ * <ExpireCartTimer defaultTimeLeft={600} /> // 10 minutes
33
+ * ```
34
+ */
35
+ defaultTimeLeft?: number;
36
+ /**
37
+ * Callback fired when the time left changes.
38
+ * Used in controlled mode to sync external state.
39
+ *
40
+ * @param seconds - The new time left in seconds
41
+ *
42
+ * @example
43
+ * ```tsx
44
+ * <ExpireCartTimer
45
+ * timeLeft={time}
46
+ * onTimeChange={(seconds) => {
47
+ * setTime(seconds);
48
+ * // Sync with server, localStorage, etc.
49
+ * }}
50
+ * />
51
+ * ```
52
+ */
53
+ onTimeChange?: (seconds: number) => void;
54
+ /**
55
+ * Callback fired when the timer reaches zero.
56
+ *
57
+ * @example
58
+ * ```tsx
59
+ * <ExpireCartTimer
60
+ * defaultTimeLeft={300}
61
+ * onExpire={() => {
62
+ * // Clear cart, redirect, show message, etc.
63
+ * console.log('Time expired!');
64
+ * }}
65
+ * />
66
+ * ```
67
+ */
68
+ onExpire?: () => void;
69
+ /**
70
+ * Visual variant of the timer.
71
+ * Affects the overall styling and semantic meaning.
72
+ *
73
+ * @default 'info'
74
+ *
75
+ * @example
76
+ * ```tsx
77
+ * <ExpireCartTimer variant="warning" /> // Warning style
78
+ * <ExpireCartTimer variant="error" /> // Error style
79
+ * ```
80
+ */
81
+ variant?: 'info' | 'warning' | 'error' | 'success';
82
+ /**
83
+ * Color theme for the timer.
84
+ * Uses HeroUI color system.
85
+ *
86
+ * @default 'primary'
87
+ *
88
+ * @example
89
+ * ```tsx
90
+ * <ExpireCartTimer color="warning" /> // Orange/yellow theme
91
+ * <ExpireCartTimer color="danger" /> // Red theme
92
+ * ```
93
+ */
94
+ color?: 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'default';
95
+ /**
96
+ * The message text displayed before the timer.
97
+ *
98
+ * @default "Your cart expires in:"
99
+ *
100
+ * @example
101
+ * ```tsx
102
+ * <ExpireCartTimer message="Limited offer ends in:" />
103
+ * ```
104
+ */
105
+ message?: string;
106
+ /**
107
+ * Whether to show the icon.
108
+ *
109
+ * @default true
110
+ *
111
+ * @example
112
+ * ```tsx
113
+ * <ExpireCartTimer showIcon={false} />
114
+ * ```
115
+ */
116
+ showIcon?: boolean;
117
+ /**
118
+ * Custom icon component from Lucide React or custom SVG component.
119
+ * If not provided, a default clock icon based on variant will be used.
120
+ *
121
+ * @example
122
+ * ```tsx
123
+ * import { AlertCircle } from 'lucide-react';
124
+ * <ExpireCartTimer icon={AlertCircle} />
125
+ * ```
126
+ */
127
+ icon?: LucideIcon | React.ComponentType<ComponentProps<'svg'>>;
128
+ /**
129
+ * Position of the timer.
130
+ *
131
+ * @default 'fixed'
132
+ *
133
+ * @example
134
+ * ```tsx
135
+ * <ExpireCartTimer position="sticky" /> // Sticks to top when scrolling
136
+ * ```
137
+ */
138
+ position?: 'fixed' | 'sticky' | 'static';
139
+ /**
140
+ * Whether to automatically start the countdown.
141
+ * When false, the timer will not count down until manually started.
142
+ *
143
+ * @default true
144
+ *
145
+ * @example
146
+ * ```tsx
147
+ * <ExpireCartTimer autoStart={false} defaultTimeLeft={300} />
148
+ * // Timer paused until user action
149
+ * ```
150
+ */
151
+ autoStart?: boolean;
152
+ /**
153
+ * Custom function to format the time display.
154
+ * Receives seconds and should return a formatted string.
155
+ *
156
+ * @example
157
+ * ```tsx
158
+ * <ExpireCartTimer
159
+ * formatTime={(seconds) => {
160
+ * const h = Math.floor(seconds / 3600);
161
+ * const m = Math.floor((seconds % 3600) / 60);
162
+ * const s = seconds % 60;
163
+ * return `${h}h ${m}m ${s}s`;
164
+ * }}
165
+ * />
166
+ * ```
167
+ */
168
+ formatTime?: (seconds: number) => string;
169
+ /**
170
+ * Custom CSS class for the timer container.
171
+ *
172
+ * @example
173
+ * ```tsx
174
+ * <ExpireCartTimer className="shadow-lg" />
175
+ * ```
176
+ */
177
+ className?: string;
178
+ }
179
+ /**
180
+ * ExpireCartTimer - A flexible countdown timer component.
181
+ *
182
+ * @description
183
+ * The ExpireCartTimer component displays a countdown timer with customizable appearance,
184
+ * behavior, and messaging. It supports both controlled and uncontrolled modes,
185
+ * making it suitable for various use cases like cart expiration, limited-time
186
+ * offers, or session timeouts.
187
+ *
188
+ * @component
189
+ *
190
+ * @features
191
+ * - **Controlled & Uncontrolled**: Works in both modes
192
+ * - **Customizable appearance**: Variants, colors, icons, and messages
193
+ * - **Flexible positioning**: Fixed, sticky, or static
194
+ * - **Auto-start control**: Pause/resume countdown
195
+ * - **Custom time formatting**: Format time display as needed
196
+ * - **Accessible**: ARIA labels and live regions
197
+ * - **Responsive**: Mobile-first design
198
+ *
199
+ * @accessibility
200
+ * - Uses `aria-live="polite"` for time announcements
201
+ * - Includes descriptive `role="banner"`
202
+ * - Time display is announced to screen readers
203
+ *
204
+ * @example
205
+ * **Basic uncontrolled timer**
206
+ * ```tsx
207
+ * <ExpireCartTimer defaultTimeLeft={1200} />
208
+ * ```
209
+ *
210
+ * @example
211
+ * **Controlled timer with expiration handler**
212
+ * ```tsx
213
+ * function CartTimer() {
214
+ * const [timeLeft, setTimeLeft] = useState(1200);
215
+ *
216
+ * return (
217
+ * <ExpireCartTimer
218
+ * timeLeft={timeLeft}
219
+ * onTimeChange={setTimeLeft}
220
+ * onExpire={() => {
221
+ * // Clear cart or redirect
222
+ * clearCart();
223
+ * }}
224
+ * variant="warning"
225
+ * color="warning"
226
+ * />
227
+ * );
228
+ * }
229
+ * ```
230
+ *
231
+ * @example
232
+ * **Custom formatting and styling**
233
+ * ```tsx
234
+ * <ExpireCartTimer
235
+ * defaultTimeLeft={3600}
236
+ * formatTime={(seconds) => {
237
+ * const h = Math.floor(seconds / 3600);
238
+ * const m = Math.floor((seconds % 60) / 60);
239
+ * return `${h}h ${m}m remaining`;
240
+ * }}
241
+ * message="Sale ends in:"
242
+ * variant="error"
243
+ * color="danger"
244
+ * />
245
+ * ```
246
+ *
247
+ * @see {@link ExpireCartTimerProps} for all available props
248
+ */
249
+ export declare const ExpireCartTimer: React.ForwardRefExoticComponent<Omit<ExpireCartTimerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * ExpireCartTimer Component Tests
3
+ */
4
+ export {};
@@ -0,0 +1 @@
1
+ export * from './ExpireCartTimer';
@@ -1,21 +1,4 @@
1
- import { ReactNode } from 'react';
2
- export interface FooterLink {
3
- label: string;
4
- href: string;
5
- }
6
- export interface FooterSection {
7
- title: string;
8
- links: FooterLink[];
9
- }
10
- export interface SocialLink {
11
- platform: string;
12
- href: string;
13
- icon?: ReactNode;
14
- }
15
- export interface FooterProps {
16
- sections?: FooterSection[];
17
- socialLinks?: SocialLink[];
18
- copyrightText?: string;
19
- logo?: ReactNode;
20
- }
21
- export declare function Footer(_props: FooterProps): import("react/jsx-runtime").JSX.Element;
1
+ /**
2
+ * Footer Component
3
+ */
4
+ export declare function Footer(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1 @@
1
1
  export { Footer } from './Footer';
2
- export type { FooterProps, FooterSection, FooterLink, SocialLink } from './Footer';
@@ -103,3 +103,4 @@ import { RichTextAreaProps } from './types';
103
103
  * @see {@link https://tiptap.dev/docs/editor/api/editor Tiptap Editor API} for underlying editor functionality
104
104
  */
105
105
  export declare const RichTextArea: import('react').ForwardRefExoticComponent<Omit<RichTextAreaProps, "ref"> & import('react').RefAttributes<HTMLTextAreaElement>>;
106
+ export type { RichTextAreaProps };
@@ -26,9 +26,16 @@ export interface ToolbarProps {
26
26
  * Custom class name
27
27
  */
28
28
  className?: string;
29
+ /**
30
+ * Callback when a toolbar action is executed
31
+ */
32
+ onToolbarAction?: (action: {
33
+ type: string;
34
+ modifier: string;
35
+ }) => void;
29
36
  }
30
37
  /**
31
38
  * Main toolbar component
32
39
  * Renders all toolbar sections based on active modifiers
33
40
  */
34
- export declare function Toolbar({ editor, modifiers, zoom, onZoomChange, sticky, className }: ToolbarProps): import("react/jsx-runtime").JSX.Element | null;
41
+ export declare function Toolbar({ editor, modifiers, zoom, onZoomChange, sticky, className, onToolbarAction, }: ToolbarProps): import("react/jsx-runtime").JSX.Element | null;
@@ -4,9 +4,13 @@ import { ModifierType, ModifierConfig } from '../../types';
4
4
  * Hook to execute toolbar commands
5
5
  *
6
6
  * @param editor - TipTap editor instance
7
+ * @param onToolbarAction - Optional callback for logging/analytics
7
8
  * @returns Command execution functions
8
9
  */
9
- export declare function useToolbarCommands(editor: Editor | null): {
10
+ export declare function useToolbarCommands(editor: Editor | null, onToolbarAction?: (action: {
11
+ type: string;
12
+ modifier: string;
13
+ }) => void): {
10
14
  executeCommand: (modifierType: ModifierType, config?: ModifierConfig) => void;
11
15
  toggleModifier: (modifierType: ModifierType) => void;
12
16
  canExecute: (modifierType: ModifierType, config?: ModifierConfig) => boolean;
@@ -3,5 +3,9 @@ import { ModifierIdentifier } from '../../types';
3
3
  export interface TextFormattingSectionProps {
4
4
  editor: Editor | null;
5
5
  modifiers: ModifierIdentifier[];
6
+ onToolbarAction?: (action: {
7
+ type: string;
8
+ modifier: string;
9
+ }) => void;
6
10
  }
7
- export declare function TextFormattingSection({ editor, modifiers }: TextFormattingSectionProps): import("react/jsx-runtime").JSX.Element | null;
11
+ export declare function TextFormattingSection({ editor, modifiers, onToolbarAction }: TextFormattingSectionProps): import("react/jsx-runtime").JSX.Element | null;
@@ -139,6 +139,14 @@ export interface RichTextAreaProps extends Omit<ComponentProps<typeof Textarea>,
139
139
  * Callback when editor content changes (controlled mode)
140
140
  */
141
141
  onUpdate?: (content: EditorContent) => void;
142
+ /**
143
+ * Callback when a toolbar action is executed
144
+ * Useful for logging/analytics
145
+ */
146
+ onToolbarAction?: (action: {
147
+ type: string;
148
+ modifier: string;
149
+ }) => void;
142
150
  }
143
151
  /**
144
152
  * Internal TipTap editor props (for core/TipTapEditor.tsx)
@@ -1,10 +1,12 @@
1
+ export * from './EventDetails';
1
2
  export { Navbar } from './Navbar';
2
3
  export { Stepper } from './Stepper';
3
4
  export { Footer } from './Footer';
4
5
  export type { RichTextAreaProps } from './RichText';
5
6
  export { RichTextArea, RICH_TEXT_PRESETS } from './RichText';
6
7
  export { DonationAmounts } from './DonationAmounts';
8
+ export { ExpireCartTimer } from './ExpireCartTimer';
7
9
  export type { NavbarProps, NavbarLink, NavbarLanguage } from './Navbar';
8
10
  export type { StepperProps } from './Stepper';
9
- export type { FooterProps, FooterSection, FooterLink, SocialLink } from './Footer';
10
11
  export type { DonationAmountsProps, DonationAmount, SelectedDonation, DonationLabels } from './DonationAmounts';
12
+ export type { ExpireCartTimerProps } from './ExpireCartTimer';
@@ -1,6 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { NavbarProps } from '../../patterns/Navbar';
3
- import { FooterProps } from '../../patterns/Footer';
4
3
  export interface ConfirmationDetails {
5
4
  title: string;
6
5
  message: string;
@@ -12,7 +11,6 @@ export interface ConfirmationDetails {
12
11
  }
13
12
  export interface ConfirmationPageTemplateProps {
14
13
  navbar?: NavbarProps;
15
- footer?: FooterProps;
16
14
  confirmation: ConfirmationDetails;
17
15
  primaryAction?: {
18
16
  label: string;
@@ -1,7 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { NavbarProps } from '../../patterns/Navbar';
3
3
  import { StepperProps } from '../../patterns/Stepper';
4
- import { FooterProps } from '../../patterns/Footer';
5
4
  export interface EventInfo {
6
5
  title: string;
7
6
  description: string;
@@ -16,7 +15,6 @@ export interface EventInfo {
16
15
  }
17
16
  export interface EventDetailsTemplateProps {
18
17
  navbar?: NavbarProps;
19
- footer?: FooterProps;
20
18
  stepper?: StepperProps;
21
19
  event: EventInfo;
22
20
  primaryAction?: {
@@ -23,12 +23,12 @@ export declare const theme: {
23
23
  readonly 200: "#e5e7eb";
24
24
  readonly 300: "#d1d5db";
25
25
  readonly 400: "#9ca3af";
26
- readonly 500: "#000000";
26
+ readonly 500: any;
27
27
  readonly 600: "#000000";
28
28
  readonly 700: "#000000";
29
29
  readonly 800: "#000000";
30
30
  readonly 900: "#000000";
31
- readonly DEFAULT: "#000000";
31
+ readonly DEFAULT: any;
32
32
  };
33
33
  };
34
34
  };
@@ -5,14 +5,13 @@
5
5
  export declare const colors: {
6
6
  readonly brand: {
7
7
  readonly primary: "#C14615";
8
- readonly secondary: "#000000";
9
- readonly accent: "#F59E0B";
10
8
  };
11
9
  readonly semantic: {
12
- readonly success: "#10B981";
13
- readonly warning: "#F59E0B";
14
- readonly error: "#EF4444";
15
- readonly info: "#3B82F6";
10
+ readonly secondary: "#000000";
11
+ readonly success: "#057A54";
12
+ readonly warning: "#F5A524";
13
+ readonly danger: "#B62214";
14
+ readonly info: "#2563EB";
16
15
  };
17
16
  readonly neutral: {
18
17
  readonly white: "#FFFFFF";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@veevarts/design-system",
3
3
  "private": false,
4
- "version": "0.1.23",
4
+ "version": "1.0.0-alpha.4",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -16,6 +16,7 @@
16
16
  "preview": "vite preview",
17
17
  "test": "vitest --run",
18
18
  "test:watch": "vitest",
19
+ "test:storybook": "vitest --project storybook --run",
19
20
  "test:unit": "vitest --project unit --run",
20
21
  "test:unit:watch": "vitest --project unit",
21
22
  "test:ui": "vitest --ui",
@@ -23,11 +24,7 @@
23
24
  "storybook": "storybook dev -p 6006",
24
25
  "build-storybook": "storybook build",
25
26
  "deploy-storybook": "npm run build-storybook && npx vercel storybook-static --prod",
26
- "prepublishOnly": "npm run test && npm run lint && npm run build",
27
- "publish:patch": "npm version patch && npm publish && git push origin main --tags",
28
- "publish:minor": "npm version minor && npm publish && git push origin main --tags",
29
- "publish:major": "npm version major && npm publish && git push origin main --tags",
30
- "publish:beta": "npm version prerelease --preid=beta && npm publish --tag beta && git push origin main --tags"
27
+ "prepublishOnly": "npm run test && npm run lint && npm run build"
31
28
  },
32
29
  "peerDependencies": {
33
30
  "@heroui/react": ">=2.7.0",
@@ -49,6 +46,7 @@
49
46
  "react-dom": "^18.0.0 || ^19.0.0"
50
47
  },
51
48
  "dependencies": {
49
+ "@iconify/react": "^6.0.2",
52
50
  "vite-plugin-css-injected-by-js": "3.5.2",
53
51
  "vite-plugin-dts": "4.5.4"
54
52
  },
@@ -56,6 +54,15 @@
56
54
  "@chromatic-com/storybook": "^4.1.3",
57
55
  "@eslint/js": "^9.39.1",
58
56
  "@heroui/react": "^2.8.7",
57
+ "@storybook/addon-a11y": "^10.0.8",
58
+ "@storybook/addon-docs": "^10.0.8",
59
+ "@storybook/addon-onboarding": "^10.0.8",
60
+ "@storybook/addon-vitest": "^10.0.8",
61
+ "@storybook/react-vite": "^10.0.8",
62
+ "@tailwindcss/line-clamp": "^0.4.4",
63
+ "@testing-library/jest-dom": "^6.9.1",
64
+ "@testing-library/react": "^16.3.1",
65
+ "@testing-library/user-event": "^14.6.1",
59
66
  "@tiptap/extension-color": "^2.27.0",
60
67
  "@tiptap/extension-highlight": "^2.27.2",
61
68
  "@tiptap/extension-link": "^2.27.2",
@@ -67,15 +74,6 @@
67
74
  "@tiptap/pm": "^2.27.0",
68
75
  "@tiptap/react": "^2.27.0",
69
76
  "@tiptap/starter-kit": "^2.27.0",
70
- "lucide-react": "^0.562.0",
71
- "@storybook/addon-a11y": "^10.0.8",
72
- "@storybook/addon-docs": "^10.0.8",
73
- "@storybook/addon-onboarding": "^10.0.8",
74
- "@storybook/addon-vitest": "^10.0.8",
75
- "@storybook/react-vite": "^10.0.8",
76
- "@testing-library/jest-dom": "^6.9.1",
77
- "@testing-library/react": "^16.3.1",
78
- "@testing-library/user-event": "^14.6.1",
79
77
  "@types/node": "^24.10.1",
80
78
  "@types/react": "^19.2.5",
81
79
  "@types/react-dom": "^19.2.3",
@@ -90,6 +88,7 @@
90
88
  "framer-motion": "^11.15.0",
91
89
  "globals": "^16.5.0",
92
90
  "jsdom": "^27.4.0",
91
+ "lucide-react": "^0.562.0",
93
92
  "playwright": "^1.56.1",
94
93
  "postcss": "^8.5.6",
95
94
  "react": "19.2.3",
@@ -1,4 +0,0 @@
1
- /**
2
- * Footer Component
3
- */
4
- export declare function Footer(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export { Footer } from './Footer';