@oliasoft-open-source/react-ui-library 2.4.8 → 3.0.0

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 (320) hide show
  1. package/README.md +0 -1
  2. package/dist/global.css +21840 -0
  3. package/dist/index.js +43567 -0
  4. package/package.json +37 -55
  5. package/.eslintignore +0 -2
  6. package/.eslintrc.js +0 -125
  7. package/.gitlab-ci.yml +0 -76
  8. package/.husky/pre-commit +0 -4
  9. package/.prettierignore +0 -3
  10. package/.prettierrc +0 -4
  11. package/.storybook/main.js +0 -36
  12. package/.storybook/preview.js +0 -40
  13. package/.storybook/storybook.less +0 -8
  14. package/babel.config.js +0 -31
  15. package/index.js +0 -76
  16. package/jest.config.js +0 -9
  17. package/scripts/send-mattermost-message.sh +0 -21
  18. package/src/components/accordion/accordion.jsx +0 -132
  19. package/src/components/accordion/accordion.module.less +0 -66
  20. package/src/components/accordion/accordion.stories.jsx +0 -171
  21. package/src/components/accordion/chevron/chevron.jsx +0 -12
  22. package/src/components/accordion/chevron/chevron.module.less +0 -12
  23. package/src/components/accordion/helpers/accordion-with-default-toggle.jsx +0 -106
  24. package/src/components/accordion/helpers/accordion-with-default-toggle.module.less +0 -24
  25. package/src/components/actions/actions.jsx +0 -129
  26. package/src/components/actions/actions.module.less +0 -44
  27. package/src/components/actions/actions.shape.js +0 -32
  28. package/src/components/actions/actions.stories.jsx +0 -79
  29. package/src/components/badge/badge.jsx +0 -58
  30. package/src/components/badge/badge.module.less +0 -55
  31. package/src/components/badge/badge.stories.jsx +0 -31
  32. package/src/components/breadcrumb/breadcrumb.jsx +0 -49
  33. package/src/components/breadcrumb/breadcrumb.module.less +0 -39
  34. package/src/components/breadcrumb/breadcrumb.stories.jsx +0 -45
  35. package/src/components/breadcrumb/link.jsx +0 -31
  36. package/src/components/button/button.jsx +0 -156
  37. package/src/components/button/button.module.less +0 -300
  38. package/src/components/button/button.stories.jsx +0 -74
  39. package/src/components/button-group/button-group.jsx +0 -140
  40. package/src/components/button-group/button-group.module.less +0 -24
  41. package/src/components/button-group/button-group.stories-data.jsx +0 -67
  42. package/src/components/button-group/button-group.stories.jsx +0 -63
  43. package/src/components/buttons-and-links.stories.mdx +0 -55
  44. package/src/components/card/card.jsx +0 -51
  45. package/src/components/card/card.module.less +0 -48
  46. package/src/components/card/card.stories.jsx +0 -39
  47. package/src/components/check-box/check-box.jsx +0 -92
  48. package/src/components/check-box/check-box.module.less +0 -101
  49. package/src/components/check-box/check-box.stories.jsx +0 -27
  50. package/src/components/color/color.stories-data.jsx +0 -71
  51. package/src/components/color/color.stories.mdx +0 -37
  52. package/src/components/dialog/dialog.jsx +0 -77
  53. package/src/components/dialog/dialog.module.less +0 -76
  54. package/src/components/divider/divider.jsx +0 -40
  55. package/src/components/divider/divider.module.less +0 -28
  56. package/src/components/divider/divider.stories.jsx +0 -50
  57. package/src/components/drawer/drawer-resize-wrapper.jsx +0 -76
  58. package/src/components/drawer/drawer-tabs.jsx +0 -44
  59. package/src/components/drawer/drawer.jsx +0 -161
  60. package/src/components/drawer/drawer.module.less +0 -217
  61. package/src/components/drawer/drawer.stories.jsx +0 -296
  62. package/src/components/empty/empty.jsx +0 -52
  63. package/src/components/empty/empty.module.less +0 -17
  64. package/src/components/empty/empty.stories.jsx +0 -26
  65. package/src/components/file-input/file-input.jsx +0 -101
  66. package/src/components/file-input/file-input.module.less +0 -3
  67. package/src/components/file-input/file-input.stories.jsx +0 -109
  68. package/src/components/form/field.jsx +0 -96
  69. package/src/components/form/field.stories.jsx +0 -101
  70. package/src/components/form/form.module.less +0 -30
  71. package/src/components/form/form.stories.jsx +0 -191
  72. package/src/components/heading/heading.jsx +0 -105
  73. package/src/components/heading/heading.module.less +0 -59
  74. package/src/components/heading/heading.stories.jsx +0 -60
  75. package/src/components/icon/deprecated-icon.jsx +0 -97
  76. package/src/components/icon/icon.jsx +0 -71
  77. package/src/components/icon/icon.module.less +0 -33
  78. package/src/components/icon/icon.stories.jsx +0 -37
  79. package/src/components/icon/icons.example.module.less +0 -4
  80. package/src/components/input/input.jsx +0 -167
  81. package/src/components/input/input.module.less +0 -94
  82. package/src/components/input/input.stories.jsx +0 -28
  83. package/src/components/input-group/input-group-addon/input-group-addon.jsx +0 -36
  84. package/src/components/input-group/input-group-addon/input-group-addon.module.less +0 -31
  85. package/src/components/input-group/input-group.jsx +0 -51
  86. package/src/components/input-group/input-group.module.less +0 -10
  87. package/src/components/input-group/input-group.stories.jsx +0 -77
  88. package/src/components/input-validation.stories.mdx +0 -61
  89. package/src/components/inputs.stories.mdx +0 -201
  90. package/src/components/label/label.jsx +0 -115
  91. package/src/components/label/label.module.less +0 -43
  92. package/src/components/label/label.stories.jsx +0 -60
  93. package/src/components/layout/column/column.jsx +0 -85
  94. package/src/components/layout/column/styles.js +0 -45
  95. package/src/components/layout/column.stories.jsx +0 -60
  96. package/src/components/layout/examples/afe.stories.jsx +0 -180
  97. package/src/components/layout/examples/blowout.stories.jsx +0 -68
  98. package/src/components/layout/examples/casing-loads.stories.jsx +0 -297
  99. package/src/components/layout/examples/formation.stories.jsx +0 -110
  100. package/src/components/layout/examples/projects.stories.jsx +0 -108
  101. package/src/components/layout/examples/reservoirs.stories.jsx +0 -211
  102. package/src/components/layout/examples/site.stories.jsx +0 -263
  103. package/src/components/layout/flex/flex.jsx +0 -48
  104. package/src/components/layout/flex/flex.stories.jsx +0 -59
  105. package/src/components/layout/form-row/form-row.jsx +0 -15
  106. package/src/components/layout/form-row/form-row.module.less +0 -11
  107. package/src/components/layout/grid/grid.jsx +0 -62
  108. package/src/components/layout/grid/grid.stories.jsx +0 -67
  109. package/src/components/layout/page/page.jsx +0 -42
  110. package/src/components/layout/page/page.module.less +0 -27
  111. package/src/components/layout/page.stories.jsx +0 -93
  112. package/src/components/layout/placeholder.jsx +0 -2
  113. package/src/components/layout/print-header/print-header.jsx +0 -22
  114. package/src/components/layout/print-header/print-header.module.less +0 -9
  115. package/src/components/layout/row/row.jsx +0 -75
  116. package/src/components/layout/row/row.module.less +0 -7
  117. package/src/components/layout/spacer/spacer.jsx +0 -26
  118. package/src/components/layout/spacer/spacer.stories.jsx +0 -50
  119. package/src/components/layout-forms.stories.mdx +0 -104
  120. package/src/components/layout-general.stories.mdx +0 -215
  121. package/src/components/list/list-row/item-content.jsx +0 -15
  122. package/src/components/list/list-row/label.jsx +0 -11
  123. package/src/components/list/list-row/list-heading.jsx +0 -52
  124. package/src/components/list/list-row/list-row.jsx +0 -128
  125. package/src/components/list/list-row/list-subheading.jsx +0 -72
  126. package/src/components/list/list-row/meta-content.jsx +0 -24
  127. package/src/components/list/list-row/meta-count.jsx +0 -10
  128. package/src/components/list/list-row/name.jsx +0 -45
  129. package/src/components/list/list.jsx +0 -276
  130. package/src/components/list/list.module.less +0 -256
  131. package/src/components/list/list.stories-data.jsx +0 -287
  132. package/src/components/list/list.stories.jsx +0 -458
  133. package/src/components/list/toggle-narrow.jsx +0 -13
  134. package/src/components/loader/loader.jsx +0 -63
  135. package/src/components/loader/loader.module.less +0 -63
  136. package/src/components/loader/loader.stories.jsx +0 -155
  137. package/src/components/menu/index.js +0 -7
  138. package/src/components/menu/layer/divider.jsx +0 -4
  139. package/src/components/menu/layer/heading.jsx +0 -15
  140. package/src/components/menu/layer/layer.jsx +0 -82
  141. package/src/components/menu/layer/option.jsx +0 -77
  142. package/src/components/menu/layer/path.js +0 -44
  143. package/src/components/menu/layer/placementOptions.js +0 -6
  144. package/src/components/menu/layer/section.jsx +0 -66
  145. package/src/components/menu/menu.jsx +0 -359
  146. package/src/components/menu/menu.module.less +0 -241
  147. package/src/components/menu/menu.stories-data.jsx +0 -168
  148. package/src/components/menu/menu.stories.jsx +0 -126
  149. package/src/components/menu/menu.test.js +0 -58
  150. package/src/components/menu/trigger/button.jsx +0 -50
  151. package/src/components/menu/trigger/component.jsx +0 -14
  152. package/src/components/menu/trigger/text.jsx +0 -25
  153. package/src/components/menu/trigger/trigger.jsx +0 -86
  154. package/src/components/message/dismiss.jsx +0 -26
  155. package/src/components/message/message.jsx +0 -137
  156. package/src/components/message/message.module.less +0 -114
  157. package/src/components/message/message.stories.jsx +0 -84
  158. package/src/components/modal/modal.jsx +0 -50
  159. package/src/components/modal/modal.module.less +0 -39
  160. package/src/components/modal/modal.stories.jsx +0 -162
  161. package/src/components/option-dropdown/heading.jsx +0 -6
  162. package/src/components/option-dropdown/layer.jsx +0 -81
  163. package/src/components/option-dropdown/option-dropdown.jsx +0 -53
  164. package/src/components/option-dropdown/option-dropdown.module.less +0 -50
  165. package/src/components/option-dropdown/option-dropdown.stories.jsx +0 -35
  166. package/src/components/option-dropdown/option.jsx +0 -13
  167. package/src/components/pagination/pagination.jsx +0 -139
  168. package/src/components/pagination/pagination.module.less +0 -11
  169. package/src/components/pagination/pagination.stories.jsx +0 -78
  170. package/src/components/pagination/pagination.test.js +0 -92
  171. package/src/components/pagination/pagination.viewdata.js +0 -66
  172. package/src/components/pop-confirm/content.jsx +0 -25
  173. package/src/components/pop-confirm/pop-confirm.jsx +0 -61
  174. package/src/components/pop-confirm/pop-confirm.module.less +0 -18
  175. package/src/components/pop-confirm/pop-confirm.stories.jsx +0 -53
  176. package/src/components/popover/popover.jsx +0 -112
  177. package/src/components/popover/popover.module.less +0 -22
  178. package/src/components/popover/popover.stories.jsx +0 -59
  179. package/src/components/portal/portal.jsx +0 -16
  180. package/src/components/portal/portal.stories.jsx +0 -69
  181. package/src/components/progress-bar/progress-bar.jsx +0 -64
  182. package/src/components/progress-bar/progress-bar.module.less +0 -64
  183. package/src/components/progress-bar/progress-bar.stories.jsx +0 -23
  184. package/src/components/radio-button/radio-button.jsx +0 -139
  185. package/src/components/radio-button/radio-button.module.less +0 -135
  186. package/src/components/radio-button/radio-button.stories.jsx +0 -37
  187. package/src/components/radio-button/radio-input.jsx +0 -52
  188. package/src/components/select/custom-select/custom-select.jsx +0 -440
  189. package/src/components/select/custom-select/custom-select.module.less +0 -123
  190. package/src/components/select/custom-select/custom-select.reducer.js +0 -157
  191. package/src/components/select/custom-select/layer/heading.jsx +0 -13
  192. package/src/components/select/custom-select/layer/layer.jsx +0 -73
  193. package/src/components/select/custom-select/layer/option.jsx +0 -54
  194. package/src/components/select/custom-select/layer/placementOptions.js +0 -7
  195. package/src/components/select/custom-select/layer/section.jsx +0 -35
  196. package/src/components/select/custom-select/trigger/input.jsx +0 -100
  197. package/src/components/select/custom-select/trigger/trigger.jsx +0 -155
  198. package/src/components/select/custom-select/trigger/trigger.module.less +0 -289
  199. package/src/components/select/native-select/native-select.jsx +0 -198
  200. package/src/components/select/native-select/native-select.module.less +0 -107
  201. package/src/components/select/select.input.js +0 -146
  202. package/src/components/select/select.jsx +0 -207
  203. package/src/components/select/select.stories-data.jsx +0 -92
  204. package/src/components/select/select.stories.jsx +0 -135
  205. package/src/components/select/select.test.js +0 -519
  206. package/src/components/side-bar/container.module.less +0 -29
  207. package/src/components/side-bar/link.jsx +0 -83
  208. package/src/components/side-bar/sections.jsx +0 -23
  209. package/src/components/side-bar/side-bar.jsx +0 -102
  210. package/src/components/side-bar/side-bar.module.less +0 -137
  211. package/src/components/side-bar/side-bar.stories.jsx +0 -101
  212. package/src/components/slider/rc-slider.less +0 -47
  213. package/src/components/slider/slider-tooltip.jsx +0 -20
  214. package/src/components/slider/slider.jsx +0 -233
  215. package/src/components/slider/slider.module.less +0 -40
  216. package/src/components/slider/slider.stories.jsx +0 -110
  217. package/src/components/spinner/spinner.jsx +0 -37
  218. package/src/components/spinner/spinner.module.less +0 -115
  219. package/src/components/spinner/spinner.stories.jsx +0 -24
  220. package/src/components/table/cell/cell.jsx +0 -621
  221. package/src/components/table/cell/cell.module.less +0 -164
  222. package/src/components/table/footer/footer.jsx +0 -66
  223. package/src/components/table/footer/footer.module.less +0 -14
  224. package/src/components/table/helper.js +0 -64
  225. package/src/components/table/helper.test.js +0 -166
  226. package/src/components/table/icon/icon.module.less +0 -31
  227. package/src/components/table/row/expanded-content-row.jsx +0 -16
  228. package/src/components/table/row/row.jsx +0 -253
  229. package/src/components/table/row/row.module.less +0 -62
  230. package/src/components/table/table-scroll-wrapper.jsx +0 -49
  231. package/src/components/table/table.jsx +0 -234
  232. package/src/components/table/table.module.less +0 -146
  233. package/src/components/table/table.stories-data.jsx +0 -875
  234. package/src/components/table/table.stories.jsx +0 -759
  235. package/src/components/table/table.test.js +0 -30
  236. package/src/components/table/table.variables.less +0 -11
  237. package/src/components/table/table.viewdata.js +0 -26
  238. package/src/components/table/title/title.jsx +0 -30
  239. package/src/components/table/title/title.module.less +0 -11
  240. package/src/components/tabs/content.jsx +0 -14
  241. package/src/components/tabs/label.jsx +0 -50
  242. package/src/components/tabs/tabs.jsx +0 -191
  243. package/src/components/tabs/tabs.module.less +0 -73
  244. package/src/components/tabs/tabs.stories.jsx +0 -110
  245. package/src/components/text/text.jsx +0 -64
  246. package/src/components/text/text.module.less +0 -45
  247. package/src/components/text/text.stories.jsx +0 -31
  248. package/src/components/text-link/text-link.jsx +0 -23
  249. package/src/components/text-link/text-link.stories.jsx +0 -20
  250. package/src/components/textarea/textarea.jsx +0 -126
  251. package/src/components/textarea/textarea.module.less +0 -55
  252. package/src/components/textarea/textarea.stories.jsx +0 -26
  253. package/src/components/toaster/toaster.jsx +0 -39
  254. package/src/components/toaster/toaster.less +0 -17
  255. package/src/components/toaster/toaster.stories.jsx +0 -116
  256. package/src/components/toggle/toggle.jsx +0 -65
  257. package/src/components/toggle/toggle.module.less +0 -139
  258. package/src/components/toggle/toggle.stories.jsx +0 -26
  259. package/src/components/tooltip/tooltip-layer.jsx +0 -72
  260. package/src/components/tooltip/tooltip.jsx +0 -108
  261. package/src/components/tooltip/tooltip.module.less +0 -28
  262. package/src/components/tooltip/tooltip.stories.jsx +0 -71
  263. package/src/components/top-bar/element/element.jsx +0 -72
  264. package/src/components/top-bar/element/link.jsx +0 -29
  265. package/src/components/top-bar/title.jsx +0 -24
  266. package/src/components/top-bar/top-bar.jsx +0 -79
  267. package/src/components/top-bar/top-bar.module.less +0 -190
  268. package/src/components/top-bar/top-bar.stories.jsx +0 -137
  269. package/src/components/top-bar/warning.jsx +0 -6
  270. package/src/components/tree/tree-item.jsx +0 -79
  271. package/src/components/tree/tree-placeholder.jsx +0 -6
  272. package/src/components/tree/tree.jsx +0 -129
  273. package/src/components/tree/tree.module.less +0 -33
  274. package/src/components/tree/tree.stories-data.jsx +0 -89
  275. package/src/components/tree/tree.stories.jsx +0 -106
  276. package/src/docs/components/page/page.jsx +0 -16
  277. package/src/docs/config/config.js +0 -1
  278. package/src/docs/html/favicon.png +0 -0
  279. package/src/docs/html/index.html +0 -11
  280. package/src/docs/navigation/footer/footer.jsx +0 -48
  281. package/src/docs/navigation/header/header.jsx +0 -39
  282. package/src/docs/navigation/header/header.module.less +0 -32
  283. package/src/docs/navigation/routes/routes.jsx +0 -16
  284. package/src/docs/start.jsx +0 -12
  285. package/src/docs/views/main/main.jsx +0 -209
  286. package/src/docs/views/main/main.module.less +0 -14
  287. package/src/docs/views/not-found/not-found.jsx +0 -5
  288. package/src/helpers/disabled-context.js +0 -8
  289. package/src/helpers/styles.js +0 -68
  290. package/src/helpers/text.js +0 -6
  291. package/src/helpers/types.js +0 -5
  292. package/src/hooks/index.js +0 -3
  293. package/src/hooks/use-focus.js +0 -11
  294. package/src/hooks/use-keyboard-event.js +0 -16
  295. package/src/hooks/use-window-width.js +0 -20
  296. package/src/images/icons/icon-drop.png +0 -0
  297. package/src/images/icons/icon-share.png +0 -0
  298. package/src/images/icons/icons8-junction.svg +0 -4
  299. package/src/images/logo.png +0 -0
  300. package/src/images/logo.svg +0 -13
  301. package/src/images/oliasoft-logo.svg +0 -1
  302. package/src/style/colors.less +0 -26
  303. package/src/style/external.less +0 -10
  304. package/src/style/fonts/lato/Lato-Bold.woff2 +0 -0
  305. package/src/style/fonts/lato/Lato-BoldItalic.woff2 +0 -0
  306. package/src/style/fonts/lato/Lato-Italic.woff2 +0 -0
  307. package/src/style/fonts/lato/Lato-Regular.woff2 +0 -0
  308. package/src/style/fonts.less +0 -27
  309. package/src/style/global.less +0 -51
  310. package/src/style/mixins.less +0 -68
  311. package/src/style/reset/reset.less +0 -34
  312. package/src/style/shared.less +0 -25
  313. package/src/style/theme.dark.less +0 -37
  314. package/src/style/theme.default.less +0 -74
  315. package/src/style/variables.less +0 -49
  316. package/webpack/webpack.common.js +0 -39
  317. package/webpack/webpack.common.rules.js +0 -102
  318. package/webpack/webpack.dev.js +0 -22
  319. package/webpack/webpack.prod.js +0 -23
  320. package/webpack/webpack.resolve.js +0 -22
@@ -1,875 +0,0 @@
1
- import React from 'react';
2
- import {
3
- FaArrowDown,
4
- FaArrowUp,
5
- FaCheck,
6
- FaExclamationCircle,
7
- FaExclamationTriangle,
8
- FaHeartbeat,
9
- FaMinus,
10
- FaPlus,
11
- FaShareSquare,
12
- } from 'react-icons/fa';
13
- import { Text } from '../text/text';
14
-
15
- export const table = {
16
- headers: [
17
- {
18
- cells: [
19
- { value: 'Name' },
20
- { value: 'Weight' },
21
- { value: 'Energy' },
22
- { value: 'Origin' },
23
- ],
24
- },
25
- ],
26
- rows: [
27
- {
28
- cells: [
29
- { value: 'Brown rice', testId: 'table-tbody-cell-brown-rice' },
30
- { value: 100, testId: 'table-tbody-cell-100' },
31
- { value: 361, testId: 'table-tbody-cell-361' },
32
- { value: 'Vietnam', testId: 'table-tbody-cell-vietnam' },
33
- ],
34
- },
35
- {
36
- cells: [
37
- { value: 'Buckwheat', testId: 'table-tbody-cell-buckwheat' },
38
- { value: 50, testId: 'table-tbody-cell-50' },
39
- { value: 358, testId: 'table-tbody-cell-358' },
40
- { value: 'Poland', testId: 'table-tbody-cell-poland' },
41
- ],
42
- },
43
- {
44
- cells: [
45
- { value: 'Couscous', testId: 'table-tbody-cell-couscous' },
46
- { value: 10, testId: 'table-tbody-cell-10' },
47
- { value: 368, testId: 'table-tbody-cell-368' },
48
- { value: 'France', testId: 'table-tbody-cell-france' },
49
- ],
50
- },
51
- ],
52
- };
53
-
54
- export const tableColumnWidths = {
55
- ...table,
56
- columnWidths: ['200px', '20%', '100px', 'auto'],
57
- };
58
-
59
- export const tableStaticTooltips = {
60
- ...table,
61
- rows: table.rows.map((row) => ({
62
- ...row,
63
- cells: row.cells.map((cell) => ({ ...cell, tooltip: 'Tooltip' })),
64
- })),
65
- };
66
-
67
- export const tableBreakLongContent = {
68
- ...table,
69
- rows: [
70
- {
71
- cells: [
72
- {
73
- breakWord: true,
74
- value:
75
- 'LoremipsumdolorsitametconsecteturadipiscingelitseddoeiusmodtemporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeufugiatnullapariaturufugiatnullapariatur',
76
- },
77
- { value: 100 },
78
- { value: 361 },
79
- { value: 'Vietnam' },
80
- ],
81
- },
82
- ...table.rows,
83
- ],
84
- };
85
-
86
- export const tableUnits = {
87
- ...table,
88
- headers: [
89
- ...table.headers,
90
- {
91
- cells: [
92
- {},
93
- {
94
- options: [
95
- { label: 'kg', value: 'kg' },
96
- { label: 'tonnes', value: 'tonnes' },
97
- ],
98
- type: 'Select',
99
- searchable: false,
100
- value: { label: 'kg', value: 'kg' },
101
- onChange: () => {},
102
- },
103
- { type: 'Unit', value: 'kcal / 100g' },
104
- {},
105
- ],
106
- },
107
- ],
108
- };
109
-
110
- export const tableActiveRow = {
111
- ...table,
112
- rows: table.rows.map((row, index) => ({
113
- ...row,
114
- active: index === 0,
115
- onRowClick: () => {},
116
- })),
117
- };
118
-
119
- export const tableTitle = {
120
- ...table,
121
- name: 'Food',
122
- };
123
-
124
- export const tableChildComponent = {
125
- ...table,
126
- name: 'Food',
127
- actions: [{ childComponent: <FaHeartbeat /> }],
128
- };
129
-
130
- export const tableInfiniteScroll = {
131
- ...table,
132
- headers: [
133
- ...table.headers,
134
- {
135
- cells: [
136
- {},
137
- {
138
- options: [
139
- { label: 'kg', value: 'kg' },
140
- { label: 'tonnes', value: 'tonnes' },
141
- ],
142
- type: 'Select',
143
- native: true,
144
- value: { label: 'kg', value: 'kg' },
145
- onChange: () => {},
146
- },
147
- { type: 'Unit', value: 'kcal / 100g' },
148
- {},
149
- ],
150
- },
151
- ],
152
- bordered: true,
153
- infiniteScroll: true,
154
- maxHeight: '500px',
155
- stickyHeaders: true,
156
- rows: Array.from({ length: 100 }, (_, index) => ({
157
- cells: [
158
- { type: 'Input', value: `Strawberry Letter ${index + 1}` },
159
- { type: 'Input', value: 100 },
160
- { type: 'Input', value: 361 },
161
- { type: 'Input', value: 'Vietnam' },
162
- ],
163
- })),
164
- footer: {
165
- content: (
166
- <>
167
- <strong>Footer content:</strong> goes here
168
- </>
169
- ),
170
- },
171
- };
172
-
173
- export const tableInfiniteScrollFullHeight = {
174
- ...tableInfiniteScroll,
175
- maxHeight: '100%',
176
- };
177
-
178
- export const tableInfiniteScrollShort = {
179
- ...tableInfiniteScroll,
180
- rows: Array.from({ length: 1 }, (_, index) => ({
181
- cells: [
182
- { type: 'Input', value: `Strawberry Letter ${index + 1}` },
183
- { type: 'Input', value: 100 },
184
- { type: 'Input', value: 361 },
185
- { type: 'Input', value: 'Vietnam' },
186
- ],
187
- })),
188
- };
189
-
190
- export const tableInfiniteScrollDnD = {
191
- ...tableInfiniteScroll,
192
- draggable: true,
193
- };
194
-
195
- export const tableRowFocus = {
196
- ...table,
197
- rows: table.rows.map((row, index) => ({
198
- ...row,
199
- onRowFocus: () => {},
200
- })),
201
- };
202
-
203
- const subComponent = () => {
204
- return (
205
- <ul>
206
- <li>Carrots</li>
207
- <li>Chocolate</li>
208
- <li>Chorizo</li>
209
- </ul>
210
- );
211
- };
212
-
213
- export const tableJsxContent = {
214
- headers: [
215
- {
216
- cells: [{ value: 'Name' }, { value: 'Content' }],
217
- },
218
- ],
219
- rows: [
220
- {
221
- cells: [{ value: 'Sub-component' }, { value: subComponent() }],
222
- },
223
- {
224
- cells: [
225
- { value: 'JSX' },
226
- {
227
- value: (
228
- <div>
229
- Some <Text bold>bold content</Text>
230
- </div>
231
- ),
232
- },
233
- ],
234
- },
235
- ],
236
- };
237
-
238
- export const tableColspan = {
239
- ...table,
240
- headers: [
241
- {
242
- cells: [{ value: '' }, { value: 'Stats', colSpan: 2 }, { value: '' }],
243
- },
244
- ...table.headers,
245
- ],
246
- rows: [
247
- ...table.rows,
248
- {
249
- cells: [{ value: 'Total', colSpan: 4 }],
250
- },
251
- ],
252
- };
253
-
254
- export const tableColspanWidths = {
255
- ...table,
256
- columnWidths: ['auto', '120px', '120px', 'auto'],
257
- headers: [
258
- {
259
- cells: [
260
- { value: 'Header' },
261
- { value: 'Header', colSpan: 2 },
262
- { value: 'Header' },
263
- ],
264
- },
265
- ],
266
- };
267
-
268
- export const tableAlignment = {
269
- ...tableColspan,
270
- columnAlignment: ['left', 'right', 'right', 'left', 'right'],
271
- columnHeaderAlignments: [
272
- ['', 'center', ''],
273
- ['', 'right', 'right', ''],
274
- ['', 'right', 'right', ''],
275
- ],
276
- };
277
-
278
- export const tableEditable = {
279
- headers: [
280
- {
281
- cells: [
282
- { value: 'Name', testId: 'with-editable-cells-cell-name' },
283
- { value: 'Weight (kg)' },
284
- { value: 'Energy (kcal / 100g)' },
285
- { value: 'Origin' },
286
- ],
287
- },
288
- ],
289
- rows: [
290
- {
291
- cells: [
292
- {
293
- value: 'Brown rice',
294
- type: 'Input',
295
- onChange: () => {},
296
- testId: 'table-tbody-cell-brown-rice',
297
- disabled: true,
298
- },
299
- {
300
- type: 'Select',
301
- native: true,
302
- options: [
303
- { label: 50, value: 50 },
304
- { label: 100, value: 100 },
305
- ],
306
- value: { label: 100, value: 100 },
307
- onChange: () => {},
308
- },
309
- { value: 361, type: 'Input', onChange: () => {} },
310
- {
311
- type: 'Select',
312
- options: [
313
- { label: 'France', value: 'France' },
314
- { label: 'Poland', value: 'Poland' },
315
- { label: 'Vietnam', value: 'Vietnam' },
316
- ],
317
- value: { label: 'Vietnam', value: 'Vietnam' },
318
- onChange: () => {},
319
- },
320
- ],
321
- },
322
- {
323
- cells: [
324
- {
325
- value: 'Buckwheat',
326
- type: 'Input',
327
- onChange: () => {},
328
- testId: 'table-tbody-cell-buckwheat',
329
- },
330
- {
331
- type: 'Select',
332
- native: true,
333
- options: [
334
- { label: 50, value: 50 },
335
- { label: 100, value: 100 },
336
- ],
337
- value: { label: 100, value: 100 },
338
- onChange: () => {},
339
- },
340
- { value: 361, type: 'Input', onChange: () => {} },
341
- {
342
- type: 'Select',
343
- options: [
344
- { label: 'France', value: 'France' },
345
- { label: 'Poland', value: 'Poland' },
346
- { label: 'Vietnam', value: 'Vietnam' },
347
- ],
348
- value: { label: 'Poland', value: 'Poland' },
349
- onChange: () => {},
350
- error: 'Error',
351
- },
352
- ],
353
- },
354
- {
355
- cells: [
356
- {
357
- value: 'Couscous',
358
- type: 'Input',
359
- onChange: () => {},
360
- testId: 'table-tbody-cell-couscous',
361
- },
362
- {
363
- type: 'Select',
364
- native: true,
365
- options: [
366
- { label: 50, value: 50 },
367
- { label: 100, value: 100 },
368
- ],
369
- value: { label: 100, value: 100 },
370
- onChange: () => {},
371
- warning: 'Warning',
372
- },
373
- { value: 361, type: 'Input', onChange: () => {} },
374
- {
375
- type: 'Select',
376
- options: [
377
- { label: 'France', value: 'France' },
378
- { label: 'Poland', value: 'Poland' },
379
- { label: 'Vietnam', value: 'Vietnam' },
380
- ],
381
- value: { label: 'France', value: 'France' },
382
- onChange: () => {},
383
- },
384
- ],
385
- },
386
- ],
387
- };
388
-
389
- export const tableFilters = {
390
- ...table,
391
- headers: [
392
- ...table.headers,
393
- {
394
- cells: [
395
- {
396
- value: '',
397
- type: 'Input',
398
- placeholder: 'Search',
399
- onChange: () => {},
400
- },
401
- {
402
- value: '',
403
- type: 'Input',
404
- placeholder: 'Search',
405
- onChange: () => {},
406
- },
407
- {
408
- value: '',
409
- type: 'Input',
410
- placeholder: 'Search',
411
- onChange: () => {},
412
- },
413
- {
414
- value: '',
415
- type: 'Input',
416
- placeholder: 'Search',
417
- onChange: () => {},
418
- },
419
- ],
420
- },
421
- ],
422
- };
423
-
424
- export const tableStickyHeaders = {
425
- maxHeight: '400px',
426
- name: 'Food',
427
- stickyHeaders: 'true',
428
- headers: [
429
- {
430
- cells: [
431
- { value: 'Name' },
432
- { value: 'Weight' },
433
- { value: 'Energy' },
434
- { value: 'Origin' },
435
- ],
436
- actions: [
437
- {
438
- primary: true,
439
- icon: 'plus',
440
- label: 'Add',
441
- onClick: () => {},
442
- },
443
- ],
444
- },
445
- {
446
- cells: [
447
- {},
448
- {
449
- options: [
450
- { label: 'kg', value: 'kg' },
451
- { label: 'tonnes', value: 'tonnes' },
452
- ],
453
- type: 'Select',
454
- native: true,
455
- value: { label: 'kg', value: 'kg' },
456
- onChange: () => {},
457
- },
458
- { type: 'Unit', value: 'kcal / 100g' },
459
- {},
460
- ],
461
- },
462
- ],
463
- rows: Array.from({ length: 100 }, () => ({
464
- cells: [
465
- { type: 'Input', value: 'Brown rice' },
466
- { type: 'Input', value: 100 },
467
- { type: 'Input', value: 361, error: 'test error' },
468
- { type: 'Input', value: 'Vietnam' },
469
- ],
470
- })),
471
- };
472
-
473
- export const tableSort = {
474
- headers: [
475
- {
476
- cells: [
477
- { value: 'Name' },
478
- {
479
- value: 'Weight (kg)',
480
- hasSort: true,
481
- sort: 'up',
482
- sortPriority: 1,
483
- onSort: () => {},
484
- },
485
- {
486
- value: 'Energy (kcal / 100g)',
487
- hasSort: true,
488
- sort: 'down',
489
- sortPriority: 2,
490
- onSort: () => {},
491
- },
492
- {
493
- value: 'Origin',
494
- hasSort: true,
495
- sort: '',
496
- sortPriority: 1,
497
- onSort: () => {},
498
- },
499
- ],
500
- },
501
- ],
502
- rows: [
503
- {
504
- cells: [
505
- { value: 'Brown rice' },
506
- { value: 100 },
507
- { value: 361 },
508
- { value: 'Vietnam' },
509
- ],
510
- },
511
- {
512
- cells: [
513
- { value: 'Buckwheat' },
514
- { value: 50 },
515
- { value: 358 },
516
- { value: 'Poland' },
517
- ],
518
- },
519
- {
520
- cells: [
521
- { value: 'Couscous' },
522
- { value: 10 },
523
- { value: 368 },
524
- { value: 'France' },
525
- ],
526
- },
527
- ],
528
- };
529
-
530
- export const tableIcons = {
531
- headers: [
532
- {
533
- cells: [
534
- {},
535
- { value: 'Name' },
536
- { value: 'Weight (kg)' },
537
- { value: 'Energy (kcal / 100g)' },
538
- { value: 'Origin' },
539
- ],
540
- },
541
- ],
542
- rows: [
543
- {
544
- cells: [
545
- { type: 'Icon', icon: <FaCheck color="var(--color-text-success)" /> },
546
- { value: 'Brown rice' },
547
- { value: 100 },
548
- { value: 361 },
549
- { value: 'Vietnam' },
550
- ],
551
- },
552
- {
553
- cells: [
554
- {
555
- type: 'Icon',
556
- icon: <FaExclamationCircle color="var(--color-text-warning)" />,
557
- },
558
- { value: 'Buckwheat' },
559
- { value: 50 },
560
- { value: 358 },
561
- { value: 'Poland' },
562
- ],
563
- },
564
- {
565
- cells: [
566
- {
567
- type: 'Icon',
568
- icon: <FaExclamationTriangle color="var(--color-text-error)" />,
569
- },
570
- { value: 'Couscous' },
571
- { value: 10 },
572
- { value: 368 },
573
- { value: 'France' },
574
- ],
575
- },
576
- ],
577
- };
578
-
579
- export const tableActions = {
580
- headers: [
581
- {
582
- cells: [
583
- { value: 'Name' },
584
- { value: 'Weight (kg)' },
585
- { value: 'Energy (kcal / 100g)' },
586
- { value: 'Origin' },
587
- ],
588
- actions: [
589
- {
590
- primary: true,
591
- label: 'Add',
592
- icon: <FaPlus />,
593
- onClick: () => {},
594
- },
595
- ],
596
- },
597
- ],
598
- rows: [
599
- {
600
- cells: [
601
- { value: 'Brown rice' },
602
- { value: 100 },
603
- { value: 361 },
604
- { value: 'Vietnam' },
605
- ],
606
- actions: [{ label: 'Delete', icon: <FaMinus />, onClick: () => {} }],
607
- },
608
- {
609
- cells: [
610
- { value: 'Buckwheat' },
611
- { value: 50 },
612
- { value: 358 },
613
- { value: 'Poland' },
614
- ],
615
- actions: [{ label: 'Delete', icon: <FaMinus />, onClick: () => {} }],
616
- },
617
- {
618
- cells: [
619
- { value: 'Couscous' },
620
- { value: 10 },
621
- { value: 368 },
622
- { value: 'France' },
623
- ],
624
- actions: [
625
- {
626
- label: 'test',
627
- icon: <FaMinus />,
628
- onClick: () => {},
629
- hidden: true,
630
- },
631
- ],
632
- },
633
- ],
634
- };
635
-
636
- export const tableWithSubActions = {
637
- headers: [
638
- {
639
- cells: [
640
- { value: 'Name' },
641
- { value: 'Weight (kg)' },
642
- { value: 'Energy (kcal / 100g)' },
643
- { value: 'Origin' },
644
- ],
645
- actions: [
646
- {
647
- primary: true,
648
- label: 'Add',
649
- icon: <FaPlus />,
650
- onClick: () => {},
651
- },
652
- ],
653
- },
654
- ],
655
- rows: [
656
- {
657
- cells: [
658
- { value: 'Brown rice' },
659
- { value: 100 },
660
- { value: 361 },
661
- { value: 'Vietnam' },
662
- ],
663
- actions: [
664
- {
665
- label: 'More',
666
- subActions: [
667
- {
668
- label: 'Move Up',
669
- icon: <FaArrowUp />,
670
- onClick: () => {},
671
- },
672
- {
673
- label: 'Move Down',
674
- icon: <FaArrowDown />,
675
- onClick: () => {},
676
- },
677
- { label: 'Delete', icon: <FaMinus />, onClick: () => {} },
678
- ],
679
- },
680
- ],
681
- },
682
- {
683
- cells: [
684
- { value: 'Buckwheat' },
685
- { value: 50 },
686
- { value: 358 },
687
- { value: 'Poland' },
688
- ],
689
- actions: [
690
- {
691
- label: 'More',
692
- subActions: [
693
- {
694
- label: 'Move Up',
695
- icon: <FaArrowUp />,
696
- onClick: () => {},
697
- },
698
- {
699
- label: 'Move Down',
700
- icon: <FaArrowDown />,
701
- onClick: () => {},
702
- },
703
- { label: 'Delete', icon: <FaMinus />, onClick: () => {} },
704
- ],
705
- },
706
- ],
707
- },
708
- {
709
- cells: [
710
- { value: 'Couscous' },
711
- { value: 10 },
712
- { value: 368 },
713
- { value: 'France' },
714
- ],
715
- actions: [
716
- {
717
- label: 'More',
718
- subActions: [
719
- {
720
- label: 'Move Up',
721
- icon: <FaArrowUp />,
722
- onClick: () => {},
723
- },
724
- {
725
- label: 'Move Down',
726
- icon: <FaArrowDown />,
727
- onClick: () => {},
728
- },
729
- { label: 'Delete', icon: <FaMinus />, onClick: () => {} },
730
- ],
731
- },
732
- ],
733
- },
734
- ],
735
- };
736
-
737
- export const tableFooter = {
738
- ...table,
739
- footer: {
740
- content: (
741
- <>
742
- <strong>Footer content:</strong> goes here
743
- </>
744
- ),
745
- pagination: {
746
- rowCount: 500,
747
- selectedPage: 10,
748
- rowsPerPage: {
749
- onChange: () => {},
750
- options: [
751
- { label: '10 / page', value: 10 },
752
- { label: '20 / page', value: 20 },
753
- { label: '50 / page', value: 50 },
754
- { label: 'Show all', value: 0 },
755
- ],
756
- value: 20,
757
- },
758
- goTo: { onChange: () => {} },
759
- onSelectPage: () => {},
760
- small: true,
761
- },
762
- actions: [{ label: 'Share', icon: <FaShareSquare />, onClick: () => {} }],
763
- },
764
- };
765
-
766
- export const tableHelpLibraryIcons = {
767
- ...table,
768
- headers: table.headers.map((header) => ({
769
- ...header,
770
- cells: header.cells.map((cell) => ({
771
- ...cell,
772
- helpIcon: {
773
- onClick: () => console.log('Help clicked'),
774
- tooltip: 'Help text goes here',
775
- },
776
- libraryIcon: {
777
- onClick: () => console.log('Library clicked'),
778
- tooltip: 'Edit in library',
779
- },
780
- })),
781
- })),
782
- };
783
-
784
- export const tableOverflowing = {
785
- columnWidths: [undefined, '100px', '100px', '100px', undefined],
786
- headers: [
787
- {
788
- cells: [
789
- { value: 'Name' },
790
- { value: 'Weight (kg)' },
791
- { value: 'Energy (kcal / 100g)' },
792
- { value: 'Origin' },
793
- { value: 'Static' },
794
- ],
795
- },
796
- ],
797
- rows: [
798
- {
799
- cells: [
800
- {
801
- breakWord: true,
802
- value:
803
- 'LoremipsumdolorsitametconsecteturadipiscingelitseddoeiusmodtemporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeufugiatnullapariaturufugiatnullapariatur',
804
- },
805
- {
806
- type: 'Select',
807
- native: true,
808
- options: [
809
- { label: 50, value: 50 },
810
- { label: 100, value: 100 },
811
- ],
812
- value: { label: 100, value: 100 },
813
- onChange: () => {},
814
- disabled: true,
815
- },
816
- {
817
- type: 'Select',
818
- options: [
819
- { label: 'Vietnam', value: 'Vietnam' },
820
- { label: 'Other', value: 'Other' },
821
- ],
822
- value: { label: 'Vietnam', value: 'Vietnam' },
823
- onChange: () => {},
824
- error: 'Error',
825
- },
826
- {
827
- value: 'Brown rice',
828
- type: 'Input',
829
- onChange: () => {},
830
- testId: 'table-tbody-cell-brown-rice',
831
- warning: 'Warning message',
832
- },
833
- {
834
- value: 'Static warning',
835
- warning: 'Warning message',
836
- },
837
- ],
838
- },
839
- {
840
- cells: [
841
- { value: 'Buckwheat' },
842
- {
843
- type: 'Select',
844
- native: true,
845
- options: [
846
- { label: 50, value: 50 },
847
- { label: 100, value: 100 },
848
- ],
849
- value: { label: 100, value: 100 },
850
- onChange: () => {},
851
- },
852
- {
853
- type: 'Select',
854
- options: [
855
- { label: 'Vietnam', value: 'Vietnam' },
856
- { label: 'Other', value: 'Other' },
857
- ],
858
- value: { label: 'Vietnam', value: 'Vietnam' },
859
- onChange: () => {},
860
- },
861
- {
862
- value: 'Brown rice',
863
- type: 'Input',
864
- onChange: () => {},
865
- testId: 'table-tbody-cell-brown-rice',
866
- },
867
- {
868
- type: 'Link',
869
- value: 'Static error link',
870
- error: 'Error message',
871
- },
872
- ],
873
- },
874
- ],
875
- };