@kaio-xyz/design-system 1.1.15 → 1.1.17
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.ts +314 -24
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,24 +1,314 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { ReactNode, ButtonHTMLAttributes, AnchorHTMLAttributes, PropsWithChildren, InputHTMLAttributes, JSX, Dispatch, SetStateAction, HTMLAttributes } from 'react';
|
|
4
|
+
import { GroupBase, Props as Props$2, SingleValue } from 'react-select';
|
|
5
|
+
export { SingleValue } from 'react-select';
|
|
6
|
+
import { FieldValues, ControllerProps, Control, Path } from 'react-hook-form';
|
|
7
|
+
import * as _radix_ui_react_accordion from '@radix-ui/react-accordion';
|
|
8
|
+
import { TableProps as TableProps$1 } from 'react-data-table-component';
|
|
9
|
+
export { TableColumn } from 'react-data-table-component';
|
|
10
|
+
|
|
11
|
+
declare const BadgeStatuses: {
|
|
12
|
+
readonly success: "success";
|
|
13
|
+
readonly rejected: "rejected";
|
|
14
|
+
readonly none: "none";
|
|
15
|
+
readonly warning: "warning";
|
|
16
|
+
readonly loading: "loading";
|
|
17
|
+
};
|
|
18
|
+
type BadgeStatus = typeof BadgeStatuses[keyof typeof BadgeStatuses];
|
|
19
|
+
type BadgeProps = {
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
fullWidth?: boolean;
|
|
22
|
+
dataTest?: string;
|
|
23
|
+
status?: BadgeStatus;
|
|
24
|
+
size?: "s" | "m" | "l";
|
|
25
|
+
reverted?: boolean;
|
|
26
|
+
hasIcon?: boolean;
|
|
27
|
+
className?: string;
|
|
28
|
+
};
|
|
29
|
+
declare const Badge: ({ className, children, status, fullWidth, dataTest, reverted, size, hasIcon, ...props }: BadgeProps) => react_jsx_runtime.JSX.Element;
|
|
30
|
+
|
|
31
|
+
type CommonButtonProps = {
|
|
32
|
+
variant?: "primary" | "secondary" | "info" | "warning" | "danger" | "success";
|
|
33
|
+
fullWidth?: boolean;
|
|
34
|
+
size?: "small" | "normal" | "large";
|
|
35
|
+
isInverted?: boolean;
|
|
36
|
+
isLoading?: boolean;
|
|
37
|
+
icon?: SvgIcon | null;
|
|
38
|
+
iconSize?: number;
|
|
39
|
+
};
|
|
40
|
+
type AnchorProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
41
|
+
href: string;
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
onClick?: never;
|
|
44
|
+
};
|
|
45
|
+
type ButtonProps = {
|
|
46
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
href?: never;
|
|
49
|
+
} & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
50
|
+
type PolymorphicProps = ButtonProps | AnchorProps;
|
|
51
|
+
type Props$1 = CommonButtonProps & PolymorphicProps;
|
|
52
|
+
type RefType = HTMLButtonElement | HTMLAnchorElement;
|
|
53
|
+
declare const Button: react.ForwardRefExoticComponent<Props$1 & react.RefAttributes<RefType>>;
|
|
54
|
+
|
|
55
|
+
type StackProps = PropsWithChildren & {
|
|
56
|
+
space?: "none" | "xs" | "s" | "m" | "l" | "xl" | "xxl";
|
|
57
|
+
position?: "vertical" | "horizontal" | "horizontal-end" | "horizontal-space" | "horizontal-start" | "horizontal-center";
|
|
58
|
+
className?: string;
|
|
59
|
+
fullHeight?: boolean;
|
|
60
|
+
fullWidth?: boolean;
|
|
61
|
+
dataTest?: string;
|
|
62
|
+
dataAlignItems?: "center" | "flex-end" | "flex-start";
|
|
63
|
+
dataCapitalize?: boolean;
|
|
64
|
+
dataMarginTop?: boolean;
|
|
65
|
+
dataMarginBottom?: boolean;
|
|
66
|
+
dataMarginLeft?: boolean;
|
|
67
|
+
dataPaddingBottom?: boolean;
|
|
68
|
+
};
|
|
69
|
+
declare const Stack: ({ children, space, className, position, fullHeight, fullWidth, dataTest, dataAlignItems, dataCapitalize, dataMarginTop, dataMarginBottom, dataMarginLeft, dataPaddingBottom, ...rest }: StackProps) => react_jsx_runtime.JSX.Element;
|
|
70
|
+
|
|
71
|
+
type TextFieldAttributes = Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "placeholder">;
|
|
72
|
+
type TextFieldProps = TextFieldAttributes & {
|
|
73
|
+
hint?: string | ReactNode;
|
|
74
|
+
label?: ReactNode;
|
|
75
|
+
invalid?: boolean;
|
|
76
|
+
fullWidth?: boolean;
|
|
77
|
+
button?: JSX.Element;
|
|
78
|
+
size?: "default" | "small";
|
|
79
|
+
noPadding?: boolean;
|
|
80
|
+
floatingLabel?: boolean;
|
|
81
|
+
};
|
|
82
|
+
declare const TextField: react.ForwardRefExoticComponent<TextFieldAttributes & {
|
|
83
|
+
hint?: string | ReactNode;
|
|
84
|
+
label?: ReactNode;
|
|
85
|
+
invalid?: boolean;
|
|
86
|
+
fullWidth?: boolean;
|
|
87
|
+
button?: JSX.Element;
|
|
88
|
+
size?: "default" | "small";
|
|
89
|
+
noPadding?: boolean;
|
|
90
|
+
floatingLabel?: boolean;
|
|
91
|
+
} & react.RefAttributes<HTMLInputElement>>;
|
|
92
|
+
|
|
93
|
+
type ContainerProps = PropsWithChildren<{
|
|
94
|
+
size?: "full" | "small" | "medium" | "large" | "extra";
|
|
95
|
+
noPadding?: boolean;
|
|
96
|
+
className?: string;
|
|
97
|
+
}>;
|
|
98
|
+
declare const Container: ({ children, className, size, noPadding, ...attributes }: ContainerProps) => react_jsx_runtime.JSX.Element;
|
|
99
|
+
|
|
100
|
+
type PasswordFieldProps = Omit<TextFieldProps, "type" | "button">;
|
|
101
|
+
declare const PasswordField: react.ForwardRefExoticComponent<PasswordFieldProps & react.RefAttributes<HTMLInputElement>>;
|
|
102
|
+
|
|
103
|
+
declare const ValidatePasswordField: react.ForwardRefExoticComponent<PasswordFieldProps & {
|
|
104
|
+
setIsPasswordValid: Dispatch<SetStateAction<boolean>>;
|
|
105
|
+
} & react.RefAttributes<HTMLInputElement>>;
|
|
106
|
+
|
|
107
|
+
type SelectOption<T = string> = {
|
|
108
|
+
value: T;
|
|
109
|
+
label: string;
|
|
110
|
+
icon?: SvgIcon;
|
|
111
|
+
};
|
|
112
|
+
type SelectProps<Option, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>> = Props$2<Option, IsMulti, Group> & {
|
|
113
|
+
label?: ReactNode;
|
|
114
|
+
dataTest: string;
|
|
115
|
+
error?: string;
|
|
116
|
+
};
|
|
117
|
+
declare const Select: {
|
|
118
|
+
<Option, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>({ id, label, dataTest, isDisabled, className, error, components: customComponents, ...rest }: SelectProps<Option, IsMulti, Group>): react_jsx_runtime.JSX.Element;
|
|
119
|
+
displayName: string;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
type FormSelectProps<T extends FieldValues, Option, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>> = Omit<SelectProps<Option, IsMulti, Group>, "value" | "onChange" | "onBlur" | "name"> & Pick<ControllerProps<T>, "rules" | "defaultValue"> & {
|
|
123
|
+
control: Control<T>;
|
|
124
|
+
name: Path<T>;
|
|
125
|
+
};
|
|
126
|
+
declare const FormSelect: {
|
|
127
|
+
<T extends FieldValues, Option, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>({ name, control, rules, defaultValue, ...rest }: FormSelectProps<T, Option, IsMulti, Group>): react_jsx_runtime.JSX.Element;
|
|
128
|
+
displayName: string;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
type SpinnedIconProps = {
|
|
132
|
+
icon?: SvgIcon;
|
|
133
|
+
size?: number;
|
|
134
|
+
duration?: number;
|
|
135
|
+
className?: string;
|
|
136
|
+
};
|
|
137
|
+
declare const SpinnedIcon: ({ size, duration, className, icon: Icon, ...rest }: SpinnedIconProps) => react_jsx_runtime.JSX.Element;
|
|
138
|
+
|
|
139
|
+
type LoaderProps = PropsWithChildren<{
|
|
140
|
+
fullPage?: boolean;
|
|
141
|
+
text?: string;
|
|
142
|
+
isLightOverlay?: boolean;
|
|
143
|
+
}>;
|
|
144
|
+
declare const Loader: ({ text, fullPage, isLightOverlay, children }: LoaderProps) => react_jsx_runtime.JSX.Element;
|
|
145
|
+
|
|
146
|
+
type CheckboxAttributes = Omit<InputHTMLAttributes<HTMLInputElement>, "id" | "size">;
|
|
147
|
+
type Props = CheckboxAttributes & {
|
|
148
|
+
id?: string;
|
|
149
|
+
label?: ReactNode;
|
|
150
|
+
verticalAlign?: "start" | "center" | "end";
|
|
151
|
+
dataTest: string;
|
|
152
|
+
size?: "small" | "medium";
|
|
153
|
+
variant?: "primary" | "secondary";
|
|
154
|
+
indeterminate?: boolean;
|
|
155
|
+
};
|
|
156
|
+
declare const Checkbox: {
|
|
157
|
+
({ className, disabled, id, label, verticalAlign, onChange, dataTest, size, variant, indeterminate, checked, ...attributes }: Props): react_jsx_runtime.JSX.Element;
|
|
158
|
+
displayName: string;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
type ClipboardProps = {
|
|
162
|
+
value: string;
|
|
163
|
+
trim?: boolean;
|
|
164
|
+
trimLength?: number;
|
|
165
|
+
};
|
|
166
|
+
declare const Clipboard: ({ value, trim, trimLength }: ClipboardProps) => react_jsx_runtime.JSX.Element;
|
|
167
|
+
|
|
168
|
+
type StepperProps = {
|
|
169
|
+
children: ReactNode;
|
|
170
|
+
};
|
|
171
|
+
declare const Stepper: ({ children }: StepperProps) => react_jsx_runtime.JSX.Element;
|
|
172
|
+
|
|
173
|
+
type StepProps = {
|
|
174
|
+
label: string;
|
|
175
|
+
isCompleted?: boolean;
|
|
176
|
+
isCurrent?: boolean;
|
|
177
|
+
iconSize?: number;
|
|
178
|
+
key?: string;
|
|
179
|
+
};
|
|
180
|
+
declare const Step: ({ key, label, iconSize, isCompleted, isCurrent }: StepProps) => react_jsx_runtime.JSX.Element;
|
|
181
|
+
|
|
182
|
+
type ListProps = {
|
|
183
|
+
label?: string;
|
|
184
|
+
children?: ReactNode;
|
|
185
|
+
};
|
|
186
|
+
declare const List: ({ label, children }: ListProps) => react_jsx_runtime.JSX.Element;
|
|
187
|
+
|
|
188
|
+
type ListItem = {
|
|
189
|
+
value: string;
|
|
190
|
+
label: string;
|
|
191
|
+
key?: string;
|
|
192
|
+
};
|
|
193
|
+
declare const ListItem: ({ value, label, key }: ListItem) => react_jsx_runtime.JSX.Element;
|
|
194
|
+
|
|
195
|
+
declare const Accordion: {
|
|
196
|
+
Root: ({ children, ...rest }: (_radix_ui_react_accordion.AccordionSingleProps | _radix_ui_react_accordion.AccordionMultipleProps) & react.RefAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
|
|
197
|
+
Item: react.ForwardRefExoticComponent<{
|
|
198
|
+
icon?: SvgIcon;
|
|
199
|
+
value: string;
|
|
200
|
+
triggerClassName?: string;
|
|
201
|
+
dataTest?: string;
|
|
202
|
+
trigger: react.ReactNode;
|
|
203
|
+
hasChildrenPadding?: boolean;
|
|
204
|
+
} & {
|
|
205
|
+
children?: react.ReactNode | undefined;
|
|
206
|
+
} & react.RefAttributes<HTMLDivElement | null>>;
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
type ModalProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {
|
|
210
|
+
id?: string;
|
|
211
|
+
visible?: boolean;
|
|
212
|
+
title?: string;
|
|
213
|
+
actions?: ReactNode[];
|
|
214
|
+
size?: "default" | "small" | "medium" | "large";
|
|
215
|
+
isFullWidth?: boolean;
|
|
216
|
+
isScrollable?: boolean;
|
|
217
|
+
onClose?: () => void;
|
|
218
|
+
};
|
|
219
|
+
declare const Modal: ({ visible, ...props }: ModalProps) => react.ReactPortal | null;
|
|
220
|
+
|
|
221
|
+
type ConfirmModalProps$1 = Omit<ModalProps, "actions"> & {
|
|
222
|
+
isLoading?: boolean;
|
|
223
|
+
cancelDataTest: string;
|
|
224
|
+
confirmDataTest: string;
|
|
225
|
+
isConfirmDisabled?: boolean;
|
|
226
|
+
confirmText?: string;
|
|
227
|
+
cancelText?: string;
|
|
228
|
+
onConfirmClick: () => void;
|
|
229
|
+
};
|
|
230
|
+
declare const ConfirmModal: ({ children, isLoading, cancelDataTest, confirmDataTest, isConfirmDisabled, confirmText, cancelText, onClose, onConfirmClick, ...props }: ConfirmModalProps$1) => react_jsx_runtime.JSX.Element;
|
|
231
|
+
|
|
232
|
+
type OtpModalProps = Omit<ConfirmModalProps$1, "cancelDataTest" | "confirmDataTest" | "title"> & {
|
|
233
|
+
code: string;
|
|
234
|
+
setCode: Dispatch<SetStateAction<string>>;
|
|
235
|
+
};
|
|
236
|
+
declare const OtpModal: ({ code, setCode, onConfirmClick, isLoading, ...rest }: OtpModalProps) => react_jsx_runtime.JSX.Element;
|
|
237
|
+
|
|
238
|
+
type ConfirmModalProps = Omit<ModalProps, "actions"> & {
|
|
239
|
+
acceptDataTest: string;
|
|
240
|
+
acceptText?: string;
|
|
241
|
+
};
|
|
242
|
+
declare const InfoModal: ({ children, acceptDataTest, acceptText, onClose, ...props }: ConfirmModalProps) => react_jsx_runtime.JSX.Element;
|
|
243
|
+
|
|
244
|
+
declare const DropdownMenu: {
|
|
245
|
+
Root: ({ text, children, icon: Icon, disabled, body, variant, ...rest }: {
|
|
246
|
+
children?: react.ReactNode | undefined;
|
|
247
|
+
} & {
|
|
248
|
+
text?: string;
|
|
249
|
+
icon?: SvgIcon;
|
|
250
|
+
disabled?: boolean;
|
|
251
|
+
body?: React.ReactNode;
|
|
252
|
+
variant?: CommonButtonProps["variant"];
|
|
253
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
254
|
+
Item: ({ children, disabled, ...rest }: {
|
|
255
|
+
children?: react.ReactNode | undefined;
|
|
256
|
+
} & {
|
|
257
|
+
disabled?: boolean;
|
|
258
|
+
onClick: () => void;
|
|
259
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
type TooltipProps = PropsWithChildren<{
|
|
263
|
+
title: string;
|
|
264
|
+
description?: ReactNode;
|
|
265
|
+
}>;
|
|
266
|
+
declare const Tooltip: ({ children, title, description }: TooltipProps) => react_jsx_runtime.JSX.Element;
|
|
267
|
+
|
|
268
|
+
type DataPoint = {
|
|
269
|
+
date: string;
|
|
270
|
+
value: number;
|
|
271
|
+
};
|
|
272
|
+
declare const Timeframes: {
|
|
273
|
+
readonly month: "month";
|
|
274
|
+
readonly quarter: "quarter";
|
|
275
|
+
readonly halfYear: "half-year";
|
|
276
|
+
readonly year: "year";
|
|
277
|
+
};
|
|
278
|
+
type TimeFrame = typeof Timeframes[keyof typeof Timeframes];
|
|
279
|
+
declare const periodOptions: ({
|
|
280
|
+
value: "month";
|
|
281
|
+
label: string;
|
|
282
|
+
} | {
|
|
283
|
+
value: "quarter";
|
|
284
|
+
label: string;
|
|
285
|
+
} | {
|
|
286
|
+
value: "half-year";
|
|
287
|
+
label: string;
|
|
288
|
+
} | {
|
|
289
|
+
value: "year";
|
|
290
|
+
label: string;
|
|
291
|
+
})[];
|
|
292
|
+
type InvestmentGraphProps = {
|
|
293
|
+
dataPoints: DataPoint[];
|
|
294
|
+
timeFrame: SingleValue<SelectOption<TimeFrame>>;
|
|
295
|
+
setTimeFrame: Dispatch<SetStateAction<SingleValue<SelectOption<TimeFrame>>>>;
|
|
296
|
+
header?: ReactNode;
|
|
297
|
+
};
|
|
298
|
+
declare const InvestmentGraph: ({ dataPoints, timeFrame, header, setTimeFrame, }: InvestmentGraphProps) => react_jsx_runtime.JSX.Element;
|
|
299
|
+
|
|
300
|
+
type InvestmentsHeaderProps = {
|
|
301
|
+
currentTotalInvestmentValue: number;
|
|
302
|
+
currentGainLossValue: number;
|
|
303
|
+
currentGainLossPercentageValue: number;
|
|
304
|
+
};
|
|
305
|
+
declare const InvestmentsHeader: ({ currentTotalInvestmentValue, currentGainLossValue, currentGainLossPercentageValue, }: InvestmentsHeaderProps) => react_jsx_runtime.JSX.Element;
|
|
306
|
+
|
|
307
|
+
type TableProps<T> = TableProps$1<T> & {
|
|
308
|
+
dataTest: string;
|
|
309
|
+
isLoading?: boolean;
|
|
310
|
+
};
|
|
311
|
+
declare const Table: <T>({ data, columns, dataTest, customStyles, isLoading, onRowClicked, ...rest }: TableProps<T>) => react_jsx_runtime.JSX.Element | null;
|
|
312
|
+
|
|
313
|
+
export { Accordion, Badge, Button, Checkbox, Clipboard, ConfirmModal, Container, DropdownMenu, FormSelect, InfoModal, InvestmentGraph, InvestmentsHeader, List, ListItem, Loader, Modal, OtpModal, PasswordField, Select, SpinnedIcon, Stack, Step, Stepper, Table, TextField, Timeframes, Tooltip, ValidatePasswordField, periodOptions };
|
|
314
|
+
export type { ButtonProps, ConfirmModalProps$1 as ConfirmModalProps, DataPoint, TimeFrame };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaio-xyz/design-system",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.17",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"react": "19.2.1",
|
|
47
47
|
"react-dom": "19.2.1",
|
|
48
48
|
"rollup": "4.53.3",
|
|
49
|
+
"rollup-plugin-dts": "6.3.0",
|
|
49
50
|
"rollup-plugin-postcss": "4.0.2",
|
|
50
51
|
"storybook": "10.1.4",
|
|
51
52
|
"tslib": "2.8.1",
|