@6thbridge/hexa 0.0.0-pr32-13
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/index.d.mts +601 -0
- package/dist/index.d.ts +601 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +10 -0
- package/dist/index.mjs.map +1 -0
- package/dist/output.css +3531 -0
- package/eslint.config.mjs +33 -0
- package/jest.config.js +8 -0
- package/package.json +94 -0
- package/postcss.config.js +12 -0
- package/tailwind.config.js +30 -0
- package/tsconfig.json +30 -0
package/dist/index.d.mts
ADDED
@@ -0,0 +1,601 @@
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
|
+
import * as React$1 from 'react';
|
3
|
+
import React__default, { DetailedHTMLProps, ButtonHTMLAttributes, ReactNode } from 'react';
|
4
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
5
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
6
|
+
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
7
|
+
import { VariantProps } from 'class-variance-authority';
|
8
|
+
import * as RPNInput from 'react-phone-number-input';
|
9
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
10
|
+
import { DialogCloseProps } from '@radix-ui/react-dialog';
|
11
|
+
import { OTPInputProps as OTPInputProps$1 } from 'react-otp-input';
|
12
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
13
|
+
import { Drawer as Drawer$1 } from 'vaul';
|
14
|
+
import { RowData, Row, Table as Table$1 } from '@tanstack/react-table';
|
15
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
16
|
+
import dayjs from 'dayjs';
|
17
|
+
import { ClassValue } from 'clsx';
|
18
|
+
|
19
|
+
declare const TooltipProvider: React$1.FC<TooltipPrimitive.TooltipProviderProps>;
|
20
|
+
declare const TooltipRoot: React$1.FC<TooltipPrimitive.TooltipProps>;
|
21
|
+
declare const TooltipTrigger: React$1.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
22
|
+
declare const TooltipContent: React$1.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
23
|
+
type TooltipPropsType = {
|
24
|
+
trigger: React$1.ReactNode;
|
25
|
+
children: React$1.ReactNode;
|
26
|
+
contentClassName?: string;
|
27
|
+
triggerClassName?: string;
|
28
|
+
asChild?: boolean;
|
29
|
+
side?: TooltipPrimitive.TooltipContentProps["side"];
|
30
|
+
sideOffset?: number;
|
31
|
+
align?: TooltipPrimitive.TooltipContentProps["align"];
|
32
|
+
alignOffset?: number;
|
33
|
+
delayDuration?: number;
|
34
|
+
hasArrow?: boolean;
|
35
|
+
arrowClassName?: string;
|
36
|
+
};
|
37
|
+
declare const Tooltip: {
|
38
|
+
({ trigger, children, contentClassName, triggerClassName, asChild, side, sideOffset, align, alignOffset, delayDuration, hasArrow, arrowClassName, ...props }: TooltipPropsType & React$1.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
39
|
+
displayName: string;
|
40
|
+
};
|
41
|
+
|
42
|
+
declare const FormLabel: React__default.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React__default.RefAttributes<HTMLLabelElement>, "ref"> & {
|
43
|
+
showAsterisk?: boolean;
|
44
|
+
error?: string;
|
45
|
+
formItemId?: string;
|
46
|
+
} & React__default.RefAttributes<HTMLLabelElement>>;
|
47
|
+
|
48
|
+
type Colours = "primary" | "secondary";
|
49
|
+
declare const Loader: ({ size, colour, }: {
|
50
|
+
size?: number;
|
51
|
+
colour?: Colours;
|
52
|
+
}) => react_jsx_runtime.JSX.Element;
|
53
|
+
|
54
|
+
declare const buttonVariants: (props?: ({
|
55
|
+
variant?: "primary" | "danger" | "neutral" | "outlined" | "danger-outlined" | "light-outlined" | "dark-text" | "light" | null | undefined;
|
56
|
+
size?: "default" | "sm" | "lg" | "md" | "icon-sm" | "icon" | "icon-lg" | null | undefined;
|
57
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
58
|
+
interface ButtonProps extends DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
59
|
+
asChild?: boolean;
|
60
|
+
isLoading?: boolean;
|
61
|
+
leftNode?: React$1.ReactNode;
|
62
|
+
rightNode?: React$1.ReactNode;
|
63
|
+
LoaderSize?: number;
|
64
|
+
}
|
65
|
+
declare const Button: React$1.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
66
|
+
|
67
|
+
declare const inputVariants: (props?: ({
|
68
|
+
status?: "loading" | "default" | "error" | "neutral" | "prefilled" | null | undefined;
|
69
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
70
|
+
interface BaseInnerInputProps extends React$1.InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {
|
71
|
+
}
|
72
|
+
declare const inputContainerVariants: (props?: ({
|
73
|
+
status?: "loading" | "default" | "error" | "neutral" | "prefilled" | null | undefined;
|
74
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
75
|
+
interface InputProps extends BaseInnerInputProps, VariantProps<typeof inputContainerVariants> {
|
76
|
+
isLoading?: boolean;
|
77
|
+
error?: string;
|
78
|
+
leftNode?: React$1.ReactNode;
|
79
|
+
rightNode?: React$1.ReactNode;
|
80
|
+
sideNodeClassName?: string;
|
81
|
+
label?: string;
|
82
|
+
showAsterisk?: boolean;
|
83
|
+
description?: React$1.ReactNode;
|
84
|
+
}
|
85
|
+
declare const Input: React$1.ForwardRefExoticComponent<InputProps & React$1.RefAttributes<HTMLInputElement>>;
|
86
|
+
|
87
|
+
type PasswordInputProps = InputProps & {
|
88
|
+
/**
|
89
|
+
* onValidate(validated: boolean, value: string) => void
|
90
|
+
* args - validated: this is boolean value that indicated that all validation options were met
|
91
|
+
* args - value: this is the string input value
|
92
|
+
*/
|
93
|
+
onValidate?: (validated: boolean, value: string) => void;
|
94
|
+
disableValidation?: boolean;
|
95
|
+
};
|
96
|
+
declare const PasswordInput: {
|
97
|
+
({ onValidate, onChange, disableValidation, ...props }: PasswordInputProps): react_jsx_runtime.JSX.Element;
|
98
|
+
displayName: string;
|
99
|
+
};
|
100
|
+
|
101
|
+
interface TextareaProps extends DetailedHTMLProps<React$1.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, VariantProps<typeof inputContainerVariants> {
|
102
|
+
isLoading?: boolean;
|
103
|
+
error?: string;
|
104
|
+
label?: string;
|
105
|
+
showAsterisk?: boolean;
|
106
|
+
description?: React$1.ReactNode;
|
107
|
+
}
|
108
|
+
declare const Textarea: {
|
109
|
+
({ className, status, disabled, error, isLoading, showAsterisk, label, description, ...props }: TextareaProps): react_jsx_runtime.JSX.Element;
|
110
|
+
displayName: string;
|
111
|
+
};
|
112
|
+
|
113
|
+
type SearchableDataType = {
|
114
|
+
value: string;
|
115
|
+
label: string;
|
116
|
+
} & {
|
117
|
+
[key: string]: any;
|
118
|
+
};
|
119
|
+
|
120
|
+
type CountryPropsStatus = VariantProps<typeof inputContainerVariants>["status"];
|
121
|
+
interface CountryProps {
|
122
|
+
modal?: boolean;
|
123
|
+
hideSearch?: boolean;
|
124
|
+
loading?: boolean;
|
125
|
+
inputValue?: string;
|
126
|
+
onInputValueChange?: (arg: string) => void;
|
127
|
+
disabled?: boolean;
|
128
|
+
placeholder?: string;
|
129
|
+
value?: SearchableDataType;
|
130
|
+
optionComponent?: (arg: SearchableDataType) => React.ReactNode;
|
131
|
+
className?: string;
|
132
|
+
containerClassName?: string;
|
133
|
+
onChange: (value: SearchableDataType) => void;
|
134
|
+
status?: CountryPropsStatus;
|
135
|
+
label?: string;
|
136
|
+
showAsterisk?: boolean;
|
137
|
+
description?: React.ReactNode;
|
138
|
+
error?: string;
|
139
|
+
}
|
140
|
+
declare const Country: ({ hideSearch, showAsterisk, label, description, error, ...props }: CountryProps) => react_jsx_runtime.JSX.Element;
|
141
|
+
|
142
|
+
type SelectPropsStatus = VariantProps<typeof inputContainerVariants>["status"];
|
143
|
+
interface SelectProps {
|
144
|
+
modal?: boolean;
|
145
|
+
hideSearch?: boolean;
|
146
|
+
loading?: boolean;
|
147
|
+
inputValue?: string;
|
148
|
+
onInputValueChange?: (arg: string) => void;
|
149
|
+
disabled?: boolean;
|
150
|
+
placeholder?: string;
|
151
|
+
value?: SearchableDataType;
|
152
|
+
options: SearchableDataType[];
|
153
|
+
optionComponent?: (arg: SearchableDataType) => React.ReactNode;
|
154
|
+
className?: string;
|
155
|
+
containerClassName?: string;
|
156
|
+
onChange: (value: SearchableDataType) => void;
|
157
|
+
status?: SelectPropsStatus;
|
158
|
+
label?: string;
|
159
|
+
showAsterisk?: boolean;
|
160
|
+
description?: React.ReactNode;
|
161
|
+
error?: string;
|
162
|
+
id?: string;
|
163
|
+
}
|
164
|
+
declare const Select: ({ showAsterisk, label, description, error, hideSearch, status, ...props }: SelectProps) => react_jsx_runtime.JSX.Element;
|
165
|
+
|
166
|
+
type PhoneInputProps = Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value"> & Omit<RPNInput.Props<typeof RPNInput.default>, "onChange"> & {
|
167
|
+
onChange?: (value: RPNInput.Value) => void;
|
168
|
+
} & {
|
169
|
+
status?: VariantProps<typeof inputContainerVariants>["status"];
|
170
|
+
defaultCountry?: RPNInput.Country;
|
171
|
+
modal?: boolean;
|
172
|
+
label?: string;
|
173
|
+
showAsterisk?: boolean;
|
174
|
+
description?: React$1.ReactNode;
|
175
|
+
error?: string;
|
176
|
+
};
|
177
|
+
declare const PhoneInput: React$1.ForwardRefExoticComponent<PhoneInputProps>;
|
178
|
+
type FlagComponentProps = RPNInput.FlagProps & {
|
179
|
+
className?: string;
|
180
|
+
};
|
181
|
+
declare const FlagComponent: {
|
182
|
+
({ country, countryName, className, }: FlagComponentProps): react_jsx_runtime.JSX.Element;
|
183
|
+
displayName: string;
|
184
|
+
};
|
185
|
+
|
186
|
+
type DialogPropsType = {
|
187
|
+
trigger?: React$1.ReactNode;
|
188
|
+
children: React$1.ReactNode;
|
189
|
+
title?: React$1.ReactNode;
|
190
|
+
description?: React$1.ReactNode;
|
191
|
+
footer?: React$1.ReactNode;
|
192
|
+
hideCloseButton?: boolean;
|
193
|
+
contentClassName?: string;
|
194
|
+
headerClassName?: string;
|
195
|
+
titleClassName?: string;
|
196
|
+
descriptionClassName?: string;
|
197
|
+
footerClassName?: string;
|
198
|
+
asChild?: boolean;
|
199
|
+
onOpenAutoFocus?: (e: Event) => void;
|
200
|
+
onCloseAutoFocus?: (e: Event) => void;
|
201
|
+
onInteractOutside?: (e: Event) => void;
|
202
|
+
onPointerDownOutside?: (e: Event) => void;
|
203
|
+
onEscapeKeyDown?: (e: KeyboardEvent) => void;
|
204
|
+
};
|
205
|
+
declare const Dialog: {
|
206
|
+
({ trigger, children, open, onOpenChange, hideCloseButton, footer, title, description, contentClassName, headerClassName, titleClassName, descriptionClassName, footerClassName, asChild, onOpenAutoFocus, onCloseAutoFocus, onEscapeKeyDown, onInteractOutside, onPointerDownOutside, ...props }: React$1.ComponentPropsWithoutRef<typeof DialogPrimitive.Root> & DialogPropsType): react_jsx_runtime.JSX.Element;
|
207
|
+
displayName: string | undefined;
|
208
|
+
};
|
209
|
+
|
210
|
+
declare const otpInputVariants: (props?: ({
|
211
|
+
status?: "loading" | "default" | "error" | null | undefined;
|
212
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
213
|
+
type DefailtInputProps = Omit<OTPInputProps$1, "renderInput">;
|
214
|
+
type OTPInputProps = DefailtInputProps & VariantProps<typeof otpInputVariants> & {};
|
215
|
+
declare const OTPInput: ({ numInputs, inputStyle, containerStyle, placeholder, status, ...props }: OTPInputProps) => react_jsx_runtime.JSX.Element;
|
216
|
+
|
217
|
+
declare const PopoverRoot: React$1.FC<PopoverPrimitive.PopoverProps>;
|
218
|
+
declare const PopoverTrigger: React$1.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
219
|
+
declare const PopoverContent: React$1.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
220
|
+
portal?: boolean;
|
221
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
222
|
+
type PopoverPropsType = {
|
223
|
+
trigger: React$1.ReactNode;
|
224
|
+
children: React$1.ReactNode;
|
225
|
+
contentClassName?: string;
|
226
|
+
triggerClassName?: string;
|
227
|
+
asChild?: boolean;
|
228
|
+
align?: PopoverPrimitive.PopoverContentProps["align"];
|
229
|
+
side?: PopoverPrimitive.PopoverContentProps["side"];
|
230
|
+
alignOffset?: number | undefined;
|
231
|
+
sideOffset?: number | undefined;
|
232
|
+
onOpenAutoFocus?: (e: Event) => void;
|
233
|
+
onCloseAutoFocus?: (e: Event) => void;
|
234
|
+
portal?: boolean;
|
235
|
+
id?: string;
|
236
|
+
};
|
237
|
+
declare const Popover: {
|
238
|
+
({ trigger, children, open, onOpenChange, contentClassName, asChild, align, side, alignOffset, triggerClassName, sideOffset, onOpenAutoFocus, onCloseAutoFocus, portal, id, ...props }: React$1.ComponentPropsWithoutRef<typeof PopoverPrimitive.Root> & PopoverPropsType): react_jsx_runtime.JSX.Element;
|
239
|
+
displayName: string | undefined;
|
240
|
+
};
|
241
|
+
|
242
|
+
interface BannerTypes {
|
243
|
+
type?: "gray" | "info" | "warning" | "success" | "danger";
|
244
|
+
}
|
245
|
+
interface BannerProps extends BannerTypes {
|
246
|
+
title?: React.ReactNode;
|
247
|
+
description?: React.ReactNode;
|
248
|
+
showIcon?: boolean;
|
249
|
+
showCloseButton?: boolean;
|
250
|
+
bottomNode?: React.ReactNode;
|
251
|
+
sideNode?: React.ReactNode;
|
252
|
+
open: boolean;
|
253
|
+
onClose?: () => void;
|
254
|
+
}
|
255
|
+
declare const Banner: ({ type, title, description, open, showCloseButton, bottomNode, sideNode, onClose, showIcon, }: BannerProps) => react_jsx_runtime.JSX.Element | null;
|
256
|
+
|
257
|
+
interface CopyableLabelProps {
|
258
|
+
text: string;
|
259
|
+
textToCopy?: string;
|
260
|
+
onCopy?: () => void;
|
261
|
+
iconsPosition?: "left" | "right";
|
262
|
+
clampText?: boolean;
|
263
|
+
textClassName?: string;
|
264
|
+
clampMode?: "truncate" | "wrap";
|
265
|
+
isLink?: boolean;
|
266
|
+
}
|
267
|
+
declare const CopyableLabel: React.FC<CopyableLabelProps>;
|
268
|
+
|
269
|
+
type DebouncedInputProps = {
|
270
|
+
value?: string;
|
271
|
+
onChange: (e: string) => void;
|
272
|
+
debounce?: number;
|
273
|
+
addon?: React__default.ReactNode;
|
274
|
+
} & Omit<BaseInnerInputProps, "onChange" | "size">;
|
275
|
+
declare const DebouncedInput: ({ value: initialValue, onChange, debounce, addon, ...props }: DebouncedInputProps) => react_jsx_runtime.JSX.Element;
|
276
|
+
|
277
|
+
type Props = {
|
278
|
+
environment: "staging" | "sandbox" | "production";
|
279
|
+
branch: string;
|
280
|
+
version: string;
|
281
|
+
deployTime: string;
|
282
|
+
onClose: () => void;
|
283
|
+
showBanner: boolean;
|
284
|
+
initDefault: () => void;
|
285
|
+
removeFromStorage: () => void;
|
286
|
+
syncLocalStorageToState: () => void;
|
287
|
+
};
|
288
|
+
declare const DevBanner: (props: Props) => react_jsx_runtime.JSX.Element | null;
|
289
|
+
|
290
|
+
type DrawerRootType = React$1.ComponentProps<typeof Drawer$1.Root> & {
|
291
|
+
id?: string;
|
292
|
+
};
|
293
|
+
declare const DrawerRoot: {
|
294
|
+
({ shouldScaleBackground, ...props }: DrawerRootType): react_jsx_runtime.JSX.Element;
|
295
|
+
displayName: string;
|
296
|
+
};
|
297
|
+
declare const DrawerClose: React$1.ForwardRefExoticComponent<DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
|
298
|
+
type DrawerPropsType = {
|
299
|
+
trigger?: React$1.ReactNode;
|
300
|
+
children: React$1.ReactNode;
|
301
|
+
title?: React$1.ReactNode;
|
302
|
+
description?: React$1.ReactNode;
|
303
|
+
footer?: React$1.ReactNode;
|
304
|
+
hideCloseButton?: boolean;
|
305
|
+
contentClassName?: string;
|
306
|
+
drawerContentClassName?: string;
|
307
|
+
headerClassName?: string;
|
308
|
+
titleClassName?: string;
|
309
|
+
descriptionClassName?: string;
|
310
|
+
footerClassName?: string;
|
311
|
+
asChild?: boolean;
|
312
|
+
onOpenAutoFocus?: (e: Event) => void;
|
313
|
+
onCloseAutoFocus?: (e: Event) => void;
|
314
|
+
};
|
315
|
+
declare const Drawer: ({ trigger, children, open, onOpenChange, hideCloseButton, footer, title, description, contentClassName, headerClassName, titleClassName, descriptionClassName, footerClassName, asChild, onOpenAutoFocus, drawerContentClassName, onCloseAutoFocus, id, }: Omit<DrawerRootType, "value"> & DrawerPropsType) => react_jsx_runtime.JSX.Element;
|
316
|
+
|
317
|
+
type LocaleOption = {
|
318
|
+
key: string;
|
319
|
+
label: string;
|
320
|
+
};
|
321
|
+
declare const LocaleSelector: ({ locale, onChange, locales, }: {
|
322
|
+
locale?: string;
|
323
|
+
onChange?: (locale: string) => void;
|
324
|
+
locales?: LocaleOption[];
|
325
|
+
}) => react_jsx_runtime.JSX.Element;
|
326
|
+
|
327
|
+
type BusinessType = {
|
328
|
+
clientId?: string;
|
329
|
+
email?: string;
|
330
|
+
name?: string;
|
331
|
+
updatedAt?: string;
|
332
|
+
phoneNumber?: string;
|
333
|
+
logo?: string;
|
334
|
+
currencyCode?: string;
|
335
|
+
countryCode?: string;
|
336
|
+
currencyIcon?: string;
|
337
|
+
countryFlag?: string;
|
338
|
+
isKYCCompleted?: boolean;
|
339
|
+
parentClientId?: string;
|
340
|
+
supportedCountryCodes?: string[];
|
341
|
+
status?: string;
|
342
|
+
access?: string;
|
343
|
+
};
|
344
|
+
|
345
|
+
type SingleLinkType = {
|
346
|
+
to: string;
|
347
|
+
name: string;
|
348
|
+
isHidden?: boolean;
|
349
|
+
icon?: ReactNode;
|
350
|
+
badge?: ReactNode;
|
351
|
+
permission?: string;
|
352
|
+
key?: string;
|
353
|
+
id: string;
|
354
|
+
};
|
355
|
+
type BusinessProps = {
|
356
|
+
businessList: BusinessType[];
|
357
|
+
activeBusiness: BusinessType;
|
358
|
+
isBusinessDrawerActive: boolean;
|
359
|
+
toggleAddBusinessDrawer: () => void;
|
360
|
+
handleSetActiveBusiness: (clientId: string) => void;
|
361
|
+
};
|
362
|
+
type LinksType = {
|
363
|
+
children?: SingleLinkType[];
|
364
|
+
} & SingleLinkType;
|
365
|
+
type SidebarProps = {
|
366
|
+
isSidebarCollapsed: boolean;
|
367
|
+
collapseType: CollapseType;
|
368
|
+
links: LinksType[];
|
369
|
+
onToggleSideBar: (isOpen: boolean) => void;
|
370
|
+
isMobile: boolean;
|
371
|
+
businessProps: BusinessProps;
|
372
|
+
currentPath: string;
|
373
|
+
onNavigate: (path: string) => void;
|
374
|
+
appConfig?: IAppConfig & {
|
375
|
+
[key: string]: unknown;
|
376
|
+
};
|
377
|
+
onLogoutClick: () => void;
|
378
|
+
openSidebarIcon?: ReactNode;
|
379
|
+
closedSidebarIcon?: ReactNode;
|
380
|
+
nodeAfterSideBarLogo?: ReactNode;
|
381
|
+
};
|
382
|
+
interface IAppConfig {
|
383
|
+
appName: string;
|
384
|
+
hiddenRoutes?: string[];
|
385
|
+
}
|
386
|
+
type CollapseType = "icons" | "hidden";
|
387
|
+
|
388
|
+
declare const Sidebar: ({ isSidebarCollapsed, onToggleSideBar, isMobile, links, businessProps, currentPath, onNavigate, appConfig, collapseType: propCollapseType, onLogoutClick, openSidebarIcon, closedSidebarIcon, nodeAfterSideBarLogo, }: SidebarProps) => react_jsx_runtime.JSX.Element;
|
389
|
+
|
390
|
+
type Variant = "success" | "failed" | "pending" | "abandoned";
|
391
|
+
declare const Status: ({ status, variant, className, }: {
|
392
|
+
status: string;
|
393
|
+
variant: Variant;
|
394
|
+
className?: string;
|
395
|
+
}) => react_jsx_runtime.JSX.Element;
|
396
|
+
|
397
|
+
type PaginationProps = {
|
398
|
+
currentPage?: number;
|
399
|
+
totalPages?: number;
|
400
|
+
onPageChange?: (page: number) => void;
|
401
|
+
totalItems?: number;
|
402
|
+
itemsPerPage?: number;
|
403
|
+
id?: string;
|
404
|
+
};
|
405
|
+
/**
|
406
|
+
* Pagination component for displaying pagination controls.
|
407
|
+
* @param {number} currentPage - The current page number.
|
408
|
+
* @param {number} totalPages - The total number of pages.
|
409
|
+
* @param {function} onPageChange - Callback function to handle page change.
|
410
|
+
* @param {number | undefined} itemsPerPage - The number of items per page.
|
411
|
+
*/
|
412
|
+
declare const Pagination: ({ currentPage, totalPages, onPageChange, itemsPerPage, totalItems, id, }: PaginationProps) => react_jsx_runtime.JSX.Element;
|
413
|
+
|
414
|
+
type SelectOption = {
|
415
|
+
value: string;
|
416
|
+
label: string;
|
417
|
+
};
|
418
|
+
type Base = {
|
419
|
+
type: "input" | "drop-down" | "date-range" | "multi" | "date" | "radio";
|
420
|
+
key: string;
|
421
|
+
label: string;
|
422
|
+
placeholder?: string;
|
423
|
+
};
|
424
|
+
type FilterListOption = {
|
425
|
+
type: "input";
|
426
|
+
} & Exclude<InputProps, "value" | "onChange">;
|
427
|
+
type FilterListDate = {
|
428
|
+
type: "date";
|
429
|
+
date?: string | Date;
|
430
|
+
};
|
431
|
+
type FilterListInputDropDown = {
|
432
|
+
type: "drop-down" | "multi" | "radio";
|
433
|
+
options: SelectOption[];
|
434
|
+
};
|
435
|
+
type FilterListItem = Base & (FilterListOption | FilterListInputDropDown | FilterListDate);
|
436
|
+
type FilterContentProps = {
|
437
|
+
filters: FilterListItem[];
|
438
|
+
values?: Record<string, any>;
|
439
|
+
setAppliedFilters?: (values: Record<string, any>) => void;
|
440
|
+
id?: string;
|
441
|
+
};
|
442
|
+
type FilterListOptions = FilterListItem[];
|
443
|
+
|
444
|
+
type TableSearchProps = {
|
445
|
+
enabled: boolean;
|
446
|
+
debounceRate?: number;
|
447
|
+
onSearch?: (query: string) => void;
|
448
|
+
};
|
449
|
+
type TableDownloadProps = {
|
450
|
+
enabled: boolean;
|
451
|
+
buttonId?: string;
|
452
|
+
onDownload?: () => void;
|
453
|
+
buttonText?: string;
|
454
|
+
};
|
455
|
+
type TablePaginationProps = {
|
456
|
+
enabled: boolean;
|
457
|
+
} & PaginationProps;
|
458
|
+
type TableProps<T extends RowData> = {
|
459
|
+
ExtraNode?: ReactNode;
|
460
|
+
/**
|
461
|
+
* @deprecated Use the `filterListOptions` prop instead.
|
462
|
+
*
|
463
|
+
* The `FilterMenu` prop is deprecated in favor of `filterListOptions`, which provides a more flexible and structured way to define filter options for the table.
|
464
|
+
*
|
465
|
+
* To manage the state of applied filters, use the `setAppliedFilters` callback. This function can be used to collect and update the current filter state based on user interactions with the filter list options.
|
466
|
+
*
|
467
|
+
* The `filterListOptions` prop accepts an array of filter configuration objects, allowing you to define available filters, their types, and possible values. This approach enables dynamic filter rendering and better state management compared to the static `FilterMenu` node.
|
468
|
+
*/
|
469
|
+
FilterMenu?: ReactNode;
|
470
|
+
setAppliedFilters?: (values: Record<string, any>) => void;
|
471
|
+
filterListOptions?: FilterListItem[];
|
472
|
+
buttonClassName?: string;
|
473
|
+
download?: TableDownloadProps;
|
474
|
+
id?: string;
|
475
|
+
isLoading?: boolean;
|
476
|
+
isMobile?: boolean;
|
477
|
+
isRefetching?: boolean;
|
478
|
+
onExport?: () => void;
|
479
|
+
onRefetch?: () => void;
|
480
|
+
onRowClick?: (row: Row<T>) => void;
|
481
|
+
pagination?: TablePaginationProps;
|
482
|
+
search?: TableSearchProps;
|
483
|
+
table: Table$1<T>;
|
484
|
+
};
|
485
|
+
declare const Table: <T extends RowData>({ table, isMobile, onRowClick, id, onRefetch, isRefetching, FilterMenu, ExtraNode, onExport, search, download, isLoading, pagination, filterListOptions, setAppliedFilters, }: TableProps<T>) => react_jsx_runtime.JSX.Element;
|
486
|
+
|
487
|
+
type PageDataToolbarProps = {
|
488
|
+
onRefetch?: () => void;
|
489
|
+
search?: TableSearchProps;
|
490
|
+
FilterMenu?: ReactNode;
|
491
|
+
ExtraNode?: ReactNode;
|
492
|
+
onExport?: () => void;
|
493
|
+
download?: TableDownloadProps;
|
494
|
+
isRefetching?: boolean;
|
495
|
+
setAppliedFilters?: (values: Record<string, any>) => void;
|
496
|
+
filterListOptions?: FilterListItem[];
|
497
|
+
id?: string;
|
498
|
+
};
|
499
|
+
declare const PageDataToolbar: ({ onRefetch, search, FilterMenu, ExtraNode, onExport, download, isRefetching, filterListOptions, setAppliedFilters, id, }: PageDataToolbarProps) => react_jsx_runtime.JSX.Element;
|
500
|
+
|
501
|
+
type ResourcePermission = {
|
502
|
+
resource: string;
|
503
|
+
action: string;
|
504
|
+
};
|
505
|
+
type ResourcePermissions = ResourcePermission[];
|
506
|
+
type ResourcePermissionProps = {
|
507
|
+
permission?: {
|
508
|
+
resource?: string;
|
509
|
+
action?: string;
|
510
|
+
};
|
511
|
+
children: ReactNode;
|
512
|
+
};
|
513
|
+
|
514
|
+
declare const PermissionsContext: React$1.Context<ResourcePermissions | undefined>;
|
515
|
+
declare const PermissionsProvider: ({ permissions, children, }: {
|
516
|
+
permissions: ResourcePermissions;
|
517
|
+
children: ReactNode;
|
518
|
+
}) => react_jsx_runtime.JSX.Element;
|
519
|
+
|
520
|
+
declare const usePermissions: () => ResourcePermissions | undefined;
|
521
|
+
declare const useHasPermission: (permission: {
|
522
|
+
resource?: string;
|
523
|
+
action?: string;
|
524
|
+
}) => {
|
525
|
+
hasPermission: boolean;
|
526
|
+
validatePermission: (permission: {
|
527
|
+
resource?: string;
|
528
|
+
action?: string;
|
529
|
+
}) => boolean;
|
530
|
+
};
|
531
|
+
|
532
|
+
declare const HasResourcePermission: ({ permission, children, }: ResourcePermissionProps) => react_jsx_runtime.JSX.Element;
|
533
|
+
|
534
|
+
type CalendarInputProps = {
|
535
|
+
label?: string;
|
536
|
+
helpText?: string | React$1.ReactNode;
|
537
|
+
error?: string;
|
538
|
+
optional?: boolean;
|
539
|
+
onChange: (value: string | null) => void;
|
540
|
+
value?: string;
|
541
|
+
};
|
542
|
+
declare const CalendarInput: ({ label, optional, onChange, error, helpText, value, }: CalendarInputProps) => react_jsx_runtime.JSX.Element;
|
543
|
+
|
544
|
+
declare const RadioGroup: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
545
|
+
className?: string;
|
546
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
547
|
+
declare const RadioGroupItem: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & {
|
548
|
+
className?: string;
|
549
|
+
} & React$1.RefAttributes<HTMLButtonElement>>;
|
550
|
+
|
551
|
+
type FilterPopoverProps = FilterContentProps & {
|
552
|
+
isOpen?: boolean;
|
553
|
+
trigger?: ReactNode;
|
554
|
+
id?: string;
|
555
|
+
};
|
556
|
+
declare const FilterPopover: ({ filters, setAppliedFilters, isOpen, id, }: FilterPopoverProps) => react_jsx_runtime.JSX.Element | null;
|
557
|
+
|
558
|
+
interface TextOverflowProps extends React__default.HTMLAttributes<HTMLElement> {
|
559
|
+
children: React__default.ReactNode;
|
560
|
+
mode?: "wrap" | "truncate" | "overflow";
|
561
|
+
as?: React__default.ElementType;
|
562
|
+
href?: string;
|
563
|
+
}
|
564
|
+
/**
|
565
|
+
* TextOverflow is a React component that controls how text overflows its container.
|
566
|
+
*
|
567
|
+
* Props:
|
568
|
+
* - children: ReactNode - The content to display.
|
569
|
+
* - mode: "truncate" | "wrap" | "overflow" (default: "truncate")
|
570
|
+
* - "truncate": Single line, truncated with ellipsis.
|
571
|
+
* - "wrap": Allows text to wrap onto multiple lines.
|
572
|
+
* - "overflow": No special overflow handling.
|
573
|
+
* - as: React.ElementType - The HTML element or React component to render as the container (default: "div").
|
574
|
+
* - href: string (optional) - If provided and 'as' is an anchor, sets the link target to "_blank".
|
575
|
+
* - className: string (optional) - Additional CSS classes for the container.
|
576
|
+
* - ...rest: Other HTML attributes passed to the container.
|
577
|
+
*/
|
578
|
+
declare const TextOverflow: ({ children, mode, className, as: Component, ...rest }: TextOverflowProps) => react_jsx_runtime.JSX.Element;
|
579
|
+
|
580
|
+
declare const CurrencySymbolMap: Record<string, string>;
|
581
|
+
interface FormatCurrencyOptions {
|
582
|
+
convertToMajorCurrency?: boolean;
|
583
|
+
locale?: string;
|
584
|
+
}
|
585
|
+
declare class AmountAction {
|
586
|
+
static getCurrencyLocaleMap(currency: string): string;
|
587
|
+
static koboToNaira(amount: number | string): number;
|
588
|
+
static nairaToKobo(amount: number | string): number;
|
589
|
+
static getCurrencySymbol(currency: string): string;
|
590
|
+
static formatAmountAndCurrency: (currency: string, value: number | string, options: FormatCurrencyOptions) => string;
|
591
|
+
}
|
592
|
+
|
593
|
+
declare class DateAction {
|
594
|
+
static getDateLibrary(): dayjs.Dayjs;
|
595
|
+
static formatTimestampToDate(timestamp: number, dateFormat?: string): string;
|
596
|
+
static formatDateToTimestamp(date: string): number;
|
597
|
+
}
|
598
|
+
|
599
|
+
declare function cn(...inputs: ClassValue[]): string;
|
600
|
+
|
601
|
+
export { AmountAction, Banner, Button, CalendarInput, CopyableLabel, Country, CurrencySymbolMap, DateAction, DebouncedInput, DevBanner, Dialog, Drawer, DrawerClose, type DrawerPropsType, DrawerRoot, type FilterListItem, type FilterListOptions, FilterPopover, FlagComponent, FormLabel, type FormatCurrencyOptions, HasResourcePermission, Input, Loader, LocaleSelector, OTPInput, PageDataToolbar, Pagination, PasswordInput, PermissionsContext, PermissionsProvider, PhoneInput, Popover, PopoverContent, PopoverRoot, PopoverTrigger, RadioGroup, RadioGroupItem, type ResourcePermission, type ResourcePermissionProps, type ResourcePermissions, Select, Sidebar, Status, Table, type TablePaginationProps, TextOverflow, type TextOverflowProps, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger, buttonVariants, cn, useHasPermission, usePermissions };
|