@majoo-ui/react 1.45.0 → 1.46.0
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/README.md +7 -7
- package/components/button/Button.d.ts +143 -0
- package/components/button/index.d.ts +2 -0
- package/components/form/components/InputCombobox/InputCombobox.d.ts +43 -0
- package/components/form/components/InputCombobox/index.d.ts +1 -0
- package/components/form/components/InputSelect/InputSelect.migration.d.ts +18 -0
- package/components/form/components/index.d.ts +2 -0
- package/components/index.d.ts +1 -0
- package/components/link/Link.d.ts +108 -0
- package/components/link/index.d.ts +1 -0
- package/components/loadingBar/LoadingBar.d.ts +2 -1
- package/hooks/useListOption.d.ts +9 -0
- package/index.esm.css +244 -244
- package/index.esm.js +1762 -1287
- package/index.umd.css +244 -244
- package/index.umd.js +1567 -1068
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
React
|
|
2
|
-
|
|
3
|
-
This library was generated with [Nx](https://nx.dev).
|
|
4
|
-
|
|
5
|
-
Running unit tests
|
|
6
|
-
|
|
7
|
-
Run `nx test react` to execute the unit tests via [Jest](https://jestjs.io).
|
|
1
|
+
React
|
|
2
|
+
|
|
3
|
+
This library was generated with [Nx](https://nx.dev).
|
|
4
|
+
|
|
5
|
+
Running unit tests
|
|
6
|
+
|
|
7
|
+
Run `nx test react` to execute the unit tests via [Jest](https://jestjs.io).
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type * as Stitches from '@stitches/react';
|
|
3
|
+
import { CSS } from '../../config/stitches.config';
|
|
4
|
+
export declare const ButtonPrimitive: import("@stitches/react/types/styled-component").StyledComponent<"button", {
|
|
5
|
+
buttonType?: "primary" | "secondary" | "ghost" | "negative" | "negative-secondary" | "headerMenu" | "tableMenu" | undefined;
|
|
6
|
+
size?: "sm" | "md" | "lg" | "xs" | undefined;
|
|
7
|
+
iconSize?: "sm" | "md" | "lg" | "xs" | undefined;
|
|
8
|
+
}, {
|
|
9
|
+
sm: "(min-width: 359px)";
|
|
10
|
+
md: "(min-width: 767px)";
|
|
11
|
+
lg: "(min-width: 1023px)";
|
|
12
|
+
xl: "(min-width: 1199px)";
|
|
13
|
+
'2xl': "(min-width: 1399px)";
|
|
14
|
+
'3xl': "(min-width: 1600px)";
|
|
15
|
+
}, import("@stitches/react/types/css-util").CSS<{
|
|
16
|
+
sm: "(min-width: 359px)";
|
|
17
|
+
md: "(min-width: 767px)";
|
|
18
|
+
lg: "(min-width: 1023px)";
|
|
19
|
+
xl: "(min-width: 1199px)";
|
|
20
|
+
'2xl': "(min-width: 1399px)";
|
|
21
|
+
'3xl': "(min-width: 1600px)";
|
|
22
|
+
}, {
|
|
23
|
+
colors: unknown;
|
|
24
|
+
space: unknown;
|
|
25
|
+
shadows: unknown;
|
|
26
|
+
fontSizes: unknown;
|
|
27
|
+
fonts: unknown;
|
|
28
|
+
lineHeights: unknown;
|
|
29
|
+
letterSpacings: unknown;
|
|
30
|
+
radii: unknown;
|
|
31
|
+
sizes: unknown;
|
|
32
|
+
zIndices: unknown;
|
|
33
|
+
}, import("@stitches/react/types/config").DefaultThemeMap, {
|
|
34
|
+
m: (value: {
|
|
35
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
36
|
+
}) => {
|
|
37
|
+
margin: {
|
|
38
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
mt: (value: {
|
|
42
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
43
|
+
}) => {
|
|
44
|
+
marginTop: {
|
|
45
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
mr: (value: {
|
|
49
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
50
|
+
}) => {
|
|
51
|
+
marginRight: {
|
|
52
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
mb: (value: {
|
|
56
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
57
|
+
}) => {
|
|
58
|
+
marginBottom: {
|
|
59
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
ml: (value: {
|
|
63
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
64
|
+
}) => {
|
|
65
|
+
marginLeft: {
|
|
66
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
mx: (value: {
|
|
70
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
71
|
+
}) => {
|
|
72
|
+
marginLeft: {
|
|
73
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
74
|
+
};
|
|
75
|
+
marginRight: {
|
|
76
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
my: (value: {
|
|
80
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
81
|
+
}) => {
|
|
82
|
+
marginTop: {
|
|
83
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
84
|
+
};
|
|
85
|
+
marginBottom: {
|
|
86
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
size: (value: {
|
|
90
|
+
readonly [Stitches.$$PropertyValue]: "width";
|
|
91
|
+
}) => {
|
|
92
|
+
width: {
|
|
93
|
+
readonly [Stitches.$$PropertyValue]: "width";
|
|
94
|
+
};
|
|
95
|
+
height: {
|
|
96
|
+
readonly [Stitches.$$PropertyValue]: "width";
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
subtleColor: (value: string) => {
|
|
100
|
+
color: string;
|
|
101
|
+
backgroundColor: string;
|
|
102
|
+
};
|
|
103
|
+
}>>;
|
|
104
|
+
interface AdditionalButtonProps extends React.ComponentPropsWithoutRef<'button'> {
|
|
105
|
+
/**
|
|
106
|
+
* Specify whether the button should be disabled, or not
|
|
107
|
+
*/
|
|
108
|
+
disabled?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Specify whether the button should be displayed as block and 100% width , or not
|
|
111
|
+
*/
|
|
112
|
+
block?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Specify the button width
|
|
115
|
+
*/
|
|
116
|
+
width?: string | number;
|
|
117
|
+
/**
|
|
118
|
+
* Specify the button left icon component
|
|
119
|
+
*/
|
|
120
|
+
leftIcon?: React.ReactNode;
|
|
121
|
+
/**
|
|
122
|
+
* Specify the button right icon component
|
|
123
|
+
*/
|
|
124
|
+
rightIcon?: React.ReactNode;
|
|
125
|
+
/**
|
|
126
|
+
* Specify whether the Button children is icon only , or not
|
|
127
|
+
*/
|
|
128
|
+
icon?: boolean;
|
|
129
|
+
css?: CSS;
|
|
130
|
+
}
|
|
131
|
+
export declare const Button: React.ForwardRefExoticComponent<import("@stitches/react/types/styled-component").TransformProps<{
|
|
132
|
+
buttonType?: "primary" | "secondary" | "ghost" | "negative" | "negative-secondary" | "headerMenu" | "tableMenu" | undefined;
|
|
133
|
+
size?: "sm" | "md" | "lg" | "xs" | undefined;
|
|
134
|
+
iconSize?: "sm" | "md" | "lg" | "xs" | undefined;
|
|
135
|
+
}, {
|
|
136
|
+
sm: "(min-width: 359px)";
|
|
137
|
+
md: "(min-width: 767px)";
|
|
138
|
+
lg: "(min-width: 1023px)";
|
|
139
|
+
xl: "(min-width: 1199px)";
|
|
140
|
+
'2xl': "(min-width: 1399px)";
|
|
141
|
+
'3xl': "(min-width: 1600px)";
|
|
142
|
+
}> & AdditionalButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
143
|
+
export default Button;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CSS } from '../../../../config/stitches.config';
|
|
3
|
+
interface InputComboboxProps extends Partial<Omit<React.ComponentPropsWithoutRef<'input'>, 'size'>> {
|
|
4
|
+
/**
|
|
5
|
+
* Array of options.
|
|
6
|
+
*/
|
|
7
|
+
options: string[];
|
|
8
|
+
/**
|
|
9
|
+
* If true, the search icon is shown.
|
|
10
|
+
*/
|
|
11
|
+
showLeadingIcon?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Specify the default value.
|
|
14
|
+
*/
|
|
15
|
+
defaultValue?: string;
|
|
16
|
+
/**
|
|
17
|
+
* If true, the component is disabled.
|
|
18
|
+
*/
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Specify the input placeholder.
|
|
22
|
+
*/
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Specify the options view placement.
|
|
26
|
+
*/
|
|
27
|
+
placement?: 'top' | 'bottom';
|
|
28
|
+
/**
|
|
29
|
+
* Specify the input size.
|
|
30
|
+
*/
|
|
31
|
+
size?: 'sm' | 'lg';
|
|
32
|
+
/**
|
|
33
|
+
* If true, the input will become invalid state.
|
|
34
|
+
*/
|
|
35
|
+
isInvalid?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Called whenever the input value changes.
|
|
38
|
+
*/
|
|
39
|
+
onValueChange?: (value: string) => void;
|
|
40
|
+
css?: CSS;
|
|
41
|
+
}
|
|
42
|
+
export declare const InputCombobox: React.ForwardRefExoticComponent<InputComboboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './InputCombobox';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type Option = {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
};
|
|
6
|
+
interface InputComboboxProps {
|
|
7
|
+
options: any[];
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
onChange?: (value: string, option: Option) => void;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
readOnly?: boolean;
|
|
12
|
+
showSearch?: boolean;
|
|
13
|
+
allowClear?: boolean;
|
|
14
|
+
isInvalid?: boolean;
|
|
15
|
+
size?: 'sm' | 'lg';
|
|
16
|
+
}
|
|
17
|
+
declare const InputSelect: React.FC<InputComboboxProps>;
|
|
18
|
+
export default InputSelect;
|
|
@@ -14,7 +14,9 @@ export { default as InputTags } from './InputTags/InputTags';
|
|
|
14
14
|
export { default as InputSwitch } from './InputSwitch/InputSwitch';
|
|
15
15
|
export { default as InputSearchbox } from './InputSearchbox/InputSearchbox';
|
|
16
16
|
export { default as InputSelect } from './InputSelect/InputSelect';
|
|
17
|
+
export * from './InputSelect';
|
|
17
18
|
export { default as InputSelectCheck } from './InputSelectCheck/InputSelectCheck';
|
|
18
19
|
export { default as InputSelectTag } from './InputSelectTag/InputSelectTag';
|
|
19
20
|
export { default as InputCreatable } from './InputCreatable/InputCreatable';
|
|
20
21
|
export { default as InputResourceList } from './InputResourceList/InputResourceList';
|
|
22
|
+
export * from './InputCombobox';
|
package/components/index.d.ts
CHANGED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type * as Stitches from '@stitches/react';
|
|
3
|
+
import { CSS } from '../../config/stitches.config';
|
|
4
|
+
declare const StyledLink: import("@stitches/react/types/styled-component").StyledComponent<"a", {
|
|
5
|
+
color?: "success" | "info" | "warning" | "failed" | undefined;
|
|
6
|
+
}, {
|
|
7
|
+
sm: "(min-width: 359px)";
|
|
8
|
+
md: "(min-width: 767px)";
|
|
9
|
+
lg: "(min-width: 1023px)";
|
|
10
|
+
xl: "(min-width: 1199px)";
|
|
11
|
+
'2xl': "(min-width: 1399px)";
|
|
12
|
+
'3xl': "(min-width: 1600px)";
|
|
13
|
+
}, import("@stitches/react/types/css-util").CSS<{
|
|
14
|
+
sm: "(min-width: 359px)";
|
|
15
|
+
md: "(min-width: 767px)";
|
|
16
|
+
lg: "(min-width: 1023px)";
|
|
17
|
+
xl: "(min-width: 1199px)";
|
|
18
|
+
'2xl': "(min-width: 1399px)";
|
|
19
|
+
'3xl': "(min-width: 1600px)";
|
|
20
|
+
}, {
|
|
21
|
+
colors: unknown;
|
|
22
|
+
space: unknown;
|
|
23
|
+
shadows: unknown;
|
|
24
|
+
fontSizes: unknown;
|
|
25
|
+
fonts: unknown;
|
|
26
|
+
lineHeights: unknown;
|
|
27
|
+
letterSpacings: unknown;
|
|
28
|
+
radii: unknown;
|
|
29
|
+
sizes: unknown;
|
|
30
|
+
zIndices: unknown;
|
|
31
|
+
}, import("@stitches/react/types/config").DefaultThemeMap, {
|
|
32
|
+
m: (value: {
|
|
33
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
34
|
+
}) => {
|
|
35
|
+
margin: {
|
|
36
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
mt: (value: {
|
|
40
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
41
|
+
}) => {
|
|
42
|
+
marginTop: {
|
|
43
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
mr: (value: {
|
|
47
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
48
|
+
}) => {
|
|
49
|
+
marginRight: {
|
|
50
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
mb: (value: {
|
|
54
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
55
|
+
}) => {
|
|
56
|
+
marginBottom: {
|
|
57
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
ml: (value: {
|
|
61
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
62
|
+
}) => {
|
|
63
|
+
marginLeft: {
|
|
64
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
mx: (value: {
|
|
68
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
69
|
+
}) => {
|
|
70
|
+
marginLeft: {
|
|
71
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
72
|
+
};
|
|
73
|
+
marginRight: {
|
|
74
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
my: (value: {
|
|
78
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
79
|
+
}) => {
|
|
80
|
+
marginTop: {
|
|
81
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
82
|
+
};
|
|
83
|
+
marginBottom: {
|
|
84
|
+
readonly [Stitches.$$ScaleValue]: "space";
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
size: (value: {
|
|
88
|
+
readonly [Stitches.$$PropertyValue]: "width";
|
|
89
|
+
}) => {
|
|
90
|
+
width: {
|
|
91
|
+
readonly [Stitches.$$PropertyValue]: "width";
|
|
92
|
+
};
|
|
93
|
+
height: {
|
|
94
|
+
readonly [Stitches.$$PropertyValue]: "width";
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
subtleColor: (value: string) => {
|
|
98
|
+
color: string;
|
|
99
|
+
backgroundColor: string;
|
|
100
|
+
};
|
|
101
|
+
}>>;
|
|
102
|
+
declare type LinkVariants = Stitches.VariantProps<typeof StyledLink> & React.ComponentPropsWithoutRef<'a'>;
|
|
103
|
+
interface ButtonLinkProps extends LinkVariants {
|
|
104
|
+
isExternal: boolean;
|
|
105
|
+
css?: CSS;
|
|
106
|
+
}
|
|
107
|
+
export declare const Link: React.ForwardRefExoticComponent<ButtonLinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
108
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Link';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type * as Stitches from '@stitches/react';
|
|
3
3
|
interface LoadingBarProps {
|
|
4
4
|
progress: number;
|
|
@@ -7,6 +7,7 @@ interface LoadingBarProps {
|
|
|
7
7
|
showProgressOnly?: boolean;
|
|
8
8
|
show?: boolean;
|
|
9
9
|
isAuto?: boolean;
|
|
10
|
+
onCompleted?: React.ChangeEventHandler;
|
|
10
11
|
}
|
|
11
12
|
export default function LoadingBar(props: LoadingBarProps): JSX.Element;
|
|
12
13
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ITransform<T> {
|
|
2
|
+
name: string;
|
|
3
|
+
value: any;
|
|
4
|
+
rec: T;
|
|
5
|
+
key: any;
|
|
6
|
+
isDisabled: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare function useListOption<T>(list: T[], nameKey?: string | string[], valueKey?: string | string[], disableList?: string[], separator?: string | ((values: string | string[], item: any, index: any) => string)): ITransform<T>[];
|
|
9
|
+
export default useListOption;
|