@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,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';
|
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* OfferCard - Type Definitions
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Represents an offer with its details
|
|
7
|
+
*/
|
|
8
|
+
export interface Offer {
|
|
9
|
+
/**
|
|
10
|
+
* Unique identifier for the offer
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
/**
|
|
14
|
+
* Display name of the offer
|
|
15
|
+
*/
|
|
16
|
+
name: string;
|
|
17
|
+
/**
|
|
18
|
+
* Optional description or details about the offer
|
|
19
|
+
*/
|
|
20
|
+
description?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Price of the offer (before or after tax based on your implementation)
|
|
23
|
+
*/
|
|
24
|
+
price: number;
|
|
25
|
+
/**
|
|
26
|
+
* Maximum number of tickets allowed for this offer
|
|
27
|
+
* If not provided, unlimited tickets are assumed
|
|
28
|
+
*/
|
|
29
|
+
ticketsAllowed?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Total number of tickets already sold
|
|
32
|
+
* Used to calculate availability and sold out status
|
|
33
|
+
*/
|
|
34
|
+
totalTicketsSold?: number | null;
|
|
35
|
+
/**
|
|
36
|
+
* Number of people included in the offer (e.g., for table tickets)
|
|
37
|
+
*/
|
|
38
|
+
numberOfPeople?: number | null;
|
|
39
|
+
/**
|
|
40
|
+
* Position for sorting offers in a list
|
|
41
|
+
*/
|
|
42
|
+
position?: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Selection state for offers (map of offer ID to quantity)
|
|
46
|
+
*/
|
|
47
|
+
export type OfferSelection = Record<string, number>;
|
|
48
|
+
/**
|
|
49
|
+
* Labels for internationalization
|
|
50
|
+
*/
|
|
51
|
+
export interface OfferCardLabels {
|
|
52
|
+
/**
|
|
53
|
+
* Label for single person (e.g., "Person")
|
|
54
|
+
*/
|
|
55
|
+
person?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Label for multiple people (e.g., "People")
|
|
58
|
+
*/
|
|
59
|
+
people?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Label for tickets section (e.g., "Tickets:")
|
|
62
|
+
*/
|
|
63
|
+
tickets?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Label for sold out status (e.g., "Sold Out")
|
|
66
|
+
*/
|
|
67
|
+
soldOut?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Message when maximum tickets reached (e.g., "Maximum number of tickets allowed reached")
|
|
70
|
+
*/
|
|
71
|
+
maxReached?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Labels for error state
|
|
75
|
+
*/
|
|
76
|
+
export interface OfferCardErrorLabels {
|
|
77
|
+
/**
|
|
78
|
+
* Error title (e.g., "Error Fetching Offers")
|
|
79
|
+
*/
|
|
80
|
+
title?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Error description (e.g., "An error occurred while fetching offers.")
|
|
83
|
+
*/
|
|
84
|
+
description?: string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Class names for styling different parts of the OfferCard
|
|
88
|
+
*/
|
|
89
|
+
export interface OfferCardClassNames {
|
|
90
|
+
/**
|
|
91
|
+
* Class for the root/container element
|
|
92
|
+
*/
|
|
93
|
+
base?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Class for the card body
|
|
96
|
+
*/
|
|
97
|
+
body?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Class for the offer name
|
|
100
|
+
*/
|
|
101
|
+
name?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Class for the price display
|
|
104
|
+
*/
|
|
105
|
+
price?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Class for the description text
|
|
108
|
+
*/
|
|
109
|
+
description?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Class for the people count section
|
|
112
|
+
*/
|
|
113
|
+
peopleCount?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Class for the tickets label
|
|
116
|
+
*/
|
|
117
|
+
ticketsLabel?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Class for the quantity selector container
|
|
120
|
+
*/
|
|
121
|
+
quantitySelector?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Class for the sold out badge
|
|
124
|
+
*/
|
|
125
|
+
soldOut?: string;
|
|
126
|
+
/**
|
|
127
|
+
* Class for the max reached alert
|
|
128
|
+
*/
|
|
129
|
+
maxReachedAlert?: string;
|
|
130
|
+
/**
|
|
131
|
+
* Class for the card footer
|
|
132
|
+
*/
|
|
133
|
+
footer?: string;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Class names for OfferCardList
|
|
137
|
+
*/
|
|
138
|
+
export interface OfferCardListClassNames {
|
|
139
|
+
/**
|
|
140
|
+
* Class for the list container
|
|
141
|
+
*/
|
|
142
|
+
base?: string;
|
|
143
|
+
/**
|
|
144
|
+
* Class for each card wrapper (motion div)
|
|
145
|
+
*/
|
|
146
|
+
cardWrapper?: string;
|
|
147
|
+
/**
|
|
148
|
+
* Class names passed to each OfferCard
|
|
149
|
+
*/
|
|
150
|
+
card?: OfferCardClassNames;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Class names for OfferCardSkeleton
|
|
154
|
+
*/
|
|
155
|
+
export interface OfferCardSkeletonClassNames {
|
|
156
|
+
/**
|
|
157
|
+
* Class for the container
|
|
158
|
+
*/
|
|
159
|
+
base?: string;
|
|
160
|
+
/**
|
|
161
|
+
* Class for each skeleton card
|
|
162
|
+
*/
|
|
163
|
+
card?: string;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Class names for OfferCardError
|
|
167
|
+
*/
|
|
168
|
+
export interface OfferCardErrorClassNames {
|
|
169
|
+
/**
|
|
170
|
+
* Class for the root element
|
|
171
|
+
*/
|
|
172
|
+
base?: string;
|
|
173
|
+
/**
|
|
174
|
+
* Class for the alert component
|
|
175
|
+
*/
|
|
176
|
+
alert?: string;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Class names for OfferCardEmpty
|
|
180
|
+
*/
|
|
181
|
+
export interface OfferCardEmptyClassNames {
|
|
182
|
+
/**
|
|
183
|
+
* Class for the root element
|
|
184
|
+
*/
|
|
185
|
+
base?: string;
|
|
186
|
+
/**
|
|
187
|
+
* Class for the content container
|
|
188
|
+
*/
|
|
189
|
+
content?: string;
|
|
190
|
+
/**
|
|
191
|
+
* Class for the icon
|
|
192
|
+
*/
|
|
193
|
+
icon?: string;
|
|
194
|
+
/**
|
|
195
|
+
* Class for the message text
|
|
196
|
+
*/
|
|
197
|
+
message?: string;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Slot render functions for custom content
|
|
201
|
+
*/
|
|
202
|
+
export interface OfferCardSlots {
|
|
203
|
+
/**
|
|
204
|
+
* Custom render for the offer name
|
|
205
|
+
*/
|
|
206
|
+
renderName?: (name: string, offer: Offer) => React.ReactNode;
|
|
207
|
+
/**
|
|
208
|
+
* Custom render for the price display
|
|
209
|
+
*/
|
|
210
|
+
renderPrice?: (price: number, formattedPrice: string, offer: Offer) => React.ReactNode;
|
|
211
|
+
/**
|
|
212
|
+
* Custom render for the description
|
|
213
|
+
*/
|
|
214
|
+
renderDescription?: (description: string, offer: Offer) => React.ReactNode;
|
|
215
|
+
/**
|
|
216
|
+
* Custom render for the people count
|
|
217
|
+
*/
|
|
218
|
+
renderPeopleCount?: (count: number, label: string, offer: Offer) => React.ReactNode;
|
|
219
|
+
/**
|
|
220
|
+
* Custom render for the quantity selector
|
|
221
|
+
*/
|
|
222
|
+
renderQuantitySelector?: (props: {
|
|
223
|
+
quantity: number;
|
|
224
|
+
onIncrement: () => void;
|
|
225
|
+
onDecrement: () => void;
|
|
226
|
+
isDecrementDisabled: boolean;
|
|
227
|
+
isIncrementDisabled: boolean;
|
|
228
|
+
isDisabled: boolean;
|
|
229
|
+
}) => React.ReactNode;
|
|
230
|
+
/**
|
|
231
|
+
* Custom render for sold out badge
|
|
232
|
+
*/
|
|
233
|
+
renderSoldOut?: (label: string) => React.ReactNode;
|
|
234
|
+
/**
|
|
235
|
+
* Custom render for max reached alert
|
|
236
|
+
*/
|
|
237
|
+
renderMaxReachedAlert?: (message: string) => React.ReactNode;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Props for the OfferCard component
|
|
241
|
+
*/
|
|
242
|
+
export interface OfferCardProps {
|
|
243
|
+
/**
|
|
244
|
+
* A unique identifier for testing purposes.
|
|
245
|
+
*/
|
|
246
|
+
'data-testid'?: string;
|
|
247
|
+
/**
|
|
248
|
+
* The offer data to display
|
|
249
|
+
*/
|
|
250
|
+
offer: Offer;
|
|
251
|
+
/**
|
|
252
|
+
* Currently selected quantity (controlled mode)
|
|
253
|
+
*/
|
|
254
|
+
quantity?: number;
|
|
255
|
+
/**
|
|
256
|
+
* Default quantity (uncontrolled mode)
|
|
257
|
+
* @default 0
|
|
258
|
+
*/
|
|
259
|
+
defaultQuantity?: number;
|
|
260
|
+
/**
|
|
261
|
+
* Callback fired when quantity changes
|
|
262
|
+
*/
|
|
263
|
+
onQuantityChange?: (id: string, quantity: number) => void;
|
|
264
|
+
/**
|
|
265
|
+
* Currency code (ISO 4217)
|
|
266
|
+
* @default 'USD'
|
|
267
|
+
*/
|
|
268
|
+
currency?: string;
|
|
269
|
+
/**
|
|
270
|
+
* Locale for currency and number formatting
|
|
271
|
+
* @default 'en-US'
|
|
272
|
+
*/
|
|
273
|
+
locale?: string;
|
|
274
|
+
/**
|
|
275
|
+
* Labels for internationalization
|
|
276
|
+
*/
|
|
277
|
+
labels?: OfferCardLabels;
|
|
278
|
+
/**
|
|
279
|
+
* Slot render functions for custom content
|
|
280
|
+
*/
|
|
281
|
+
slots?: OfferCardSlots;
|
|
282
|
+
/**
|
|
283
|
+
* Whether the component is disabled
|
|
284
|
+
* @default false
|
|
285
|
+
*/
|
|
286
|
+
isDisabled?: boolean;
|
|
287
|
+
/**
|
|
288
|
+
* Button variant for quantity controls
|
|
289
|
+
* @default 'bordered'
|
|
290
|
+
*/
|
|
291
|
+
buttonVariant?: 'solid' | 'bordered' | 'light' | 'flat' | 'faded' | 'shadow' | 'ghost';
|
|
292
|
+
/**
|
|
293
|
+
* Button color for quantity controls
|
|
294
|
+
* @default 'default'
|
|
295
|
+
*/
|
|
296
|
+
buttonColor?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
|
|
297
|
+
/**
|
|
298
|
+
* Color for the selected/active state
|
|
299
|
+
* @default 'primary'
|
|
300
|
+
*/
|
|
301
|
+
selectedColor?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
|
|
302
|
+
/**
|
|
303
|
+
* Whether to show the component inside a Card
|
|
304
|
+
* @default true
|
|
305
|
+
*/
|
|
306
|
+
showCard?: boolean;
|
|
307
|
+
/**
|
|
308
|
+
* Whether to show the description
|
|
309
|
+
* @default true
|
|
310
|
+
*/
|
|
311
|
+
showDescription?: boolean;
|
|
312
|
+
/**
|
|
313
|
+
* Whether to show the people count
|
|
314
|
+
* @default true
|
|
315
|
+
*/
|
|
316
|
+
showPeopleCount?: boolean;
|
|
317
|
+
/**
|
|
318
|
+
* Whether to show the price
|
|
319
|
+
* @default true
|
|
320
|
+
*/
|
|
321
|
+
showPrice?: boolean;
|
|
322
|
+
/**
|
|
323
|
+
* Class names for styling different parts of the component
|
|
324
|
+
*/
|
|
325
|
+
classNames?: OfferCardClassNames;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Props for the OfferCardList component
|
|
329
|
+
*/
|
|
330
|
+
export interface OfferCardListProps {
|
|
331
|
+
/**
|
|
332
|
+
* Array of offers to display
|
|
333
|
+
*/
|
|
334
|
+
offers: Offer[];
|
|
335
|
+
/**
|
|
336
|
+
* Currently selected quantities (controlled mode)
|
|
337
|
+
* Map of offer ID to quantity
|
|
338
|
+
*/
|
|
339
|
+
selection?: OfferSelection;
|
|
340
|
+
/**
|
|
341
|
+
* Default selection (uncontrolled mode)
|
|
342
|
+
*/
|
|
343
|
+
defaultSelection?: OfferSelection;
|
|
344
|
+
/**
|
|
345
|
+
* Callback fired when any quantity changes
|
|
346
|
+
*/
|
|
347
|
+
onSelectionChange?: (selection: OfferSelection) => void;
|
|
348
|
+
/**
|
|
349
|
+
* Callback fired when a single offer quantity changes
|
|
350
|
+
*/
|
|
351
|
+
onQuantityChange?: (id: string, quantity: number) => void;
|
|
352
|
+
/**
|
|
353
|
+
* Currency code (ISO 4217)
|
|
354
|
+
* @default 'USD'
|
|
355
|
+
*/
|
|
356
|
+
currency?: string;
|
|
357
|
+
/**
|
|
358
|
+
* Locale for currency and number formatting
|
|
359
|
+
* @default 'en-US'
|
|
360
|
+
*/
|
|
361
|
+
locale?: string;
|
|
362
|
+
/**
|
|
363
|
+
* Labels for internationalization (applied to all cards)
|
|
364
|
+
*/
|
|
365
|
+
labels?: OfferCardLabels;
|
|
366
|
+
/**
|
|
367
|
+
* Slot render functions (applied to all cards)
|
|
368
|
+
*/
|
|
369
|
+
slots?: OfferCardSlots;
|
|
370
|
+
/**
|
|
371
|
+
* Whether all cards are disabled
|
|
372
|
+
* @default false
|
|
373
|
+
*/
|
|
374
|
+
isDisabled?: boolean;
|
|
375
|
+
/**
|
|
376
|
+
* Button variant for quantity controls
|
|
377
|
+
* @default 'bordered'
|
|
378
|
+
*/
|
|
379
|
+
buttonVariant?: 'solid' | 'bordered' | 'light' | 'flat' | 'faded' | 'shadow' | 'ghost';
|
|
380
|
+
/**
|
|
381
|
+
* Button color for quantity controls
|
|
382
|
+
* @default 'default'
|
|
383
|
+
*/
|
|
384
|
+
buttonColor?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
|
|
385
|
+
/**
|
|
386
|
+
* Whether to show cards inside Card components
|
|
387
|
+
* @default true
|
|
388
|
+
*/
|
|
389
|
+
showCard?: boolean;
|
|
390
|
+
/**
|
|
391
|
+
* Whether to animate the list
|
|
392
|
+
* @default true
|
|
393
|
+
*/
|
|
394
|
+
animated?: boolean;
|
|
395
|
+
/**
|
|
396
|
+
* Gap between cards
|
|
397
|
+
* @default 2
|
|
398
|
+
*/
|
|
399
|
+
gap?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
400
|
+
/**
|
|
401
|
+
* Class names for styling different parts of the component
|
|
402
|
+
*/
|
|
403
|
+
classNames?: OfferCardListClassNames;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Props for the OfferCardSkeleton component
|
|
407
|
+
*/
|
|
408
|
+
export interface OfferCardSkeletonProps {
|
|
409
|
+
/**
|
|
410
|
+
* Number of skeleton cards to display
|
|
411
|
+
* @default 2
|
|
412
|
+
*/
|
|
413
|
+
quantity?: number;
|
|
414
|
+
/**
|
|
415
|
+
* Gap between skeleton cards
|
|
416
|
+
* @default 4
|
|
417
|
+
*/
|
|
418
|
+
gap?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
419
|
+
/**
|
|
420
|
+
* Class names for styling different parts of the component
|
|
421
|
+
*/
|
|
422
|
+
classNames?: OfferCardSkeletonClassNames;
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Props for the OfferCardError component
|
|
426
|
+
*/
|
|
427
|
+
export interface OfferCardErrorProps {
|
|
428
|
+
/**
|
|
429
|
+
* Custom error message to display
|
|
430
|
+
*/
|
|
431
|
+
error?: string;
|
|
432
|
+
/**
|
|
433
|
+
* Labels for internationalization
|
|
434
|
+
*/
|
|
435
|
+
labels?: OfferCardErrorLabels;
|
|
436
|
+
/**
|
|
437
|
+
* Whether to show inside a Card
|
|
438
|
+
* @default true
|
|
439
|
+
*/
|
|
440
|
+
showCard?: boolean;
|
|
441
|
+
/**
|
|
442
|
+
* Alert color variant
|
|
443
|
+
* @default 'danger'
|
|
444
|
+
*/
|
|
445
|
+
color?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
|
|
446
|
+
/**
|
|
447
|
+
* Class names for styling different parts of the component
|
|
448
|
+
*/
|
|
449
|
+
classNames?: OfferCardErrorClassNames;
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Props for the OfferCardEmpty component
|
|
453
|
+
*/
|
|
454
|
+
export interface OfferCardEmptyProps {
|
|
455
|
+
/**
|
|
456
|
+
* Custom message to display
|
|
457
|
+
* @default 'No offers available.'
|
|
458
|
+
*/
|
|
459
|
+
message?: string;
|
|
460
|
+
/**
|
|
461
|
+
* Iconify icon to display
|
|
462
|
+
* @default 'solar:ticket-sale-outline'
|
|
463
|
+
*/
|
|
464
|
+
icon?: string;
|
|
465
|
+
/**
|
|
466
|
+
* Icon size in pixels
|
|
467
|
+
* @default 48
|
|
468
|
+
*/
|
|
469
|
+
iconSize?: number;
|
|
470
|
+
/**
|
|
471
|
+
* Whether to show inside a Card
|
|
472
|
+
* @default true
|
|
473
|
+
*/
|
|
474
|
+
showCard?: boolean;
|
|
475
|
+
/**
|
|
476
|
+
* Class names for styling different parts of the component
|
|
477
|
+
*/
|
|
478
|
+
classNames?: OfferCardEmptyClassNames;
|
|
479
|
+
/**
|
|
480
|
+
* Custom render function for the entire empty state
|
|
481
|
+
*/
|
|
482
|
+
renderEmpty?: () => React.ReactNode;
|
|
483
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Currency formatting utilities for OfferCard
|
|
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(25.00, 'en-US', 'USD') // "$25.00"
|
|
13
|
+
* formatCurrency(25.00, 'es-ES', 'EUR') // "25,00 €"
|
|
14
|
+
* formatCurrency(1000, 'de-DE', 'EUR') // "1.000,00 €"
|
|
15
|
+
*/
|
|
16
|
+
export declare function formatCurrency(amount: number, locale?: string, currency?: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Parses a currency string to a number
|
|
19
|
+
* @param value - The currency string to parse
|
|
20
|
+
* @returns Parsed number or null if invalid
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* parseCurrency('$25.00') // 25
|
|
24
|
+
* parseCurrency('1.000,00 €') // 1000
|
|
25
|
+
*/
|
|
26
|
+
export declare function parseCurrency(value: string): number | null;
|
|
@@ -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)
|
package/dist/patterns/index.d.ts
CHANGED
|
@@ -3,6 +3,13 @@ export { Stepper } from './Stepper';
|
|
|
3
3
|
export { Footer } from './Footer';
|
|
4
4
|
export type { RichTextAreaProps } from './RichText';
|
|
5
5
|
export { RichTextArea, RICH_TEXT_PRESETS } from './RichText';
|
|
6
|
+
export { DonationAmounts } from './DonationAmounts';
|
|
7
|
+
export { ExpireCartTimer } from './ExpireCartTimer';
|
|
8
|
+
export { EventDetails } from './EventDetails';
|
|
9
|
+
export { OfferCard, OfferCardList, OfferCardSkeleton, OfferCardError, OfferCardEmpty, offerListVariants, offerCardVariants, formatCurrency as formatOfferCurrency, parseCurrency as parseOfferCurrency, } from './OfferCard';
|
|
10
|
+
export type { EventDetailsProps } from './EventDetails';
|
|
6
11
|
export type { NavbarProps, NavbarLink, NavbarLanguage } from './Navbar';
|
|
7
12
|
export type { StepperProps } from './Stepper';
|
|
8
|
-
export type {
|
|
13
|
+
export type { DonationAmountsProps, DonationAmount, SelectedDonation, DonationLabels } from './DonationAmounts';
|
|
14
|
+
export type { ExpireCartTimerProps } from './ExpireCartTimer';
|
|
15
|
+
export type { Offer, OfferSelection, OfferCardLabels, OfferCardErrorLabels, OfferCardClassNames, OfferCardListClassNames, OfferCardSkeletonClassNames, OfferCardErrorClassNames, OfferCardEmptyClassNames, OfferCardSlots, OfferCardProps, OfferCardListProps, OfferCardSkeletonProps, OfferCardErrorProps, OfferCardEmptyProps, } from './OfferCard';
|
|
@@ -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;
|