@willphan1712000/frontend 1.0.0 → 1.0.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/README.md CHANGED
@@ -1,14 +1,8 @@
1
1
  <img style="width: 15%" src="./will.png">
2
2
 
3
- ## Will-js is a Web development library made easy for Full-stack Development to develop, build, and push to production created by Will Phan
3
+ ## Will-js is a Frontend package developed by Will Phan that makes Fronted development easy with pre-built UI components
4
4
 
5
- ## It has pre-built classes that can be used for Web Development
6
-
7
- ## Key Benefits
8
-
9
- - Simple syntax that includes object-oriented programming techniques
10
- - Pre-built functionalities that handle difficult tasks in Full-stack Development
11
- - Provides flexibility, maintainability, and extensibility
5
+ ## UI Components
12
6
 
13
7
  ## Technology
14
8
 
@@ -16,27 +10,12 @@
16
10
 
17
11
  ## Installation
18
12
 
19
- ### Option 1: Clone this project to your local computer
20
-
21
- There is a file called W.ts that exports $$ function, this is the root function to use every other functions and classes.
22
- Simply import $$ to every ts files that you want to use Will-js
23
-
24
- ```ts
25
- import { $$ } from "path/of/your/project/Web-Development/W";
26
- ```
27
-
28
- ### Options 2: Install from npm
13
+ ### Install from npm
29
14
 
30
15
  Run this command in your terminal (note: this assumes you have installed Nodejs)
31
16
 
32
17
  ```npm
33
- npm i @willphan1712000/w
34
- ```
35
-
36
- Then import $$ function to every ts files that you want to use Will-js as an entry point where you can access every features of the library
37
-
38
- ```ts
39
- import { $$ } from "@willphan1712000/w";
18
+ npm i @willphan1712000/frontend
40
19
  ```
41
20
 
42
21
  ## How to use Will-js
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$4 {
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$4) => react_jsx_runtime.JSX.Element;
23
23
 
24
- interface Props$2 {
24
+ interface Props$3 {
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$3) => 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$2 {
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$2) => react_jsx_runtime.JSX.Element;
63
63
 
64
- interface Props {
64
+ interface Props$1 {
65
65
  value: string;
66
66
  onChange: (value: string) => void;
67
67
  width?: string;
@@ -73,6 +73,26 @@ 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$1) => react_jsx_runtime.JSX.Element;
77
+
78
+ type Options = {
79
+ label: string;
80
+ value: string;
81
+ }[];
82
+ interface Props {
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 - a chosen value
92
+ * @param onChange - a function to set a value
93
+ * @param width - specify the width of the component
94
+ * @returns
95
+ */
96
+ declare const MultiSelect: ({ options, value, onChange, width }: Props) => react_jsx_runtime.JSX.Element;
77
97
 
78
- export { ColorPickerSlider, DropdownSelect, OptionSlider, type Options$1 as Options, RangeSlider, type Options as SliderOptions };
98
+ export { 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$4 {
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$4) => react_jsx_runtime.JSX.Element;
23
23
 
24
- interface Props$2 {
24
+ interface Props$3 {
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$3) => 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$2 {
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$2) => react_jsx_runtime.JSX.Element;
63
63
 
64
- interface Props {
64
+ interface Props$1 {
65
65
  value: string;
66
66
  onChange: (value: string) => void;
67
67
  width?: string;
@@ -73,6 +73,26 @@ 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$1) => react_jsx_runtime.JSX.Element;
77
+
78
+ type Options = {
79
+ label: string;
80
+ value: string;
81
+ }[];
82
+ interface Props {
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 - a chosen value
92
+ * @param onChange - a function to set a value
93
+ * @param width - specify the width of the component
94
+ * @returns
95
+ */
96
+ declare const MultiSelect: ({ options, value, onChange, width }: Props) => react_jsx_runtime.JSX.Element;
77
97
 
78
- export { ColorPickerSlider, DropdownSelect, OptionSlider, type Options$1 as Options, RangeSlider, type Options as SliderOptions };
98
+ export { ColorPickerSlider, DropdownSelect, MultiSelect, OptionSlider, type Options$2 as Options, RangeSlider, type Options$1 as SliderOptions };