@xaypay/tui 0.0.119 → 0.0.120

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 (181) hide show
  1. package/dist/index.es.js +4112 -4330
  2. package/dist/index.js +4111 -4331
  3. package/package.json +1 -1
  4. package/storybook-static/favicon.ico +0 -0
  5. package/tui.config.js +1 -1
  6. package/.eslintrc.js +0 -30
  7. package/.husky/pre-commit +0 -4
  8. package/.prettierrc +0 -10
  9. package/.storybook/main.js +0 -48
  10. package/.storybook/preview.js +0 -9
  11. package/rollup.config.js +0 -37
  12. package/src/assets/attach.svg +0 -4
  13. package/src/assets/delete.svg +0 -4
  14. package/src/assets/down-arrow.svg +0 -4
  15. package/src/assets/figma-image.png +0 -0
  16. package/src/assets/heart-filled.svg +0 -17
  17. package/src/assets/heart-outline.svg +0 -14
  18. package/src/assets/like-filled.svg +0 -21
  19. package/src/assets/like-outline.svg +0 -21
  20. package/src/assets/minus.svg +0 -4
  21. package/src/assets/pdf.svg +0 -3
  22. package/src/assets/plus.svg +0 -4
  23. package/src/assets/range-arrow-default.svg +0 -19
  24. package/src/assets/range-arrow-error.svg +0 -19
  25. package/src/assets/range-arrow-success.svg +0 -19
  26. package/src/assets/star-filled.svg +0 -21
  27. package/src/assets/star-outline.svg +0 -5
  28. package/src/assets/table-settings-icon.svg +0 -3
  29. package/src/assets/up-arrow.svg +0 -4
  30. package/src/assets_old/icons/Read Me.txt +0 -7
  31. package/src/assets_old/icons/demo-files/demo.css +0 -152
  32. package/src/assets_old/icons/demo-files/demo.js +0 -28
  33. package/src/assets_old/icons/demo.html +0 -192
  34. package/src/assets_old/icons/fonts/icomoon.eot +0 -0
  35. package/src/assets_old/icons/fonts/icomoon.svg +0 -21
  36. package/src/assets_old/icons/fonts/icomoon.ttf +0 -0
  37. package/src/assets_old/icons/fonts/icomoon.woff +0 -0
  38. package/src/assets_old/icons/selection.json +0 -1
  39. package/src/assets_old/icons/style.css +0 -58
  40. package/src/components/autocomplate/autocomplate.module.css +0 -95
  41. package/src/components/autocomplate/autocomplate.stories.js +0 -35
  42. package/src/components/autocomplate/index.js +0 -164
  43. package/src/components/button/button.stories.js +0 -13
  44. package/src/components/button/index.js +0 -187
  45. package/src/components/captcha/captcha.module.css +0 -74
  46. package/src/components/captcha/captcha.stories.js +0 -21
  47. package/src/components/captcha/index.js +0 -158
  48. package/src/components/checkbox/checkbox.module.css +0 -0
  49. package/src/components/checkbox/checkbox.stories.js +0 -76
  50. package/src/components/checkbox/index.js +0 -120
  51. package/src/components/file/file.module.css +0 -114
  52. package/src/components/file/file.stories.js +0 -20
  53. package/src/components/file/index.js +0 -138
  54. package/src/components/icon/Active.js +0 -20
  55. package/src/components/icon/Arrow.js +0 -19
  56. package/src/components/icon/Cancel.js +0 -19
  57. package/src/components/icon/CaptchaArrowDown.js +0 -19
  58. package/src/components/icon/CaptchaArrowUp.js +0 -19
  59. package/src/components/icon/CheckboxChecked.js +0 -21
  60. package/src/components/icon/CheckboxUnchecked.js +0 -21
  61. package/src/components/icon/Close.js +0 -19
  62. package/src/components/icon/CloseIcon.js +0 -19
  63. package/src/components/icon/CloseSlide.js +0 -19
  64. package/src/components/icon/DeActive.js +0 -20
  65. package/src/components/icon/DeleteComponent.js +0 -20
  66. package/src/components/icon/Done.js +0 -19
  67. package/src/components/icon/Dots.js +0 -19
  68. package/src/components/icon/DownArrow.js +0 -20
  69. package/src/components/icon/HeartFilled.js +0 -25
  70. package/src/components/icon/HeartOutline.js +0 -25
  71. package/src/components/icon/Heic.js +0 -21
  72. package/src/components/icon/Icon.js +0 -11
  73. package/src/components/icon/ListItemDelete.js +0 -19
  74. package/src/components/icon/ListItemJpeg.js +0 -21
  75. package/src/components/icon/ListItemJpg.js +0 -21
  76. package/src/components/icon/ListItemPdf.js +0 -21
  77. package/src/components/icon/ListItemPng.js +0 -21
  78. package/src/components/icon/Next.js +0 -20
  79. package/src/components/icon/Nextarrow.js +0 -19
  80. package/src/components/icon/PDF.js +0 -19
  81. package/src/components/icon/Prev.js +0 -20
  82. package/src/components/icon/RangeArrowDefault.js +0 -43
  83. package/src/components/icon/RangeArrowError.js +0 -43
  84. package/src/components/icon/RangeArrowSuccess.js +0 -43
  85. package/src/components/icon/Reject.js +0 -19
  86. package/src/components/icon/RemoveFile.js +0 -20
  87. package/src/components/icon/Required.js +0 -19
  88. package/src/components/icon/ToasterClose.js +0 -19
  89. package/src/components/icon/ToasterError.js +0 -19
  90. package/src/components/icon/ToasterInfo.js +0 -19
  91. package/src/components/icon/ToasterSuccess.js +0 -19
  92. package/src/components/icon/ToasterWarning.js +0 -19
  93. package/src/components/icon/Tooltip.js +0 -19
  94. package/src/components/icon/UpArrow.js +0 -20
  95. package/src/components/icon/Upload.js +0 -25
  96. package/src/components/icon/Wrong.js +0 -21
  97. package/src/components/icon/Zoom.js +0 -21
  98. package/src/components/icon/index.js +0 -0
  99. package/src/components/input/index.js +0 -688
  100. package/src/components/input/input.module.css +0 -51
  101. package/src/components/input/input.stories.js +0 -26
  102. package/src/components/modal/index.js +0 -436
  103. package/src/components/modal/modal.module.css +0 -22
  104. package/src/components/modal/modal.stories.js +0 -88
  105. package/src/components/newAutocomplete/NewAutocomplete.stories.js +0 -102
  106. package/src/components/newAutocomplete/autocomplete.module.css +0 -4
  107. package/src/components/newAutocomplete/index.js +0 -592
  108. package/src/components/newFile/fileItem.js +0 -281
  109. package/src/components/newFile/index.js +0 -731
  110. package/src/components/newFile/newFile.stories.js +0 -93
  111. package/src/components/pagination/index.js +0 -234
  112. package/src/components/pagination/pagination.module.css +0 -93
  113. package/src/components/pagination/pagination.stories.js +0 -371
  114. package/src/components/pagination/paginationRange.js +0 -45
  115. package/src/components/radio/index.js +0 -236
  116. package/src/components/radio/radio.module.css +0 -59
  117. package/src/components/radio/radio.stories.js +0 -59
  118. package/src/components/select/index.js +0 -534
  119. package/src/components/select/select.module.css +0 -93
  120. package/src/components/select/select.stories.js +0 -39
  121. package/src/components/singleCheckbox/Checkbox.js +0 -84
  122. package/src/components/singleCheckbox/index.js +0 -65
  123. package/src/components/singleCheckbox/singleCheckbox.stories.js +0 -24
  124. package/src/components/stepper/index.js +0 -45
  125. package/src/components/stepper/stepper.module.css +0 -57
  126. package/src/components/stepper/stepper.stories.js +0 -17
  127. package/src/components/table/index.js +0 -789
  128. package/src/components/table/table.module.css +0 -63
  129. package/src/components/table/table.stories.js +0 -497
  130. package/src/components/table/td.js +0 -429
  131. package/src/components/table/th.js +0 -103
  132. package/src/components/textarea/index.js +0 -285
  133. package/src/components/textarea/textarea.module.css +0 -25
  134. package/src/components/textarea/textarea.stories.js +0 -56
  135. package/src/components/toaster/Toast.js +0 -203
  136. package/src/components/toaster/index.js +0 -131
  137. package/src/components/toaster/toaster.module.css +0 -201
  138. package/src/components/toaster/toaster.stories.js +0 -593
  139. package/src/components/tooltip/index.js +0 -156
  140. package/src/components/tooltip/tooltip.module.css +0 -46
  141. package/src/components/tooltip/tooltip.stories.js +0 -30
  142. package/src/components/typography/index.js +0 -124
  143. package/src/components/typography/typography.module.css +0 -57
  144. package/src/components/typography/typography.stories.js +0 -22
  145. package/src/index.js +0 -19
  146. package/src/stories/Introduction.stories.mdx +0 -210
  147. package/src/stories/assets/code-brackets.svg +0 -1
  148. package/src/stories/assets/colors.svg +0 -1
  149. package/src/stories/assets/comments.svg +0 -1
  150. package/src/stories/assets/direction.svg +0 -1
  151. package/src/stories/assets/flow.svg +0 -1
  152. package/src/stories/assets/plugin.svg +0 -1
  153. package/src/stories/assets/repo.svg +0 -1
  154. package/src/stories/assets/stackalt.svg +0 -1
  155. package/src/stories/changelog.stories.mdx +0 -172
  156. package/src/stories/configuration.stories.mdx +0 -715
  157. package/src/stories/documentation.stories.mdx +0 -118
  158. package/src/stories/static/autocomplete-usage.png +0 -0
  159. package/src/stories/static/button-usage-icon.png +0 -0
  160. package/src/stories/static/button-usage.png +0 -0
  161. package/src/stories/static/captcha-usage.png +0 -0
  162. package/src/stories/static/checkbox-group-usage-2.png +0 -0
  163. package/src/stories/static/checkbox-group-usage.png +0 -0
  164. package/src/stories/static/file-single-usage.png +0 -0
  165. package/src/stories/static/file-usage.png +0 -0
  166. package/src/stories/static/input-usage.png +0 -0
  167. package/src/stories/static/modal-usage.png +0 -0
  168. package/src/stories/static/radio-usage.png +0 -0
  169. package/src/stories/static/select-usage.png +0 -0
  170. package/src/stories/static/table-body-data-structure-first-part-usage.png +0 -0
  171. package/src/stories/static/table-body-data-structure-second-part-usage.png +0 -0
  172. package/src/stories/static/table-body-data-structure-third-part-usage.png +0 -0
  173. package/src/stories/static/table-component-usage.png +0 -0
  174. package/src/stories/static/table-header-data-structure-usage.png +0 -0
  175. package/src/stories/static/table-new-data-structure-usage.png +0 -0
  176. package/src/stories/static/textarea-usage.png +0 -0
  177. package/src/stories/static/toaster-container-usage.png +0 -0
  178. package/src/stories/static/toaster-usage.png +0 -0
  179. package/src/stories/static/tooltip-usage.png +0 -0
  180. package/src/stories/usage.stories.mdx +0 -201
  181. package/src/utils/index.js +0 -29
@@ -1,93 +0,0 @@
1
- import React, { useState } from 'react'
2
- import { NewFile } from './index'
3
-
4
- export default {
5
- component: NewFile,
6
- title: 'Components/NewFile',
7
- argTypes: {
8
- change: {
9
- control: 'function',
10
- },
11
- },
12
- }
13
-
14
- const Template = (args) => {
15
- const [files, setFiles] = useState([])
16
- const [secondFiles, setSecondFiles] = useState([])
17
-
18
- const handleChange = (file) => {
19
- setFiles((prev) => {
20
- return [...prev, file]
21
- })
22
- }
23
-
24
- const handleRemove = (id) => {
25
- setFiles((prevItems) => prevItems.filter((item) => item.uuid !== id))
26
- }
27
-
28
- const handleRemoveComponent = (componentId) => {
29
- alert(`You want to remove component with id, ${componentId}`)
30
- }
31
-
32
- const secondHandleChange = (file) => {
33
- setSecondFiles((prev) => {
34
- return [...prev, file]
35
- })
36
- }
37
-
38
- const secondHandleRemove = (id) => {
39
- setSecondFiles((prevItems) => prevItems.filter((item) => item.uuid !== id))
40
- }
41
-
42
- const secondHandleRemoveComponent = (componentId) => {
43
- alert(`You want to remove component with id, ${componentId}`)
44
- }
45
-
46
- return (
47
- <div
48
- style={{
49
- display: 'flex',
50
- justifyContent: 'space-between',
51
- }}
52
- >
53
- <NewFile
54
- {...args}
55
- removeFromDOM
56
- componentId={2}
57
- filesArray={files}
58
- change={handleChange}
59
- removeFile={handleRemove}
60
- removeComponent={handleRemoveComponent}
61
- formatError="Փաստաթղթի ֆորմատը չի համապատասխանում"
62
- maxSizeError="Փաստաթուղթը գերազանցում է առավելագույն չափը"
63
- />
64
-
65
- <NewFile
66
- {...args}
67
- removeFromDOM
68
- height="50px"
69
- preview={false}
70
- componentId={2}
71
- filesArray={secondFiles}
72
- change={secondHandleChange}
73
- removeFile={secondHandleRemove}
74
- removeComponent={secondHandleRemoveComponent}
75
- formatError="Փաստաթղթի ֆորմատը չի համապատասխանում"
76
- maxSizeError="Փաստաթուղթը գերազանցում է առավելագույն չափը"
77
- />
78
- </div>
79
- )
80
- }
81
-
82
- export const Default = Template.bind({})
83
- Default.args = {
84
- label: 'File component',
85
- deleteComponent: false,
86
- disabled: false,
87
- defaultData: {
88
- url: 'https://images.pexels.com/photos/753626/pexels-photo-753626.jpeg?auto=compress&cs=tinysrgb&w=1600',
89
- type: 'image/png',
90
- },
91
- multiple: true,
92
- name: 'sss',
93
- }
@@ -1,234 +0,0 @@
1
- import React, { useState, useEffect } from 'react'
2
- import PropTypes from 'prop-types'
3
- import classnames from 'classnames'
4
- import { compereConfigs } from './../../utils'
5
- import styles from './pagination.module.css'
6
- import { PaginationRange, Dots } from './paginationRange'
7
-
8
- import DotsIcon from './../../components/icon/Dots'
9
- import SvgNextarrow from './../../components/icon/Nextarrow'
10
-
11
- export const Pagination = ({ goTo, offset, onChange, className, totalCount, currentPage }) => {
12
- const configStyles = compereConfigs()
13
- const [inpVal, setInpVal] = useState('')
14
- const [error, setError] = useState(false)
15
- const [currentPageNumber, setCurrentPage] = useState(currentPage)
16
- const [currentTotalCount, setcurrentTotalCount] = useState(totalCount)
17
- useEffect(() => {
18
- setcurrentTotalCount(totalCount)
19
- }, [totalCount])
20
- useEffect(() => {
21
- setCurrentPage(currentPage)
22
- }, [currentPage])
23
- const onPageChange = (page) => {
24
- if (page > 0) {
25
- setCurrentPage(page)
26
- }
27
- }
28
- useEffect(() => {
29
- onChange(currentPageNumber)
30
- }, [currentPageNumber])
31
- const paginationRange = PaginationRange({
32
- currentPageNumber,
33
- currentTotalCount,
34
- offset,
35
- })
36
-
37
- if (currentPageNumber === 0 || paginationRange?.length < 2) {
38
- return null
39
- }
40
- const classProps = classnames(
41
- styles.list,
42
- className ? className : configStyles.PAGINATION.className,
43
- `${styles['pagination-bar']} pagination-bar-rem`
44
- )
45
-
46
- const onNext = () => {
47
- onPageChange(currentPageNumber + 1)
48
- }
49
-
50
- const onPrevious = () => {
51
- onPageChange(currentPageNumber - 1)
52
- }
53
-
54
- const onNextFive = () => {
55
- currentPageNumber !== lastPage - 4 ? onPageChange(currentPageNumber + 5) : onPageChange(currentPageNumber + 4)
56
- }
57
-
58
- const onPreviousFive = () => {
59
- currentPageNumber !== 5 ? onPageChange(currentPageNumber - 5) : onPageChange(currentPageNumber - 4)
60
- }
61
-
62
- const handleChangeInput = (e) => {
63
- setError(false)
64
- if (e.target.value.trim() !== '') {
65
- const val = parseInt(e.target.value)
66
- if (Number.isInteger(val)) {
67
- setInpVal(val)
68
- } else {
69
- setInpVal('')
70
- }
71
- } else {
72
- setInpVal('')
73
- }
74
- }
75
-
76
- const handleKeyDown = (e) => {
77
- const forbiddenKeys = ['e', '.', '+', '-']
78
- if (forbiddenKeys.includes(e.key)) {
79
- e.preventDefault()
80
- }
81
-
82
- if (e.keyCode === 13) {
83
- if (inpVal === '') {
84
- setError(true)
85
- } else {
86
- if (inpVal <= 1) {
87
- setInpVal(1)
88
- onPageChange(1)
89
- } else if (inpVal >= totalCount / offset) {
90
- setInpVal(Math.ceil(totalCount / offset))
91
- onPageChange(Math.ceil(totalCount / offset))
92
- } else {
93
- onPageChange(inpVal)
94
- }
95
- }
96
- }
97
- }
98
-
99
- let lastPage = paginationRange[paginationRange.length - 1]
100
- return (
101
- <div
102
- style={{
103
- display: 'flex',
104
- margin: '0 auto',
105
- alignItems: 'center',
106
- justifyContent: 'center',
107
- }}
108
- className={classProps}
109
- >
110
- <ul>
111
- <button
112
- style={{
113
- transform: 'rotate(180deg)',
114
- }}
115
- onClick={onPrevious}
116
- disabled={currentPageNumber === 1 ? true : false}
117
- className={`${styles['pagination-btn']} pagination-btn-rem`}
118
- >
119
- <SvgNextarrow />
120
- </button>
121
-
122
- {paginationRange.map((pageNumber, id) => {
123
- if (pageNumber === Dots) {
124
- let currentPageIndex = paginationRange.indexOf(currentPageNumber)
125
- return (
126
- <li
127
- key={id}
128
- className={classnames(
129
- `${styles['pagination-jump-next']} pagination-jump-next-rem`,
130
- styles.listItem
131
- )}
132
- onClick={id < currentPageIndex ? onPreviousFive : onNextFive}
133
- disabled={currentPageIndex === 0 ? true : false}
134
- >
135
- {id < currentPageIndex ? (
136
- <>
137
- <span
138
- className={`${styles['pagination-jump-next-txt']} pagination-jump-next-txt-rem`}
139
- >
140
- <DotsIcon />
141
- </span>
142
- <span
143
- className={`${styles['pagination-jump-next-arrow']} pagination-jump-next-arrow-rem`}
144
- style={{
145
- transform: 'rotate(180deg)',
146
- }}
147
- >
148
- <SvgNextarrow />
149
- </span>
150
- </>
151
- ) : (
152
- <>
153
- <span
154
- className={`${styles['pagination-jump-next-txt']} pagination-jump-next-txt-rem`}
155
- >
156
- <DotsIcon />
157
- </span>
158
- <span
159
- className={`${styles['pagination-jump-next-arrow']} pagination-jump-next-arrow-rem`}
160
- >
161
- <SvgNextarrow />
162
- </span>
163
- </>
164
- )}
165
- </li>
166
- )
167
- }
168
-
169
- return (
170
- <li
171
- onClick={() => onPageChange(pageNumber)}
172
- key={id}
173
- className={classnames(
174
- `${pageNumber === currentPageNumber ? styles.selected : styles.listItem}`,
175
- `${styles['pagination-item']} pagination-item-rem`
176
- )}
177
- >
178
- {pageNumber}
179
- </li>
180
- )
181
- })}
182
-
183
- <button
184
- onClick={onNext}
185
- disabled={currentPageNumber === lastPage ? true : false}
186
- className={`${styles['pagination-btn']} pagination-btn-rem`}
187
- >
188
- <SvgNextarrow />
189
- </button>
190
- </ul>
191
- {goTo && (
192
- <div>
193
- <input
194
- onKeyDown={handleKeyDown}
195
- onInput={handleChangeInput}
196
- type="number"
197
- style={{
198
- width: '53px',
199
- height: '30px',
200
- outline: 'none',
201
- color: '#3C393E',
202
- fontSize: '13px',
203
- margin: '0px 6px',
204
- fontWeight: '500',
205
- textAlign: 'center',
206
- border: '1px solid',
207
- borderRadius: '6px',
208
- borderColor: error ? 'red' : '#00236a',
209
- }}
210
- value={inpVal}
211
- />
212
- <span
213
- style={{
214
- color: '#3C393E',
215
- fontSize: '13px',
216
- }}
217
- >
218
- Էջ
219
- </span>
220
- </div>
221
- )}
222
- </div>
223
- )
224
- }
225
-
226
- Pagination.propTypes = {
227
- goTo: PropTypes.bool,
228
- offset: PropTypes.number,
229
- totalCount: PropTypes.number,
230
- className: PropTypes.string,
231
- currentPage: PropTypes.number,
232
- }
233
-
234
- Pagination.defaultProps = { offset: 2 }
@@ -1,93 +0,0 @@
1
-
2
- .listItem:focus {
3
- background-color: #4CAF50;
4
- color: white;
5
- }
6
-
7
- .listItem:hover:not(.active) {
8
- background-color: #ddd;
9
- }
10
-
11
- .pagination-bar {
12
- display: flex;
13
- flex-direction: row;
14
- justify-content: center;
15
- flex-wrap: nowrap;
16
- gap: 8px;
17
- }
18
- .pagination-btn {
19
- width: 34px;
20
- height: 34px;
21
- display: flex;
22
- align-items: center;
23
- justify-content: center;
24
- background-color: rgba(255, 255, 255, 1);
25
- box-shadow: 0 0 0 1px rgba(238,238,238, 1);
26
- border-radius: 6px;
27
- cursor: pointer;
28
- border: none;
29
- outline: none;
30
- }
31
- .pagination-item, .pagination-jump-next {
32
- flex: 0 0 auto;
33
- display: flex;
34
- align-items: center;
35
- justify-content: center;
36
- width: 34px;
37
- height: 34px;
38
- position: relative;
39
- font-size: 13px;
40
- line-height: 16px;
41
- background-color: rgba(255, 255, 255, 1);
42
- box-shadow: 0 0 0 1px rgba(238,238,238, 1);
43
- border-radius: 6px;
44
- cursor: pointer;
45
- transition: background-color 240ms;
46
- }
47
- .pagination-item:hover {
48
- background-color: rgba(238, 238, 238, 1);
49
- }
50
- .pagination-item.selected {
51
- background-color: rgba(0, 35, 106, 1);
52
- color: rgba(255, 255, 255, 1);
53
- }
54
- .pagination-jump-next-txt, .pagination-jump-next-arrow {
55
- position: absolute;
56
- top: 0;
57
- left: 0;
58
- right: 0;
59
- bottom: 0;
60
- font-size: 12px;
61
- line-height: 14px;
62
- margin: auto;
63
- display: flex;
64
- align-items: center;
65
- justify-content: center;
66
- transition: opacity 240ms, color 240ms;
67
- }
68
- .pagination-jump-next-arrow {
69
- opacity: 0;
70
- }
71
- .pagination-jump-next:hover .pagination-jump-next-arrow {
72
- opacity: 1;
73
- }
74
- .pagination-jump-next:hover .pagination-jump-next-txt {
75
- opacity: 0;
76
- }
77
- i {
78
- font-size: 12px;
79
- line-height: 12px;
80
- color: #3C393E;
81
- }
82
-
83
- /* Works for Chrome, Safari, Edge, Opera */
84
- input::-webkit-outer-spin-button,
85
- input::-webkit-inner-spin-button {
86
- -webkit-appearance: none;
87
- margin: 0;
88
- }
89
-
90
- /* Works for Firefox */
91
- input[type="number"] {
92
- -moz-appearance: textfield;
93
- }