@veevarts/design-system 0.1.22 → 1.0.0-alpha.10
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.
Potentially problematic release.
This version of @veevarts/design-system might be problematic. Click here for more details.
- package/dist/index.cjs +12 -12
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3657 -1561
- package/dist/patterns/DonationAmounts/DonationAmounts.d.ts +7 -0
- package/dist/patterns/DonationAmounts/DonationAmounts.test.d.ts +4 -0
- package/dist/patterns/DonationAmounts/index.d.ts +9 -0
- package/dist/patterns/DonationAmounts/types.d.ts +145 -0
- package/dist/patterns/DonationAmounts/utils/currency.d.ts +25 -0
- package/dist/patterns/EventDetails/EventDetails.d.ts +37 -0
- package/dist/patterns/EventDetails/EventDetails.test.d.ts +0 -0
- package/dist/patterns/EventDetails/index.d.ts +2 -0
- package/dist/patterns/ExpireCartTimer/ExpireCartTimer.d.ts +249 -0
- package/dist/patterns/ExpireCartTimer/ExpireCartTimer.test.d.ts +4 -0
- package/dist/patterns/ExpireCartTimer/index.d.ts +1 -0
- package/dist/patterns/Footer/Footer.d.ts +4 -21
- package/dist/patterns/Footer/Footer.test.d.ts +1 -0
- package/dist/patterns/Footer/index.d.ts +0 -1
- package/dist/patterns/Navbar/Navbar.d.ts +23 -7
- package/dist/patterns/Navbar/Navbar.test.d.ts +1 -0
- package/dist/patterns/OfferCard/OfferCard.d.ts +12 -0
- package/dist/patterns/OfferCard/OfferCard.test.d.ts +1 -0
- package/dist/patterns/OfferCard/OfferCardEmpty.d.ts +12 -0
- package/dist/patterns/OfferCard/OfferCardError.d.ts +12 -0
- package/dist/patterns/OfferCard/OfferCardList.d.ts +12 -0
- package/dist/patterns/OfferCard/OfferCardSkeleton.d.ts +12 -0
- package/dist/patterns/OfferCard/animations.d.ts +42 -0
- package/dist/patterns/OfferCard/examples/CustomQuantitySelectorExample.d.ts +1 -0
- package/dist/patterns/OfferCard/examples/ListWithEurosCurrencyExample.d.ts +1 -0
- package/dist/patterns/OfferCard/examples/ListWithoutAnimationExample.d.ts +1 -0
- package/dist/patterns/OfferCard/examples/index.d.ts +3 -0
- package/dist/patterns/OfferCard/index.d.ts +14 -0
- package/dist/patterns/OfferCard/types.d.ts +483 -0
- package/dist/patterns/OfferCard/utils/currency.d.ts +26 -0
- package/dist/patterns/OfferCard/utils/index.d.ts +2 -0
- package/dist/patterns/OfferCard/utils/offers.d.ts +3 -0
- package/dist/patterns/RichText/RichText.d.ts +1 -0
- package/dist/patterns/RichText/toolbar/Toolbar.d.ts +8 -1
- package/dist/patterns/RichText/toolbar/hooks/useToolbarCommands.d.ts +5 -1
- package/dist/patterns/RichText/toolbar/sections/TextFormattingSection.d.ts +5 -1
- package/dist/patterns/RichText/types/props.d.ts +8 -0
- package/dist/patterns/index.d.ts +8 -1
- package/dist/templates/ConfirmationPageTemplate/ConfirmationPageTemplate.d.ts +0 -2
- package/dist/templates/EventDetailsTemplate/EventDetailsTemplate.d.ts +0 -2
- package/dist/theme/index.d.ts +26 -2
- package/dist/tokens/colors.d.ts +33 -7
- package/package.json +16 -12
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { DonationAmountsProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* DonationAmounts component for selecting donation values
|
|
5
|
+
*/
|
|
6
|
+
export declare const DonationAmounts: React.FC<DonationAmountsProps>;
|
|
7
|
+
export default DonationAmounts;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DonationAmounts Pattern
|
|
3
|
+
*
|
|
4
|
+
* A component for selecting donation amounts with preset options and custom input.
|
|
5
|
+
* Ensures exclusive selection (preset OR custom).
|
|
6
|
+
*/
|
|
7
|
+
export { DonationAmounts } from './DonationAmounts';
|
|
8
|
+
export type { DonationAmount, SelectedDonation, DonationLabels, DonationAmountsProps } from './types';
|
|
9
|
+
export { formatCurrency, parseCurrency } from './utils/currency';
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DonationAmounts - Type Definitions
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Represents a preset donation amount option
|
|
6
|
+
*/
|
|
7
|
+
export interface DonationAmount {
|
|
8
|
+
/**
|
|
9
|
+
* Unique identifier for the amount
|
|
10
|
+
*/
|
|
11
|
+
id: string;
|
|
12
|
+
/**
|
|
13
|
+
* The numerical value of the donation
|
|
14
|
+
*/
|
|
15
|
+
amount: number;
|
|
16
|
+
/**
|
|
17
|
+
* Optional label to display instead of the amount
|
|
18
|
+
* If not provided, the formatted currency will be used
|
|
19
|
+
*/
|
|
20
|
+
label?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Selected donation value (can be preset or custom)
|
|
24
|
+
*/
|
|
25
|
+
export interface SelectedDonation {
|
|
26
|
+
/**
|
|
27
|
+
* The selected amount
|
|
28
|
+
*/
|
|
29
|
+
amount: number;
|
|
30
|
+
/**
|
|
31
|
+
* Whether this is a custom amount
|
|
32
|
+
*/
|
|
33
|
+
isCustom: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* ID of the preset (if not custom)
|
|
36
|
+
*/
|
|
37
|
+
presetId?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Labels for internationalization
|
|
41
|
+
*/
|
|
42
|
+
export interface DonationLabels {
|
|
43
|
+
/**
|
|
44
|
+
* Title text (e.g., "Donation Amount")
|
|
45
|
+
*/
|
|
46
|
+
title?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Placeholder for custom amount input
|
|
49
|
+
*/
|
|
50
|
+
customAmountPlaceholder?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Aria label for custom amount input
|
|
53
|
+
*/
|
|
54
|
+
customAmountAriaLabel?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Props for DonationAmounts component
|
|
58
|
+
*/
|
|
59
|
+
export interface DonationAmountsProps {
|
|
60
|
+
/**
|
|
61
|
+
* Array of preset donation amounts to display as buttons
|
|
62
|
+
* @default [100, 250, 500, 1000, 2000]
|
|
63
|
+
*/
|
|
64
|
+
presetAmounts?: DonationAmount[];
|
|
65
|
+
/**
|
|
66
|
+
* Currently selected donation (controlled mode)
|
|
67
|
+
*/
|
|
68
|
+
selectedDonation?: SelectedDonation | null;
|
|
69
|
+
/**
|
|
70
|
+
* Default selected donation (uncontrolled mode)
|
|
71
|
+
*/
|
|
72
|
+
defaultSelectedDonation?: SelectedDonation | null;
|
|
73
|
+
/**
|
|
74
|
+
* Callback fired when donation selection changes
|
|
75
|
+
*/
|
|
76
|
+
onChange?: (donation: SelectedDonation | null) => void;
|
|
77
|
+
/**
|
|
78
|
+
* Currency code (ISO 4217)
|
|
79
|
+
* @default 'USD'
|
|
80
|
+
*/
|
|
81
|
+
currency?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Locale for currency formatting
|
|
84
|
+
* @default 'en-US'
|
|
85
|
+
*/
|
|
86
|
+
locale?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Whether to show the custom amount input
|
|
89
|
+
* @default true
|
|
90
|
+
*/
|
|
91
|
+
showCustomAmount?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Minimum allowed custom amount
|
|
94
|
+
* @default 0.5
|
|
95
|
+
*/
|
|
96
|
+
minCustomAmount?: number;
|
|
97
|
+
/**
|
|
98
|
+
* Maximum allowed custom amount
|
|
99
|
+
* @default 1000000
|
|
100
|
+
*/
|
|
101
|
+
maxCustomAmount?: number;
|
|
102
|
+
/**
|
|
103
|
+
* Labels for internationalization
|
|
104
|
+
*/
|
|
105
|
+
labels?: DonationLabels;
|
|
106
|
+
/**
|
|
107
|
+
* Number of columns for preset buttons on mobile
|
|
108
|
+
* @default 2
|
|
109
|
+
*/
|
|
110
|
+
mobileColumns?: 2 | 3;
|
|
111
|
+
/**
|
|
112
|
+
* Number of columns for preset buttons on desktop
|
|
113
|
+
* @default 3
|
|
114
|
+
*/
|
|
115
|
+
desktopColumns?: 3 | 4 | 5 | 6;
|
|
116
|
+
/**
|
|
117
|
+
* Whether the component is disabled
|
|
118
|
+
* @default false
|
|
119
|
+
*/
|
|
120
|
+
isDisabled?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Button variant for preset amounts
|
|
123
|
+
* @default 'bordered'
|
|
124
|
+
*/
|
|
125
|
+
buttonVariant?: 'solid' | 'bordered' | 'light' | 'flat' | 'faded' | 'shadow' | 'ghost';
|
|
126
|
+
/**
|
|
127
|
+
* Button color for preset amounts
|
|
128
|
+
* @default 'default'
|
|
129
|
+
*/
|
|
130
|
+
buttonColor?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
|
|
131
|
+
/**
|
|
132
|
+
* Input variant for custom amount
|
|
133
|
+
* @default 'bordered'
|
|
134
|
+
*/
|
|
135
|
+
inputVariant?: 'flat' | 'bordered' | 'faded' | 'underlined';
|
|
136
|
+
/**
|
|
137
|
+
* Additional CSS classes
|
|
138
|
+
*/
|
|
139
|
+
className?: string;
|
|
140
|
+
/**
|
|
141
|
+
* Whether to show the component inside a Card
|
|
142
|
+
* @default true
|
|
143
|
+
*/
|
|
144
|
+
showCard?: boolean;
|
|
145
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Currency formatting utilities
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Formats a number as currency
|
|
6
|
+
* @param amount - The amount to format
|
|
7
|
+
* @param locale - The locale to use for formatting (e.g., 'en-US', 'es-ES')
|
|
8
|
+
* @param currency - The currency code (ISO 4217, e.g., 'USD', 'EUR')
|
|
9
|
+
* @returns Formatted currency string
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* formatCurrency(1000, 'en-US', 'USD') // "$1,000.00"
|
|
13
|
+
* formatCurrency(1000, 'es-ES', 'EUR') // "1.000,00 €"
|
|
14
|
+
*/
|
|
15
|
+
export declare function formatCurrency(amount: number, locale?: string, currency?: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Parses a currency string to a number
|
|
18
|
+
* @param value - The currency string to parse
|
|
19
|
+
* @returns Parsed number or null if invalid
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* parseCurrency('$1,000.00') // 1000
|
|
23
|
+
* parseCurrency('1.000,00 €') // 1000
|
|
24
|
+
*/
|
|
25
|
+
export declare function parseCurrency(value: string): number | null;
|
|
@@ -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
|
+
export declare const EventDetails: ({ classes, name, imageUrl, eventDate, eventTime, location, description, showImage, showMoreButtonClassName, labels, }: EventDetailsProps) => JSX.Element;
|
|
37
|
+
export default EventDetails;
|
|
File without changes
|
|
@@ -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 @@
|
|
|
1
|
+
export * from './ExpireCartTimer';
|
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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,4 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Navbar Component
|
|
3
|
+
*
|
|
4
|
+
* A flexible, stateless navigation bar pattern for React apps.
|
|
5
|
+
*
|
|
6
|
+
* Features:
|
|
7
|
+
* - Logo on the left (image URL via `logo` prop)
|
|
8
|
+
* - Language selector dropdown with a globe icon (disabled if no languages)
|
|
9
|
+
* - Login/Logout button with user icon, fully controlled via props
|
|
10
|
+
* - All state and actions (login, logout, language change) are controlled by parent via props
|
|
11
|
+
* - Strictly typed with TypeScript
|
|
12
|
+
*/
|
|
2
13
|
export interface NavbarLink {
|
|
3
14
|
label: string;
|
|
4
15
|
href: string;
|
|
@@ -8,17 +19,22 @@ export interface NavbarLanguage {
|
|
|
8
19
|
code: string;
|
|
9
20
|
label: string;
|
|
10
21
|
}
|
|
22
|
+
export interface NavbarLabels {
|
|
23
|
+
login: string;
|
|
24
|
+
logout: string;
|
|
25
|
+
selectLanguage: string;
|
|
26
|
+
}
|
|
11
27
|
export interface NavbarProps {
|
|
12
|
-
logo?:
|
|
13
|
-
links?: NavbarLink[];
|
|
28
|
+
logo?: string;
|
|
14
29
|
languages?: NavbarLanguage[];
|
|
15
30
|
selectedLanguage?: string;
|
|
16
31
|
onLanguageChange?: (languageCode: string) => void;
|
|
17
32
|
isLoggedIn?: boolean;
|
|
18
|
-
|
|
33
|
+
hasLanguages?: boolean;
|
|
34
|
+
hasAuth?: boolean;
|
|
19
35
|
onLogin?: () => void;
|
|
20
36
|
onLogout?: () => void;
|
|
21
|
-
|
|
22
|
-
|
|
37
|
+
labels?: Partial<NavbarLabels>;
|
|
38
|
+
className?: string;
|
|
23
39
|
}
|
|
24
|
-
export declare function Navbar(
|
|
40
|
+
export declare function Navbar({ logo, languages, selectedLanguage, onLanguageChange, isLoggedIn, onLogin, onLogout, hasLanguages, hasAuth, labels, className, }: NavbarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { OfferCardProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* OfferCard component displays a single offer with quantity selection controls.
|
|
5
|
+
* Provides visual feedback for sold out status and maximum ticket limits.
|
|
6
|
+
* Supports slot-based customization for all rendered elements.
|
|
7
|
+
*/
|
|
8
|
+
export declare const OfferCard: {
|
|
9
|
+
({ offer, quantity: quantityProp, defaultQuantity, onQuantityChange, currency, locale, labels: customLabels, slots, isDisabled, buttonVariant, buttonColor, showCard, showDescription, showPeopleCount, showPrice, classNames, "data-testid": dataTestId, selectedColor, }: OfferCardProps): JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export default OfferCard;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { OfferCardEmptyProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* OfferCardEmpty component renders a visually informative empty state
|
|
5
|
+
* when there are no offers to display. It includes an icon and a message
|
|
6
|
+
* that can be customized via props.
|
|
7
|
+
*/
|
|
8
|
+
export declare const OfferCardEmpty: {
|
|
9
|
+
({ message, icon, iconSize, showCard, classNames, renderEmpty, }: OfferCardEmptyProps): JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export default OfferCardEmpty;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { OfferCardErrorProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* OfferCardError component renders an alert with error information
|
|
5
|
+
* when the offers cannot be loaded. Supports custom error messages
|
|
6
|
+
* and color variants for different error severity levels.
|
|
7
|
+
*/
|
|
8
|
+
export declare const OfferCardError: {
|
|
9
|
+
({ error, labels: customLabels, showCard, color, classNames, }: OfferCardErrorProps): JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export default OfferCardError;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { OfferCardListProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* OfferCardList component displays a collection of offer cards in a responsive grid.
|
|
5
|
+
* It manages selection state internally or accepts external control via props.
|
|
6
|
+
* When animated is true, cards animate in/out using Framer Motion variants.
|
|
7
|
+
*/
|
|
8
|
+
export declare const OfferCardList: {
|
|
9
|
+
({ offers, selection: selectionProp, defaultSelection, onSelectionChange, onQuantityChange, currency, locale, labels, slots, isDisabled, buttonVariant, buttonColor, showCard, animated, gap, classNames, }: OfferCardListProps): JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export default OfferCardList;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { OfferCardSkeletonProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* OfferCardSkeleton component renders placeholder cards with animated skeletons
|
|
5
|
+
* that mimic the structure of actual offer cards. This provides visual feedback
|
|
6
|
+
* to users while content is loading.
|
|
7
|
+
*/
|
|
8
|
+
export declare const OfferCardSkeleton: {
|
|
9
|
+
({ quantity, gap, classNames }: OfferCardSkeletonProps): JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export default OfferCardSkeleton;
|