@platformatic/ui-components 0.15.0 → 0.15.2
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/index.d.ts +3 -43
- package/package.json +1 -1
- package/src/components/constants.d.ts +25 -0
- package/test-d/index.test-d.ts +17 -11
package/index.d.ts
CHANGED
|
@@ -39,18 +39,9 @@ declare module "@platformatic/ui-components" {
|
|
|
39
39
|
position?: string;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
export interface IconsType {
|
|
43
|
-
CircleStopIcon: ComponentType<any>;
|
|
44
|
-
RunningIcon: ComponentType<any>;
|
|
45
|
-
[key: string]: string | ComponentType<any>;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
42
|
export const PlatformaticIcon: ComponentType<PlatformaticIconProps>;
|
|
49
43
|
export const CopyAndPaste: ComponentType<CopyAndPasteProps>;
|
|
50
|
-
export const Icons: IconsType;
|
|
51
|
-
}
|
|
52
44
|
|
|
53
|
-
declare module "@platformatic/ui-components/src/components/icons" {
|
|
54
45
|
interface IconProps {
|
|
55
46
|
size?: string;
|
|
56
47
|
color?: string;
|
|
@@ -58,7 +49,8 @@ declare module "@platformatic/ui-components/src/components/icons" {
|
|
|
58
49
|
className?: string;
|
|
59
50
|
}
|
|
60
51
|
|
|
61
|
-
const Icons: {
|
|
52
|
+
export const Icons: {
|
|
53
|
+
AppIcon: ComponentType<IconProps>;
|
|
62
54
|
AlertIcon: ComponentType<IconProps>;
|
|
63
55
|
ArrowUpIcon: ComponentType<IconProps>;
|
|
64
56
|
ArrowDownIcon: ComponentType<IconProps>;
|
|
@@ -67,36 +59,6 @@ declare module "@platformatic/ui-components/src/components/icons" {
|
|
|
67
59
|
[key: string]: ComponentType<IconProps>;
|
|
68
60
|
};
|
|
69
61
|
|
|
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
62
|
interface ToggleSwitchProps {
|
|
101
63
|
label?: string;
|
|
102
64
|
labelClassName?: string;
|
|
@@ -147,13 +109,11 @@ declare module "@platformatic/ui-components/src/components/forms" {
|
|
|
147
109
|
disabled?: boolean;
|
|
148
110
|
}
|
|
149
111
|
|
|
150
|
-
const Forms: {
|
|
112
|
+
export const Forms: {
|
|
151
113
|
ToggleSwitch: ComponentType<ToggleSwitchProps>;
|
|
152
114
|
Input: ComponentType<InputProps>;
|
|
153
115
|
Select: ComponentType<SelectProps>;
|
|
154
116
|
Checkbox: ComponentType<CheckboxProps>;
|
|
155
117
|
RadioButton: ComponentType<RadioButtonProps>;
|
|
156
118
|
};
|
|
157
|
-
|
|
158
|
-
export default Forms;
|
|
159
119
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare module "@platformatic/ui-components/src/components/constants" {
|
|
2
|
+
export const WHITE: string;
|
|
3
|
+
export const SMALL: string;
|
|
4
|
+
export const POSITION_END: string;
|
|
5
|
+
export const RICH_BLACK: string;
|
|
6
|
+
export const BLACK_RUSSIAN: string;
|
|
7
|
+
export const TRANSPARENT: string;
|
|
8
|
+
export const MARGIN_0: string;
|
|
9
|
+
export const OPACITY_15: string;
|
|
10
|
+
export const OPACITY_30: string;
|
|
11
|
+
export const OPACITY_100: string;
|
|
12
|
+
export const WARNING_YELLOW: string;
|
|
13
|
+
export const ANTI_FLASH_WHITE: string;
|
|
14
|
+
export const DULLS_BACKGROUND_COLOR: string;
|
|
15
|
+
export const ERROR_RED: string;
|
|
16
|
+
export const LARGE: string;
|
|
17
|
+
export const MEDIUM: string;
|
|
18
|
+
export const MAIN_GREEN: string;
|
|
19
|
+
export const BOX_SHADOW: string;
|
|
20
|
+
export const UNDERLINE: string;
|
|
21
|
+
export const MAIN_DARK_BLUE: string;
|
|
22
|
+
export const DIRECTION_RIGHT: string;
|
|
23
|
+
export const POSITION_CENTER: string;
|
|
24
|
+
export const TINY: string;
|
|
25
|
+
}
|
package/test-d/index.test-d.ts
CHANGED
|
@@ -12,12 +12,25 @@ import {
|
|
|
12
12
|
TooltipAbsolute,
|
|
13
13
|
PlatformaticIconProps,
|
|
14
14
|
CopyAndPasteProps,
|
|
15
|
-
IconsType,
|
|
16
15
|
PlatformaticIcon,
|
|
17
16
|
CopyAndPaste,
|
|
18
17
|
Icons,
|
|
18
|
+
Forms,
|
|
19
|
+
ToggleSwitchProps,
|
|
20
|
+
InputProps,
|
|
21
|
+
SelectProps,
|
|
22
|
+
CheckboxProps,
|
|
23
|
+
RadioButtonProps,
|
|
24
|
+
IconProps,
|
|
19
25
|
} from "@platformatic/ui-components";
|
|
20
26
|
|
|
27
|
+
// Test that Forms components are properly typed as React ComponentType
|
|
28
|
+
expectType<ComponentType<ToggleSwitchProps>>(Forms.ToggleSwitch);
|
|
29
|
+
expectType<ComponentType<InputProps>>(Forms.Input);
|
|
30
|
+
expectType<ComponentType<SelectProps>>(Forms.Select);
|
|
31
|
+
expectType<ComponentType<CheckboxProps>>(Forms.Checkbox);
|
|
32
|
+
expectType<ComponentType<RadioButtonProps>>(Forms.RadioButton);
|
|
33
|
+
|
|
21
34
|
// Test VerticalSeparatorProps interface
|
|
22
35
|
expectAssignable<VerticalSeparatorProps>({});
|
|
23
36
|
expectAssignable<VerticalSeparatorProps>({
|
|
@@ -70,17 +83,10 @@ expectType<ComponentType<any>>(TooltipAbsolute);
|
|
|
70
83
|
expectType<ComponentType<PlatformaticIconProps>>(PlatformaticIcon);
|
|
71
84
|
expectType<ComponentType<CopyAndPasteProps>>(CopyAndPaste);
|
|
72
85
|
|
|
73
|
-
// Test IconsType
|
|
74
|
-
expectAssignable<IconsType>({
|
|
75
|
-
CircleStopIcon: (() => null) as ComponentType<any>,
|
|
76
|
-
RunningIcon: (() => null) as ComponentType<any>,
|
|
77
|
-
customIcon: "string-value",
|
|
78
|
-
});
|
|
79
|
-
|
|
80
86
|
// Test specific Icons exports
|
|
81
|
-
expectType<ComponentType<
|
|
82
|
-
expectType<ComponentType<
|
|
87
|
+
expectType<ComponentType<IconProps>>(Icons.CircleStopIcon);
|
|
88
|
+
expectType<ComponentType<IconProps>>(Icons.RunningIcon);
|
|
83
89
|
|
|
84
90
|
// Test that Icons allows string index access
|
|
85
91
|
const dynamicIcon: string | ComponentType<any> = Icons["someIconName"];
|
|
86
|
-
expectType<
|
|
92
|
+
expectType<ComponentType<any>>(dynamicIcon);
|