@unbxd-ui/unbxd-react-components 0.2.107-beta.2 → 0.2.108-beta.2

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 (289) hide show
  1. package/components/Accordian/Accordian.js +13 -45
  2. package/components/Accordian/Accordian.stories.js +6 -25
  3. package/components/Accordian/index.js +0 -3
  4. package/components/Button/Button.js +9 -26
  5. package/components/Button/Button.stories.js +1 -14
  6. package/components/Button/DropdownButton.js +9 -31
  7. package/components/Button/DropdownButton.stories.js +6 -23
  8. package/components/Button/index.js +1 -8
  9. package/components/DataLoader/DataLoader.js +10 -40
  10. package/components/DataLoader/DataLoader.stories.js +5 -30
  11. package/components/DataLoader/index.js +0 -3
  12. package/components/Form/Checkbox.js +18 -43
  13. package/components/Form/DragDropFileUploader.js +12 -42
  14. package/components/Form/Dropdown.js +106 -182
  15. package/components/Form/FileUploader.js +10 -32
  16. package/components/Form/Form.js +15 -45
  17. package/components/Form/FormElementWrapper.js +2 -7
  18. package/components/Form/Input.js +27 -72
  19. package/components/Form/RadioList.js +20 -49
  20. package/components/Form/RangeSlider.js +39 -74
  21. package/components/Form/ServerPaginatedDDList.js +86 -130
  22. package/components/Form/Textarea.js +18 -43
  23. package/components/Form/Toggle.js +16 -48
  24. package/components/Form/index.js +18 -30
  25. package/components/Form/stories/Checkbox.stories.js +1 -12
  26. package/components/Form/stories/DragDropFileUploader.stories.js +0 -8
  27. package/components/Form/stories/Dropdown.stories.js +6 -24
  28. package/components/Form/stories/FileUploader.stories.js +0 -8
  29. package/components/Form/stories/FormDefault.stories.js +1 -21
  30. package/components/Form/stories/RadioList.stories.js +1 -12
  31. package/components/Form/stories/RangeSlider.stories.js +1 -15
  32. package/components/Form/stories/TextInput.stories.js +3 -19
  33. package/components/Form/stories/Textarea.stories.js +1 -12
  34. package/components/Form/stories/Toggle.stories.js +0 -7
  35. package/components/Form/stories/form.stories.js +3 -40
  36. package/components/InlineModal/InlineModal.js +14 -51
  37. package/components/InlineModal/InlineModal.stories.js +2 -14
  38. package/components/InlineModal/index.js +1 -6
  39. package/components/List/List.js +9 -24
  40. package/components/List/index.js +0 -3
  41. package/components/List/list.stories.js +0 -10
  42. package/components/Modal/Modal.js +17 -49
  43. package/components/Modal/Modal.stories.js +1 -15
  44. package/components/Modal/index.js +0 -3
  45. package/components/NotificationComponent/NotificationComponent.js +11 -34
  46. package/components/NotificationComponent/NotificationComponent.stories.js +0 -6
  47. package/components/NotificationComponent/index.js +0 -3
  48. package/components/ProgressBar/ProgressBar.js +2 -11
  49. package/components/ProgressBar/ProgressBar.stories.js +0 -6
  50. package/components/ProgressBar/index.js +0 -3
  51. package/components/Table/BaseTable.js +69 -134
  52. package/components/Table/PaginationComponent.js +11 -23
  53. package/components/Table/Table.js +68 -149
  54. package/components/Table/Table.stories.js +22 -67
  55. package/components/Table/index.js +0 -4
  56. package/components/TabsComponent/TabsComponent.js +20 -57
  57. package/components/TabsComponent/TabsComponent.stories.js +0 -16
  58. package/components/TabsComponent/index.js +0 -3
  59. package/components/Tooltip/Tooltip.js +25 -47
  60. package/components/Tooltip/Tooltip.stories.js +0 -6
  61. package/components/Tooltip/index.js +0 -3
  62. package/components/core.css +3 -1
  63. package/components/index.js +1 -17
  64. package/components/theme.css +2 -0
  65. package/package.json +3 -2
  66. package/.babelrc +0 -4
  67. package/.eslintrc.js +0 -38
  68. package/CONTRIBUTE.md +0 -105
  69. package/README.md +0 -82
  70. package/lib/components/Accordian/Accordian.js +0 -117
  71. package/lib/components/Accordian/Accordian.stories.js +0 -137
  72. package/lib/components/Accordian/index.js +0 -10
  73. package/lib/components/Button/Button.js +0 -84
  74. package/lib/components/Button/Button.stories.js +0 -89
  75. package/lib/components/Button/DropdownButton.js +0 -77
  76. package/lib/components/Button/DropdownButton.stories.js +0 -51
  77. package/lib/components/Button/index.js +0 -32
  78. package/lib/components/DataLoader/DataLoader.js +0 -88
  79. package/lib/components/DataLoader/DataLoader.stories.js +0 -77
  80. package/lib/components/DataLoader/index.js +0 -10
  81. package/lib/components/Form/Checkbox.js +0 -93
  82. package/lib/components/Form/DragDropFileUploader.js +0 -85
  83. package/lib/components/Form/Dropdown.js +0 -478
  84. package/lib/components/Form/FileUploader.js +0 -81
  85. package/lib/components/Form/Form.js +0 -106
  86. package/lib/components/Form/FormElementWrapper.js +0 -27
  87. package/lib/components/Form/Input.js +0 -140
  88. package/lib/components/Form/RadioList.js +0 -111
  89. package/lib/components/Form/RangeSlider.js +0 -142
  90. package/lib/components/Form/ServerPaginatedDDList.js +0 -267
  91. package/lib/components/Form/Textarea.js +0 -95
  92. package/lib/components/Form/Toggle.js +0 -117
  93. package/lib/components/Form/index.js +0 -73
  94. package/lib/components/Form/stories/Checkbox.stories.js +0 -54
  95. package/lib/components/Form/stories/DragDropFileUploader.stories.js +0 -27
  96. package/lib/components/Form/stories/Dropdown.stories.js +0 -114
  97. package/lib/components/Form/stories/FileUploader.stories.js +0 -31
  98. package/lib/components/Form/stories/FormDefault.stories.js +0 -117
  99. package/lib/components/Form/stories/RadioList.stories.js +0 -55
  100. package/lib/components/Form/stories/RangeSlider.stories.js +0 -82
  101. package/lib/components/Form/stories/TextInput.stories.js +0 -79
  102. package/lib/components/Form/stories/Textarea.stories.js +0 -48
  103. package/lib/components/Form/stories/Toggle.stories.js +0 -25
  104. package/lib/components/Form/stories/form.stories.js +0 -240
  105. package/lib/components/InlineModal/InlineModal.js +0 -146
  106. package/lib/components/InlineModal/InlineModal.stories.js +0 -61
  107. package/lib/components/InlineModal/index.js +0 -24
  108. package/lib/components/List/List.js +0 -76
  109. package/lib/components/List/index.js +0 -10
  110. package/lib/components/List/list.stories.js +0 -38
  111. package/lib/components/Modal/Modal.js +0 -117
  112. package/lib/components/Modal/Modal.stories.js +0 -55
  113. package/lib/components/Modal/index.js +0 -10
  114. package/lib/components/NotificationComponent/NotificationComponent.js +0 -76
  115. package/lib/components/NotificationComponent/NotificationComponent.stories.js +0 -29
  116. package/lib/components/NotificationComponent/index.js +0 -10
  117. package/lib/components/ProgressBar/ProgressBar.js +0 -49
  118. package/lib/components/ProgressBar/ProgressBar.stories.js +0 -21
  119. package/lib/components/ProgressBar/index.js +0 -10
  120. package/lib/components/Table/BaseTable.js +0 -352
  121. package/lib/components/Table/PaginationComponent.js +0 -87
  122. package/lib/components/Table/Table.js +0 -333
  123. package/lib/components/Table/Table.stories.js +0 -204
  124. package/lib/components/Table/index.js +0 -17
  125. package/lib/components/TabsComponent/TabsComponent.js +0 -134
  126. package/lib/components/TabsComponent/TabsComponent.stories.js +0 -65
  127. package/lib/components/TabsComponent/index.js +0 -10
  128. package/lib/components/Tooltip/Tooltip.js +0 -102
  129. package/lib/components/Tooltip/Tooltip.stories.js +0 -25
  130. package/lib/components/Tooltip/index.js +0 -10
  131. package/lib/components/core.css +0 -3
  132. package/lib/components/core.scss +0 -29
  133. package/lib/components/index.js +0 -159
  134. package/lib/components/theme.css +0 -3
  135. package/lib/components/theme.scss +0 -11
  136. package/lib/package-lock.json +0 -20607
  137. package/lib/package.json +0 -94
  138. package/src/Intro.stories.mdx +0 -119
  139. package/src/components/Accordian/Accordian.js +0 -89
  140. package/src/components/Accordian/Accordian.stories.js +0 -92
  141. package/src/components/Accordian/accordianCore.css +0 -1
  142. package/src/components/Accordian/accordianCore.scss +0 -8
  143. package/src/components/Accordian/accordianTheme.css +0 -1
  144. package/src/components/Accordian/accordianTheme.scss +0 -6
  145. package/src/components/Accordian/index.js +0 -3
  146. package/src/components/Button/Button.js +0 -67
  147. package/src/components/Button/Button.stories.js +0 -103
  148. package/src/components/Button/DropdownButton.js +0 -60
  149. package/src/components/Button/DropdownButton.stories.js +0 -38
  150. package/src/components/Button/button.css +0 -1
  151. package/src/components/Button/buttonTheme.css +0 -1
  152. package/src/components/Button/buttonTheme.scss +0 -45
  153. package/src/components/Button/index.js +0 -5
  154. package/src/components/DataLoader/DataLoader.js +0 -86
  155. package/src/components/DataLoader/DataLoader.stories.js +0 -72
  156. package/src/components/DataLoader/index.js +0 -3
  157. package/src/components/Form/Checkbox.js +0 -73
  158. package/src/components/Form/DragDropFileUploader.js +0 -67
  159. package/src/components/Form/Dropdown.js +0 -430
  160. package/src/components/Form/FileUploader.js +0 -64
  161. package/src/components/Form/Form.js +0 -83
  162. package/src/components/Form/FormElementWrapper.js +0 -22
  163. package/src/components/Form/Input.js +0 -121
  164. package/src/components/Form/RadioList.js +0 -86
  165. package/src/components/Form/RangeSlider.js +0 -100
  166. package/src/components/Form/ServerPaginatedDDList.js +0 -231
  167. package/src/components/Form/Textarea.js +0 -76
  168. package/src/components/Form/Toggle.js +0 -96
  169. package/src/components/Form/form.css +0 -1
  170. package/src/components/Form/formCore.css +0 -1
  171. package/src/components/Form/formCore.scss +0 -142
  172. package/src/components/Form/formTheme.css +0 -1
  173. package/src/components/Form/formTheme.scss +0 -27
  174. package/src/components/Form/index.js +0 -13
  175. package/src/components/Form/stories/Checkbox.stories.js +0 -41
  176. package/src/components/Form/stories/DragDropFileUploader.stories.js +0 -21
  177. package/src/components/Form/stories/Dropdown.stories.js +0 -124
  178. package/src/components/Form/stories/FileUploader.stories.js +0 -21
  179. package/src/components/Form/stories/FormDefault.stories.js +0 -87
  180. package/src/components/Form/stories/RadioList.stories.js +0 -48
  181. package/src/components/Form/stories/RangeSlider.stories.js +0 -84
  182. package/src/components/Form/stories/TextInput.stories.js +0 -77
  183. package/src/components/Form/stories/Textarea.stories.js +0 -43
  184. package/src/components/Form/stories/Toggle.stories.js +0 -14
  185. package/src/components/Form/stories/form.stories.js +0 -216
  186. package/src/components/InlineModal/InlineModal.js +0 -135
  187. package/src/components/InlineModal/InlineModal.stories.js +0 -54
  188. package/src/components/InlineModal/index.js +0 -4
  189. package/src/components/InlineModal/inlineModal.css +0 -1
  190. package/src/components/InlineModal/inlineModalCore.css +0 -1
  191. package/src/components/InlineModal/inlineModalCore.scss +0 -31
  192. package/src/components/InlineModal/inlineModalTheme.css +0 -1
  193. package/src/components/InlineModal/inlineModalTheme.scss +0 -16
  194. package/src/components/List/List.js +0 -72
  195. package/src/components/List/index.js +0 -3
  196. package/src/components/List/list.css +0 -1
  197. package/src/components/List/list.stories.js +0 -28
  198. package/src/components/List/listCore.css +0 -1
  199. package/src/components/List/listCore.scss +0 -6
  200. package/src/components/List/listTheme.css +0 -0
  201. package/src/components/List/listTheme.scss +0 -0
  202. package/src/components/Modal/Modal.js +0 -99
  203. package/src/components/Modal/Modal.stories.js +0 -54
  204. package/src/components/Modal/index.js +0 -3
  205. package/src/components/Modal/modal.css +0 -1
  206. package/src/components/Modal/modalCore.css +0 -1
  207. package/src/components/Modal/modalCore.scss +0 -34
  208. package/src/components/Modal/modalTheme.css +0 -0
  209. package/src/components/Modal/modalTheme.scss +0 -0
  210. package/src/components/NotificationComponent/NotificationComponent.js +0 -58
  211. package/src/components/NotificationComponent/NotificationComponent.stories.js +0 -28
  212. package/src/components/NotificationComponent/index.js +0 -3
  213. package/src/components/NotificationComponent/notificationComponent.css +0 -1
  214. package/src/components/NotificationComponent/notificationTheme.css +0 -1
  215. package/src/components/NotificationComponent/notificationTheme.scss +0 -30
  216. package/src/components/ProgressBar/ProgressBar.js +0 -45
  217. package/src/components/ProgressBar/ProgressBar.stories.js +0 -14
  218. package/src/components/ProgressBar/index.js +0 -3
  219. package/src/components/ProgressBar/progressBar.css +0 -1
  220. package/src/components/ProgressBar/progressBarCore.css +0 -1
  221. package/src/components/ProgressBar/progressBarCore.scss +0 -14
  222. package/src/components/ProgressBar/progressBarTheme.css +0 -0
  223. package/src/components/ProgressBar/progressBarTheme.scss +0 -0
  224. package/src/components/Table/BaseTable.js +0 -306
  225. package/src/components/Table/PaginationComponent.js +0 -73
  226. package/src/components/Table/Table.js +0 -295
  227. package/src/components/Table/Table.stories.js +0 -198
  228. package/src/components/Table/index.js +0 -8
  229. package/src/components/Table/table.css +0 -1
  230. package/src/components/Table/tableCore.css +0 -1
  231. package/src/components/Table/tableCore.scss +0 -94
  232. package/src/components/Table/tableTheme.css +0 -1
  233. package/src/components/Table/tableTheme.scss +0 -34
  234. package/src/components/TabsComponent/TabsComponent.js +0 -99
  235. package/src/components/TabsComponent/TabsComponent.stories.js +0 -69
  236. package/src/components/TabsComponent/index.js +0 -3
  237. package/src/components/TabsComponent/tabs.css +0 -1
  238. package/src/components/TabsComponent/tabsCore.css +0 -1
  239. package/src/components/TabsComponent/tabsCore.scss +0 -59
  240. package/src/components/TabsComponent/tabsTheme.css +0 -0
  241. package/src/components/TabsComponent/tabsTheme.scss +0 -0
  242. package/src/components/Tooltip/Tooltip.js +0 -87
  243. package/src/components/Tooltip/Tooltip.stories.js +0 -16
  244. package/src/components/Tooltip/index.js +0 -3
  245. package/src/components/Tooltip/tooltipCore.css +0 -1
  246. package/src/components/Tooltip/tooltipCore.scss +0 -22
  247. package/src/components/Tooltip/tooltipTheme.css +0 -1
  248. package/src/components/Tooltip/tooltipTheme.scss +0 -21
  249. package/src/components/core.css +0 -1
  250. package/src/components/core.scss +0 -29
  251. package/src/components/index.js +0 -38
  252. package/src/components/theme.css +0 -1
  253. package/src/components/theme.scss +0 -11
  254. package/src/core/Validators.js +0 -34
  255. package/src/core/customHooks.js +0 -20
  256. package/src/core/dataLoader.js +0 -143
  257. package/src/core/dataLoader.stories.js +0 -123
  258. package/src/core/index.js +0 -3
  259. package/src/core/utils.js +0 -95
  260. package/src/index.js +0 -68
  261. package/vscode-templates/NewStoryTemplate.stories.js +0 -8
  262. /package/{lib/Readme.md → Readme.md} +0 -0
  263. /package/{lib/components → components}/Accordian/accordianCore.css +0 -0
  264. /package/{lib/components → components}/Accordian/accordianTheme.css +0 -0
  265. /package/{lib/components → components}/Button/buttonTheme.css +0 -0
  266. /package/{lib/components → components}/Form/formCore.css +0 -0
  267. /package/{lib/components → components}/Form/formTheme.css +0 -0
  268. /package/{lib/components → components}/InlineModal/inlineModalCore.css +0 -0
  269. /package/{lib/components → components}/InlineModal/inlineModalTheme.css +0 -0
  270. /package/{lib/components → components}/List/listCore.css +0 -0
  271. /package/{lib/components → components}/List/listTheme.css +0 -0
  272. /package/{lib/components → components}/Modal/modalCore.css +0 -0
  273. /package/{lib/components → components}/Modal/modalTheme.css +0 -0
  274. /package/{lib/components → components}/NotificationComponent/notificationTheme.css +0 -0
  275. /package/{lib/components → components}/ProgressBar/progressBarCore.css +0 -0
  276. /package/{lib/components → components}/ProgressBar/progressBarTheme.css +0 -0
  277. /package/{lib/components → components}/Table/tableCore.css +0 -0
  278. /package/{lib/components → components}/Table/tableTheme.css +0 -0
  279. /package/{lib/components → components}/TabsComponent/tabsCore.css +0 -0
  280. /package/{lib/components → components}/TabsComponent/tabsTheme.css +0 -0
  281. /package/{lib/components → components}/Tooltip/tooltipCore.css +0 -0
  282. /package/{lib/components → components}/Tooltip/tooltipTheme.css +0 -0
  283. /package/{lib/core → core}/Validators.js +0 -0
  284. /package/{lib/core → core}/customHooks.js +0 -0
  285. /package/{lib/core → core}/dataLoader.js +0 -0
  286. /package/{lib/core → core}/dataLoader.stories.js +0 -0
  287. /package/{lib/core → core}/index.js +0 -0
  288. /package/{lib/core → core}/utils.js +0 -0
  289. /package/{lib/index.js → index.js} +0 -0
package/lib/package.json DELETED
@@ -1,94 +0,0 @@
1
- {
2
- "name": "@unbxd-ui/unbxd-react-components",
3
- "version": "0.2.107-beta.1",
4
- "description": "React components library",
5
- "keywords": [
6
- "react components",
7
- "react library",
8
- "react components library",
9
- "react components bundle"
10
- ],
11
- "repository": {
12
- "type": "git",
13
- "url": "https://github.com/unbxd/unbxd-react-components.git"
14
- },
15
- "author": "Anupama H",
16
- "license": "ISC",
17
- "main": "lib/index.js",
18
- "sideEffects": [
19
- "*.css"
20
- ],
21
- "scripts": {
22
- "storybook": "start-storybook -p 6006 -s public",
23
- "deploy-storybook": "storybook-to-ghpages",
24
- "scss": "node-sass src/components -o src/components --output-style compressed",
25
- "publish-scss": "node-sass src/components -o lib/components --output-style compressed",
26
- "postcss": "postcss src/components/*.css --use autoprefixer --dir src/components",
27
- "publish-postcss": "postcss src/components/*.css --use autoprefixer --dir lib/components",
28
- "build-css": "npm run scss && npm run postcss",
29
- "publish-css": "npm run publish-scss && npm run publish-postcss",
30
- "build": "babel src -d lib",
31
- "lint": "eslint src",
32
- "copypackage": "cp -rf package.json Readme.md lib",
33
- "copyscss": "cp -rf src/components/core.scss src/components/theme.scss lib/components",
34
- "link": "npm run publish-css && npm run build && npm run copypackage && npm run copyscss && cd lib && npm link",
35
- "publish": "npm run publish-css && npm run build && npm run copypackage && npm run copyscss && cd lib && npm publish"
36
- },
37
- "dependencies": {
38
- "@storybook/addon-a11y": "^7.0.25",
39
- "@storybook/addon-storysource": "^7.0.25",
40
- "bluebird": "^3.7.2",
41
- "dequal": "^1.0.1",
42
- "lodash.clonedeep": "^4.5.0",
43
- "react": "^16.14.0",
44
- "react-dom": "^16.14.0",
45
- "react-window": "^1.8.6",
46
- "react-window-infinite-loader": "^1.0.7",
47
- "sass": "^1.63.6",
48
- "whatwg-fetch": "^3.6.2"
49
- },
50
- "devDependencies": {
51
- "@babel/cli": "^7.15.7",
52
- "@babel/core": "^7.15.8",
53
- "@babel/plugin-proposal-class-properties": "^7.14.5",
54
- "@babel/plugin-proposal-export-default-from": "^7.14.5",
55
- "@babel/preset-env": "^7.15.8",
56
- "@babel/preset-react": "^7.14.5",
57
- "@storybook/addon-actions": "^7.0.25",
58
- "@storybook/addon-console": "^2.0.0",
59
- "@storybook/addon-docs": "^7.0.26",
60
- "@storybook/addon-info": "^4.1.8",
61
- "@storybook/addon-links": "^7.0.25",
62
- "@storybook/addons": "^7.0.25",
63
- "@storybook/react": "^7.0.25",
64
- "@storybook/storybook-deployer": "^2.8.16",
65
- "autoprefixer": "^10.4.14",
66
- "babel-eslint": "^10.1.0",
67
- "babel-loader": "^8.2.3",
68
- "cross-env": "^7.0.3",
69
- "css-loader": "^3.6.0",
70
- "eslint": "^7.2.0",
71
- "eslint-plugin-babel": "^5.3.1",
72
- "eslint-plugin-react": "^7.26.1",
73
- "mini-css-extract-plugin": "^0.8.2",
74
- "node-sass": "^8.0.0",
75
- "optimize-css-assets-webpack-plugin": "^6.0.1",
76
- "postcss-cli": "^10.1.0",
77
- "sass-loader": "^7.3.1",
78
- "storybook-readme": "^4.0.5",
79
- "terser-webpack-plugin": "^1.4.5",
80
- "webpack": "^4.46.0",
81
- "webpack-cli": "^3.3.12"
82
- },
83
- "overrides": {
84
- "fbjs": "^3.0.5",
85
- "marked": "^5.1.0",
86
- "prismjs": "^1.29.0",
87
- "glob-parent": "5.1.2",
88
- "parse-url": "^8.1.0",
89
- "@jest/transform":"^29.3.1",
90
- "semver": "^7.3.5"
91
-
92
- }
93
- }
94
-
@@ -1,119 +0,0 @@
1
- import { Meta } from '@storybook/addon-docs/blocks';
2
-
3
- <Meta title="Design System|Introduction" />
4
-
5
- ## Introduction to the RCB (React Components Bundle) library
6
-
7
- RCB contains a bunch of low level components (atoms of a design system) that you can use individually
8
- or combine them to make additional components (molecules of a design system) to build web pages.
9
-
10
- ## Using the components library
11
-
12
- First, install the package from npm
13
-
14
- ```
15
- npm install react-components-bundle
16
- ```
17
-
18
- Next, import the required components. There are 2 ways to achieve this.
19
-
20
- If you want a minimal footprint from the RCB library and include only the components which you use,
21
- then import the components individually as shown below.
22
- This enables tree shaking and therefore components that you did not use will not get included in your final bundle.
23
-
24
- ```
25
- import Button from "react-components-bundle/components/Button";
26
- ```
27
-
28
- If size of the bundle does not matter or you will use all/most of the components in the RCB library,
29
- then you can import the components as shown below:
30
-
31
- ```
32
- import { Button } from "react-components-bundle";
33
- ```
34
-
35
- ### Using core CSS
36
-
37
- Finally, include the core CSS like below,
38
-
39
- ```
40
- import "react-components-bundle/components/core.css";
41
- ```
42
-
43
- The core CSS file will contain the core styles without which the component will not behave as expected.
44
- Hence do not forget to include this.
45
-
46
- ### Using theme CSS
47
-
48
- Theme CSS file will contain the styles which suggests a theme for all the components but is not a must have to use the library.
49
-
50
- You can use the theme CSS in 2 ways:
51
-
52
- **1. Use individual component CSS**
53
-
54
- You can import the individual files for each of the components like below:
55
-
56
- ```
57
- import "react-components-bundle/components/Table/tableTheme.css";
58
- ```
59
-
60
- **2. Include the bundled CSS file which has all component's CSS**
61
-
62
- You can import the bundled CSS file which contains all the component's CSS like below:
63
-
64
- ```
65
- import "react-components-bundle/components/theme.css";
66
- ```
67
-
68
- ## Library structure
69
-
70
- ```
71
- react-components-bundle
72
-
73
-
74
- └─── components
75
- │ │
76
- │ └─── Button
77
- │ │
78
- │ └─── DataLoader
79
- │ │
80
- │ └─── Form
81
- │ │ │
82
- │ │ └─── Input
83
- │ │ │
84
- │ │ └─── Checkbox
85
- │ │ │
86
- │ │ └─── DragDropFileUploader
87
- │ │ │
88
- │ │ └─── Dropdown
89
- │ │ │
90
- │ │ └─── FileUploader
91
- │ │ │
92
- │ │ └─── RadioList
93
- │ │ │
94
- │ │ └─── RangeSlider
95
- │ │ │
96
- │ │ └─── TextArea
97
- │ │ │
98
- │ │ └─── Toggle
99
- │ │
100
- │ └─── InlineModal
101
- │ │
102
- │ └─── List
103
- │ │
104
- │ └─── Modal
105
- │ │
106
- │ └─── NotificationComponent
107
- │ │
108
- │ └─── ProgressBar
109
- │ │
110
- │ └─── Table
111
- │ │
112
- │ └─── TabsComponent
113
-
114
- └─── core
115
-
116
- └─── dataLoader
117
-
118
- └─── utils
119
- ```
@@ -1,89 +0,0 @@
1
- import React, { useState, cloneElement } from "react";
2
- import PropTypes from "prop-types";
3
- import List from "../List";
4
-
5
- const ALL = "ALL";
6
-
7
- const getDefaultOpenedItems = (items = [], defaultOpen) =>{
8
- let arr = [];
9
- if(items.length > 0) {
10
- items.forEach((item) => {
11
- const {
12
- id
13
- } = item;
14
- if(id === defaultOpen || defaultOpen === ALL ) {
15
- arr.push(id)
16
- }
17
- })
18
- }
19
- return arr;
20
- }
21
-
22
- const AccordianItem = (props) => {
23
- const {
24
- itemData,
25
- allowOneOpen,
26
- openedItems,
27
- setOpenedItems
28
- } = props;
29
- const { titleComponent, bodyComponent, id } = itemData;
30
- const isOpen = openedItems.find(item => item === id) ? true: false;
31
- const onItemClick = () => {
32
- let newList = [id];
33
- if(!allowOneOpen) {
34
- newList = isOpen ? openedItems.filter(item => item !== id) : [...openedItems, id]
35
- }
36
- setOpenedItems(newList)
37
- }
38
- return <li className={`RCB-accordian-item ${isOpen ? "RCB-accordian-open" : "RCB-accordian-close"}`}>
39
- <div className="RCB-accordian-title" onClick={onItemClick}>{cloneElement(titleComponent, { isOpen: isOpen })}</div>
40
- {isOpen && <div className="RCB-accordian-body">{bodyComponent}</div>}
41
- </li>
42
- };
43
-
44
- AccordianItem.propTypes = {
45
- itemData: PropTypes.shape({
46
- id: PropTypes.string.isRequired,
47
- titleComponent: PropTypes.element.isRequired,
48
- bodyComponent: PropTypes.element.isRequired,
49
- }),
50
- setOpenedItems: PropTypes.func,
51
- openedItems: PropTypes.array,
52
- allowOneOpen: PropTypes.bool
53
- };
54
-
55
-
56
- const Accordian = ({defaultOpen, items, allowOneOpen}) => {
57
- const defaultOpened = getDefaultOpenedItems(items, defaultOpen);
58
- const [openedItems, setOpenedItems] = useState(defaultOpened);
59
- return (<div className={`RCB-accordian`}>
60
- {
61
- <List
62
- items={items}
63
- openedItems={openedItems}
64
- defaultOpen={defaultOpen}
65
- allowOneOpen={allowOneOpen}
66
- setOpenedItems={setOpenedItems}
67
- ListItem={AccordianItem} />
68
- }
69
- </div>);
70
- };
71
-
72
- Accordian.propTypes = {
73
- defaultOpen: PropTypes.string,
74
- items: PropTypes.arrayOf(PropTypes.shape({
75
- id: PropTypes.string.isRequired,
76
- titleComponent: PropTypes.element.isRequired,
77
- bodyComponent: PropTypes.element.isRequired,
78
- })).isRequired,
79
- // /* set to false if you want more than one accordian item to be open at a time */
80
- allowOneOpen: PropTypes.bool
81
- };
82
-
83
- Accordian.defaultProps = {
84
- allowOneOpen: false,
85
- defaultOpen:"",//"ALL","ID","",
86
- items:[]
87
- };
88
-
89
- export default Accordian;
@@ -1,92 +0,0 @@
1
- import React, { Fragment, useState } from "react";
2
- import Accordian from "./Accordian";
3
-
4
-
5
- export default {
6
- title: 'Accordian',
7
- component: Accordian,
8
- };
9
-
10
- const AccordianBody = () => {
11
- const [count, setRandomNumber] = useState(1);
12
- const onSetRandom = ()=>{
13
- setRandomNumber(Math.round(Math.random()*10))
14
- }
15
- return <div style={{padding:'20px'}}>
16
- <h3>This is accordian body</h3>
17
- <button onClick={onSetRandom}> changed to {count}</button>
18
- </div>
19
- }
20
- const AccordianTitle = ({id}) => {
21
- return <div>
22
- {`Title ${id}`}
23
- </div>
24
- }
25
- const Template = (args) => <Accordian {...args} />;
26
-
27
- export const Default = Template.bind();
28
- Default.args = {
29
- items: [{
30
- id: "41",
31
- titleComponent: <AccordianTitle id={'41'}/>,
32
- bodyComponent: <AccordianBody/>,
33
- }, {
34
- id: "42",
35
- titleComponent: <AccordianTitle id={'42'}/>,
36
- bodyComponent: <AccordianBody/>
37
- }, {
38
- id: "43",
39
- titleComponent: <AccordianTitle id={'43'}/>,
40
- bodyComponent: <AccordianBody/>
41
- }, {
42
- id: "44",
43
- titleComponent: <AccordianTitle id={'44'}/>,
44
- bodyComponent: <AccordianBody/>
45
- }],
46
- defaultOpen:""
47
- };
48
-
49
- export const DefaultOpen = Template.bind();
50
- DefaultOpen.args = {
51
- items: [{
52
- id: "41",
53
- titleComponent: <AccordianTitle id={'41'}/>,
54
- bodyComponent: <AccordianBody/>,
55
- }, {
56
- id: "42",
57
- titleComponent: <AccordianTitle id={'42'}/>,
58
- bodyComponent: <AccordianBody/>
59
- }, {
60
- id: "43",
61
- titleComponent: <AccordianTitle id={'43'}/>,
62
- bodyComponent: <AccordianBody/>
63
- }, {
64
- id: "44",
65
- titleComponent: <AccordianTitle id={'44'}/>,
66
- bodyComponent: <AccordianBody/>
67
- }],
68
- defaultOpen:"42"
69
- }
70
-
71
- export const OpenAtLeastOneAlways = Template.bind();
72
- OpenAtLeastOneAlways.args = {
73
- items: [{
74
- id: "411",
75
- titleComponent: <AccordianTitle id={'41'}/>,
76
- bodyComponent: <AccordianBody/>,
77
- }, {
78
- id: "421",
79
- titleComponent: <AccordianTitle id={'42'}/>,
80
- bodyComponent: <AccordianBody/>
81
- }, {
82
- id: "431",
83
- titleComponent: <AccordianTitle id={'43'}/>,
84
- bodyComponent: <AccordianBody/>
85
- }, {
86
- id: "441",
87
- titleComponent: <AccordianTitle id={'44'}/>,
88
- bodyComponent: <AccordianBody/>
89
- }],
90
- defaultOpen:"421",
91
- allowOneOpen:true
92
- }
@@ -1 +0,0 @@
1
- .RCB-accordian-title{cursor:pointer}.RCB-list{list-style-type:none}
@@ -1,8 +0,0 @@
1
- .RCB {
2
- &-accordian-title {
3
- cursor: pointer;
4
- }
5
- &-list {
6
- list-style-type: none;
7
- }
8
- }
@@ -1 +0,0 @@
1
- .RCB-accordian-title{padding:10px;border:1px solid #ccc}
@@ -1,6 +0,0 @@
1
- .RCB {
2
- &-accordian-title {
3
- padding: 10px;
4
- border: 1px solid #ccc;
5
- }
6
- }
@@ -1,3 +0,0 @@
1
- import Accordian from "./Accordian";
2
-
3
- export default Accordian;
@@ -1,67 +0,0 @@
1
- import React from "react";
2
- import PropTypes from "prop-types";
3
-
4
- /** ButtonAppearance enum */
5
- export const ButtonAppearance = {
6
- DEFAULT: "default",
7
- PRIMARY: "primary",
8
- SECONDARY: "secondary"
9
- };
10
- /** ButtonSize enum */
11
- export const ButtonSize = {
12
- SMALL: "small",
13
- MEDIUM: "medium",
14
- LARGE: "large"
15
- };
16
-
17
- /**
18
- *
19
- * Displays a Button component
20
- */
21
- const Button = (props) => {
22
- const { children, className, loading, disabled, appearance, size, onClick, ...restProps } = props;
23
- const btnClassName = `RCB-btn RCB-btn-${appearance} RCB-btn-${size} ${className}` + (loading ? " RCB-btn-loading" : "");
24
-
25
- return (<button className={btnClassName} disabled={disabled} onClick={onClick} {...restProps}>
26
- {children}
27
- </button>);
28
- };
29
-
30
- Button.propTypes = {
31
- /** Add any additional classes to Button component */
32
- className: PropTypes.string,
33
- /** Boolean indicating whether the button should render as disabled */
34
- disabled: PropTypes.bool,
35
- /** Boolean indicating whether the button is in loading state */
36
- loading: PropTypes.bool,
37
- /** String indicating how Button should be rendered.
38
- * Must be one of,
39
- * ButtonAppearance = {
40
- DEFAULT: "default",
41
- PRIMARY: "primary",
42
- SECONDARY: "secondary"
43
- }
44
- */
45
- appearance: PropTypes.oneOf(Object.values(ButtonAppearance)),
46
- /** String indicating the size of the Button
47
- * Must be one of,
48
- * ButtonSize = {
49
- SMALL: "small",
50
- MEDIUM: "medium",
51
- LARGE: "large"
52
- }
53
- */
54
- size: PropTypes.oneOf(Object.values(ButtonSize)),
55
- /** Button onClick handler */
56
- onClick: PropTypes.func
57
- };
58
-
59
- Button.defaultProps = {
60
- onClick: () => {},
61
- appearance: ButtonAppearance.DEFAULT,
62
- size: ButtonSize.SMALL,
63
- className: ""
64
- };
65
-
66
- export default Button;
67
-
@@ -1,103 +0,0 @@
1
- import React from "react";
2
- import { action } from "@storybook/addon-actions";
3
- import Button, { ButtonAppearance, ButtonSize } from "./Button";
4
-
5
- export const SimpleUsage = () => {
6
- return (
7
- <div className="margin-btns">
8
- <Button size={ButtonSize.SMALL} onClick={action("clicked")}>
9
- SMALL
10
- </Button>
11
- <Button size={ButtonSize.MEDIUM} onClick={action("clicked")}>
12
- MEDIUM
13
- </Button>
14
- <Button size={ButtonSize.LARGE} onClick={action("clicked")}>
15
- LARGE
16
- </Button>
17
- </div>
18
- );
19
- };
20
-
21
- SimpleUsage.story = {
22
- parameters: {
23
- docs: {
24
- storyDescription: "Depicts a simple usage of the button",
25
- },
26
- },
27
- };
28
-
29
- export const PrimaryButton = () => {
30
- return (
31
- <div className="margin-btns">
32
- <Button
33
- appearance={ButtonAppearance.PRIMARY}
34
- size={ButtonSize.SMALL}
35
- onClick={action("clicked")}
36
- >
37
- SMALL
38
- </Button>
39
- <Button
40
- appearance={ButtonAppearance.PRIMARY}
41
- size={ButtonSize.MEDIUM}
42
- onClick={action("clicked")}
43
- >
44
- MEDIUM
45
- </Button>
46
- <Button
47
- appearance={ButtonAppearance.PRIMARY}
48
- size={ButtonSize.LARGE}
49
- onClick={action("clicked")}
50
- >
51
- LARGE
52
- </Button>
53
- </div>
54
- );
55
- };
56
-
57
- PrimaryButton.story = {
58
- parameters: {
59
- docs: {
60
- storyDescription: "Depicts a primary button",
61
- },
62
- },
63
- };
64
-
65
- export const SecondaryButton = () => {
66
- return (
67
- <div className="margin-btns">
68
- <Button
69
- appearance={ButtonAppearance.SECONDARY}
70
- size={ButtonSize.SMALL}
71
- onClick={action("clicked")}
72
- >
73
- SMALL
74
- </Button>
75
- <Button
76
- appearance={ButtonAppearance.SECONDARY}
77
- size={ButtonSize.MEDIUM}
78
- onClick={action("clicked")}
79
- >
80
- MEDIUM
81
- </Button>
82
- <Button
83
- appearance={ButtonAppearance.SECONDARY}
84
- size={ButtonSize.LARGE}
85
- onClick={action("clicked")}
86
- >
87
- LARGE
88
- </Button>
89
- </div>
90
- );
91
- };
92
-
93
- SecondaryButton.story = {
94
- parameters: {
95
- docs: {
96
- storyDescription: "Depicts a secondary button",
97
- },
98
- },
99
- };
100
-
101
- export default {
102
- title: "Button",
103
- };
@@ -1,60 +0,0 @@
1
- import React, { useRef } from "react";
2
- import PropTypes from "prop-types";
3
- import InlineModal, { InlineModalActivator, InlineModalBody } from "../InlineModal";
4
- import List from "../List";
5
-
6
- const DefaultDropdownButtonItem = (props) => {
7
- let { itemData = {}, onClick } = props;
8
- let { name } = itemData;
9
-
10
- const onItemClicked = () => {
11
- onClick(itemData);
12
- };
13
-
14
- return (<li className="RCB-list-item" onClick={onItemClicked}>{name}</li>);
15
- };
16
-
17
- DefaultDropdownButtonItem.propTypes = {
18
- itemData: PropTypes.shape({
19
- id: PropTypes.string.isRequired,
20
- name: PropTypes.string.isRequired
21
- }).isRequired,
22
- onClick: PropTypes.func.isRequired
23
- };
24
-
25
- const DropdownButton = (props) => {
26
- const { label, options, className, onClick, DropdownButtonItem, ...restProps } = props;
27
- const modalRef = useRef();
28
-
29
- const onItemClicked = (itemData) => {
30
- onClick(itemData);
31
- modalRef.current.hideModal();
32
- };
33
-
34
- return (<InlineModal className={`RCB-dropdown-button ${className}`} ref={modalRef}>
35
- <InlineModalActivator>{label}</InlineModalActivator>
36
- <InlineModalBody>
37
- <List items={options} ListItem={DropdownButtonItem} onClick={onItemClicked} {...restProps} />
38
- </InlineModalBody>
39
- </InlineModal>);
40
- };
41
-
42
- DropdownButton.propTypes = {
43
- label: PropTypes.string,
44
- /** Dropdown items list */
45
- options: PropTypes.arrayOf(PropTypes.shape({
46
- id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
47
- name: PropTypes.string,
48
- })).isRequired,
49
- onClick: PropTypes.func.isRequired,
50
- DropdownButtonItem: PropTypes.any,
51
- className: PropTypes.string
52
- };
53
-
54
- DropdownButton.defaultProps = {
55
- label: "Select",
56
- DropdownButtonItem: DefaultDropdownButtonItem,
57
- className: ""
58
- };
59
-
60
- export default DropdownButton;
@@ -1,38 +0,0 @@
1
- import React, { useState } from "react";
2
- import { Fragment } from "react";
3
- import DropdownButton from "./DropdownButton";
4
-
5
- const DROPDOWN_OPTIONS = [{
6
- id: "PrintApple",
7
- name: "Print Apple",
8
- message: "Apple"
9
- }, {
10
- id: "PrintMango",
11
- name: "Print Mango",
12
- message: "Mango"
13
- }, {
14
- id: "PrintGrapes",
15
- name: "Print Grapes",
16
- message: "Grapes"
17
- }];
18
-
19
- export const DefaultDropdownButton = () => {
20
- const [ message, setMessage ] = useState();
21
-
22
- const printMessage = (data) => {
23
- const { message } = data;
24
- setMessage(message);
25
- };
26
-
27
- return (<Fragment>
28
- <DropdownButton
29
- label="Actions"
30
- options={DROPDOWN_OPTIONS}
31
- onClick={printMessage} />
32
- <div>{`Message is ${message}`}</div>
33
- </Fragment>);
34
- };
35
-
36
- export default {
37
- title: "Dropdown Button"
38
- };
@@ -1 +0,0 @@
1
- .RCB-btn{border-radius:3px;cursor:pointer}.RCB-btn-default:hover{background:#f3f3f3}.RCB-btn-primary{background:#1fa7fd;color:#FFF;border:0}.RCB-btn-primary:hover{background:#208dd2}.RCB-btn-secondary{background:#FFF;border:1px solid #95c7e7}.RCB-btn-secondary:hover{background:#eef8ff}.RCB-btn-small{padding:6px 8px}.RCB-btn-medium{padding:10px 15px}.RCB-btn-large{padding:15px 22px}