Skip to content

Commit bb7cf54

Browse files
authored
chore(types): add definition (#443)
* chore(types): add definition Signed-off-by: Roberto Bianchi <[email protected]> * update Signed-off-by: Roberto Bianchi <[email protected]> --------- Signed-off-by: Roberto Bianchi <[email protected]>
1 parent 9f55e65 commit bb7cf54

File tree

5 files changed

+1217
-11
lines changed

5 files changed

+1217
-11
lines changed

index.d.ts

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
import { ComponentType } from "react";
2+
3+
declare module "@platformatic/ui-components" {
4+
export interface VerticalSeparatorProps {
5+
color?: string;
6+
backgroundColorOpacity?: string;
7+
classes?: string;
8+
height?: string;
9+
width?: string;
10+
marginLeft?: string;
11+
marginRight?: string;
12+
}
13+
export const Checkbox: ComponentType<any>;
14+
export const BorderedBox: ComponentType<any>;
15+
export const Button: ComponentType<any>;
16+
export const HorizontalSeparator: ComponentType<any>;
17+
export const LoadingSpinnerV2: ComponentType<any>;
18+
export const Tooltip: ComponentType<any>;
19+
export const VerticalSeparator: ComponentType<VerticalSeparatorProps>;
20+
export const TooltipAbsolute: ComponentType<any>;
21+
22+
export interface PlatformaticIconProps {
23+
iconName: string;
24+
color?: string;
25+
size?: string;
26+
onClick?: (() => void) | null;
27+
disabled?: boolean;
28+
inactive?: boolean;
29+
className?: string;
30+
internalOverHandling?: boolean;
31+
}
32+
33+
export interface CopyAndPasteProps {
34+
value: unknown;
35+
tooltipLabel?: string;
36+
color?: string;
37+
size?: string;
38+
tooltipClassName?: string;
39+
position?: string;
40+
}
41+
42+
export interface IconsType {
43+
CircleStopIcon: ComponentType<any>;
44+
RunningIcon: ComponentType<any>;
45+
[key: string]: string | ComponentType<any>;
46+
}
47+
48+
export const PlatformaticIcon: ComponentType<PlatformaticIconProps>;
49+
export const CopyAndPaste: ComponentType<CopyAndPasteProps>;
50+
export const Icons: IconsType;
51+
}
52+
53+
declare module "@platformatic/ui-components/src/components/icons" {
54+
interface IconProps {
55+
size?: string;
56+
color?: string;
57+
addImportantToColor?: boolean;
58+
className?: string;
59+
}
60+
61+
const Icons: {
62+
AlertIcon: ComponentType<IconProps>;
63+
ArrowUpIcon: ComponentType<IconProps>;
64+
ArrowDownIcon: ComponentType<IconProps>;
65+
CircleCheckMarkIcon: ComponentType<IconProps>;
66+
CLIIcon: ComponentType<IconProps>;
67+
[key: string]: ComponentType<IconProps>;
68+
};
69+
70+
export default Icons;
71+
}
72+
73+
declare module "@platformatic/ui-components/src/components/constants" {
74+
export const WHITE: string;
75+
export const SMALL: string;
76+
export const POSITION_END: string;
77+
export const RICH_BLACK: string;
78+
export const BLACK_RUSSIAN: string;
79+
export const TRANSPARENT: string;
80+
export const MARGIN_0: string;
81+
export const OPACITY_15: string;
82+
export const OPACITY_30: string;
83+
export const OPACITY_100: string;
84+
export const WARNING_YELLOW: string;
85+
export const ANTI_FLASH_WHITE: string;
86+
export const DULLS_BACKGROUND_COLOR: string;
87+
export const ERROR_RED: string;
88+
export const LARGE: string;
89+
export const MEDIUM: string;
90+
export const MAIN_GREEN: string;
91+
export const BOX_SHADOW: string;
92+
export const UNDERLINE: string;
93+
export const MAIN_DARK_BLUE: string;
94+
export const DIRECTION_RIGHT: string;
95+
export const POSITION_CENTER: string;
96+
export const TINY: string;
97+
}
98+
99+
declare module "@platformatic/ui-components/src/components/forms" {
100+
interface ToggleSwitchProps {
101+
label?: string;
102+
labelClassName?: string;
103+
name: string;
104+
onChange: () => void;
105+
checked: boolean;
106+
size?: string;
107+
}
108+
109+
interface InputProps {
110+
label?: string;
111+
placeholder?: string;
112+
value: string;
113+
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
114+
name: string;
115+
type?: string;
116+
error?: string;
117+
className?: string;
118+
disabled?: boolean;
119+
}
120+
121+
interface SelectProps {
122+
label?: string;
123+
options: Array<{ label: string; value: string }>;
124+
value: string;
125+
onChange: (value: string) => void;
126+
name: string;
127+
placeholder?: string;
128+
error?: string;
129+
className?: string;
130+
disabled?: boolean;
131+
}
132+
133+
interface CheckboxProps {
134+
label: string;
135+
checked: boolean;
136+
onChange: () => void;
137+
name: string;
138+
disabled?: boolean;
139+
}
140+
141+
interface RadioButtonProps {
142+
label: string;
143+
value: string;
144+
checked: boolean;
145+
onChange: () => void;
146+
name: string;
147+
disabled?: boolean;
148+
}
149+
150+
const Forms: {
151+
ToggleSwitch: ComponentType<ToggleSwitchProps>;
152+
Input: ComponentType<InputProps>;
153+
Select: ComponentType<SelectProps>;
154+
Checkbox: ComponentType<CheckboxProps>;
155+
RadioButton: ComponentType<RadioButtonProps>;
156+
};
157+
158+
export default Forms;
159+
}

0 commit comments

Comments
 (0)