@veevarts/design-system 0.1.23 → 1.0.0-alpha.12
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/dist/components/index.d.ts +12 -1
- package/dist/index.cjs +11 -11
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3113 -1651
- package/dist/patterns/DonationAmounts/index.d.ts +1 -1
- 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/RevenueDistribution/RevenueDistributionCard.d.ts +16 -0
- package/dist/patterns/RevenueDistribution/RevenueDistributionCard.test.d.ts +1 -0
- package/dist/patterns/RevenueDistribution/RevenueDistributionEmpty.d.ts +11 -0
- package/dist/patterns/RevenueDistribution/RevenueDistributionError.d.ts +11 -0
- package/dist/patterns/RevenueDistribution/RevenueDistributionSkeleton.d.ts +11 -0
- package/dist/patterns/RevenueDistribution/examples/InteractiveExample.d.ts +8 -0
- package/dist/patterns/RevenueDistribution/examples/MultipleDistributionsFormExample.d.ts +10 -0
- package/dist/patterns/RevenueDistribution/examples/WithGlAccountSearchExample.d.ts +7 -0
- package/dist/patterns/RevenueDistribution/examples/index.d.ts +9 -0
- package/dist/patterns/RevenueDistribution/index.d.ts +14 -0
- package/dist/patterns/RevenueDistribution/types.d.ts +394 -0
- package/dist/patterns/RevenueDistribution/utils/amount.d.ts +56 -0
- package/dist/patterns/RevenueDistribution/utils/data.d.ts +4 -0
- package/dist/patterns/RevenueDistribution/utils/index.d.ts +5 -0
- package/dist/patterns/RichText/RichText.d.ts +1 -0
- package/dist/patterns/RichText/TipTapArea/TipTapArea.d.ts +1 -1
- 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 +9 -1
- package/dist/patterns/Stepper/Stepper.d.ts +1 -1
- package/dist/patterns/index.d.ts +5 -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 +72 -7
- package/package.json +16 -16
- package/dist/components/Footer/Footer.d.ts +0 -4
- package/dist/components/Footer/index.d.ts +0 -1
|
@@ -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
|
|
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;
|
|
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;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Variants for the offer list animation.
|
|
3
|
+
* This includes the initial hidden state and the final visible state.
|
|
4
|
+
*/
|
|
5
|
+
export declare const offerListVariants: {
|
|
6
|
+
hidden: {
|
|
7
|
+
opacity: number;
|
|
8
|
+
};
|
|
9
|
+
show: {
|
|
10
|
+
opacity: number;
|
|
11
|
+
transition: {
|
|
12
|
+
staggerChildren: number;
|
|
13
|
+
delayChildren: number;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* @description Variants for the offer card animation.
|
|
19
|
+
* This includes the initial hidden state, the final visible state, and the exit state.
|
|
20
|
+
*/
|
|
21
|
+
export declare const offerCardVariants: {
|
|
22
|
+
hidden: {
|
|
23
|
+
opacity: number;
|
|
24
|
+
y: number;
|
|
25
|
+
};
|
|
26
|
+
show: {
|
|
27
|
+
opacity: number;
|
|
28
|
+
y: number;
|
|
29
|
+
transition: {
|
|
30
|
+
duration: number;
|
|
31
|
+
ease: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
exit: {
|
|
35
|
+
opacity: number;
|
|
36
|
+
y: number;
|
|
37
|
+
transition: {
|
|
38
|
+
duration: number;
|
|
39
|
+
ease: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function CustomQuantitySelectorExample(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ListWithEurosCurrencyExample(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ListWithoutAnimationExample(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OfferCard Pattern
|
|
3
|
+
*
|
|
4
|
+
* A complete pattern for displaying offers with quantity selection,
|
|
5
|
+
* price formatting, and various states (loading, error, empty).
|
|
6
|
+
*/
|
|
7
|
+
export { OfferCard, default as OfferCardDefault } from './OfferCard';
|
|
8
|
+
export { OfferCardList } from './OfferCardList';
|
|
9
|
+
export { OfferCardSkeleton } from './OfferCardSkeleton';
|
|
10
|
+
export { OfferCardError } from './OfferCardError';
|
|
11
|
+
export { OfferCardEmpty } from './OfferCardEmpty';
|
|
12
|
+
export type { Offer, OfferSelection, OfferCardLabels, OfferCardErrorLabels, OfferCardClassNames, OfferCardListClassNames, OfferCardSkeletonClassNames, OfferCardErrorClassNames, OfferCardEmptyClassNames, OfferCardSlots, OfferCardProps, OfferCardListProps, OfferCardSkeletonProps, OfferCardErrorProps, OfferCardEmptyProps, } from './types';
|
|
13
|
+
export { offerListVariants, offerCardVariants } from './animations';
|
|
14
|
+
export { formatCurrency, parseCurrency } from './utils/currency';
|