@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,281 +0,0 @@
1
- import React, { useEffect, useState } from 'react'
2
-
3
- import SvgHeic from './../icon/Heic'
4
- import SvgWrong from './../icon/Wrong'
5
- import SvgListItemPdf from './../icon/ListItemPdf'
6
- import SvgListItemJpg from './../icon/ListItemJpg'
7
- import SvgListItemPng from './../icon/ListItemPng'
8
- import SvgListItemJpeg from './../icon/ListItemJpeg'
9
- import SvgListItemDelete from './../icon/ListItemDelete'
10
-
11
- // eslint-disable-next-line react/display-name
12
- const FileItem = React.memo(
13
- ({
14
- size,
15
- name,
16
- uuid,
17
- check,
18
- radius,
19
- status,
20
- removeFile,
21
- fileFormat,
22
- progressColor,
23
- listItemHeight,
24
- listItemPadding,
25
- progressFontSize,
26
- listItemErrorSize,
27
- timeForRemoveError,
28
- listItemErrorColor,
29
- progressTrackColor,
30
- progressFailedColor,
31
- progressSuccessColor,
32
- progressLoadingColor,
33
- listItemBackgroundColor,
34
- listItemBackgroundErrorColor,
35
- }) => {
36
- const [i, setI] = useState((_) => _)
37
- const [t, setT] = useState((_) => _)
38
- const [progress, setProgress] = useState(7)
39
-
40
- const handleRemoveItem = (id) => {
41
- removeFile(id)
42
- }
43
-
44
- useEffect(() => {
45
- let time = Math.floor(Math.random() * (1100 - 900 + 1)) + 900
46
- let fileSizeInMB = Math.round(size / (1024 * 1024))
47
- if (fileSizeInMB > 5) {
48
- const times = [
49
- Math.floor(Math.random() * (1700 - 1300 + 1)) + 1300,
50
- Math.floor(Math.random() * (3200 - 2800 + 1)) + 2800,
51
- Math.floor(Math.random() * (4700 - 4300 + 1)) + 4300,
52
- Math.floor(Math.random() * (6200 - 5800 + 1)) + 5800,
53
- Math.floor(Math.random() * (7700 - 7300 + 1)) + 7300,
54
- ]
55
- const index = Math.min(Math.floor((size - 1) / 15), times.length - 1)
56
- time = times[index]
57
- }
58
- setI(
59
- setInterval(() => {
60
- setProgress((prev) => {
61
- return (prev += 7)
62
- })
63
- }, time)
64
- )
65
- return () => {
66
- setI((_) => _)
67
- setT((_) => _)
68
- clearTimeout(t)
69
- clearInterval(i)
70
- }
71
- }, [])
72
-
73
- useEffect(() => {
74
- if (progress > 84) {
75
- clearInterval(i)
76
- }
77
- }, [progress])
78
-
79
- useEffect(() => {
80
- if (status === 'success') {
81
- setProgress(100)
82
- clearInterval(i)
83
- }
84
-
85
- if (status === 'failed') {
86
- setProgress(0)
87
- clearInterval(i)
88
- }
89
- }, [status])
90
-
91
- useEffect(() => {
92
- if (check !== '') {
93
- setT(
94
- setTimeout(() => {
95
- removeFile(uuid)
96
- }, timeForRemoveError)
97
- )
98
- }
99
- }, [check])
100
-
101
- return (
102
- <div
103
- style={{
104
- width: '100%',
105
- display: 'flex',
106
- marginTop: '6px',
107
- alignItems: 'center',
108
- borderRadius: radius,
109
- height: listItemHeight,
110
- boxSizing: 'border-box',
111
- padding: listItemPadding,
112
- flexDirection: 'row',
113
- justifyContent: 'space-between',
114
- border: check !== '' ? `1px solid ${listItemErrorColor}` : '',
115
- backgroundColor: check !== '' ? listItemBackgroundErrorColor : listItemBackgroundColor,
116
- }}
117
- >
118
- {check !== '' ? (
119
- <>
120
- <div
121
- style={{
122
- width: '32px',
123
- }}
124
- >
125
- <SvgWrong />
126
- </div>
127
-
128
- <div
129
- style={{
130
- position: 'relative',
131
- display: 'flex',
132
- height: '40px',
133
- margin: '0px',
134
- alignItems: 'flex-end',
135
- width: 'calc(100% - 40px)',
136
- }}
137
- >
138
- <div
139
- style={{
140
- width: '100%',
141
- height: '100%',
142
- display: 'flex',
143
- paddingTop: '5px',
144
- color: progressColor,
145
- boxSizing: 'border-box',
146
- flexDirection: 'column',
147
- fontSize: listItemErrorSize,
148
- }}
149
- >
150
- <p
151
- style={{
152
- margin: '0px',
153
- overflow: 'hidden',
154
- whiteSpace: 'nowrap',
155
- textOverflow: 'ellipsis',
156
- width: '100%',
157
- maxWidth: '100%',
158
- }}
159
- >
160
- {name}
161
- </p>
162
- <p
163
- style={{
164
- margin: '0px',
165
- overflow: 'hidden',
166
- whiteSpace: 'nowrap',
167
- textOverflow: 'ellipsis',
168
- width: '100%',
169
- maxWidth: '100%',
170
- color: listItemErrorColor,
171
- }}
172
- >
173
- {check ? check : ''}
174
- </p>
175
- </div>
176
- </div>
177
- </>
178
- ) : (
179
- <>
180
- <div
181
- style={{
182
- width: '32px',
183
- }}
184
- >
185
- {fileFormat === 'pdf' ? (
186
- <SvgListItemPdf />
187
- ) : fileFormat === 'jpg' ? (
188
- <SvgListItemJpg />
189
- ) : fileFormat === 'png' ? (
190
- <SvgListItemPng />
191
- ) : fileFormat === 'jpeg' ? (
192
- <SvgListItemJpeg />
193
- ) : fileFormat === 'heic' || fileFormat === 'heif' ? (
194
- <SvgHeic />
195
- ) : (
196
- ''
197
- )}
198
- </div>
199
-
200
- <div
201
- style={{
202
- position: 'relative',
203
- display: 'flex',
204
- height: '40px',
205
- margin: '0px 14px',
206
- alignItems: 'flex-end',
207
- width: 'calc(100% - 82px)',
208
- }}
209
- >
210
- <div
211
- style={{
212
- width: '100%',
213
- height: '100%',
214
- display: 'flex',
215
- paddingTop: '5px',
216
- color: progressColor,
217
- boxSizing: 'border-box',
218
- alignItems: 'flex-start',
219
- fontSize: progressFontSize,
220
- justifyContent: 'space-between',
221
- }}
222
- >
223
- <p
224
- style={{
225
- margin: '0px',
226
- overflow: 'hidden',
227
- whiteSpace: 'nowrap',
228
- textOverflow: 'ellipsis',
229
- maxWidth: 'calc(100% - 56px)',
230
- }}
231
- >
232
- {name}
233
- </p>
234
-
235
- <span>{progress} %</span>
236
- </div>
237
-
238
- <div
239
- style={{
240
- position: 'absolute',
241
- left: '0px',
242
- bottom: '5px',
243
- width: '100%',
244
- height: '4px',
245
- borderRadius: '10px',
246
- backgroundColor: progressTrackColor,
247
- }}
248
- >
249
- <div
250
- style={{
251
- height: '100%',
252
- borderRadius: '10px',
253
- width: status === 'failed' ? '100%' : progress + '%',
254
- backgroundColor:
255
- status === 'success'
256
- ? progressSuccessColor
257
- : status === 'failed'
258
- ? progressFailedColor
259
- : progressLoadingColor,
260
- }}
261
- ></div>
262
- </div>
263
- </div>
264
-
265
- <div
266
- style={{
267
- width: '22px',
268
- cursor: 'pointer',
269
- }}
270
- onClick={() => handleRemoveItem(uuid)}
271
- >
272
- <SvgListItemDelete />
273
- </div>
274
- </>
275
- )}
276
- </div>
277
- )
278
- }
279
- )
280
-
281
- export default FileItem