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

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,215 +0,0 @@
1
- import { Canvas, Meta, Story } from '@storybook/addon-docs';
2
- import { Row, Column, Flex, Grid, Spacer, Button, Card } from '../..';
3
-
4
- <Meta title="Layout (General)" />
5
-
6
- # Layout (General)
7
-
8
- ## Flex
9
-
10
- The `Flex` component is a basic flexbox wrapper with optional props for `alignItems`, `justifyContent` and `flexDirection`. This is a conveninent way to center items vertically and/or horizontally, to align them to opposite edges, or align them to the far side.
11
-
12
- This is best for situations for more fluid layouts, because the children set their own width.
13
-
14
- <Canvas>
15
- <Flex alignItems="center">
16
- <Button label="Button" />
17
- <Spacer width="20px" />
18
- Text
19
- </Flex>
20
- </Canvas>
21
-
22
- <Canvas>
23
- <Flex alignItems="center" justifyContent="space-between">
24
- <Button label="Button" />
25
- Text
26
- </Flex>
27
- </Canvas>
28
-
29
- <Canvas>
30
- <Flex alignItems="center" justifyContent="flex-end">
31
- <Button label="Button" />
32
- <Spacer width="20px" />
33
- Text
34
- </Flex>
35
- </Canvas>
36
-
37
- <Canvas>
38
- <Flex alignItems="center" justifyContent="center">
39
- <Button label="Button" />
40
- <Spacer width="20px" />
41
- Text
42
- </Flex>
43
- </Canvas>
44
-
45
- <Canvas>
46
- <Flex alignItems="center" direction="column">
47
- <Button label="Button" />
48
- <Spacer />
49
- Text
50
- </Flex>
51
- </Canvas>
52
-
53
- ## Grid
54
-
55
- Similar to `Flex`, the `Grid` component is a conveninence wrapper for grid CSS. This is best for situations where the layout is predictable and static (i.e. you know how many columns there will be and how wide you want each to be).
56
-
57
- <Canvas>
58
- <Grid columns="1fr 1fr 1fr">
59
- <Card>Item 1</Card>
60
- <Card>Item 2</Card>
61
- <Card>Item 3</Card>
62
- </Grid>
63
- </Canvas>
64
-
65
- <Canvas>
66
- <Grid columns="100px 1fr 1fr">
67
- <Card>Item 1</Card>
68
- <Card>Item 2</Card>
69
- <Card>Item 3</Card>
70
- </Grid>
71
- </Canvas>
72
-
73
- <Canvas>
74
- <Grid columns="1fr 1fr 1fr">
75
- <Card>Item 1</Card>
76
- <Card>Item 2</Card>
77
- <Card>Item 3</Card>
78
- <Card>Item 4</Card>
79
- <Card>Item 5</Card>
80
- <Card>Item 6</Card>
81
- </Grid>
82
- </Canvas>
83
-
84
- ### Gap
85
-
86
- Use the `gap` prop to set spacing between grid items. You can set to the spacing you need, or omit the value for default spacing (20px).
87
-
88
- <Canvas>
89
- <Grid columns="1fr 1fr 1fr" gap>
90
- <Card>Item 1</Card>
91
- <Card>Item 2</Card>
92
- <Card>Item 3</Card>
93
- <Card>Item 4</Card>
94
- <Card>Item 5</Card>
95
- <Card>Item 6</Card>
96
- </Grid>
97
- </Canvas>
98
-
99
- <Canvas>
100
- <Grid columns="1fr 1fr 1fr" gap="5px">
101
- <Card>Item 1</Card>
102
- <Card>Item 2</Card>
103
- <Card>Item 3</Card>
104
- <Card>Item 4</Card>
105
- <Card>Item 5</Card>
106
- <Card>Item 6</Card>
107
- </Grid>
108
- </Canvas>
109
-
110
- ### Responsive grid
111
-
112
- To change the layout on smaller devices, you can set props for `columnsTablet` (up to 992px wide) and/or `columnsMobile` (up to 575px wide).
113
-
114
- <Canvas>
115
- <Grid columns="1fr 1fr 1fr" columnsTablet="1fr 1fr" columnsMobile="1fr">
116
- <Card>Item 1</Card>
117
- <Card>Item 2</Card>
118
- <Card>Item 3</Card>
119
- <Card>Item 4</Card>
120
- <Card>Item 5</Card>
121
- <Card>Item 6</Card>
122
- </Grid>
123
- </Canvas>
124
-
125
- ## Rows & Columns
126
-
127
- `Row` and `Column` are a more opinionated flexbox layout, best used together for top-level layouts that require separate scrolling areas. For most layout needs it would be better to use something simpler like `Flex` or `Grid`.
128
-
129
- ### Default
130
-
131
- Each `Column` shares the available width of its `Row`.
132
-
133
- <Canvas>
134
- <Row spacing="0" height="100px">
135
- <Column scroll>
136
- Content of first column lorem ipsum dolor sit amet, consectetur adipiscing
137
- elit. Donec varius est id purus tempus, at mattis sem cursus. In convallis
138
- hendrerit massa, vitae elementum nisl porttitor eu. Proin id mauris ac
139
- tellus ullamcorper feugiat quis vel odio. Quisque ultrices purus sed
140
- finibus lobortis.
141
- </Column>
142
- <Column scroll background="#f5f7f9" borderLeft>
143
- Content of second column lorem ipsum dolor sit amet, consectetur
144
- adipiscing elit. Donec varius est id purus tempus, at mattis sem cursus.
145
- In convallis hendrerit massa, vitae elementum nisl porttitor eu. Proin id
146
- mauris ac tellus ullamcorper feugiat quis vel odio. Quisque ultrices purus
147
- sed finibus lobortis.
148
- </Column>
149
- </Row>
150
- </Canvas>
151
-
152
- ### Fixed width
153
-
154
- You can set a fixed or percentage `width` on a `Column`, and any others will share the remaining space.
155
-
156
- <Canvas>
157
- <Row spacing="0" height="100px">
158
- <Column width="100px" scroll>
159
- Content of first column lorem ipsum dolor sit amet, consectetur adipiscing
160
- elit. Donec varius est id purus tempus, at mattis sem cursus. In convallis
161
- hendrerit massa, vitae elementum nisl porttitor eu.
162
- </Column>
163
- <Column scroll background="#f5f7f9" borderLeft>
164
- Content of second column lorem ipsum dolor sit amet, consectetur
165
- adipiscing elit. Donec varius est id purus tempus, at mattis sem cursus.
166
- In convallis hendrerit massa, vitae elementum nisl porttitor eu.
167
- </Column>
168
- </Row>
169
- </Canvas>
170
-
171
- ### Padding & spacing
172
-
173
- There is 20px `spacing` between each `Column` by default. You can set different `spacing`, or remove it entirely if you want them to be flush.
174
-
175
- There is no `padding` inside a `Column` by default. You can add the `padding` prop on its own for standard padding, or set it to what you need.
176
-
177
- <Canvas>
178
- <Row spacing="0" height="100px">
179
- <Column scroll padding>
180
- Content of first column lorem ipsum dolor sit amet, consectetur adipiscing
181
- elit. Donec varius est id purus tempus, at mattis sem cursus. In convallis
182
- hendrerit massa, vitae elementum nisl porttitor eu.
183
- </Column>
184
- <Column scroll padding background="#f5f7f9" borderLeft>
185
- Content of second column lorem ipsum dolor sit amet, consectetur
186
- adipiscing elit. Donec varius est id purus tempus, at mattis sem cursus.
187
- In convallis hendrerit massa, vitae elementum nisl porttitor eu.
188
- </Column>
189
- </Row>
190
- </Canvas>
191
-
192
- ### Responsive
193
-
194
- To change the layout on smaller devices, you can set props for `widthTablet` (up to 992px wide) and/or `widthMobile` (up to 575px wide).
195
-
196
- <Canvas>
197
- <Row wrap spacing="0">
198
- <Column scroll width="30%" widthTablet="50%" widthMobile="100%">
199
- Content of first column lorem ipsum dolor sit amet, consectetur adipiscing
200
- elit. Donec varius est id purus tempus, at mattis sem cursus. In convallis
201
- hendrerit massa, vitae elementum nisl porttitor eu.
202
- </Column>
203
- <Column
204
- scroll
205
- width="70%"
206
- widthTablet="50%"
207
- widthMobile="100%"
208
- background="#f5f7f9"
209
- >
210
- Content of second column lorem ipsum dolor sit amet, consectetur
211
- adipiscing elit. Donec varius est id purus tempus, at mattis sem cursus.
212
- In convallis hendrerit massa, vitae elementum nisl porttitor eu.
213
- </Column>
214
- </Row>
215
- </Canvas>
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import styles from '../list.module.less';
3
-
4
- export const ItemContent = ({ item, expanding }) => {
5
- const onClick = (evt) => {
6
- evt.preventDefault();
7
- evt.stopPropagation();
8
- };
9
-
10
- return expanding && item.active && item.content ? (
11
- <div className={styles.itemContent} onClick={onClick}>
12
- {item.content}
13
- </div>
14
- ) : null;
15
- };
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { Badge } from '../../badge/badge';
3
- import styles from '../list.module.less';
4
-
5
- export const Label = ({ label }) => {
6
- return label ? (
7
- <span className={styles.label}>
8
- <Badge color={label.color} title={label.value} />
9
- </span>
10
- ) : null;
11
- };
@@ -1,52 +0,0 @@
1
- import React, { forwardRef } from 'react';
2
- import PropTypes from 'prop-types';
3
- import cx from 'classnames';
4
- import { ToggleNarrow } from '../toggle-narrow';
5
- import { Heading } from '../../heading/heading';
6
- import { Actions } from '../../actions/actions';
7
- import { actionsShape } from '../../actions/actions.shape';
8
- import styles from '../list.module.less';
9
-
10
- export const ListHeading = forwardRef(
11
- (
12
- { name, actions, toggleNarrow, onToggleNarrow, stickyHeader },
13
- listHeadingRef,
14
- ) => {
15
- return (
16
- <div
17
- ref={listHeadingRef}
18
- className={cx(styles.header, stickyHeader ? styles.stickyHeader : '')}
19
- >
20
- <ToggleNarrow
21
- toggleNarrow={toggleNarrow}
22
- onClickToggleNarrow={onToggleNarrow}
23
- />
24
- {name && (
25
- <div className={styles.headerTitle}>
26
- <Heading top marginBottom={0}>
27
- {name}
28
- </Heading>
29
- </div>
30
- )}
31
- <div className={styles.right}>
32
- <div className={styles.actions}>
33
- <Actions actions={actions} right />
34
- </div>
35
- </div>
36
- </div>
37
- );
38
- },
39
- );
40
-
41
- ListHeading.defaultProps = {
42
- actions: [],
43
- toggleNarrow: false,
44
- onToggleNarrow: () => {},
45
- };
46
-
47
- ListHeading.propTypes = {
48
- name: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
49
- actions: actionsShape,
50
- toggleNarrow: PropTypes.bool,
51
- onToggleNarrow: PropTypes.func,
52
- };
@@ -1,128 +0,0 @@
1
- import React, { forwardRef, useContext } from 'react';
2
- import cx from 'classnames';
3
- import { GrDrag } from 'react-icons/gr';
4
- import { BsArrowReturnRight } from 'react-icons/bs';
5
- import { Draggable } from 'react-beautiful-dnd';
6
- import { Actions } from '../../actions/actions';
7
- import { Label } from './label';
8
- import { MetaContent } from './meta-content';
9
- import { MetaCount } from './meta-count';
10
- import { ItemContent } from './item-content';
11
- import { Icon } from '../../icon/icon';
12
- import { ListSubheading } from './list-subheading';
13
- import styles from '../list.module.less';
14
- import { DisabledContext } from '../../../helpers/disabled-context';
15
-
16
- const getItemStyle = (draggableProps, item) => {
17
- if (!draggableProps) return null;
18
-
19
- return {
20
- cursor: item.cursor ? item.cursor : '',
21
- ...draggableProps.style,
22
- };
23
- };
24
-
25
- export const ListRow = forwardRef(
26
- (
27
- { items, expanding, invokeEditOnRowClick, provided, draggable },
28
- listRowRefs,
29
- ) => {
30
- const disabledContext = useContext(DisabledContext);
31
-
32
- const listElement = (index, provided, item, indent, hasOnClick, edit) => {
33
- return (
34
- <a
35
- href={item.url}
36
- ref={provided?.innerRef}
37
- {...provided.draggableProps} // eslint-disable-line react/jsx-props-no-spreading
38
- style={getItemStyle(provided.draggableProps, item)}
39
- className={cx(
40
- styles.item,
41
- item.active ? styles.active : '',
42
- item.disabled || disabledContext ? styles.disabled : '',
43
- hasOnClick ? styles.action : '',
44
- )}
45
- onClick={(evt) => {
46
- if (invokeEditOnRowClick && edit) {
47
- //If invokeEditOnRowClick (default) and an edit action exists
48
- //Then clicking the list row will also invoke the edit action
49
- edit.onClick(evt, item.id);
50
- }
51
- if (item.onClick) {
52
- return item.onClick(evt);
53
- }
54
- }}
55
- key={index}
56
- data-id={index}
57
- title={item.title}
58
- data-testid={item.testId}
59
- >
60
- <div
61
- ref={(el) => (listRowRefs.current[index] = el)}
62
- style={{ paddingLeft: indent }}
63
- >
64
- <div className={styles.itemHeader}>
65
- {draggable && (
66
- <div
67
- className={styles.drag}
68
- {...provided.dragHandleProps} // eslint-disable-line react/jsx-props-no-spreading
69
- >
70
- <Icon icon={<GrDrag />} />
71
- </div>
72
- )}
73
- {item.level && item.level > 0 ? (
74
- <div className={styles.indentIcon}>
75
- <Icon icon={<BsArrowReturnRight />} color="#777" />
76
- </div>
77
- ) : null}
78
- <Label label={item.label} />
79
- <MetaContent item={item} />
80
- <div className={styles.right}>
81
- <MetaCount item={item} />
82
- {!(item.disabled || disabledContext) && item.actions && (
83
- <div className={styles.actions}>
84
- <Actions actions={item.actions} right />
85
- </div>
86
- )}
87
- </div>
88
- </div>
89
- <ItemContent item={item} expanding={expanding} />
90
- </div>
91
- </a>
92
- );
93
- };
94
-
95
- return (
96
- <>
97
- {items.map((item, index) => {
98
- const isSubheading = item.type === 'Heading';
99
- const edit =
100
- item.actions &&
101
- item.actions.find(
102
- (a) => a.label && a.label.toLowerCase() === 'edit',
103
- );
104
- const hasOnClick = edit || item.url || item.onClick;
105
- const indent =
106
- item.level && item.level > 1 ? (item.level - 1) * 20 : 0;
107
- return isSubheading ? (
108
- <ListSubheading
109
- ref={listRowRefs}
110
- item={item}
111
- index={index}
112
- key={index}
113
- />
114
- ) : draggable ? (
115
- <Draggable key={item.id} draggableId={item.id + ''} index={index}>
116
- {(provided) =>
117
- listElement(index, provided, item, indent, hasOnClick, edit)
118
- }
119
- </Draggable>
120
- ) : (
121
- listElement(index, provided, item, indent, hasOnClick, edit)
122
- );
123
- })}
124
- {provided.placeholder}
125
- </>
126
- );
127
- },
128
- );
@@ -1,72 +0,0 @@
1
- import React, { useContext, forwardRef } from 'react';
2
- import PropTypes from 'prop-types';
3
- import cx from 'classnames';
4
- import { FaAngleRight } from 'react-icons/fa';
5
- import { Icon } from '../../icon/icon';
6
- import { Actions } from '../../actions/actions';
7
- import { actionsShape } from '../../actions/actions.shape';
8
- import styles from '../list.module.less';
9
- import { DisabledContext } from '../../../helpers/disabled-context';
10
- import { Name } from './name';
11
- import { MetaCount } from './meta-count';
12
-
13
- export const ListSubheading = forwardRef(({ item, index }, listRowRefs) => {
14
- const disabledContext = useContext(DisabledContext);
15
-
16
- const { actions, disabled, expanded, onClick, title, name, icon } = item;
17
- return (
18
- <div
19
- ref={(el) =>
20
- listRowRefs ? (listRowRefs.current[index] = el) : undefined
21
- }
22
- className={cx(
23
- styles.item,
24
- styles.heading,
25
- disabled || disabledContext ? styles.disabled : '',
26
- onClick ? styles.action : '',
27
- )}
28
- onClick={(evt) => {
29
- if (onClick) {
30
- onClick(evt);
31
- }
32
- }}
33
- title={title}
34
- >
35
- <div>
36
- <div className={styles.itemHeader}>
37
- {typeof expanded === 'boolean' && (
38
- <div className={cx(styles.expandIcon, expanded && styles.expanded)}>
39
- <Icon icon={<FaAngleRight />} color="#777" />
40
- </div>
41
- )}
42
- <Name name={name} icon={icon} />
43
-
44
- <div className={styles.right}>
45
- <MetaCount item={item} />
46
- {!(disabled || disabledContext) && item.actions && (
47
- <div className={styles.actions}>
48
- <Actions actions={item.actions} right />
49
- </div>
50
- )}
51
- </div>
52
- </div>
53
- </div>
54
- </div>
55
- );
56
- });
57
-
58
- ListSubheading.defaultProps = {
59
- index: undefined,
60
- };
61
-
62
- ListSubheading.propTypes = {
63
- item: PropTypes.shape({
64
- actions: actionsShape,
65
- disabled: PropTypes.bool,
66
- expanded: PropTypes.bool,
67
- name: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
68
- onClick: PropTypes.func,
69
- title: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
70
- }).isRequired,
71
- index: PropTypes.number,
72
- };
@@ -1,24 +0,0 @@
1
- import React from 'react';
2
- import styles from '../list.module.less';
3
- import { Badge } from '../../badge/badge';
4
- import { styleVariables } from '../../../helpers/styles';
5
- import { Name } from './name';
6
-
7
- export const MetaContent = ({ item }) => {
8
- const { col_danger } = styleVariables;
9
- const { name, icon, details, metadata, invalid } = item;
10
-
11
- return (
12
- <span className={styles.title}>
13
- {invalid ? (
14
- <Badge small margin="-2px" color={col_danger} title="!">
15
- <Name name={name} icon={icon} />
16
- </Badge>
17
- ) : (
18
- <Name name={name} icon={icon} />
19
- )}
20
- {details && <span className={styles.details}>{details}</span>}
21
- {metadata && <span className={styles.metadata}>{metadata}</span>}
22
- </span>
23
- );
24
- };
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { Badge } from '../../badge/badge';
3
-
4
- export const MetaCount = ({ item }) => {
5
- return (
6
- item.metaCount !== undefined && (
7
- <Badge color="var(--color-text-faint)" title={item.metaCount} />
8
- )
9
- );
10
- };
@@ -1,45 +0,0 @@
1
- import React from 'react';
2
- import cx from 'classnames';
3
- import PropTypes from 'prop-types';
4
- import { Icon } from '../../icon/icon';
5
- import styles from '../list.module.less';
6
- import { Tooltip } from '../../tooltip/tooltip';
7
-
8
- export const Name = ({ name, icon }) => {
9
- const newIcon = icon && (
10
- <Icon icon={icon.icon} color={icon.color || '#db2828'} size={12} />
11
- );
12
-
13
- return (
14
- <span className={cx(styles.name, styles.bold)}>
15
- {name}
16
- {icon && icon.tooltip && icon.tooltip.text ? (
17
- <span className={styles.iconTooltipMargin}>
18
- <Tooltip text={icon.tooltip.text} maxWidth="350px">
19
- {newIcon}
20
- </Tooltip>
21
- </span>
22
- ) : (
23
- icon &&
24
- icon.icon && <span className={styles.iconTooltipMargin}>{newIcon}</span>
25
- )}
26
- </span>
27
- );
28
- };
29
-
30
- Name.propTypes = {
31
- name: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
32
- icon: PropTypes.shape({
33
- icon: PropTypes.node, // JSX
34
- color: PropTypes.string,
35
- tooltip: PropTypes.shape({
36
- text: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
37
- }),
38
- }),
39
- };
40
-
41
- Name.defaultProps = {
42
- icon: null,
43
- };
44
-
45
- export default Name;