@xaypay/tui 0.0.119 → 0.0.121

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 (180) hide show
  1. package/dist/index.es.js +3983 -4344
  2. package/dist/index.js +3982 -4345
  3. package/package.json +1 -1
  4. package/tui.config.js +1 -1
  5. package/.eslintrc.js +0 -30
  6. package/.husky/pre-commit +0 -4
  7. package/.prettierrc +0 -10
  8. package/.storybook/main.js +0 -48
  9. package/.storybook/preview.js +0 -9
  10. package/rollup.config.js +0 -37
  11. package/src/assets/attach.svg +0 -4
  12. package/src/assets/delete.svg +0 -4
  13. package/src/assets/down-arrow.svg +0 -4
  14. package/src/assets/figma-image.png +0 -0
  15. package/src/assets/heart-filled.svg +0 -17
  16. package/src/assets/heart-outline.svg +0 -14
  17. package/src/assets/like-filled.svg +0 -21
  18. package/src/assets/like-outline.svg +0 -21
  19. package/src/assets/minus.svg +0 -4
  20. package/src/assets/pdf.svg +0 -3
  21. package/src/assets/plus.svg +0 -4
  22. package/src/assets/range-arrow-default.svg +0 -19
  23. package/src/assets/range-arrow-error.svg +0 -19
  24. package/src/assets/range-arrow-success.svg +0 -19
  25. package/src/assets/star-filled.svg +0 -21
  26. package/src/assets/star-outline.svg +0 -5
  27. package/src/assets/table-settings-icon.svg +0 -3
  28. package/src/assets/up-arrow.svg +0 -4
  29. package/src/assets_old/icons/Read Me.txt +0 -7
  30. package/src/assets_old/icons/demo-files/demo.css +0 -152
  31. package/src/assets_old/icons/demo-files/demo.js +0 -28
  32. package/src/assets_old/icons/demo.html +0 -192
  33. package/src/assets_old/icons/fonts/icomoon.eot +0 -0
  34. package/src/assets_old/icons/fonts/icomoon.svg +0 -21
  35. package/src/assets_old/icons/fonts/icomoon.ttf +0 -0
  36. package/src/assets_old/icons/fonts/icomoon.woff +0 -0
  37. package/src/assets_old/icons/selection.json +0 -1
  38. package/src/assets_old/icons/style.css +0 -58
  39. package/src/components/autocomplate/autocomplate.module.css +0 -95
  40. package/src/components/autocomplate/autocomplate.stories.js +0 -35
  41. package/src/components/autocomplate/index.js +0 -164
  42. package/src/components/button/button.stories.js +0 -13
  43. package/src/components/button/index.js +0 -187
  44. package/src/components/captcha/captcha.module.css +0 -74
  45. package/src/components/captcha/captcha.stories.js +0 -21
  46. package/src/components/captcha/index.js +0 -158
  47. package/src/components/checkbox/checkbox.module.css +0 -0
  48. package/src/components/checkbox/checkbox.stories.js +0 -76
  49. package/src/components/checkbox/index.js +0 -120
  50. package/src/components/file/file.module.css +0 -114
  51. package/src/components/file/file.stories.js +0 -20
  52. package/src/components/file/index.js +0 -138
  53. package/src/components/icon/Active.js +0 -20
  54. package/src/components/icon/Arrow.js +0 -19
  55. package/src/components/icon/Cancel.js +0 -19
  56. package/src/components/icon/CaptchaArrowDown.js +0 -19
  57. package/src/components/icon/CaptchaArrowUp.js +0 -19
  58. package/src/components/icon/CheckboxChecked.js +0 -21
  59. package/src/components/icon/CheckboxUnchecked.js +0 -21
  60. package/src/components/icon/Close.js +0 -19
  61. package/src/components/icon/CloseIcon.js +0 -19
  62. package/src/components/icon/CloseSlide.js +0 -19
  63. package/src/components/icon/DeActive.js +0 -20
  64. package/src/components/icon/DeleteComponent.js +0 -20
  65. package/src/components/icon/Done.js +0 -19
  66. package/src/components/icon/Dots.js +0 -19
  67. package/src/components/icon/DownArrow.js +0 -20
  68. package/src/components/icon/HeartFilled.js +0 -25
  69. package/src/components/icon/HeartOutline.js +0 -25
  70. package/src/components/icon/Heic.js +0 -21
  71. package/src/components/icon/Icon.js +0 -11
  72. package/src/components/icon/ListItemDelete.js +0 -19
  73. package/src/components/icon/ListItemJpeg.js +0 -21
  74. package/src/components/icon/ListItemJpg.js +0 -21
  75. package/src/components/icon/ListItemPdf.js +0 -21
  76. package/src/components/icon/ListItemPng.js +0 -21
  77. package/src/components/icon/Next.js +0 -20
  78. package/src/components/icon/Nextarrow.js +0 -19
  79. package/src/components/icon/PDF.js +0 -19
  80. package/src/components/icon/Prev.js +0 -20
  81. package/src/components/icon/RangeArrowDefault.js +0 -43
  82. package/src/components/icon/RangeArrowError.js +0 -43
  83. package/src/components/icon/RangeArrowSuccess.js +0 -43
  84. package/src/components/icon/Reject.js +0 -19
  85. package/src/components/icon/RemoveFile.js +0 -20
  86. package/src/components/icon/Required.js +0 -19
  87. package/src/components/icon/ToasterClose.js +0 -19
  88. package/src/components/icon/ToasterError.js +0 -19
  89. package/src/components/icon/ToasterInfo.js +0 -19
  90. package/src/components/icon/ToasterSuccess.js +0 -19
  91. package/src/components/icon/ToasterWarning.js +0 -19
  92. package/src/components/icon/Tooltip.js +0 -19
  93. package/src/components/icon/UpArrow.js +0 -20
  94. package/src/components/icon/Upload.js +0 -25
  95. package/src/components/icon/Wrong.js +0 -21
  96. package/src/components/icon/Zoom.js +0 -21
  97. package/src/components/icon/index.js +0 -0
  98. package/src/components/input/index.js +0 -688
  99. package/src/components/input/input.module.css +0 -51
  100. package/src/components/input/input.stories.js +0 -26
  101. package/src/components/modal/index.js +0 -436
  102. package/src/components/modal/modal.module.css +0 -22
  103. package/src/components/modal/modal.stories.js +0 -88
  104. package/src/components/newAutocomplete/NewAutocomplete.stories.js +0 -102
  105. package/src/components/newAutocomplete/autocomplete.module.css +0 -4
  106. package/src/components/newAutocomplete/index.js +0 -592
  107. package/src/components/newFile/fileItem.js +0 -281
  108. package/src/components/newFile/index.js +0 -731
  109. package/src/components/newFile/newFile.stories.js +0 -93
  110. package/src/components/pagination/index.js +0 -234
  111. package/src/components/pagination/pagination.module.css +0 -93
  112. package/src/components/pagination/pagination.stories.js +0 -371
  113. package/src/components/pagination/paginationRange.js +0 -45
  114. package/src/components/radio/index.js +0 -236
  115. package/src/components/radio/radio.module.css +0 -59
  116. package/src/components/radio/radio.stories.js +0 -59
  117. package/src/components/select/index.js +0 -534
  118. package/src/components/select/select.module.css +0 -93
  119. package/src/components/select/select.stories.js +0 -39
  120. package/src/components/singleCheckbox/Checkbox.js +0 -84
  121. package/src/components/singleCheckbox/index.js +0 -65
  122. package/src/components/singleCheckbox/singleCheckbox.stories.js +0 -24
  123. package/src/components/stepper/index.js +0 -45
  124. package/src/components/stepper/stepper.module.css +0 -57
  125. package/src/components/stepper/stepper.stories.js +0 -17
  126. package/src/components/table/index.js +0 -789
  127. package/src/components/table/table.module.css +0 -63
  128. package/src/components/table/table.stories.js +0 -497
  129. package/src/components/table/td.js +0 -429
  130. package/src/components/table/th.js +0 -103
  131. package/src/components/textarea/index.js +0 -285
  132. package/src/components/textarea/textarea.module.css +0 -25
  133. package/src/components/textarea/textarea.stories.js +0 -56
  134. package/src/components/toaster/Toast.js +0 -203
  135. package/src/components/toaster/index.js +0 -131
  136. package/src/components/toaster/toaster.module.css +0 -201
  137. package/src/components/toaster/toaster.stories.js +0 -593
  138. package/src/components/tooltip/index.js +0 -156
  139. package/src/components/tooltip/tooltip.module.css +0 -46
  140. package/src/components/tooltip/tooltip.stories.js +0 -30
  141. package/src/components/typography/index.js +0 -124
  142. package/src/components/typography/typography.module.css +0 -57
  143. package/src/components/typography/typography.stories.js +0 -22
  144. package/src/index.js +0 -19
  145. package/src/stories/Introduction.stories.mdx +0 -210
  146. package/src/stories/assets/code-brackets.svg +0 -1
  147. package/src/stories/assets/colors.svg +0 -1
  148. package/src/stories/assets/comments.svg +0 -1
  149. package/src/stories/assets/direction.svg +0 -1
  150. package/src/stories/assets/flow.svg +0 -1
  151. package/src/stories/assets/plugin.svg +0 -1
  152. package/src/stories/assets/repo.svg +0 -1
  153. package/src/stories/assets/stackalt.svg +0 -1
  154. package/src/stories/changelog.stories.mdx +0 -172
  155. package/src/stories/configuration.stories.mdx +0 -715
  156. package/src/stories/documentation.stories.mdx +0 -118
  157. package/src/stories/static/autocomplete-usage.png +0 -0
  158. package/src/stories/static/button-usage-icon.png +0 -0
  159. package/src/stories/static/button-usage.png +0 -0
  160. package/src/stories/static/captcha-usage.png +0 -0
  161. package/src/stories/static/checkbox-group-usage-2.png +0 -0
  162. package/src/stories/static/checkbox-group-usage.png +0 -0
  163. package/src/stories/static/file-single-usage.png +0 -0
  164. package/src/stories/static/file-usage.png +0 -0
  165. package/src/stories/static/input-usage.png +0 -0
  166. package/src/stories/static/modal-usage.png +0 -0
  167. package/src/stories/static/radio-usage.png +0 -0
  168. package/src/stories/static/select-usage.png +0 -0
  169. package/src/stories/static/table-body-data-structure-first-part-usage.png +0 -0
  170. package/src/stories/static/table-body-data-structure-second-part-usage.png +0 -0
  171. package/src/stories/static/table-body-data-structure-third-part-usage.png +0 -0
  172. package/src/stories/static/table-component-usage.png +0 -0
  173. package/src/stories/static/table-header-data-structure-usage.png +0 -0
  174. package/src/stories/static/table-new-data-structure-usage.png +0 -0
  175. package/src/stories/static/textarea-usage.png +0 -0
  176. package/src/stories/static/toaster-container-usage.png +0 -0
  177. package/src/stories/static/toaster-usage.png +0 -0
  178. package/src/stories/static/tooltip-usage.png +0 -0
  179. package/src/stories/usage.stories.mdx +0 -201
  180. package/src/utils/index.js +0 -29
@@ -1,51 +0,0 @@
1
- .input-wrap {
2
- width: 100%;
3
- position: relative;
4
- }
5
-
6
- .input-content {
7
- display: flex;
8
- width: 100%;
9
- appearance: none !important;
10
- -webkit-appearance: none !important;
11
- }
12
-
13
- input:-webkit-autofill,
14
- input:-webkit-autofill:hover,
15
- input:-webkit-autofill:focus,
16
- input:-webkit-autofill:active {
17
- background-color: inherit !important;
18
- }
19
-
20
- input::-ms-reveal,
21
- input::-ms-clear {
22
- display: none;
23
- }
24
-
25
- .error-message-show {
26
- animation-name: error-show;
27
- animation-fill-mode: forwards;
28
- }
29
-
30
- /* Works for Chrome, Safari, Edge, Opera */
31
- .inp-num::-webkit-outer-spin-button,
32
- .inp-num::-webkit-inner-spin-button {
33
- -webkit-appearance: none;
34
- margin: 0;
35
- }
36
-
37
- /* Works for Firefox */
38
- .inp-num[type="number"] {
39
- -moz-appearance: textfield;
40
- }
41
-
42
- @keyframes error-show {
43
- 100% {
44
- bottom: -20px;
45
- transform: scale3d(1,1,1);
46
- -webkit-transform: scale3d(1,1,1);
47
- -moz-transform: scale3d(1,1,1);
48
- -ms-transform: scale3d(1,1,1);
49
- -o-transform: scale3d(1,1,1);
50
- }
51
- }
@@ -1,26 +0,0 @@
1
- import React, { useState } from 'react'
2
- import { Input, InputTypes } from './index'
3
-
4
- export default {
5
- component: Input,
6
- title: 'Components/Input',
7
- argsType: {
8
- change: {
9
- control: { type: 'function' },
10
- },
11
- },
12
- }
13
-
14
- const Template = (args) => {
15
- const [newVal, setNewVal] = useState('5.0100')
16
- const handleChange = (val) => {
17
- setNewVal(val)
18
- }
19
-
20
- return <Input value={newVal} change={handleChange} {...args} />
21
- }
22
-
23
- export const Default = Template.bind({})
24
- Default.args = {
25
- type: InputTypes.TEXT,
26
- }
@@ -1,436 +0,0 @@
1
- import React, { useState, useEffect } from 'react'
2
- import PropTypes from 'prop-types'
3
- import classnames from 'classnames'
4
-
5
- import { compereConfigs, hasOwnerProperty } from './../../utils'
6
- import styles from './modal.module.css'
7
-
8
- import SvgNext from './../icon/Next'
9
- import SvgPrev from './../icon/Prev'
10
- import SvgZoom from './../icon/Zoom'
11
- import SvgCloseIcon from './../icon/CloseIcon'
12
- import SvgCloseSlide from './../icon/CloseSlide'
13
-
14
- export const Modal = ({
15
- type,
16
- data,
17
- width,
18
- radius,
19
- height,
20
- padding,
21
- setShow,
22
- zoomIcon,
23
- selected,
24
- children,
25
- minWidth,
26
- minHeight,
27
- className,
28
- mMaxWidth,
29
- alignItems,
30
- mMaxHeight,
31
- headerText,
32
- imageWidth,
33
- headerSize,
34
- imageHeight,
35
- headerColor,
36
- borderStyle,
37
- borderWidth,
38
- borderColor,
39
- imageMargin,
40
- showZoomIcon,
41
- outsideClose,
42
- headerWeight,
43
- headerHeight,
44
- imageMaxWidth,
45
- justifyContent,
46
- imageWrapWidth,
47
- backgroundColor,
48
- imageWrapHeight,
49
- grayDecorHeight,
50
- layerBackgroundColor,
51
- }) => {
52
- const [select, setSelect] = useState(0)
53
- const [isHover, setIsHover] = useState(false)
54
- const [innerData, setInnerData] = useState([])
55
-
56
- const configStyles = compereConfigs()
57
- const classProps = classnames(className ? className : configStyles.MODAL.className)
58
-
59
- const handleCloseModal = () => {
60
- setShow(false)
61
- }
62
-
63
- const handleStopClosing = (e) => {
64
- e.stopPropagation()
65
- }
66
-
67
- const handleGoTo = (goTo) => {
68
- if (goTo === 'next') {
69
- if (select >= data.length - 1) {
70
- setSelect(0)
71
- } else {
72
- setSelect(select + 1)
73
- }
74
- } else {
75
- if (select <= 0) {
76
- setSelect(data.length - 1)
77
- } else {
78
- setSelect(select - 1)
79
- }
80
- }
81
- }
82
-
83
- const handleESC = (e) => {
84
- if (e.key === 'Escape') {
85
- handleCloseModal()
86
- }
87
- }
88
-
89
- const handleOpenInNewTab = (url) => {
90
- const imageLink = document.createElement('a')
91
- ;(imageLink.href = url), (imageLink.target = '_blank')
92
- imageLink.click()
93
- }
94
-
95
- const handleMouseEnter = () => {
96
- setIsHover(true)
97
- }
98
-
99
- const handleMouseLeave = () => {
100
- setIsHover(false)
101
- }
102
-
103
- useEffect(() => {
104
- if (type === 'images') {
105
- if (data) {
106
- if (data.length === 0) {
107
- alert('Please fill data prop')
108
- } else {
109
- setInnerData(data)
110
- }
111
- } else {
112
- alert('Please add data prop on Modal component')
113
- }
114
- }
115
- }, [type, data, data?.length])
116
-
117
- useEffect(() => {
118
- if (selected) {
119
- if (selected <= 0) {
120
- setSelect(0)
121
- } else if (selected >= data.length - 1) {
122
- setSelect(data.length - 1)
123
- } else {
124
- setSelect(selected)
125
- }
126
- }
127
- }, [selected])
128
-
129
- useEffect(() => {
130
- document.addEventListener('keydown', handleESC, false)
131
- return () => {
132
- setSelect(0)
133
- setInnerData([])
134
- document.removeEventListener('keydown', handleESC, false)
135
- }
136
- }, [])
137
-
138
- return (
139
- <div
140
- className={classProps}
141
- onClick={outsideClose || configStyles.MODAL.outsideClose ? handleCloseModal : (_) => _}
142
- style={{
143
- top: '0px',
144
- left: '0px',
145
- zIndex: 999,
146
- width: '100%',
147
- height: '100vh',
148
- position: 'fixed',
149
- backgroundColor: layerBackgroundColor ? layerBackgroundColor : configStyles.MODAL.layerBackgroundColor,
150
- }}
151
- >
152
- <div
153
- style={{
154
- position: 'relative',
155
- display: 'flex',
156
- width: '100%',
157
- height: '100vh',
158
- alignItems: alignItems ? alignItems : configStyles.MODAL.alignItems,
159
- justifyContent: justifyContent ? justifyContent : configStyles.MODAL.justifyContent,
160
- }}
161
- >
162
- <div
163
- className={`${styles['animation__modal']}`}
164
- onClick={handleStopClosing}
165
- style={{
166
- position: 'relative',
167
- boxSizing: 'border-box',
168
- display: type === 'content' ? 'grid' : 'block',
169
- width: width ? width : configStyles.MODAL.width,
170
- overflow: type === 'content' ? 'auto' : 'hidden',
171
- height: height ? height : configStyles.MODAL.height,
172
- gridTemplateRows: type === 'content' ? 'auto 10fr' : '',
173
- borderRadius: radius ? radius : configStyles.MODAL.radius,
174
- maxWidth: mMaxWidth ? mMaxWidth : configStyles.MODAL.mMaxWidth,
175
- maxHeight: mMaxHeight ? mMaxHeight : configStyles.MODAL.mMaxHeight,
176
- minWidth: type === 'content' ? (minWidth ? minWidth : configStyles.MODAL.minWidth) : '',
177
- backgroundColor: backgroundColor ? backgroundColor : configStyles.MODAL.backgroundColor,
178
- minHeight: type === 'content' ? (minHeight ? minHeight : configStyles.MODAL.minHeight) : '',
179
- }}
180
- >
181
- {type === 'content' && (
182
- <div
183
- style={{
184
- width: '100%',
185
- minWidth: '0',
186
- display: 'flex',
187
- alignItems: 'center',
188
- boxSizing: 'border-box',
189
- backgroundColor: '#FBFBFB',
190
- padding: padding ? padding : configStyles.MODAL.padding,
191
- height: headerHeight ? headerHeight : configStyles.MODAL.headerHeight,
192
- justifyContent: headerText && type === 'content' ? 'space-between' : 'flex-end',
193
- }}
194
- >
195
- {headerText && type === 'content' && (
196
- <p
197
- style={{
198
- flex: '1',
199
- overflow: 'hidden',
200
- whiteSpace: 'nowrap',
201
- textOverflow: 'ellipsis',
202
- margin: '0px 16px 0px 0px',
203
- fontSize: headerSize ? headerSize : configStyles.MODAL.headerSize,
204
- color: headerColor ? headerColor : configStyles.MODAL.headerColor,
205
- fontWeight: headerWeight ? headerWeight : configStyles.MODAL.headerWeight,
206
- }}
207
- >
208
- {headerText}
209
- </p>
210
- )}
211
- <div
212
- onClick={handleCloseModal}
213
- style={{
214
- width: '14px',
215
- height: '14px',
216
- cursor: 'pointer',
217
- }}
218
- >
219
- <SvgCloseIcon />
220
- </div>
221
- </div>
222
- )}
223
-
224
- <div
225
- style={{
226
- display: 'flex',
227
- width: '100%',
228
- height: '100%',
229
- position: 'relative',
230
- alignItems: 'center',
231
- boxSizing: 'border-box',
232
- justifyContent: 'center',
233
- overflow: type === 'content' ? 'auto' : 'hidden',
234
- borderWidth: borderWidth ? borderWidth : configStyles.MODAL.borderWidth,
235
- borderStyle: borderStyle ? borderStyle : configStyles.MODAL.borderStyle,
236
- borderColor: borderColor ? borderColor : configStyles.MODAL.borderColor,
237
- }}
238
- onMouseEnter={handleMouseEnter}
239
- onMouseLeave={handleMouseLeave}
240
- >
241
- {type === 'content' ? (
242
- children ? (
243
- children
244
- ) : (
245
- ''
246
- )
247
- ) : (
248
- <>
249
- <div
250
- style={{
251
- position: 'absolute',
252
- top: '0px',
253
- left: '0px',
254
- width: '100%',
255
- borderTopLeftRadius: '6px',
256
- borderTopRightRadius: '6px',
257
- height: grayDecorHeight ? grayDecorHeight : configStyles.MODAL.grayDecorHeight,
258
- backgroundImage: 'linear-gradient(rgb(60, 57, 62), rgba(60, 57, 62, 0))',
259
- }}
260
- >
261
- <button
262
- onClick={handleCloseModal}
263
- style={{
264
- position: 'absolute',
265
- zIndex: '1',
266
- top: '20px',
267
- width: '18px',
268
- right: '20px',
269
- height: '18px',
270
- border: 'none',
271
- padding: '0px',
272
- outline: 'none',
273
- cursor: 'pointer',
274
- backgroundColor: 'transparent',
275
- }}
276
- >
277
- <SvgCloseSlide />
278
- </button>
279
- </div>
280
- <div
281
- style={{
282
- width: imageWrapWidth ? imageWrapWidth : configStyles.MODAL.imageWrapWidth,
283
- height: imageWrapHeight ? imageWrapHeight : configStyles.MODAL.imageWrapHeight,
284
- }}
285
- >
286
- {innerData &&
287
- innerData.length > 0 &&
288
- innerData.map((item, index) => {
289
- if (select === index) {
290
- if (!hasOwnerProperty(item, 'url')) {
291
- alert('Please add url property in data prop on each element')
292
- } else {
293
- return (
294
- <span key={`${item.url}_${item.id ? item.id : '007'}_${index}`}>
295
- <img
296
- style={{
297
- display: 'block',
298
- objectFit: 'cover',
299
- objectPosition: 'center',
300
- margin: imageMargin
301
- ? imageMargin
302
- : configStyles.MODAL.imageMargin,
303
- borderRadius: radius
304
- ? radius
305
- : configStyles.MODAL.radius,
306
- width: imageWidth
307
- ? imageWidth
308
- : configStyles.MODAL.imageWidth,
309
- height: imageHeight
310
- ? imageHeight
311
- : configStyles.MODAL.imageHeight,
312
- maxWidth: imageMaxWidth
313
- ? imageMaxWidth
314
- : configStyles.MODAL.imageMaxWidth,
315
- }}
316
- src={item.url}
317
- />
318
- {isHover && showZoomIcon ? (
319
- <div
320
- style={{
321
- top: '0px',
322
- left: '0px',
323
- zIndex: '10',
324
- right: '0px',
325
- bottom: '0px',
326
- margin: 'auto',
327
- display: 'flex',
328
- maxWidth: '40px',
329
- maxHeight: '40px',
330
- cursor: 'pointer',
331
- overflow: 'hidden',
332
- position: 'absolute',
333
- alignItems: 'center',
334
- justifyContent: 'center',
335
- }}
336
- onClick={() => handleOpenInNewTab(item.url)}
337
- >
338
- {zoomIcon ? zoomIcon : <SvgZoom />}
339
- </div>
340
- ) : (
341
- ''
342
- )}
343
- </span>
344
- )
345
- }
346
- }
347
- })}
348
-
349
- {innerData && innerData.length > 1 && (
350
- <>
351
- <button
352
- onClick={() => handleGoTo('prev')}
353
- style={{
354
- position: 'absolute',
355
- left: '14px',
356
- width: '24px',
357
- height: '24px',
358
- padding: '0px',
359
- border: 'none',
360
- outline: 'none',
361
- cursor: 'pointer',
362
- top: 'calc(50% - 12px)',
363
- backgroundColor: 'transparent',
364
- }}
365
- >
366
- <SvgPrev />
367
- </button>
368
- <button
369
- onClick={() => handleGoTo('next')}
370
- style={{
371
- position: 'absolute',
372
- width: '24px',
373
- right: '14px',
374
- height: '24px',
375
- border: 'none',
376
- padding: '0px',
377
- outline: 'none',
378
- cursor: 'pointer',
379
- top: 'calc(50% - 12px)',
380
- backgroundColor: 'transparent',
381
- }}
382
- >
383
- <SvgNext />
384
- </button>
385
- </>
386
- )}
387
- </div>
388
- </>
389
- )}
390
- </div>
391
- </div>
392
- </div>
393
- </div>
394
- )
395
- }
396
-
397
- Modal.propTypes = {
398
- data: PropTypes.array,
399
- type: PropTypes.string,
400
- setShow: PropTypes.func,
401
- width: PropTypes.string,
402
- radius: PropTypes.string,
403
- height: PropTypes.string,
404
- padding: PropTypes.string,
405
- selected: PropTypes.number,
406
- minWidth: PropTypes.string,
407
- mMaxWidth: PropTypes.string,
408
- minHeight: PropTypes.string,
409
- className: PropTypes.string,
410
- zoomIcon: PropTypes.element,
411
- alignItems: PropTypes.string,
412
- mMaxHeight: PropTypes.string,
413
- headerText: PropTypes.string,
414
- imageWidth: PropTypes.string,
415
- headerSize: PropTypes.string,
416
- outsideClose: PropTypes.bool,
417
- showZoomIcon: PropTypes.bool,
418
- imageMargin: PropTypes.string,
419
- borderStyle: PropTypes.string,
420
- borderWidth: PropTypes.string,
421
- headerColor: PropTypes.string,
422
- imageHeight: PropTypes.string,
423
- headerWeight: PropTypes.string,
424
- headerHeight: PropTypes.string,
425
- imageMaxWidth: PropTypes.string,
426
- justifyContent: PropTypes.string,
427
- imageWrapWidth: PropTypes.string,
428
- backgroundColor: PropTypes.string,
429
- grayDecorHeight: PropTypes.string,
430
- imageWrapHeight: PropTypes.string,
431
- layerBackgroundColor: PropTypes.string,
432
- }
433
-
434
- Modal.defaultProps = {
435
- type: 'content',
436
- }
@@ -1,22 +0,0 @@
1
- .animation__modal {
2
- animation: show-popup 150ms;
3
- -webkit-animation: show-popup 150ms;
4
- }
5
-
6
- @keyframes show-popup {
7
- 0% {
8
- transform: translate3d(0, -50%, 0);
9
- -webkit-transform: translate3d(0, -50%, 0);
10
- -moz-transform: translate3d(0, -50%, 0);
11
- -ms-transform: translate3d(0, -50%, 0);
12
- -o-transform: translate3d(0, -50%, 0);
13
- }
14
- 100% {
15
- opacity: 1;
16
- transform: translate3d(0, 0, 0);
17
- -webkit-transform: translate3d(0, 0, 0);
18
- -moz-transform: translate3d(0, 0, 0);
19
- -ms-transform: translate3d(0, 0, 0);
20
- -o-transform: translate3d(0, 0, 0);
21
- }
22
- }
@@ -1,88 +0,0 @@
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 = ({ className }) => {
10
- const [show, setShow] = useState(false)
11
- const [type, setType] = useState('content')
12
- const data = [
13
- {
14
- url: 'https://images.pexels.com/photos/268533/pexels-photo-268533.jpeg?cs=srgb&dl=pexels-pixabay-268533.jpg&fm=jpg',
15
- id: 1,
16
- },
17
- {
18
- url: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSS8LHEGxt49kfpf7asGDZd5rnTjQMD0HF2WtJ3wKEDww&s',
19
- id: 2,
20
- },
21
- {
22
- url: 'https://s.alamy.com/kdawwlsweh27/2LtummpjO849eQ83yGGiUN/316e62a71020a924f9f663b6ca6b7eda/Fresh_Stock_Content.jpg?fm=jpg&q=100',
23
- id: 3,
24
- },
25
- {
26
- url: 'https://media.istockphoto.com/id/533899788/photo/mount-ararat-from-armenia.jpg?s=612x612&w=0&k=20&c=dB48gVwJq4UGCzdLpOsxDv9DniGQIOBdmli28zUXu0A=',
27
- id: 4,
28
- },
29
- {
30
- url: 'https://media.istockphoto.com/id/500221043/photo/cascade-yerevan.jpg?s=612x612&w=0&k=20&c=vaULCkIZaIbetZlkFnP20ELnD8cyhlc9cRsvt-X5YAk=',
31
- id: 5,
32
- },
33
- {
34
- url: 'https://images.unsplash.com/photo-1512850183-6d7990f42385?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8NXx8dmVydGljYWx8ZW58MHx8MHx8fDA%3D&w=1000&q=80',
35
- id: 6,
36
- },
37
- {
38
- url: './../../assets/figma-image.png',
39
- id: 7,
40
- },
41
- ]
42
-
43
- const handleClick = () => {
44
- setShow(true)
45
- }
46
-
47
- const handleChangeType = () => {
48
- if (type === 'content') {
49
- setType('images')
50
- } else {
51
- setType('content')
52
- }
53
- }
54
-
55
- return (
56
- <>
57
- <button
58
- onClick={handleClick}
59
- style={{ cursor: 'pointer', padding: '8px', fontSize: '16px', marginRight: '10px' }}
60
- >
61
- Click
62
- </button>
63
- <button onClick={handleChangeType} style={{ cursor: 'pointer', padding: '8px', fontSize: '16px' }}>
64
- Change type to {type === 'content' ? 'images' : 'content'}
65
- </button>
66
- {show && (
67
- <Modal type={type} selected={0} showZoomIcon data={data} setShow={setShow} className={className}>
68
- <div
69
- style={{
70
- width: '400px',
71
- height: '500px',
72
- backgroundColor: 'red',
73
- }}
74
- >
75
- just test
76
- </div>
77
- </Modal>
78
- )}
79
- </>
80
- )
81
- }
82
-
83
- export const Default = Template.bind({})
84
-
85
- Default.args = {
86
- headerText: 'Modal header text',
87
- className: 'Modal',
88
- }