@veevarts/design-system 1.0.0-alpha.10 → 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.
Potentially problematic release.
This version of @veevarts/design-system might be problematic. Click here for more details.
- package/dist/components/index.d.ts +12 -0
- package/dist/index.cjs +11 -11
- package/dist/index.d.ts +4 -4
- package/dist/index.js +8004 -8512
- package/dist/patterns/EventDetails/EventDetails.d.ts +1 -1
- 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/TipTapArea/TipTapArea.d.ts +1 -1
- package/dist/patterns/RichText/types/props.d.ts +1 -1
- package/dist/patterns/Stepper/Stepper.d.ts +1 -1
- package/dist/patterns/index.d.ts +1 -2
- package/dist/tokens/colors.d.ts +39 -0
- package/package.json +2 -1
|
@@ -33,5 +33,5 @@ export interface EventDetailsProps {
|
|
|
33
33
|
* @function EventDetails
|
|
34
34
|
* @description Displays a card with event information such as name, image, date, time, location, and description.
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
declare const EventDetails: ({ classes, name, imageUrl, eventDate, eventTime, location, description, showImage, showMoreButtonClassName, labels, }: EventDetailsProps) => JSX.Element;
|
|
37
37
|
export default EventDetails;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
|
3
|
+
import { RevenueDistributionCardProps } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* RevenueDistributionCard displays a single distribution with
|
|
6
|
+
* amount input, GL account selector, tax deductible checkbox, and delete button.
|
|
7
|
+
*
|
|
8
|
+
* Supports two modes:
|
|
9
|
+
* 1. Standalone mode: Use distribution/onDistributionChange props
|
|
10
|
+
* 2. React Hook Form mode: Pass control and name props for native RHF integration
|
|
11
|
+
*/
|
|
12
|
+
export declare const RevenueDistributionCard: {
|
|
13
|
+
<TFieldValues extends FieldValues = FieldValues>({ distribution: distributionProp, defaultDistribution, glAccounts, isLoadingGlAccounts, onSearchGlAccounts, onDistributionChange, onAmountChange, onGlAccountChange, onTaxDeductibleChange, onDelete, canDelete, canEditTaxDeductible, isDisabled, labels: customLabels, classNames, "data-testid": dataTestId, control, name, rules, }: RevenueDistributionCardProps<TFieldValues>): JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
export default RevenueDistributionCard;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { RevenueDistributionEmptyProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* RevenueDistributionEmpty displays a placeholder when there are no
|
|
5
|
+
* distributions configured or available.
|
|
6
|
+
*/
|
|
7
|
+
export declare const RevenueDistributionEmpty: {
|
|
8
|
+
({ message, icon, iconSize, showCard, classNames, renderEmpty, }: RevenueDistributionEmptyProps): JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
export default RevenueDistributionEmpty;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { RevenueDistributionErrorProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* RevenueDistributionError displays an error alert when there's an issue
|
|
5
|
+
* loading or processing distributions.
|
|
6
|
+
*/
|
|
7
|
+
export declare const RevenueDistributionError: {
|
|
8
|
+
({ error, labels: customLabels, showCard, color, classNames, }: RevenueDistributionErrorProps): JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
export default RevenueDistributionError;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { RevenueDistributionSkeletonProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* RevenueDistributionSkeleton displays a loading placeholder
|
|
5
|
+
* matching the structure of RevenueDistributionCard.
|
|
6
|
+
*/
|
|
7
|
+
export declare const RevenueDistributionSkeleton: {
|
|
8
|
+
({ rows, showCard, classNames, }: RevenueDistributionSkeletonProps): JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
export default RevenueDistributionSkeleton;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InteractiveExample
|
|
3
|
+
*
|
|
4
|
+
* A stateful example component for the RevenueDistributionCard.
|
|
5
|
+
* Demonstrates controlled mode with GL account search.
|
|
6
|
+
*/
|
|
7
|
+
export declare const InteractiveExample: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default InteractiveExample;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MultipleDistributionsFormExample
|
|
3
|
+
*
|
|
4
|
+
* Example demonstrating multiple RevenueDistributionCard components
|
|
5
|
+
* managed with React Hook Form's useFieldArray.
|
|
6
|
+
*
|
|
7
|
+
* Uses native RHF integration via control/name props for validation.
|
|
8
|
+
*/
|
|
9
|
+
export declare const MultipleDistributionsFormExample: () => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default MultipleDistributionsFormExample;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RevenueDistribution Examples
|
|
3
|
+
*
|
|
4
|
+
* Stateful example components for Storybook stories.
|
|
5
|
+
* These are separated from stories to avoid using hooks directly in stories.
|
|
6
|
+
*/
|
|
7
|
+
export { InteractiveExample } from './InteractiveExample';
|
|
8
|
+
export { WithGlAccountSearchExample } from './WithGlAccountSearchExample';
|
|
9
|
+
export { MultipleDistributionsFormExample } from './MultipleDistributionsFormExample';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RevenueDistribution Pattern
|
|
3
|
+
*
|
|
4
|
+
* A pattern for displaying and editing a single revenue distribution.
|
|
5
|
+
* Includes card component with amount input, GL account selector,
|
|
6
|
+
* tax deductible checkbox, and delete button.
|
|
7
|
+
*/
|
|
8
|
+
export { RevenueDistributionCard } from './RevenueDistributionCard';
|
|
9
|
+
export { RevenueDistributionSkeleton } from './RevenueDistributionSkeleton';
|
|
10
|
+
export { RevenueDistributionError } from './RevenueDistributionError';
|
|
11
|
+
export { RevenueDistributionEmpty } from './RevenueDistributionEmpty';
|
|
12
|
+
export type { GlAccount, Distribution, RevenueDistributionLabels, RevenueDistributionErrorLabels, RevenueDistributionEmptyLabels, RevenueDistributionCardClassNames, RevenueDistributionSkeletonClassNames, RevenueDistributionErrorClassNames, RevenueDistributionEmptyClassNames, RevenueDistributionCardProps, RevenueDistributionSkeletonProps, RevenueDistributionErrorProps, RevenueDistributionEmptyProps, } from './types';
|
|
13
|
+
export { formatAmount, formatCurrency, getCurrencySymbol, parseCurrency, calculateAllocationDifference, generateDistributionId, } from './utils';
|
|
14
|
+
export { InteractiveExample, WithGlAccountSearchExample, MultipleDistributionsFormExample } from './examples';
|
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
import { Control, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a General Ledger account
|
|
4
|
+
*/
|
|
5
|
+
export interface GlAccount {
|
|
6
|
+
/**
|
|
7
|
+
* Unique identifier for the GL account
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* Display name of the GL account
|
|
12
|
+
*/
|
|
13
|
+
name: string;
|
|
14
|
+
/**
|
|
15
|
+
* Optional account code
|
|
16
|
+
*/
|
|
17
|
+
code?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Represents a single revenue distribution entry
|
|
21
|
+
*/
|
|
22
|
+
export interface Distribution {
|
|
23
|
+
/**
|
|
24
|
+
* Unique identifier for this distribution
|
|
25
|
+
*/
|
|
26
|
+
id: string;
|
|
27
|
+
/**
|
|
28
|
+
* Amount allocated to this distribution
|
|
29
|
+
*/
|
|
30
|
+
amount: number;
|
|
31
|
+
/**
|
|
32
|
+
* The GL account this distribution is allocated to
|
|
33
|
+
*/
|
|
34
|
+
glAccount: GlAccount | null;
|
|
35
|
+
/**
|
|
36
|
+
* Whether this distribution is tax deductible
|
|
37
|
+
*/
|
|
38
|
+
isTaxDeductible: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Labels for internationalization
|
|
42
|
+
*/
|
|
43
|
+
export interface RevenueDistributionLabels {
|
|
44
|
+
/**
|
|
45
|
+
* Label for amount field (e.g., "Amount")
|
|
46
|
+
*/
|
|
47
|
+
amount?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Label for GL account field (e.g., "GL Account")
|
|
50
|
+
*/
|
|
51
|
+
glAccount?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Label for tax deductible (e.g., "Tax Deductible")
|
|
54
|
+
*/
|
|
55
|
+
taxDeductible?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Placeholder for amount input (e.g., "0.00")
|
|
58
|
+
*/
|
|
59
|
+
amountPlaceholder?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Placeholder for GL account search (e.g., "Search GL Account")
|
|
62
|
+
*/
|
|
63
|
+
glAccountPlaceholder?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Message when no GL accounts found (e.g., "No GL Accounts found")
|
|
66
|
+
*/
|
|
67
|
+
noGlAccountsFound?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Message while searching (e.g., "Searching...")
|
|
70
|
+
*/
|
|
71
|
+
searching?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Tooltip content for Amount info icon
|
|
74
|
+
*/
|
|
75
|
+
amountTooltip?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Tooltip content for GL Account info icon
|
|
78
|
+
*/
|
|
79
|
+
glAccountTooltip?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Tooltip content for Tax Deductible info icon
|
|
82
|
+
*/
|
|
83
|
+
taxDeductibleTooltip?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Label for delete button (e.g., "Delete")
|
|
86
|
+
*/
|
|
87
|
+
deleteButton?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Currency symbol (e.g., "$")
|
|
90
|
+
*/
|
|
91
|
+
currencySymbol?: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Labels for error state
|
|
95
|
+
*/
|
|
96
|
+
export interface RevenueDistributionErrorLabels {
|
|
97
|
+
/**
|
|
98
|
+
* Error title (e.g., "Error Loading Distributions")
|
|
99
|
+
*/
|
|
100
|
+
title?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Error description
|
|
103
|
+
*/
|
|
104
|
+
description?: string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Labels for empty state
|
|
108
|
+
*/
|
|
109
|
+
export interface RevenueDistributionEmptyLabels {
|
|
110
|
+
/**
|
|
111
|
+
* Empty state message (e.g., "No distributions configured")
|
|
112
|
+
*/
|
|
113
|
+
message?: string;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Class names for styling RevenueDistributionCard
|
|
117
|
+
*/
|
|
118
|
+
export interface RevenueDistributionCardClassNames {
|
|
119
|
+
/**
|
|
120
|
+
* Class for the root element
|
|
121
|
+
*/
|
|
122
|
+
base?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Class for the card body
|
|
125
|
+
*/
|
|
126
|
+
body?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Class for the amount input container
|
|
129
|
+
*/
|
|
130
|
+
amountContainer?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Class for the amount input
|
|
133
|
+
*/
|
|
134
|
+
amountInput?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Class for the GL account container
|
|
137
|
+
*/
|
|
138
|
+
glAccountContainer?: string;
|
|
139
|
+
/**
|
|
140
|
+
* Class for the GL account input
|
|
141
|
+
*/
|
|
142
|
+
glAccountInput?: string;
|
|
143
|
+
/**
|
|
144
|
+
* Class for the tax deductible container
|
|
145
|
+
*/
|
|
146
|
+
taxDeductibleContainer?: string;
|
|
147
|
+
/**
|
|
148
|
+
* Class for the tax deductible checkbox
|
|
149
|
+
*/
|
|
150
|
+
taxDeductibleCheckbox?: string;
|
|
151
|
+
/**
|
|
152
|
+
* Class for the delete button container
|
|
153
|
+
*/
|
|
154
|
+
deleteContainer?: string;
|
|
155
|
+
/**
|
|
156
|
+
* Class for the delete button
|
|
157
|
+
*/
|
|
158
|
+
deleteButton?: string;
|
|
159
|
+
/**
|
|
160
|
+
* Class for labels
|
|
161
|
+
*/
|
|
162
|
+
label?: string;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Class names for skeleton
|
|
166
|
+
*/
|
|
167
|
+
export interface RevenueDistributionSkeletonClassNames {
|
|
168
|
+
/**
|
|
169
|
+
* Class for the container
|
|
170
|
+
*/
|
|
171
|
+
base?: string;
|
|
172
|
+
/**
|
|
173
|
+
* Class for each skeleton row
|
|
174
|
+
*/
|
|
175
|
+
row?: string;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Class names for error state
|
|
179
|
+
*/
|
|
180
|
+
export interface RevenueDistributionErrorClassNames {
|
|
181
|
+
/**
|
|
182
|
+
* Class for the root element
|
|
183
|
+
*/
|
|
184
|
+
base?: string;
|
|
185
|
+
/**
|
|
186
|
+
* Class for the alert
|
|
187
|
+
*/
|
|
188
|
+
alert?: string;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Class names for empty state
|
|
192
|
+
*/
|
|
193
|
+
export interface RevenueDistributionEmptyClassNames {
|
|
194
|
+
/**
|
|
195
|
+
* Class for the root element
|
|
196
|
+
*/
|
|
197
|
+
base?: string;
|
|
198
|
+
/**
|
|
199
|
+
* Class for the content
|
|
200
|
+
*/
|
|
201
|
+
content?: string;
|
|
202
|
+
/**
|
|
203
|
+
* Class for the icon
|
|
204
|
+
*/
|
|
205
|
+
icon?: string;
|
|
206
|
+
/**
|
|
207
|
+
* Class for the message
|
|
208
|
+
*/
|
|
209
|
+
message?: string;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Props for the RevenueDistributionCard component
|
|
213
|
+
* Handles a SINGLE revenue distribution (not a list)
|
|
214
|
+
*
|
|
215
|
+
* Supports two modes:
|
|
216
|
+
* 1. Standalone mode: Use distribution/onDistributionChange props
|
|
217
|
+
* 2. React Hook Form mode: Pass control and name props for native RHF integration
|
|
218
|
+
*/
|
|
219
|
+
export interface RevenueDistributionCardProps<TFieldValues extends FieldValues = FieldValues> {
|
|
220
|
+
/**
|
|
221
|
+
* A unique identifier for testing purposes
|
|
222
|
+
*/
|
|
223
|
+
'data-testid'?: string;
|
|
224
|
+
/**
|
|
225
|
+
* The single distribution data (controlled mode)
|
|
226
|
+
*/
|
|
227
|
+
distribution?: Distribution;
|
|
228
|
+
/**
|
|
229
|
+
* Default distribution (uncontrolled mode)
|
|
230
|
+
*/
|
|
231
|
+
defaultDistribution?: Distribution;
|
|
232
|
+
/**
|
|
233
|
+
* Available GL accounts for selection
|
|
234
|
+
*/
|
|
235
|
+
glAccounts?: GlAccount[];
|
|
236
|
+
/**
|
|
237
|
+
* Whether GL accounts are loading
|
|
238
|
+
* @default false
|
|
239
|
+
*/
|
|
240
|
+
isLoadingGlAccounts?: boolean;
|
|
241
|
+
/**
|
|
242
|
+
* Callback when user searches for GL accounts
|
|
243
|
+
*/
|
|
244
|
+
onSearchGlAccounts?: (searchTerm: string) => void;
|
|
245
|
+
/**
|
|
246
|
+
* Callback when distribution changes
|
|
247
|
+
*/
|
|
248
|
+
onDistributionChange?: (distribution: Distribution) => void;
|
|
249
|
+
/**
|
|
250
|
+
* Callback when amount changes
|
|
251
|
+
*/
|
|
252
|
+
onAmountChange?: (amount: number) => void;
|
|
253
|
+
/**
|
|
254
|
+
* Callback when GL account changes
|
|
255
|
+
*/
|
|
256
|
+
onGlAccountChange?: (glAccount: GlAccount | null) => void;
|
|
257
|
+
/**
|
|
258
|
+
* Callback when tax deductible changes
|
|
259
|
+
*/
|
|
260
|
+
onTaxDeductibleChange?: (isTaxDeductible: boolean) => void;
|
|
261
|
+
/**
|
|
262
|
+
* Callback when delete button is clicked
|
|
263
|
+
*/
|
|
264
|
+
onDelete?: () => void;
|
|
265
|
+
/**
|
|
266
|
+
* Whether the distribution can be deleted
|
|
267
|
+
* If false, the delete button is not rendered
|
|
268
|
+
* @default true
|
|
269
|
+
*/
|
|
270
|
+
canDelete?: boolean;
|
|
271
|
+
/**
|
|
272
|
+
* Whether the tax deductible checkbox can be modified
|
|
273
|
+
* If false, the checkbox is rendered in disabled state
|
|
274
|
+
* @default true
|
|
275
|
+
*/
|
|
276
|
+
canEditTaxDeductible?: boolean;
|
|
277
|
+
/**
|
|
278
|
+
* Whether the component is disabled
|
|
279
|
+
* @default false
|
|
280
|
+
*/
|
|
281
|
+
isDisabled?: boolean;
|
|
282
|
+
/**
|
|
283
|
+
* Currency code for formatting
|
|
284
|
+
* @default 'USD'
|
|
285
|
+
*/
|
|
286
|
+
currency?: string;
|
|
287
|
+
/**
|
|
288
|
+
* Locale for formatting
|
|
289
|
+
* @default 'en-US'
|
|
290
|
+
*/
|
|
291
|
+
locale?: string;
|
|
292
|
+
/**
|
|
293
|
+
* Labels for internationalization
|
|
294
|
+
*/
|
|
295
|
+
labels?: RevenueDistributionLabels;
|
|
296
|
+
/**
|
|
297
|
+
* Class names for styling
|
|
298
|
+
*/
|
|
299
|
+
classNames?: RevenueDistributionCardClassNames;
|
|
300
|
+
/**
|
|
301
|
+
* React Hook Form control object
|
|
302
|
+
* When provided with `name`, enables native RHF integration
|
|
303
|
+
*/
|
|
304
|
+
control?: Control<TFieldValues>;
|
|
305
|
+
/**
|
|
306
|
+
* Field name for React Hook Form
|
|
307
|
+
* Required when using `control` prop
|
|
308
|
+
*/
|
|
309
|
+
name?: Path<TFieldValues>;
|
|
310
|
+
/**
|
|
311
|
+
* Validation rules for React Hook Form
|
|
312
|
+
* Applied when using control/name props
|
|
313
|
+
*/
|
|
314
|
+
rules?: RegisterOptions<TFieldValues>;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Props for the RevenueDistributionSkeleton component
|
|
318
|
+
*/
|
|
319
|
+
export interface RevenueDistributionSkeletonProps {
|
|
320
|
+
/**
|
|
321
|
+
* Number of skeleton rows
|
|
322
|
+
* @default 1
|
|
323
|
+
*/
|
|
324
|
+
rows?: number;
|
|
325
|
+
/**
|
|
326
|
+
* Whether to show inside a Card
|
|
327
|
+
* @default true
|
|
328
|
+
*/
|
|
329
|
+
showCard?: boolean;
|
|
330
|
+
/**
|
|
331
|
+
* Class names for styling
|
|
332
|
+
*/
|
|
333
|
+
classNames?: RevenueDistributionSkeletonClassNames;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Props for the RevenueDistributionError component
|
|
337
|
+
*/
|
|
338
|
+
export interface RevenueDistributionErrorProps {
|
|
339
|
+
/**
|
|
340
|
+
* Custom error message
|
|
341
|
+
*/
|
|
342
|
+
error?: string;
|
|
343
|
+
/**
|
|
344
|
+
* Labels for internationalization
|
|
345
|
+
*/
|
|
346
|
+
labels?: RevenueDistributionErrorLabels;
|
|
347
|
+
/**
|
|
348
|
+
* Whether to show inside a Card
|
|
349
|
+
* @default true
|
|
350
|
+
*/
|
|
351
|
+
showCard?: boolean;
|
|
352
|
+
/**
|
|
353
|
+
* Alert color variant
|
|
354
|
+
* @default 'danger'
|
|
355
|
+
*/
|
|
356
|
+
color?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
|
|
357
|
+
/**
|
|
358
|
+
* Class names for styling
|
|
359
|
+
*/
|
|
360
|
+
classNames?: RevenueDistributionErrorClassNames;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Props for the RevenueDistributionEmpty component
|
|
364
|
+
*/
|
|
365
|
+
export interface RevenueDistributionEmptyProps {
|
|
366
|
+
/**
|
|
367
|
+
* Custom message
|
|
368
|
+
* @default 'No distributions configured'
|
|
369
|
+
*/
|
|
370
|
+
message?: string;
|
|
371
|
+
/**
|
|
372
|
+
* Iconify icon name
|
|
373
|
+
* @default 'solar:document-text-outline'
|
|
374
|
+
*/
|
|
375
|
+
icon?: string;
|
|
376
|
+
/**
|
|
377
|
+
* Icon size in pixels
|
|
378
|
+
* @default 48
|
|
379
|
+
*/
|
|
380
|
+
iconSize?: number;
|
|
381
|
+
/**
|
|
382
|
+
* Whether to show inside a Card
|
|
383
|
+
* @default true
|
|
384
|
+
*/
|
|
385
|
+
showCard?: boolean;
|
|
386
|
+
/**
|
|
387
|
+
* Class names for styling
|
|
388
|
+
*/
|
|
389
|
+
classNames?: RevenueDistributionEmptyClassNames;
|
|
390
|
+
/**
|
|
391
|
+
* Custom render function
|
|
392
|
+
*/
|
|
393
|
+
renderEmpty?: () => React.ReactNode;
|
|
394
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for amount formatting and parsing
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Formats an amount with the specified number of decimal places.
|
|
6
|
+
* Shows integers without decimals, and numbers with decimals show up to 3 places.
|
|
7
|
+
*
|
|
8
|
+
* @param amount - The amount to format
|
|
9
|
+
* @param maxDecimals - Maximum decimal places to show (default: 3)
|
|
10
|
+
* @returns Formatted amount string
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatAmount(amount: number, maxDecimals?: number): string;
|
|
13
|
+
/**
|
|
14
|
+
* Formats a currency amount using Intl.NumberFormat.
|
|
15
|
+
*
|
|
16
|
+
* @param amount - The amount to format
|
|
17
|
+
* @param locale - The locale for formatting (default: 'en-US')
|
|
18
|
+
* @param currency - The currency code (default: 'USD')
|
|
19
|
+
* @returns Formatted currency string
|
|
20
|
+
*/
|
|
21
|
+
export declare function formatCurrency(amount: number, locale?: string, currency?: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Gets the currency symbol for a given currency code.
|
|
24
|
+
*
|
|
25
|
+
* @param currency - The currency code (default: 'USD')
|
|
26
|
+
* @param locale - The locale for formatting (default: 'en-US')
|
|
27
|
+
* @returns The currency symbol
|
|
28
|
+
*/
|
|
29
|
+
export declare function getCurrencySymbol(currency?: string, locale?: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Parses a currency string to a number.
|
|
32
|
+
*
|
|
33
|
+
* @param value - The string value to parse
|
|
34
|
+
* @returns The parsed number or null if invalid
|
|
35
|
+
*/
|
|
36
|
+
export declare function parseCurrency(value: string): number | null;
|
|
37
|
+
/**
|
|
38
|
+
* Calculates the difference between a price and allocated amounts.
|
|
39
|
+
*
|
|
40
|
+
* @param price - The total price
|
|
41
|
+
* @param allocated - The total allocated amount
|
|
42
|
+
* @param threshold - The threshold for considering amounts equal (default: 0.001)
|
|
43
|
+
* @returns Object with difference info
|
|
44
|
+
*/
|
|
45
|
+
export declare function calculateAllocationDifference(price: number, allocated: number, threshold?: number): {
|
|
46
|
+
difference: number;
|
|
47
|
+
isBalanced: boolean;
|
|
48
|
+
isUnderAllocated: boolean;
|
|
49
|
+
isOverAllocated: boolean;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Generates a unique ID for a new distribution.
|
|
53
|
+
*
|
|
54
|
+
* @returns A unique string ID
|
|
55
|
+
*/
|
|
56
|
+
export declare function generateDistributionId(): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RevenueDistribution Utilities
|
|
3
|
+
*/
|
|
4
|
+
export { formatAmount, formatCurrency, getCurrencySymbol, parseCurrency, calculateAllocationDifference, generateDistributionId, } from './amount';
|
|
5
|
+
export { sampleGlAccounts, sampleDistribution, emptyDistribution } from './data';
|
package/dist/patterns/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './EventDetails';
|
|
1
2
|
export { Navbar } from './Navbar';
|
|
2
3
|
export { Stepper } from './Stepper';
|
|
3
4
|
export { Footer } from './Footer';
|
|
@@ -5,9 +6,7 @@ export type { RichTextAreaProps } from './RichText';
|
|
|
5
6
|
export { RichTextArea, RICH_TEXT_PRESETS } from './RichText';
|
|
6
7
|
export { DonationAmounts } from './DonationAmounts';
|
|
7
8
|
export { ExpireCartTimer } from './ExpireCartTimer';
|
|
8
|
-
export { EventDetails } from './EventDetails';
|
|
9
9
|
export { OfferCard, OfferCardList, OfferCardSkeleton, OfferCardError, OfferCardEmpty, offerListVariants, offerCardVariants, formatCurrency as formatOfferCurrency, parseCurrency as parseOfferCurrency, } from './OfferCard';
|
|
10
|
-
export type { EventDetailsProps } from './EventDetails';
|
|
11
10
|
export type { NavbarProps, NavbarLink, NavbarLanguage } from './Navbar';
|
|
12
11
|
export type { StepperProps } from './Stepper';
|
|
13
12
|
export type { DonationAmountsProps, DonationAmount, SelectedDonation, DonationLabels } from './DonationAmounts';
|
package/dist/tokens/colors.d.ts
CHANGED
|
@@ -55,6 +55,45 @@ export declare const colors: {
|
|
|
55
55
|
readonly 900: "#000000";
|
|
56
56
|
readonly DEFAULT: "#000000";
|
|
57
57
|
};
|
|
58
|
+
readonly danger: {
|
|
59
|
+
readonly 50: "#fef2f2";
|
|
60
|
+
readonly 100: "#fee2e2";
|
|
61
|
+
readonly 200: "#fecaca";
|
|
62
|
+
readonly 300: "#fca5a5";
|
|
63
|
+
readonly 400: "#f87171";
|
|
64
|
+
readonly 500: "#B62214";
|
|
65
|
+
readonly 600: "#a31e12";
|
|
66
|
+
readonly 700: "#8b1a0f";
|
|
67
|
+
readonly 800: "#73160d";
|
|
68
|
+
readonly 900: "#5c120a";
|
|
69
|
+
readonly DEFAULT: "#B62214";
|
|
70
|
+
};
|
|
71
|
+
readonly success: {
|
|
72
|
+
readonly 50: "#ecfdf5";
|
|
73
|
+
readonly 100: "#d1fae5";
|
|
74
|
+
readonly 200: "#a7f3d0";
|
|
75
|
+
readonly 300: "#6ee7b7";
|
|
76
|
+
readonly 400: "#34d399";
|
|
77
|
+
readonly 500: "#057A54";
|
|
78
|
+
readonly 600: "#046c4a";
|
|
79
|
+
readonly 700: "#035e40";
|
|
80
|
+
readonly 800: "#025035";
|
|
81
|
+
readonly 900: "#01422b";
|
|
82
|
+
readonly DEFAULT: "#057A54";
|
|
83
|
+
};
|
|
84
|
+
readonly warning: {
|
|
85
|
+
readonly 50: "#fffbeb";
|
|
86
|
+
readonly 100: "#fef3c7";
|
|
87
|
+
readonly 200: "#fde68a";
|
|
88
|
+
readonly 300: "#fcd34d";
|
|
89
|
+
readonly 400: "#fbbf24";
|
|
90
|
+
readonly 500: "#F5A524";
|
|
91
|
+
readonly 600: "#d97706";
|
|
92
|
+
readonly 700: "#b45309";
|
|
93
|
+
readonly 800: "#92400e";
|
|
94
|
+
readonly 900: "#78350f";
|
|
95
|
+
readonly DEFAULT: "#F5A524";
|
|
96
|
+
};
|
|
58
97
|
};
|
|
59
98
|
};
|
|
60
99
|
export type ColorToken = typeof colors;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veevarts/design-system",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.0-alpha.
|
|
4
|
+
"version": "1.0.0-alpha.12",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@iconify/react": "^6.0.2",
|
|
50
|
+
"react-hook-form": "^7.56.4",
|
|
50
51
|
"vite-plugin-css-injected-by-js": "3.5.2",
|
|
51
52
|
"vite-plugin-dts": "4.5.4"
|
|
52
53
|
},
|