@xaypay/tui 0.0.25 → 0.0.27
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/dist/index.es.js +170 -107
- package/dist/index.js +170 -106
- package/package.json +1 -1
- package/src/assets_old/icons/style.css +2 -4
- package/src/components/modal/index.js +36 -9
- package/src/components/modal/modal.stories.js +24 -2
- package/src/components/select/select.module.css +1 -1
- package/src/index.js +2 -1
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@font-face {
|
|
1
|
+
/* @font-face {
|
|
2
2
|
font-family: 'icomoon';
|
|
3
3
|
src: url('fonts/icomoon.eot?pr3wo0');
|
|
4
4
|
src: url('fonts/icomoon.eot?pr3wo0#iefix') format('embedded-opentype'),
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
[class^="icon-"], [class*=" icon-"] {
|
|
14
|
-
/* use !important to prevent issues with browser extensions that change fonts */
|
|
15
14
|
font-family: 'icomoon' !important;
|
|
16
15
|
speak: never;
|
|
17
16
|
font-style: normal;
|
|
@@ -20,7 +19,6 @@
|
|
|
20
19
|
text-transform: none;
|
|
21
20
|
line-height: 1;
|
|
22
21
|
|
|
23
|
-
/* Better Font Rendering =========== */
|
|
24
22
|
-webkit-font-smoothing: antialiased;
|
|
25
23
|
-moz-osx-font-smoothing: grayscale;
|
|
26
24
|
}
|
|
@@ -57,4 +55,4 @@
|
|
|
57
55
|
}
|
|
58
56
|
.icon-arrow-back:before {
|
|
59
57
|
content: "\e904";
|
|
60
|
-
}
|
|
58
|
+
} */
|
|
@@ -1,22 +1,46 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { useState } from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import classnames from "classnames";
|
|
4
4
|
import styles from "./modal.module.css";
|
|
5
5
|
import Icon from '../icon/Icon';
|
|
6
6
|
|
|
7
|
-
export const Modal = ({ setShow, headerText, className }) => {
|
|
7
|
+
export const Modal = ({ setShow, headerText, className, type, data, selected}) => {
|
|
8
8
|
const classProps = classnames(styles.modal, className);
|
|
9
|
+
const [select, setSelect] = useState(selected)
|
|
9
10
|
return (
|
|
10
11
|
<div className={styles["modal-wrap"]}>
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
{
|
|
14
|
+
type == 'content' ?
|
|
15
|
+
<div className={styles["modal-content"]}>
|
|
12
16
|
<div className={styles["modal-top"]}>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
<div className={styles['modal-title']}>Title</div>
|
|
18
|
+
<div className={styles["close-btn"]} onClick={() => setShow(false)}>
|
|
19
|
+
<Icon className="icon-close" />
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
<div className={styles["modal-section"]} />
|
|
23
|
+
</div>
|
|
24
|
+
: type == 'images' ?
|
|
25
|
+
<div className={styles["modal-content"]}>
|
|
26
|
+
<div className={styles["close-btn"]} onClick={() => setShow(false)}>
|
|
27
|
+
<Icon className="icon-close" />
|
|
28
|
+
</div>
|
|
29
|
+
<div>
|
|
30
|
+
{select > 1 ? <h1 onClick={()=>setSelect(select - 1)}>-</h1> : null}
|
|
31
|
+
{
|
|
32
|
+
data.map(elem => {
|
|
33
|
+
if(select == elem.id){
|
|
34
|
+
return<img width='600px' key={elem.id} src={elem.url}/>
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
{select < data.length ? <h1 onClick={()=>{ setSelect(select + 1)}}>+</h1>: null}
|
|
39
|
+
</div>
|
|
40
|
+
<div className={styles["modal-section"]} />
|
|
17
41
|
</div>
|
|
18
|
-
|
|
19
|
-
|
|
42
|
+
: null
|
|
43
|
+
}
|
|
20
44
|
</div>
|
|
21
45
|
);
|
|
22
46
|
};
|
|
@@ -25,4 +49,7 @@ Modal.propTypes = {
|
|
|
25
49
|
setShow: PropTypes.func,
|
|
26
50
|
headerText: PropTypes.string,
|
|
27
51
|
className: PropTypes.string,
|
|
52
|
+
type: PropTypes.string,
|
|
53
|
+
selected: PropTypes.string,
|
|
54
|
+
data: PropTypes.array
|
|
28
55
|
};
|
|
@@ -8,6 +8,28 @@ export default {
|
|
|
8
8
|
|
|
9
9
|
const Template = ({ headerText, className }) => {
|
|
10
10
|
const [show, setShow] = useState(false);
|
|
11
|
+
const data = [
|
|
12
|
+
{
|
|
13
|
+
url: 'https://images.pexels.com/photos/268533/pexels-photo-268533.jpeg?cs=srgb&dl=pexels-pixabay-268533.jpg&fm=jpg',
|
|
14
|
+
id: 1
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
url: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSS8LHEGxt49kfpf7asGDZd5rnTjQMD0HF2WtJ3wKEDww&s',
|
|
18
|
+
id: 2
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
url: 'https://s.alamy.com/kdawwlsweh27/2LtummpjO849eQ83yGGiUN/316e62a71020a924f9f663b6ca6b7eda/Fresh_Stock_Content.jpg?fm=jpg&q=100',
|
|
22
|
+
id: 3
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
url: 'https://media.istockphoto.com/id/533899788/photo/mount-ararat-from-armenia.jpg?s=612x612&w=0&k=20&c=dB48gVwJq4UGCzdLpOsxDv9DniGQIOBdmli28zUXu0A=',
|
|
26
|
+
id: 4
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
url: 'https://media.istockphoto.com/id/500221043/photo/cascade-yerevan.jpg?s=612x612&w=0&k=20&c=vaULCkIZaIbetZlkFnP20ELnD8cyhlc9cRsvt-X5YAk=',
|
|
30
|
+
id: 5
|
|
31
|
+
}
|
|
32
|
+
]
|
|
11
33
|
const handleClick = () => {
|
|
12
34
|
setShow(true);
|
|
13
35
|
};
|
|
@@ -15,7 +37,7 @@ const Template = ({ headerText, className }) => {
|
|
|
15
37
|
<>
|
|
16
38
|
<button onClick={handleClick}>Click</button>
|
|
17
39
|
{show && (
|
|
18
|
-
<Modal setShow={setShow} headerText={headerText} className={className} />
|
|
40
|
+
<Modal type='images' selected={4} data={data} setShow={setShow} headerText={headerText} className={className} />
|
|
19
41
|
)}
|
|
20
42
|
</>
|
|
21
43
|
);
|
|
@@ -25,5 +47,5 @@ export const Default = Template.bind({});
|
|
|
25
47
|
|
|
26
48
|
Default.args = {
|
|
27
49
|
headerText: "Hi...",
|
|
28
|
-
className: "Modal"
|
|
50
|
+
className: "Modal",
|
|
29
51
|
};
|
package/src/index.js
CHANGED
|
@@ -9,4 +9,5 @@ export * from './components/radio';
|
|
|
9
9
|
export * from './components/captcha';
|
|
10
10
|
export * from './components/stepper';
|
|
11
11
|
export * from './components/select';
|
|
12
|
-
export * from './components/file';
|
|
12
|
+
export * from './components/file';
|
|
13
|
+
export * from './components/modal';
|