@willphan1712000/frontend 1.0.1 → 1.0.3

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 CHANGED
@@ -26,6 +26,25 @@ npm i @willphan1712000/frontend
26
26
 
27
27
  If you found an issue or would like to submit an improvement to this project, please submit an issue using the issues tab above. If you would like to submit a Pull Request with a fix, reference the issue you created
28
28
 
29
- ## Happy with this project
29
+ ## Happy with this project and want to make a contribution
30
30
 
31
31
  You can connect to me at [Facebook](https://www.facebook.com/phanthanhnha123200/) [Instagram](https://www.instagram.com/phanthanhnha_0117/)
32
+
33
+ You can make contributions to this project by adding new UI ideas that stand out so we can compete ones generated by AI.
34
+
35
+ To test a package, run
36
+ ```npm
37
+ npm link
38
+ ```
39
+ On the other frontend environment, run
40
+ ```npm
41
+ npm link @willphan1712000/frontend
42
+ ```
43
+
44
+ > [!NOTE]
45
+ > if you encounter the problem "3. You might have more than one copy of React in the same app?"
46
+ > it means your application has loaded two different React instances. This breaks React Hooks, which rely on a single, shared state.
47
+ > Run this to connect to react in your testing project
48
+ ```npm
49
+ npm link <path_to_your_testing_project>/node_modules/react
50
+ ```
package/dist/index.d.mts CHANGED
@@ -1,12 +1,12 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
3
 
4
- type Options$1 = {
4
+ type Options$2 = {
5
5
  label: string;
6
6
  value: string;
7
7
  }[];
8
- interface Props$3 {
9
- options: Options$1;
8
+ interface Props$5 {
9
+ options: Options$2;
10
10
  value: string;
11
11
  onChange: (value: string) => void;
12
12
  width?: string;
@@ -19,9 +19,9 @@ interface Props$3 {
19
19
  * @param width - specify the width of the component
20
20
  * @returns
21
21
  */
22
- declare const DropdownSelect: ({ options, value, onChange, width }: Props$3) => react_jsx_runtime.JSX.Element;
22
+ declare const DropdownSelect: ({ options, value, onChange, width }: Props$5) => react_jsx_runtime.JSX.Element;
23
23
 
24
- interface Props$2 {
24
+ interface Props$4 {
25
25
  value: string;
26
26
  onChange: (value: string) => void;
27
27
  min?: string;
@@ -39,17 +39,17 @@ interface Props$2 {
39
39
  * @param onChange - to set a value
40
40
  * @returns
41
41
  */
42
- declare const RangeSlider: ({ min, max, color, width, value, onChange }: Props$2) => react_jsx_runtime.JSX.Element;
42
+ declare const RangeSlider: ({ min, max, color, width, value, onChange }: Props$4) => react_jsx_runtime.JSX.Element;
43
43
 
44
- type Options = {
44
+ type Options$1 = {
45
45
  label: ReactNode;
46
46
  value: string;
47
47
  }[];
48
- interface Props$1 {
48
+ interface Props$3 {
49
49
  value: string;
50
50
  onChange: (value: string) => void;
51
51
  width?: string;
52
- options: Options;
52
+ options: Options$1;
53
53
  color?: string;
54
54
  }
55
55
  /**
@@ -59,9 +59,9 @@ interface Props$1 {
59
59
  * @options - list of options, format [{ label: React Node Syntax, value: string }]
60
60
  * @returns
61
61
  */
62
- declare const OptionSlider: ({ value, onChange, width, options, color }: Props$1) => react_jsx_runtime.JSX.Element;
62
+ declare const OptionSlider: ({ value, onChange, width, options, color }: Props$3) => react_jsx_runtime.JSX.Element;
63
63
 
64
- interface Props {
64
+ interface Props$2 {
65
65
  value: string;
66
66
  onChange: (value: string) => void;
67
67
  width?: string;
@@ -73,6 +73,49 @@ interface Props {
73
73
  * @param width
74
74
  * @returns
75
75
  */
76
- declare const ColorPickerSlider: ({ value, onChange, width }: Props) => react_jsx_runtime.JSX.Element;
76
+ declare const ColorPickerSlider: ({ value, onChange, width }: Props$2) => react_jsx_runtime.JSX.Element;
77
+
78
+ type Options = {
79
+ label: string;
80
+ value: string;
81
+ }[];
82
+ interface Props$1 {
83
+ options: Options;
84
+ value: string[];
85
+ onChange: React.Dispatch<React.SetStateAction<string[]>>;
86
+ width?: string;
87
+ }
88
+ /**
89
+ * MultiSelect component, allowing users to select multiple options from dropdown menu with search
90
+ * @param options - list of options, which is an array of object [{ label: string, value: string }]
91
+ * @param value - an array of chosen values
92
+ * @param onChange - a function to set an array of values
93
+ * @param width - specify the width of the component
94
+ * @returns
95
+ */
96
+ declare const MultiSelect: ({ options, value, onChange, width }: Props$1) => react_jsx_runtime.JSX.Element;
97
+
98
+ interface Props {
99
+ buttonType: "gradient" | "solid" | "normal";
100
+ }
101
+ interface Data {
102
+ content: string;
103
+ main?: string;
104
+ text?: string;
105
+ first?: string;
106
+ second?: string;
107
+ isLoading?: boolean;
108
+ }
109
+ /**
110
+ *
111
+ * @param buttonType type of button, default is normal button
112
+ * @param content string content inside the button
113
+ * @param main main color of the button
114
+ * @param text text color
115
+ * @param first first color when using gradient button or solid button, default is #3e8fbc
116
+ * @param second second color when using gradient button, default is #aa6392
117
+ * @returns button UI component
118
+ */
119
+ declare const Button: ({ buttonType, content, main, first, second, text, isLoading, ...props }: Props & Data & React.ComponentProps<"button">) => react_jsx_runtime.JSX.Element;
77
120
 
78
- export { ColorPickerSlider, DropdownSelect, OptionSlider, type Options$1 as Options, RangeSlider, type Options as SliderOptions };
121
+ export { Button, ColorPickerSlider, DropdownSelect, MultiSelect, OptionSlider, type Options$2 as Options, RangeSlider, type Options$1 as SliderOptions };
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
3
 
4
- type Options$1 = {
4
+ type Options$2 = {
5
5
  label: string;
6
6
  value: string;
7
7
  }[];
8
- interface Props$3 {
9
- options: Options$1;
8
+ interface Props$5 {
9
+ options: Options$2;
10
10
  value: string;
11
11
  onChange: (value: string) => void;
12
12
  width?: string;
@@ -19,9 +19,9 @@ interface Props$3 {
19
19
  * @param width - specify the width of the component
20
20
  * @returns
21
21
  */
22
- declare const DropdownSelect: ({ options, value, onChange, width }: Props$3) => react_jsx_runtime.JSX.Element;
22
+ declare const DropdownSelect: ({ options, value, onChange, width }: Props$5) => react_jsx_runtime.JSX.Element;
23
23
 
24
- interface Props$2 {
24
+ interface Props$4 {
25
25
  value: string;
26
26
  onChange: (value: string) => void;
27
27
  min?: string;
@@ -39,17 +39,17 @@ interface Props$2 {
39
39
  * @param onChange - to set a value
40
40
  * @returns
41
41
  */
42
- declare const RangeSlider: ({ min, max, color, width, value, onChange }: Props$2) => react_jsx_runtime.JSX.Element;
42
+ declare const RangeSlider: ({ min, max, color, width, value, onChange }: Props$4) => react_jsx_runtime.JSX.Element;
43
43
 
44
- type Options = {
44
+ type Options$1 = {
45
45
  label: ReactNode;
46
46
  value: string;
47
47
  }[];
48
- interface Props$1 {
48
+ interface Props$3 {
49
49
  value: string;
50
50
  onChange: (value: string) => void;
51
51
  width?: string;
52
- options: Options;
52
+ options: Options$1;
53
53
  color?: string;
54
54
  }
55
55
  /**
@@ -59,9 +59,9 @@ interface Props$1 {
59
59
  * @options - list of options, format [{ label: React Node Syntax, value: string }]
60
60
  * @returns
61
61
  */
62
- declare const OptionSlider: ({ value, onChange, width, options, color }: Props$1) => react_jsx_runtime.JSX.Element;
62
+ declare const OptionSlider: ({ value, onChange, width, options, color }: Props$3) => react_jsx_runtime.JSX.Element;
63
63
 
64
- interface Props {
64
+ interface Props$2 {
65
65
  value: string;
66
66
  onChange: (value: string) => void;
67
67
  width?: string;
@@ -73,6 +73,49 @@ interface Props {
73
73
  * @param width
74
74
  * @returns
75
75
  */
76
- declare const ColorPickerSlider: ({ value, onChange, width }: Props) => react_jsx_runtime.JSX.Element;
76
+ declare const ColorPickerSlider: ({ value, onChange, width }: Props$2) => react_jsx_runtime.JSX.Element;
77
+
78
+ type Options = {
79
+ label: string;
80
+ value: string;
81
+ }[];
82
+ interface Props$1 {
83
+ options: Options;
84
+ value: string[];
85
+ onChange: React.Dispatch<React.SetStateAction<string[]>>;
86
+ width?: string;
87
+ }
88
+ /**
89
+ * MultiSelect component, allowing users to select multiple options from dropdown menu with search
90
+ * @param options - list of options, which is an array of object [{ label: string, value: string }]
91
+ * @param value - an array of chosen values
92
+ * @param onChange - a function to set an array of values
93
+ * @param width - specify the width of the component
94
+ * @returns
95
+ */
96
+ declare const MultiSelect: ({ options, value, onChange, width }: Props$1) => react_jsx_runtime.JSX.Element;
97
+
98
+ interface Props {
99
+ buttonType: "gradient" | "solid" | "normal";
100
+ }
101
+ interface Data {
102
+ content: string;
103
+ main?: string;
104
+ text?: string;
105
+ first?: string;
106
+ second?: string;
107
+ isLoading?: boolean;
108
+ }
109
+ /**
110
+ *
111
+ * @param buttonType type of button, default is normal button
112
+ * @param content string content inside the button
113
+ * @param main main color of the button
114
+ * @param text text color
115
+ * @param first first color when using gradient button or solid button, default is #3e8fbc
116
+ * @param second second color when using gradient button, default is #aa6392
117
+ * @returns button UI component
118
+ */
119
+ declare const Button: ({ buttonType, content, main, first, second, text, isLoading, ...props }: Props & Data & React.ComponentProps<"button">) => react_jsx_runtime.JSX.Element;
77
120
 
78
- export { ColorPickerSlider, DropdownSelect, OptionSlider, type Options$1 as Options, RangeSlider, type Options as SliderOptions };
121
+ export { Button, ColorPickerSlider, DropdownSelect, MultiSelect, OptionSlider, type Options$2 as Options, RangeSlider, type Options$1 as SliderOptions };