@willphan1712000/frontend 1.1.0 → 1.2.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 +8 -1
- package/dist/index.d.mts +1 -3
- package/dist/index.d.ts +1 -3
- package/dist/index.js +7 -6
- package/dist/index.mjs +7 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
<img style="width: 15%" src="./will.png">
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Frontend package developed by Will Phan that makes Fronted development easy with pre-built UI components
|
|
4
4
|
|
|
5
5
|
## UI Components
|
|
6
|
+
- DropdownSelect, type Options
|
|
7
|
+
- RangeSlider
|
|
8
|
+
- OptionSlider, type SliderOptions
|
|
9
|
+
- ColorPickerSlider
|
|
10
|
+
- MultiSelect
|
|
11
|
+
- Button
|
|
12
|
+
- Avatar
|
|
6
13
|
|
|
7
14
|
## Technology
|
|
8
15
|
|
package/dist/index.d.mts
CHANGED
|
@@ -9,17 +9,15 @@ interface Props$b {
|
|
|
9
9
|
options: Options$2;
|
|
10
10
|
value: string;
|
|
11
11
|
onChange: (value: string) => void;
|
|
12
|
-
width?: string;
|
|
13
12
|
}
|
|
14
13
|
/**
|
|
15
14
|
* Dropdown Select component, allowing users to select options from dropdown menu
|
|
16
15
|
* @param options - list of options, which is an array of object [{ label: string, value: string }]
|
|
17
16
|
* @param value - a chosen value
|
|
18
17
|
* @param onChange - a function to set a value
|
|
19
|
-
* @param width - specify the width of the component
|
|
20
18
|
* @returns
|
|
21
19
|
*/
|
|
22
|
-
declare const DropdownSelect: ({ options, value, onChange
|
|
20
|
+
declare const DropdownSelect: ({ options, value, onChange }: Props$b) => react_jsx_runtime.JSX.Element;
|
|
23
21
|
|
|
24
22
|
interface Props$a {
|
|
25
23
|
value: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -9,17 +9,15 @@ interface Props$b {
|
|
|
9
9
|
options: Options$2;
|
|
10
10
|
value: string;
|
|
11
11
|
onChange: (value: string) => void;
|
|
12
|
-
width?: string;
|
|
13
12
|
}
|
|
14
13
|
/**
|
|
15
14
|
* Dropdown Select component, allowing users to select options from dropdown menu
|
|
16
15
|
* @param options - list of options, which is an array of object [{ label: string, value: string }]
|
|
17
16
|
* @param value - a chosen value
|
|
18
17
|
* @param onChange - a function to set a value
|
|
19
|
-
* @param width - specify the width of the component
|
|
20
18
|
* @returns
|
|
21
19
|
*/
|
|
22
|
-
declare const DropdownSelect: ({ options, value, onChange
|
|
20
|
+
declare const DropdownSelect: ({ options, value, onChange }: Props$b) => react_jsx_runtime.JSX.Element;
|
|
23
21
|
|
|
24
22
|
interface Props$a {
|
|
25
23
|
value: string;
|
package/dist/index.js
CHANGED
|
@@ -422,6 +422,10 @@ function useMyContext() {
|
|
|
422
422
|
var import_react2 = require("react");
|
|
423
423
|
// src/components/DropdownSelect/styles.ts
|
|
424
424
|
var styles = {
|
|
425
|
+
container: {
|
|
426
|
+
width: "100%",
|
|
427
|
+
position: "relative"
|
|
428
|
+
},
|
|
425
429
|
select_box: {
|
|
426
430
|
borderRadius: "10px",
|
|
427
431
|
border: "solid 1px #dadada",
|
|
@@ -498,7 +502,7 @@ var Search = function(param) {
|
|
|
498
502
|
name: "search",
|
|
499
503
|
onChange: function(e) {
|
|
500
504
|
return onSearch(options.filter(function(ele) {
|
|
501
|
-
return ele.
|
|
505
|
+
return ele.label.toLowerCase().includes(e.target.value.toLowerCase());
|
|
502
506
|
}));
|
|
503
507
|
}
|
|
504
508
|
})
|
|
@@ -572,7 +576,7 @@ var Dropdown_default = Dropdown;
|
|
|
572
576
|
var import_io = require("react-icons/io");
|
|
573
577
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
574
578
|
var DropdownSelect = function(param) {
|
|
575
|
-
var options = param.options, value = param.value, onChange = param.onChange
|
|
579
|
+
var options = param.options, value = param.value, onChange = param.onChange;
|
|
576
580
|
var _ref = _sliced_to_array((0, import_react3.useState)(false), 2), open = _ref[0], setOpen = _ref[1];
|
|
577
581
|
var _ref1 = _sliced_to_array((0, import_react3.useState)(false), 2), isHoverClose = _ref1[0], setHoverClose = _ref1[1];
|
|
578
582
|
var selectRef = (0, import_react3.useRef)(null);
|
|
@@ -596,10 +600,7 @@ var DropdownSelect = function(param) {
|
|
|
596
600
|
setOpen: setOpen
|
|
597
601
|
},
|
|
598
602
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", {
|
|
599
|
-
style:
|
|
600
|
-
width: "".concat(width, "px"),
|
|
601
|
-
position: "relative"
|
|
602
|
-
},
|
|
603
|
+
style: styles_default.container,
|
|
603
604
|
ref: selectRef,
|
|
604
605
|
children: [
|
|
605
606
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", {
|
package/dist/index.mjs
CHANGED
|
@@ -306,6 +306,10 @@ function useMyContext() {
|
|
|
306
306
|
import { useEffect, useRef, useState } from "react";
|
|
307
307
|
// src/components/DropdownSelect/styles.ts
|
|
308
308
|
var styles = {
|
|
309
|
+
container: {
|
|
310
|
+
width: "100%",
|
|
311
|
+
position: "relative"
|
|
312
|
+
},
|
|
309
313
|
select_box: {
|
|
310
314
|
borderRadius: "10px",
|
|
311
315
|
border: "solid 1px #dadada",
|
|
@@ -382,7 +386,7 @@ var Search = function(param) {
|
|
|
382
386
|
name: "search",
|
|
383
387
|
onChange: function(e) {
|
|
384
388
|
return onSearch(options.filter(function(ele) {
|
|
385
|
-
return ele.
|
|
389
|
+
return ele.label.toLowerCase().includes(e.target.value.toLowerCase());
|
|
386
390
|
}));
|
|
387
391
|
}
|
|
388
392
|
})
|
|
@@ -456,7 +460,7 @@ var Dropdown_default = Dropdown;
|
|
|
456
460
|
import { IoMdClose } from "react-icons/io";
|
|
457
461
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
458
462
|
var DropdownSelect = function(param) {
|
|
459
|
-
var options = param.options, value = param.value, onChange = param.onChange
|
|
463
|
+
var options = param.options, value = param.value, onChange = param.onChange;
|
|
460
464
|
var _useState2 = _sliced_to_array(useState2(false), 2), open = _useState2[0], setOpen = _useState2[1];
|
|
461
465
|
var _useState21 = _sliced_to_array(useState2(false), 2), isHoverClose = _useState21[0], setHoverClose = _useState21[1];
|
|
462
466
|
var selectRef = useRef2(null);
|
|
@@ -480,10 +484,7 @@ var DropdownSelect = function(param) {
|
|
|
480
484
|
setOpen: setOpen
|
|
481
485
|
},
|
|
482
486
|
children: /* @__PURE__ */ jsxs2("div", {
|
|
483
|
-
style:
|
|
484
|
-
width: "".concat(width, "px"),
|
|
485
|
-
position: "relative"
|
|
486
|
-
},
|
|
487
|
+
style: styles_default.container,
|
|
487
488
|
ref: selectRef,
|
|
488
489
|
children: [
|
|
489
490
|
/* @__PURE__ */ jsxs2("div", {
|