pixelize-design-library 1.1.71 → 1.1.73

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.
@@ -55,7 +55,15 @@ var RenderOptions = function (_a) {
55
55
  react_1.default.createElement(react_2.Text, { color: "blue.500" }, loadingText)));
56
56
  }
57
57
  if (filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.length) {
58
- return (react_1.default.createElement(react_1.default.Fragment, null, filteredOptions.map(function (option) { return (react_1.default.createElement(react_2.Box, { key: option.id, px: 4, py: 2, cursor: "pointer", _hover: { backgroundColor: "blue.50" }, onClick: function () { return handleOptionClick(option); } }, option.label)); })));
58
+ return (react_1.default.createElement(react_1.default.Fragment, null, filteredOptions.map(function (option) {
59
+ var _a;
60
+ return (react_1.default.createElement(react_2.Box, { key: option.id, px: 4, py: 2, cursor: "pointer", _hover: { backgroundColor: "blue.50" }, onClick: function () { return handleOptionClick(option); }, display: "flex", alignItems: "center", gap: "0.5rem" },
61
+ react_1.default.createElement(react_2.Box, null,
62
+ react_1.default.createElement(react_2.Avatar, { size: "sm", src: option.profileUrl || undefined, name: (_a = option.email) === null || _a === void 0 ? void 0 : _a.charAt(0).toUpperCase() })),
63
+ react_1.default.createElement(react_2.Box, null,
64
+ react_1.default.createElement(react_2.Box, null, option.label),
65
+ react_1.default.createElement(react_2.Box, { fontSize: 12, color: "gray.400" }, option.email))));
66
+ })));
59
67
  }
60
68
  return (react_1.default.createElement(react_2.Text, { px: 4, py: 2, color: "gray.500" }, "No options found"));
61
69
  };
@@ -76,19 +84,19 @@ function SelectSearch(_a) {
76
84
  // });
77
85
  // }, [options, inputValue]);
78
86
  var filteredOptions = (0, react_1.useMemo)(function () {
79
- return options
80
- .filter(function (option) {
87
+ return options.filter(function (option) {
81
88
  // First filter out already selected options
82
89
  // const isNotSelected = !selectedOptions.some(
83
90
  // (selected) => selected.id === option.id
84
91
  // );
85
- var isNotSelected = isMultipleSelect ?
86
- !selectedOptions.some(function (selected) { return selected.id === option.id; }) :
87
- true;
92
+ var isNotSelected = isMultipleSelect
93
+ ? !selectedOptions.some(function (selected) { return selected.id === option.id; })
94
+ : true;
88
95
  // Then apply the search filter
89
- var optionLabel = option.label || '';
90
- var searchValue = inputValue || '';
91
- return isNotSelected && optionLabel.toLowerCase().includes(searchValue.toLowerCase());
96
+ var optionLabel = option.label || "";
97
+ var searchValue = inputValue || "";
98
+ return (isNotSelected &&
99
+ optionLabel.toLowerCase().includes(searchValue.toLowerCase()));
92
100
  });
93
101
  }, [options, inputValue, selectedOptions]);
94
102
  // const filteredOptions = useMemo(() => {
@@ -207,7 +215,7 @@ function SelectSearch(_a) {
207
215
  react_1.default.createElement(react_2.TagLabel, { width: "50px" }, option.label),
208
216
  react_1.default.createElement(react_2.TagCloseButton, { onClick: function () { return handleRemoveOption(option); } }))); }))),
209
217
  react_1.default.createElement(react_2.InputGroup, null,
210
- react_1.default.createElement(react_2.Input, { ref: inputRef, border: error ? "1px solid #DC143C" : "1px solid #e2e8f0", variant: "flushed", value: inputValue ? inputValue : "", onClick: function () { return setIsOpen(true); }, onChange: function (e) { return handleInputChange(e.target.value); }, placeholder: placeholder, onKeyDown: handleKeyDown, id: id, name: name, cursor: "pointer", borderColor: "gray.300", _hover: { borderColor: "blue.500" }, _focus: { borderColor: "blue.500" }, style: __assign(__assign({}, inputStyle), { backgroundColor: theme.colors.backgroundColor.main, fontWeight: 800, color: theme.colors.gray[700], padding: "0 0.5rem", fontSize: 15, letterSpacing: 0.7, border: error ? "1px solid #DC143C" : "1px solid #e2e8f0" }) }),
218
+ react_1.default.createElement(react_2.Input, { ref: inputRef, border: error ? "1px solid #DC143C" : "1px solid #e2e8f0", variant: "flushed", value: inputValue ? inputValue : "", onClick: function () { return setIsOpen(true); }, onFocus: function () { return setIsOpen(true); }, onChange: function (e) { return handleInputChange(e.target.value); }, placeholder: placeholder, onKeyDown: handleKeyDown, id: id, name: name, cursor: "pointer", borderColor: "gray.300", _hover: { borderColor: "blue.500" }, _focus: { borderColor: "blue.500" }, style: __assign(__assign({}, inputStyle), { backgroundColor: theme.colors.backgroundColor.main, fontWeight: 800, color: theme.colors.gray[700], padding: "0 0.5rem", fontSize: 15, letterSpacing: 0.7, border: error ? "1px solid #DC143C" : "1px solid #e2e8f0" }) }),
211
219
  rightIcon && (react_1.default.createElement(react_2.InputRightElement, { pointerEvents: "none", children: rightIcon, style: __assign({}, rightElementStyle) }))),
212
220
  isOpen && (react_1.default.createElement(react_2.Box, { ref: dropdownRef, position: "absolute", top: position === "below" ? "100%" : "auto", bottom: position === "above" ? "100%" : "auto", left: 0, right: 0, border: "1px solid", borderColor: "gray.300", borderRadius: "md", bg: "white", maxHeight: "150px", overflowY: "auto", zIndex: 10 },
213
221
  react_1.default.createElement(RenderOptions, { isOptionLoading: isOptionLoading, filteredOptions: filteredOptions, loadingText: loadingText, handleOptionClick: handleOptionClick })))));
@@ -27,4 +27,6 @@ export type SelectSearchProps = {
27
27
  export type selectOptions = {
28
28
  id: string;
29
29
  label: string;
30
+ email?: string;
31
+ profileUrl?: string;
30
32
  };
@@ -31,15 +31,36 @@ var SelectSearch_1 = __importDefault(require("../Components/SelectSearch/SelectS
31
31
  var lucide_react_1 = require("lucide-react");
32
32
  var SelectSearchs = function () {
33
33
  var _a = (0, react_1.useState)("Option 1"), selectSearchText = _a[0], setSelectSearchText = _a[1];
34
- var _b = (0, react_1.useState)({ id: "1", label: "Option 1" }), selectedOption = _b[0], setSelectedOption = _b[1];
34
+ var _b = (0, react_1.useState)({
35
+ id: "1",
36
+ label: "Option 1",
37
+ }), selectedOption = _b[0], setSelectedOption = _b[1];
35
38
  var _c = (0, react_1.useState)("Option 1"), multiSelectSearchText = _c[0], setMultiSelectSearchText = _c[1];
36
- var _d = (0, react_1.useState)({ id: "1", label: "Option 1" }), multiselectedOption = _d[0], setMultiSelectedOption = _d[1];
39
+ var _d = (0, react_1.useState)({
40
+ id: "1",
41
+ label: "Option 1",
42
+ }), multiselectedOption = _d[0], setMultiSelectedOption = _d[1];
37
43
  return (react_1.default.createElement("div", null,
38
44
  react_1.default.createElement("div", null,
39
45
  react_1.default.createElement(SelectSearch_1.default, { options: [
40
- { id: "1", label: "Option 1" },
41
- { id: "2", label: "select 2" },
42
- { id: "3", label: "clone 3", },
46
+ {
47
+ id: "1",
48
+ label: "Option 1",
49
+ profileUrl: "https://play-lh.googleusercontent.com/Fro4e_osoDhhrjgiZ_Y2C5FNXBMWvrb4rGpmkM1PDAcUPXeiAlPCq7NeaT4Q6NRUxRqo",
50
+ email: "kavinKumar0298@gggmail.com",
51
+ },
52
+ {
53
+ id: "2",
54
+ label: "select 2",
55
+ profileUrl: "https://play-lh.googleusercontent.com/Fro4e_osoDhhrjgiZ_Y2C5FNXBMWvrb4rGpmkM1PDAcUPXeiAlPCq7NeaT4Q6NRUxRqo",
56
+ email: "kavinKumar0298@gggmail.com",
57
+ },
58
+ {
59
+ id: "3",
60
+ label: "clone 3",
61
+ profileUrl: "https://play-lh.googleusercontent.com/Fro4e_osoDhhrjgiZ_Y2C5FNXBMWvrb4rGpmkM1PDAcUPXeiAlPCq7NeaT4Q6NRUxRqo",
62
+ email: "kavinKumar0298@gggmail.com",
63
+ },
43
64
  ], inputOnchange: function (value) {
44
65
  setSelectSearchText(value.toString());
45
66
  console.log(value);
@@ -57,7 +78,7 @@ var SelectSearchs = function () {
57
78
  react_1.default.createElement(SelectSearch_1.default, { options: [
58
79
  { id: "1", label: "Option 1" },
59
80
  { id: "2", label: "select 2" },
60
- { id: "3", label: "clone 3", },
81
+ { id: "3", label: "clone 3" },
61
82
  ], inputOnchange: function (value) {
62
83
  setMultiSelectSearchText(value.toString());
63
84
  // console.log(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelize-design-library",
3
- "version": "1.1.71",
3
+ "version": "1.1.73",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",