@xaypay/tui 0.0.3 → 0.0.5

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.
Files changed (72) hide show
  1. package/.idea/misc.xml +6 -0
  2. package/.idea/modules.xml +8 -0
  3. package/.idea/tui.iml +12 -0
  4. package/.idea/vcs.xml +6 -0
  5. package/.idea/workspace.xml +1755 -0
  6. package/.storybook/main.js +1 -1
  7. package/dist/index.es.js +866 -15
  8. package/dist/index.js +903 -14
  9. package/package.json +9 -4
  10. package/src/assets/heart-filled.svg +17 -0
  11. package/src/assets/heart-outline.svg +14 -0
  12. package/src/assets/like-filled.svg +21 -0
  13. package/src/assets/like-outline.svg +21 -0
  14. package/src/assets/star-filled.svg +21 -0
  15. package/src/assets/star-outline.svg +5 -0
  16. package/src/assets_old/icons/Read Me.txt +7 -0
  17. package/src/assets_old/icons/demo-files/demo.css +152 -0
  18. package/src/assets_old/icons/demo-files/demo.js +30 -0
  19. package/src/assets_old/icons/demo.html +150 -0
  20. package/src/assets_old/icons/fonts/icomoon.eot +0 -0
  21. package/src/assets_old/icons/fonts/icomoon.svg +18 -0
  22. package/src/assets_old/icons/fonts/icomoon.ttf +0 -0
  23. package/src/assets_old/icons/fonts/icomoon.woff +0 -0
  24. package/src/assets_old/icons/selection.json +1 -0
  25. package/src/assets_old/icons/style.css +51 -0
  26. package/src/components/autocomplate/autocomplate.module.css +74 -0
  27. package/src/components/autocomplate/autocomplate.stories.js +11 -0
  28. package/src/components/autocomplate/index.js +117 -0
  29. package/src/components/button/button.module.css +63 -1
  30. package/src/components/button/button.stories.js +10 -10
  31. package/src/components/button/index.js +12 -9
  32. package/src/components/captcha/blue.png +0 -0
  33. package/src/components/captcha/captcha.module.css +66 -0
  34. package/src/components/captcha/captcha.stories.js +17 -0
  35. package/src/components/captcha/green.png +0 -0
  36. package/src/components/captcha/index.js +63 -0
  37. package/src/components/captcha/red.png +0 -0
  38. package/src/components/checkbox/checkbox.module.css +57 -0
  39. package/src/components/checkbox/checkbox.stories.js +10 -0
  40. package/src/components/checkbox/index.js +87 -0
  41. package/src/components/icon/HeartFilled.js +26 -0
  42. package/src/components/icon/HeartOutline.js +25 -0
  43. package/src/components/icon/Icon.js +6 -0
  44. package/src/components/icon/LikeFilled.js +24 -0
  45. package/src/components/icon/LikeOutline.js +24 -0
  46. package/src/components/icon/StarFilled.js +24 -0
  47. package/src/components/icon/StarOutline.js +24 -0
  48. package/src/components/icon/index.js +6 -0
  49. package/src/components/input/index.js +90 -0
  50. package/src/components/input/input.module.css +89 -0
  51. package/src/components/input/input.stories.js +38 -0
  52. package/src/components/modal/index.js +24 -0
  53. package/src/components/modal/modal.module.css +35 -0
  54. package/src/components/modal/modal.stories.js +29 -0
  55. package/src/components/multiselect/index.js +76 -0
  56. package/src/components/multiselect/multiselect.module.css +137 -0
  57. package/src/components/multiselect/multiselect.stories.js +19 -0
  58. package/src/components/pagination/index.js +119 -0
  59. package/src/components/pagination/pagination.module.css +80 -0
  60. package/src/components/pagination/pagination.stories.js +371 -0
  61. package/src/components/pagination/paginationRange.js +70 -0
  62. package/src/components/radio/index.js +68 -0
  63. package/src/components/radio/radio.module.css +59 -0
  64. package/src/components/radio/radio.stories.js +10 -0
  65. package/src/components/select/index.js +130 -0
  66. package/src/components/select/select.module.css +100 -0
  67. package/src/components/select/select.stories.js +21 -0
  68. package/src/components/typography/index.js +53 -0
  69. package/src/components/typography/typography.module.css +60 -0
  70. package/src/components/typography/typography.stories.js +29 -0
  71. package/src/index.js +10 -1
  72. package/storybook-static/favicon.ico +0 -0
@@ -0,0 +1,26 @@
1
+ import * as React from "react";
2
+
3
+
4
+ const SvgHeartFilled = ({ title, titleId, ...props }) => (
5
+ <svg
6
+ xmlns="http://www.w3.org/2000/svg"
7
+ width="1em"
8
+ height="1em"
9
+ viewBox="0 0 511.626 511.627"
10
+ style={{
11
+ enableBackground: "new 0 0 511.626 511.627",
12
+ }}
13
+ xmlSpace="preserve"
14
+ role="img"
15
+ aria-labelledby={titleId}
16
+ {...props}
17
+ >
18
+ {title ? <title id={titleId}>{title}</title> : null}
19
+ <path
20
+ d="M475.366 71.951c-24.175-23.606-57.575-35.404-100.215-35.404-11.8 0-23.843 2.046-36.117 6.136-12.279 4.093-23.702 9.615-34.256 16.562-10.568 6.945-19.65 13.467-27.269 19.556a263.828 263.828 0 0 0-21.696 19.414 264.184 264.184 0 0 0-21.698-19.414c-7.616-6.089-16.702-12.607-27.268-19.556-10.564-6.95-21.985-12.468-34.261-16.562-12.275-4.089-24.316-6.136-36.116-6.136-42.637 0-76.039 11.801-100.211 35.404C12.087 95.552 0 128.288 0 170.162c0 12.753 2.24 25.889 6.711 39.398 4.471 13.514 9.566 25.031 15.275 34.546 5.708 9.514 12.181 18.796 19.414 27.837 7.233 9.042 12.519 15.27 15.846 18.699 3.33 3.422 5.948 5.899 7.851 7.419L243.25 469.937c3.427 3.429 7.614 5.144 12.562 5.144s9.138-1.715 12.563-5.137l177.87-171.307c43.588-43.583 65.38-86.41 65.38-128.475.001-41.874-12.088-74.61-36.259-98.211z"
21
+ fill="currentColor"
22
+ />
23
+ </svg>
24
+ );
25
+
26
+ export default SvgHeartFilled;
@@ -0,0 +1,25 @@
1
+ import * as React from "react";
2
+
3
+ const SvgHeartOutline = ({ title, titleId, ...props }) => (
4
+ <svg
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ viewBox="0 0 471.701 471.701"
7
+ style={{
8
+ enableBackground: "new 0 0 471.701 471.701",
9
+ }}
10
+ xmlSpace="preserve"
11
+ width="1em"
12
+ height="1em"
13
+ role="img"
14
+ aria-labelledby={titleId}
15
+ {...props}
16
+ >
17
+ {title ? <title id={titleId}>{title}</title> : null}
18
+ <path
19
+ d="M433.601 67.001c-24.7-24.7-57.4-38.2-92.3-38.2s-67.7 13.6-92.4 38.3l-12.9 12.9-13.1-13.1c-24.7-24.7-57.6-38.4-92.5-38.4-34.8 0-67.6 13.6-92.2 38.2-24.7 24.7-38.3 57.5-38.2 92.4 0 34.9 13.7 67.6 38.4 92.3l187.8 187.8c2.6 2.6 6.1 4 9.5 4 3.4 0 6.9-1.3 9.5-3.9l188.2-187.5c24.7-24.7 38.3-57.5 38.3-92.4.1-34.9-13.4-67.7-38.1-92.4zm-19.2 165.7-178.7 178-178.3-178.3c-19.6-19.6-30.4-45.6-30.4-73.3s10.7-53.7 30.3-73.2c19.5-19.5 45.5-30.3 73.1-30.3 27.7 0 53.8 10.8 73.4 30.4l22.6 22.6c5.3 5.3 13.8 5.3 19.1 0l22.4-22.4c19.6-19.6 45.7-30.4 73.3-30.4 27.6 0 53.6 10.8 73.2 30.3 19.6 19.6 30.3 45.6 30.3 73.3.1 27.7-10.7 53.7-30.3 73.3z"
20
+ fill="currentColor"
21
+ />
22
+ </svg>
23
+ );
24
+
25
+ export default SvgHeartOutline;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Created by aleksanyan.tigran on 10/7/2022.
3
+ */
4
+ import style from '../../assets_old/icons/style.css'
5
+ const Icon = ( props) => <i className={style[props.className]} />
6
+ export default Icon;
@@ -0,0 +1,24 @@
1
+ import * as React from "react";
2
+
3
+ const SvgLikeFilled = ({ title, titleId, ...props }) => (
4
+ <svg
5
+ width="1em"
6
+ height="1em"
7
+ viewBox="0 0 23 20"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ role="img"
10
+ aria-labelledby={titleId}
11
+ {...props}
12
+ >
13
+ {title ? <title id={titleId}>{title}</title> : null}
14
+ <g fill="none" fillRule="evenodd">
15
+ <path opacity={0.87} d="M-1-1h24v24H-1z" />
16
+ <path
17
+ d="M12.12 1.06 6.58 6.6c-.37.37-.58.88-.58 1.41V18c0 1.1.9 2 2 2h9c.8 0 1.52-.48 1.84-1.21l3.26-7.61C22.94 9.2 21.49 7 19.34 7h-5.65l.95-4.58c.1-.5-.05-1.01-.41-1.37-.59-.58-1.53-.58-2.11.01ZM2 20c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2s-2 .9-2 2v8c0 1.1.9 2 2 2Z"
18
+ fill="currentColor"
19
+ />
20
+ </g>
21
+ </svg>
22
+ );
23
+
24
+ export default SvgLikeFilled;
@@ -0,0 +1,24 @@
1
+ import * as React from "react";
2
+
3
+ const SvgLikeOutline = ({ title, titleId, ...props }) => (
4
+ <svg
5
+ width="1em"
6
+ height="1em"
7
+ viewBox="0 0 22 20"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ role="img"
10
+ aria-labelledby={titleId}
11
+ {...props}
12
+ >
13
+ {title ? <title id={titleId}>{title}</title> : null}
14
+ <g fill="none" fillRule="evenodd">
15
+ <path opacity={0.87} d="M-1-1h24v24H-1z" />
16
+ <path
17
+ d="M20 7h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L13.17 0 6.59 6.59C6.22 6.95 6 7.45 6 8v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73V9c0-1.1-.9-2-2-2Zm0 4-3 7H8V8l4.34-4.34L11.23 9H20v2ZM0 8h4v12H0V8Z"
18
+ fill="currentColor"
19
+ />
20
+ </g>
21
+ </svg>
22
+ );
23
+
24
+ export default SvgLikeOutline;
@@ -0,0 +1,24 @@
1
+ import * as React from "react";
2
+
3
+ const SvgStarFilled = ({ title, titleId, ...props }) => (
4
+ <svg
5
+ width="1em"
6
+ height="1em"
7
+ viewBox="0 0 18 17"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ role="img"
10
+ aria-labelledby={titleId}
11
+ {...props}
12
+ >
13
+ {title ? <title id={titleId}>{title}</title> : null}
14
+ <g fill="none" fillRule="evenodd">
15
+ <path d="M-3-3h24v24H-3z" />
16
+ <path
17
+ d="m9 14.27 4.15 2.51c.76.46 1.69-.22 1.49-1.08l-1.1-4.72 3.67-3.18c.67-.58.31-1.68-.57-1.75l-4.83-.41-1.89-4.46c-.34-.81-1.5-.81-1.84 0L6.19 5.63l-4.83.41C.48 6.11.12 7.21.79 7.79l3.67 3.18-1.1 4.72c-.2.86.73 1.54 1.49 1.08L9 14.27Z"
18
+ fill="currentColor"
19
+ />
20
+ </g>
21
+ </svg>
22
+ );
23
+
24
+ export default SvgStarFilled;
@@ -0,0 +1,24 @@
1
+ import * as React from "react";
2
+
3
+ const SvgStarOutline = ({ title, titleId, ...props }) => (
4
+ <svg
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ viewBox="0 0 24 24"
7
+ fill="none"
8
+ stroke="currentColor"
9
+ strokeWidth={2}
10
+ strokeLinecap="round"
11
+ strokeLinejoin="round"
12
+ className="star-outline_svg__feather star-outline_svg__feather-star"
13
+ width="1em"
14
+ height="1em"
15
+ role="img"
16
+ aria-labelledby={titleId}
17
+ {...props}
18
+ >
19
+ {title ? <title id={titleId}>{title}</title> : null}
20
+ <path d="m12 2 3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" />
21
+ </svg>
22
+ );
23
+
24
+ export default SvgStarOutline;
@@ -0,0 +1,6 @@
1
+ export { default as HeartFilled } from "./HeartFilled";
2
+ export { default as HeartOutline } from "./HeartOutline";
3
+ export { default as LikeFilled } from "./LikeFilled";
4
+ export { default as LikeOutline } from "./LikeOutline";
5
+ export { default as StarFilled } from "./StarFilled";
6
+ export { default as StarOutline } from "./StarOutline";
@@ -0,0 +1,90 @@
1
+ import React, { useState } from "react";
2
+ import PropTypes from "prop-types";
3
+ import classnames from "classnames";
4
+ import styles from "./input.module.css";
5
+
6
+ export const InputTypes = {
7
+ TEXT: "text",
8
+ PASSWORD: "password",
9
+ EMAIL: "email",
10
+ NUMBER: "number",
11
+ TEL: "tel",
12
+ };
13
+
14
+ export const InputSizes = {
15
+ SMALL: "size-small",
16
+ MEDIUM: "size-medium",
17
+ LARGE: "size-large",
18
+ };
19
+
20
+ export const Input = ({
21
+ size,
22
+ color,
23
+ className,
24
+ label,
25
+ regexp,
26
+ regexpError,
27
+ errorMesage,
28
+ required,
29
+ disabled,
30
+ type,
31
+ ...props
32
+ }) => {
33
+ const [inputValue, setInputValue] = useState("");
34
+ const handleChange = (event) => {
35
+ setInputValue(event.target.value);
36
+ };
37
+
38
+ let eMessage = "";
39
+ if (errorMesage) {
40
+ eMessage = errorMesage;
41
+ } else if (regexp) {
42
+ const regex = new RegExp(regexp);
43
+ eMessage = regex.test(inputValue) ? "" : regexpError;
44
+ }
45
+
46
+ const classProps = classnames(styles.input, styles[size], eMessage != '' ? styles['error-message'] :"" , className);
47
+ return (
48
+ <div className={styles['input-wrap']}>
49
+ {label ? <label className={styles.labelInput}>{label}</label> : ""}
50
+ <input
51
+ {...props}
52
+ type={type}
53
+ className={classProps}
54
+ style={color && { color }}
55
+ disabled={disabled ? disabled : ""}
56
+ onChange={handleChange}
57
+ value={inputValue}
58
+ />
59
+ {eMessage ? (
60
+ <span className={styles.inputErrorMessages}>{eMessage}</span>
61
+ ) : (
62
+ ""
63
+ )}
64
+ </div>
65
+ );
66
+ };
67
+
68
+ Input.propTypes = {
69
+ type: PropTypes.oneOf(Object.values(InputTypes)),
70
+ size: PropTypes.oneOf(Object.values(InputSizes)),
71
+ color: PropTypes.string,
72
+ className: PropTypes.string,
73
+ onChange: PropTypes.func,
74
+ required: PropTypes.bool,
75
+ errorMesage: PropTypes.string,
76
+ regexp: PropTypes.string,
77
+ regexpError: PropTypes.string,
78
+ label: PropTypes.string.isRequired,
79
+ disabled: PropTypes.bool,
80
+ };
81
+
82
+ Input.defaultProps = {
83
+ label: "",
84
+ color: null,
85
+ size: InputSizes.MEDIUM,
86
+ onChange: undefined,
87
+ required: true,
88
+ errorMesage: "",
89
+ type: "text",
90
+ };
@@ -0,0 +1,89 @@
1
+ /*.inputs{*/
2
+ /*display: flex;*/
3
+ /*flex-direction: column;*/
4
+ /*}*/
5
+ /*.inp {*/
6
+ /*border-radius: 4px;*/
7
+ /*box-sizing: border-box;*/
8
+ /*}*/
9
+
10
+ /*.inputErrorMessages {*/
11
+ /*color: red;*/
12
+ /*font-size: 10px;*/
13
+ /*}*/
14
+
15
+ .input-wrap {
16
+ position: relative;
17
+ }
18
+ .input {
19
+ text-transform: capitalize;
20
+ font-size: 16px;
21
+ line-height: 20px;
22
+ border-radius: 6px;
23
+ color: rgba(60, 57, 62, 1);
24
+ box-shadow: 0 0 0 2px rgba(209, 209, 209, 1) inset;
25
+ border: none;
26
+ outline: none;
27
+ box-sizing: border-box;
28
+ transition: background-color 240ms, color 240ms;
29
+ overflow: hidden;
30
+ cursor: pointer;
31
+ }
32
+
33
+ .input.full-size {
34
+ width: 100%;
35
+ }
36
+
37
+ .input.content-size {
38
+ width: auto;
39
+ }
40
+
41
+ .input.size-medium {
42
+ min-height: 46px;
43
+ padding: 12px 15px;
44
+ }
45
+
46
+ .input.with-icon {
47
+
48
+ }
49
+
50
+ .input:hover {
51
+ box-shadow: 0 0 0 2px rgba(60, 57, 62, 1) inset;
52
+ }
53
+
54
+ .input:active {
55
+ box-shadow: 0 0 0 2px rgba(0, 35, 106, 1) inset;
56
+ }
57
+
58
+ .inputErrorMessages {
59
+ position: absolute;
60
+ font-size: 14px;
61
+ line-height: 19px;
62
+ bottom: 0;
63
+ left: 0;
64
+ transform: scale3d(0,0,0);
65
+ color: rgba(238, 0, 0, 1);
66
+ animation: error-message-show 240ms forwards;
67
+ z-index: 1;
68
+ }
69
+ .labelInput{
70
+ color: black;
71
+ }
72
+ .input.state-disabled {
73
+ background-color: #FBFBFB;
74
+ pointer-events: none;
75
+ }
76
+
77
+ .input.error-message {
78
+ box-shadow: 0 0 0 2px rgba(238, 0, 0, 1) inset;
79
+ }
80
+
81
+ /* .input-error-message-text {
82
+
83
+ } */
84
+ @keyframes error-message-show {
85
+ 100% {
86
+ bottom: -20px;
87
+ transform: scale3d(1,1,1);
88
+ }
89
+ }
@@ -0,0 +1,38 @@
1
+ import React from "react";
2
+ import { Input, InputTypes, InputSizes } from "./index";
3
+
4
+ export default {
5
+ component: Input,
6
+ title: "Components/Input",
7
+ };
8
+
9
+ const Template = (args) => <Input {...args} />;
10
+
11
+ export const Default = Template.bind({});
12
+ Default.args = {
13
+ size: InputSizes.MEDIUM,
14
+ type: InputTypes.TEXT,
15
+ };
16
+
17
+ export const PASSWORD = Template.bind({});
18
+ PASSWORD.args = {
19
+ type: InputTypes.PASSWORD,
20
+ regexp: "('A'-'Z')",
21
+ regexpError: "Գաղտնաբառը պետք է պարունակի մեկ մեծատառ",
22
+ };
23
+
24
+ export const EMAIL = Template.bind({});
25
+ EMAIL.args = {
26
+ type: InputTypes.EMAIL,
27
+ errorMesage: "Գոյություն չունեցող էլ. հասցե",
28
+ };
29
+
30
+ export const TEL = Template.bind({});
31
+ TEL.args = {
32
+ type: InputTypes.TEL,
33
+ };
34
+
35
+ export const NUMBER = Template.bind({});
36
+ NUMBER.args = {
37
+ type: InputTypes.NUMBER,
38
+ };
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ import PropTypes from "prop-types";
3
+ import classnames from "classnames";
4
+ import styles from "./modal.module.css";
5
+
6
+ export const Modal = ({ setShow, headerText, className }) => {
7
+ const classProps = classnames(styles.modal, className);
8
+ return (
9
+ <div className={classProps}>
10
+ <div className={styles["modal_header"]}>
11
+ <h5 className={styles.heading}>{headerText}</h5>
12
+ </div>
13
+ <button className={styles["close_btn"]} onClick={() => setShow(false)}>
14
+ X
15
+ </button>
16
+ </div>
17
+ );
18
+ };
19
+
20
+ Modal.propTypes = {
21
+ setShow: PropTypes.func,
22
+ headerText: PropTypes.string,
23
+ className: PropTypes.string,
24
+ };
@@ -0,0 +1,35 @@
1
+ .modal {
2
+ width: 250px;
3
+ height: 170px;
4
+ background: white;
5
+ color: white;
6
+ z-index: 10;
7
+ border-radius: 16px;
8
+ box-shadow: 0 5px 20px 0 rgba(0, 0, 0, 0.04);
9
+ position: relative
10
+ }
11
+
12
+ .modal_header {
13
+ height: 50px;
14
+ background: white;
15
+ }
16
+
17
+ .heading {
18
+ color: #2c3e50;
19
+ font-weight: 500;
20
+ font-size: 18px;
21
+ text-align: center;
22
+ }
23
+
24
+ .close_btn {
25
+ cursor: pointer;
26
+ font-weight: 500;
27
+ padding: 4px 8px;
28
+ border: none;
29
+ font-size: 18px;
30
+ color: #2c3e50;
31
+ background: white;
32
+ position: absolute;
33
+ right: 0;
34
+ top: 0;
35
+ }
@@ -0,0 +1,29 @@
1
+ import React, {useState} from "react";
2
+ import { Modal } from "./index";
3
+
4
+ export default {
5
+ component: Modal,
6
+ title: "Components/Modal",
7
+ };
8
+
9
+ const Template = ({ headerText, className }) => {
10
+ const [show, setShow] = useState(false);
11
+ const handleClick = () => {
12
+ setShow(true);
13
+ };
14
+ return (
15
+ <>
16
+ <button onClick={handleClick}>Click</button>
17
+ {show && (
18
+ <Modal setShow={setShow} headerText={headerText} className={className} />
19
+ )}
20
+ </>
21
+ );
22
+ };
23
+
24
+ export const Default = Template.bind({});
25
+
26
+ Default.args = {
27
+ headerText: "Hi...",
28
+ className: "Modal"
29
+ };
@@ -0,0 +1,76 @@
1
+ import React, { useState } from "react";
2
+ import PropTypes from "prop-types";
3
+ import styles from "./multiselect.module.css";
4
+ import Icon from '../icon/Icon'
5
+
6
+ export const Multiselect = ({
7
+ className,
8
+ label,
9
+ jsonOptionsData,
10
+ jsonSelectedOptionsData,
11
+ onchange,
12
+ value
13
+ }) => {
14
+ const [searchedOptions, setSearchedOptions] = useState(jsonOptionsData.length ? JSON.parse(jsonOptionsData) : []);
15
+ const [options, setOptions] = useState(jsonSelectedOptionsData?.length ? JSON.parse(jsonSelectedOptionsData) : []);
16
+ const [values, setValues] = useState(jsonOptionsData.length ? JSON.parse(jsonOptionsData) : []);
17
+ const [opened, setOpened] = useState(false);
18
+ return (
19
+ <div className={styles.main}>
20
+ {label ? <label className={styles['multi-select-title']}>վարչական շրջան <span>*</span></label> : ""}
21
+ <div className={styles['multi-select-content-top']} onClick={()=>{setOpened(!opened)}}>
22
+ {
23
+ options.map((option, i) => {
24
+ return (<div className={styles['multi-select-content-bottom-row']} >
25
+ <div id={option.id}>{option.name}</div>
26
+ <Icon className='icon-close' onClick={() => {
27
+ options.splice(i, 1);
28
+ setOptions(options);
29
+ setValues([...values, option]);
30
+ setSearchedOptions([...values, option]);
31
+ setOpened(true);
32
+ }}/>
33
+ </div>)
34
+ })
35
+ }
36
+ {/*<div onChange={(e) => {*/}
37
+ {/*setValues(e.target.value ? searchedOptions.filter((option) => {*/}
38
+ {/*return option.name.toLowerCase().includes(e.target.value.toLowerCase())*/}
39
+ {/*}) : searchedOptions)*/}
40
+
41
+ {/*}} className={styles.input} type='text' />*/}
42
+ <div className={styles['select-content-top-icon']}>
43
+ <Icon className={opened ? 'icon-arrow-up' : 'icon-arrow-down'}/>
44
+ </div>
45
+ </div>
46
+ {
47
+ opened ? <div className={styles['multi-select-content-bottom']} onClick={onchange}>
48
+ <div className={styles['multi-select-content-bottom-inner']}>
49
+ {
50
+ values.length ?
51
+ values.map((value, i) => {
52
+ return (<div className={styles['multi-select-content-bottom-row']} id={value.id} onClick={(e) => {
53
+ setOptions([...options, { 'name': value.name, 'id': value.id }])
54
+ values.splice(i, 1);
55
+ setValues(values);
56
+ setSearchedOptions(values);
57
+ }}>{value.name}</div>)
58
+ }) :
59
+ <div className={styles['no-elements']}>No Elements!</div>
60
+ }
61
+ </div>
62
+ </div> : null
63
+ }
64
+
65
+ </div>
66
+ );
67
+ };
68
+
69
+ Multiselect.propTypes = {
70
+ className: PropTypes.string,
71
+ label: PropTypes.string,
72
+ jsonOptionsData: PropTypes.string,
73
+ jsonSelectedOptionsData: PropTypes.string,
74
+ onchange: PropTypes.func,
75
+ };
76
+
@@ -0,0 +1,137 @@
1
+ .fff {
2
+ background: red;
3
+ }
4
+ .multi-select-title {
5
+ display: block;
6
+ text-transform: capitalize;
7
+ font-size: 16px;
8
+ color: #3C393E;
9
+ line-height: 22px;
10
+ font-weight: 500;
11
+ margin-bottom: 6px;
12
+ }
13
+ .multi-select-title span {
14
+ font-size: 16px;
15
+ line-height: 20px;
16
+ color: #ff0000;
17
+ }
18
+ .multi-select-content {
19
+ display: flex;
20
+ flex-direction: column;
21
+ }
22
+ .multi-select-content-top {
23
+ position: relative;
24
+ display: flex;
25
+ flex-direction: row;
26
+ flex-wrap: wrap;
27
+ align-items: center;
28
+ max-width: 840px;
29
+ height: 46px;
30
+ gap: 10px;
31
+ padding: 0 40px 0 15px;
32
+ font-size: 16px;
33
+ color: #3C393E;
34
+ line-height: 22px;
35
+ font-weight: 500;
36
+ border: 2px solid #D1D1D1;
37
+ border-radius: 6px;
38
+ transition: border-color 240ms;
39
+ box-sizing: border-box;
40
+ cursor: pointer;
41
+ }
42
+ .select-content-top-icon {
43
+ position: absolute;
44
+ top: 0;
45
+ right: 0;
46
+ display: flex;
47
+ align-items: center;
48
+ justify-content: center;
49
+ width: 40px;
50
+ height: 100%;
51
+ }
52
+ .select-content-top-icon i {
53
+ font-size: 10px;
54
+ }
55
+ .multi-select-content-top.active {
56
+ border-color: #00236A;
57
+ }
58
+ .multi-select-content-top:hover {
59
+ border-color: #3C393E;
60
+ }
61
+ .multi-select-content-bottom {
62
+ position: relative;
63
+ top: 6px;
64
+ overflow: hidden;
65
+ max-width: 840px;
66
+ background: #ffffff;
67
+ box-shadow: 0 0 10px rgba(60, 57, 62, 0.08);
68
+ border-radius: 6px;
69
+ animation: multi-select-show 640ms linear forwards;
70
+ max-height: 0;
71
+ }
72
+ .multi-select-content-bottom-inner {
73
+ display: flex;
74
+ flex-direction: row;
75
+ flex-wrap: wrap;
76
+ overflow-y: auto;
77
+ overflow-x: hidden;
78
+ max-height: 234px;
79
+ padding: 10px;
80
+ gap: 8px;
81
+ }
82
+ @keyframes multi-select-show {
83
+ 100% {
84
+ max-height: 400px;
85
+ }
86
+ }
87
+ .multi-select-content-top-text {
88
+ flex: 1;
89
+ display: flex;
90
+ flex-direction: row;
91
+ flex-wrap: nowrap;
92
+ align-items: center;
93
+ }
94
+ .multi-select-content-top-icon {
95
+ padding: 0 5px 0 20px;
96
+ box-sizing: border-box;
97
+ }
98
+ .multi-select-content-top-icon {
99
+ display: flex;
100
+ align-items: center;
101
+ flex: 0 0 auto;
102
+ }
103
+ .multi-select-content-top-icon > i{
104
+ font-size: 8px;
105
+ color: #3C393E;
106
+ }
107
+ .multi-select-content-bottom-row {
108
+ display: flex;
109
+ align-items: center;
110
+ background: #ffffff;
111
+ padding: 0 10px;
112
+ height: 30px;
113
+ font-size: 16px;
114
+ color: #3C393E;
115
+ border: 1px solid #D1D1D1;
116
+ line-height: 20px;
117
+ font-weight: 500;
118
+ border-radius: 4px;
119
+ box-sizing: border-box;
120
+ transition: border-color 240ms, color 240ms;
121
+ cursor: pointer;
122
+ }
123
+ .multi-select-content-bottom-row:hover {
124
+ color: #00236A;
125
+ border-color: #00236A;
126
+ }
127
+ .multi-select-content-top .multi-select-content-bottom-row i {
128
+ padding: 0 8px;
129
+ font-size: 10px;
130
+ }
131
+ .multi-select-content-top .multi-select-content-bottom-row {
132
+ border: 0;
133
+ padding: 0;
134
+ }
135
+ .no-elements {
136
+ color: #ff0000;
137
+ }