@spothero/ui 15.10.9 → 16.0.0-beta.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 (317) hide show
  1. package/.eslintignore +1 -1
  2. package/babel.config.js +1 -0
  3. package/dex.config.js +1 -1
  4. package/jest.config.json +4 -2
  5. package/package.json +11 -26
  6. package/v2/index.js +1 -1
  7. package/v2/index.js.map +1 -1
  8. package/backlog/Alert/Alert.js +0 -37
  9. package/backlog/AutoSuggestInput/AutoSuggestInput.js +0 -474
  10. package/backlog/AutoSuggestInput/AutoSuggestItem.js +0 -99
  11. package/backlog/AutoSuggestInput/AutoSuggestList.js +0 -126
  12. package/backlog/Badge/Badge.js +0 -28
  13. package/backlog/Chart/Chart.js +0 -211
  14. package/backlog/Checkbox/Checkbox.js +0 -167
  15. package/backlog/DateTime/DatePicker.js +0 -279
  16. package/backlog/DateTime/DatePickerCalendar.js +0 -199
  17. package/backlog/DateTime/DatePickerCalendarNavigation.js +0 -102
  18. package/backlog/DateTime/DatePickerCalendarWithRange.js +0 -241
  19. package/backlog/DateTime/DateTimePicker.js +0 -216
  20. package/backlog/DateTime/DateTimeRangePicker.js +0 -530
  21. package/backlog/DateTime/TimePicker.js +0 -180
  22. package/backlog/DateTime/date-time-assertions.js +0 -66
  23. package/backlog/DateTime/index.js +0 -55
  24. package/backlog/ErrorBoundary/ErrorBoundary.js +0 -125
  25. package/backlog/Flyout/Flyout.js +0 -198
  26. package/backlog/Form/Form.js +0 -193
  27. package/backlog/Form/FormElementError.js +0 -24
  28. package/backlog/Form/FormGroup.js +0 -30
  29. package/backlog/Form/FormGroupError.js +0 -28
  30. package/backlog/Form/index.js +0 -39
  31. package/backlog/GooglePlacesSearchInput/GooglePlacesSearchInput.js +0 -253
  32. package/backlog/GooglePlacesSearchInput/PoweredByGoogle.js +0 -38
  33. package/backlog/GooglePlacesSearchInput/index.js +0 -23
  34. package/backlog/HorizontalRule/HorizontalRule.js +0 -30
  35. package/backlog/Label/Label.js +0 -31
  36. package/backlog/Notification/Notification.js +0 -178
  37. package/backlog/Notification/NotificationContainer.js +0 -131
  38. package/backlog/Notification/NotificationPropTypes.js +0 -37
  39. package/backlog/Notification/index.js +0 -23
  40. package/backlog/PasswordControl/PasswordControl.js +0 -201
  41. package/backlog/Portal/Portal.js +0 -110
  42. package/backlog/PulseLoader/PulseLoader.js +0 -62
  43. package/backlog/Radio/Radio.js +0 -135
  44. package/backlog/Radio/RadioGroup.js +0 -123
  45. package/backlog/Radio/index.js +0 -23
  46. package/backlog/RenderInBody/RenderInBody.js +0 -103
  47. package/backlog/Select/Select.js +0 -275
  48. package/backlog/Select/SelectItemPropTypes.js +0 -32
  49. package/backlog/Select/index.js +0 -23
  50. package/backlog/SelectControlled/SelectControlled.js +0 -270
  51. package/backlog/SelectControlled/index.js +0 -15
  52. package/backlog/Sprite/Sprite.js +0 -24
  53. package/backlog/Tabs/Tab.js +0 -94
  54. package/backlog/Tabs/TabContent.js +0 -56
  55. package/backlog/Tabs/TabNavigation.js +0 -108
  56. package/backlog/Tabs/TabPanel.js +0 -29
  57. package/backlog/Tabs/Tabs.js +0 -126
  58. package/backlog/Tabs/index.js +0 -47
  59. package/backlog/TextArea/TextArea.js +0 -155
  60. package/backlog/TextInput/TextInput.js +0 -230
  61. package/backlog/TextInput/TextInputPropTypes.js +0 -114
  62. package/backlog/TextInput/index.js +0 -23
  63. package/backlog/Tooltip/Tooltip.js +0 -249
  64. package/backlog/index.js +0 -393
  65. package/backlog/v1/components/Button/Button.js +0 -64
  66. package/backlog/v1/components/Button/button-props.js +0 -48
  67. package/backlog/v1/components/Image/Image.js +0 -193
  68. package/backlog/v1/components/Loader/Loader.js +0 -51
  69. package/backlog/v1/components/Modal/Modal.js +0 -325
  70. package/backlog/v1/components/Modal/ModalContent.js +0 -154
  71. package/backlog/v1/components/Modal/ModalFooter.js +0 -89
  72. package/backlog/v1/components/Modal/index.js +0 -31
  73. package/backlog/v1/components/Panel/Panel.js +0 -209
  74. package/backlog/v1/components/Table/Table.js +0 -336
  75. package/backlog/v1/components/Table/TableCell.js +0 -28
  76. package/backlog/v1/components/Table/TableCellPropTypes.js +0 -22
  77. package/backlog/v1/components/Table/TableControls.js +0 -56
  78. package/backlog/v1/components/Table/TableFooter.js +0 -63
  79. package/backlog/v1/components/Table/TableHeading.js +0 -126
  80. package/backlog/v1/components/Table/TableHeadingPropTypes.js +0 -35
  81. package/backlog/v1/components/Table/TableSortSelector.js +0 -125
  82. package/backlog/v1/components/Table/TableSortType.js +0 -11
  83. package/backlog/v1/components/Table/index.js +0 -47
  84. package/backlog/v1/components/TextButton/TextButton.js +0 -74
  85. package/backlog/v1/components/index.js +0 -75
  86. package/backlog/v1/utils/deprecate.js +0 -61
  87. package/styles/Alert/_Alert.scss +0 -51
  88. package/styles/AutoSuggestInput/_AutoSuggestInput.scss +0 -116
  89. package/styles/Badge/_Badge.scss +0 -33
  90. package/styles/Chart/_Chart.scss +0 -105
  91. package/styles/Chart/_chartist-settings.scss +0 -131
  92. package/styles/Chart/_chartist.scss +0 -295
  93. package/styles/Checkbox/_Checkbox.scss +0 -173
  94. package/styles/DateTime/_DatePicker.scss +0 -61
  95. package/styles/DateTime/_DatePickerCalendar.scss +0 -159
  96. package/styles/DateTime/_DateTime.scss +0 -4
  97. package/styles/DateTime/_DateTimePicker.scss +0 -46
  98. package/styles/DateTime/_TimePicker.scss +0 -30
  99. package/styles/ErrorBoundary/_ErrorBoundary.scss +0 -18
  100. package/styles/Flyout/_Flyout.scss +0 -73
  101. package/styles/Form/_Form.scss +0 -53
  102. package/styles/GooglePlacesSearchInput/_GooglePlacesSearchInput.scss +0 -3
  103. package/styles/GooglePlacesSearchInput/_PoweredByGoogle.scss +0 -21
  104. package/styles/HorizontalRule/_HorizontalRule.scss +0 -48
  105. package/styles/Label/_Label.scss +0 -6
  106. package/styles/Notification/_Notification.scss +0 -113
  107. package/styles/PasswordControl/_PasswordControl.scss +0 -86
  108. package/styles/PulseLoader/_PulseLoader.scss +0 -60
  109. package/styles/Radio/_Radio.scss +0 -93
  110. package/styles/Select/_Select.scss +0 -94
  111. package/styles/Tabs/_Tabs.scss +0 -57
  112. package/styles/TextArea/_TextArea.scss +0 -26
  113. package/styles/TextInput/_TextInput.scss +0 -43
  114. package/styles/Tooltip/_Tooltip.scss +0 -108
  115. package/styles/_index.scss +0 -34
  116. package/styles/common/sass/_control-sizing.scss +0 -5
  117. package/styles/common/sass/_disable-scrolling.scss +0 -7
  118. package/styles/common/sass/_forms.scss +0 -72
  119. package/styles/index.js +0 -50
  120. package/styles/v1/components/Button/Button.jsx +0 -48
  121. package/styles/v1/components/Button/Button.spec.js +0 -76
  122. package/styles/v1/components/Button/_Button.scss +0 -178
  123. package/styles/v1/components/Button/button-props.js +0 -30
  124. package/styles/v1/components/Button/stories/button.js +0 -20
  125. package/styles/v1/components/Button/stories/index.stories.js +0 -92
  126. package/styles/v1/components/Button/stories/overview.js +0 -87
  127. package/styles/v1/components/Button/stories/types.js +0 -31
  128. package/styles/v1/components/Image/Image.jsx +0 -175
  129. package/styles/v1/components/Image/Image.spec.js +0 -113
  130. package/styles/v1/components/Image/_Image.scss +0 -24
  131. package/styles/v1/components/Image/stories/Cloudinary.stories.js +0 -39
  132. package/styles/v1/components/Image/stories/Display.stories.js +0 -92
  133. package/styles/v1/components/Loader/Loader.jsx +0 -54
  134. package/styles/v1/components/Loader/Loader.spec.js +0 -67
  135. package/styles/v1/components/Loader/_Loader.scss +0 -18
  136. package/styles/v1/components/Loader/stories/Display.stories.js +0 -55
  137. package/styles/v1/components/Modal/Modal.jsx +0 -315
  138. package/styles/v1/components/Modal/Modal.spec.js +0 -293
  139. package/styles/v1/components/Modal/ModalContent.jsx +0 -126
  140. package/styles/v1/components/Modal/ModalFooter.jsx +0 -53
  141. package/styles/v1/components/Modal/_Modal.scss +0 -262
  142. package/styles/v1/components/Modal/index.js +0 -3
  143. package/styles/v1/components/Modal/stories/Content.stories.js +0 -314
  144. package/styles/v1/components/Modal/stories/Display.stories.js +0 -208
  145. package/styles/v1/components/Modal/stories/Methods.stories.js +0 -44
  146. package/styles/v1/components/Modal/stories/Width.stories.js +0 -82
  147. package/styles/v1/components/Modal/stories/helpers/ReduxConsumer.jsx +0 -21
  148. package/styles/v1/components/Panel/Panel.jsx +0 -202
  149. package/styles/v1/components/Panel/Panel.spec.js +0 -196
  150. package/styles/v1/components/Panel/_Panel.scss +0 -55
  151. package/styles/v1/components/Panel/stories/Display.stories.js +0 -82
  152. package/styles/v1/components/Panel/stories/Methods.stories.js +0 -76
  153. package/styles/v1/components/Table/Table.jsx +0 -367
  154. package/styles/v1/components/Table/Table.spec.js +0 -526
  155. package/styles/v1/components/Table/TableCell.jsx +0 -17
  156. package/styles/v1/components/Table/TableCellPropTypes.js +0 -10
  157. package/styles/v1/components/Table/TableControls.jsx +0 -61
  158. package/styles/v1/components/Table/TableFooter.jsx +0 -72
  159. package/styles/v1/components/Table/TableHeading.jsx +0 -58
  160. package/styles/v1/components/Table/TableHeadingPropTypes.js +0 -20
  161. package/styles/v1/components/Table/TableSortSelector.jsx +0 -63
  162. package/styles/v1/components/Table/TableSortType.js +0 -4
  163. package/styles/v1/components/Table/_Table.scss +0 -263
  164. package/styles/v1/components/Table/index.js +0 -5
  165. package/styles/v1/components/Table/stories/Display.stories.js +0 -194
  166. package/styles/v1/components/Table/stories/Methods.stories.js +0 -141
  167. package/styles/v1/components/Table/stories/helpers/TableCellEmail.jsx +0 -25
  168. package/styles/v1/components/Table/stories/helpers/TableCustomRow.jsx +0 -35
  169. package/styles/v1/components/Table/stories/helpers/TableHeadingEmail.jsx +0 -20
  170. package/styles/v1/components/Table/stories/helpers/table-data.js +0 -26
  171. package/styles/v1/components/Table/stories/helpers/table-headers.js +0 -14
  172. package/styles/v1/components/TextButton/TextButton.jsx +0 -78
  173. package/styles/v1/components/TextButton/TextButton.spec.js +0 -95
  174. package/styles/v1/components/TextButton/_TextButton.scss +0 -114
  175. package/styles/v1/components/TextButton/stories/Display.stories.js +0 -46
  176. package/styles/v1/components/index.js +0 -7
  177. package/styles/v1/utils/deprecate.js +0 -45
  178. package/styles/v2/components/Accordion/Accordion.jsx +0 -1
  179. package/styles/v2/components/Accordion/Accordion.stories.js +0 -103
  180. package/styles/v2/components/Accordion/index.js +0 -7
  181. package/styles/v2/components/Accordion/styles/button.js +0 -16
  182. package/styles/v2/components/Accordion/styles/container.js +0 -9
  183. package/styles/v2/components/Accordion/styles/index.js +0 -19
  184. package/styles/v2/components/Accordion/styles/panel.js +0 -7
  185. package/styles/v2/components/Alert/Alert.jsx +0 -121
  186. package/styles/v2/components/Alert/Alert.stories.js +0 -50
  187. package/styles/v2/components/Alert/index.js +0 -1
  188. package/styles/v2/components/Alert/styles/index.js +0 -166
  189. package/styles/v2/components/AutoSuggestSelect/AutoSuggestSelect.jsx +0 -187
  190. package/styles/v2/components/AutoSuggestSelect/index.js +0 -1
  191. package/styles/v2/components/Badge/Badge.jsx +0 -1
  192. package/styles/v2/components/Badge/Badge.stories.js +0 -32
  193. package/styles/v2/components/Badge/styles/index.js +0 -29
  194. package/styles/v2/components/Button/Button.jsx +0 -31
  195. package/styles/v2/components/Button/Button.spec.js +0 -29
  196. package/styles/v2/components/Button/Button.styles.js +0 -156
  197. package/styles/v2/components/Button/button-props.js +0 -66
  198. package/styles/v2/components/Button/index.js +0 -2
  199. package/styles/v2/components/Button/stories/button.js +0 -59
  200. package/styles/v2/components/Button/stories/index.stories.js +0 -82
  201. package/styles/v2/components/Button/stories/overview.js +0 -73
  202. package/styles/v2/components/Card/Card.jsx +0 -16
  203. package/styles/v2/components/Card/Card.stories.js +0 -33
  204. package/styles/v2/components/Checkbox/Checkbox.jsx +0 -1
  205. package/styles/v2/components/Checkbox/Checkbox.stories.js +0 -41
  206. package/styles/v2/components/Checkbox/index.js +0 -1
  207. package/styles/v2/components/Checkbox/styles/index.js +0 -31
  208. package/styles/v2/components/Container/Container.jsx +0 -10
  209. package/styles/v2/components/Container/Container.stories.js +0 -52
  210. package/styles/v2/components/Container/Container.styles.js +0 -11
  211. package/styles/v2/components/Divider/Divider.jsx +0 -31
  212. package/styles/v2/components/Divider/Divider.stories.js +0 -41
  213. package/styles/v2/components/Divider/Divider.styles.js +0 -15
  214. package/styles/v2/components/FormControl/FormControl.jsx +0 -77
  215. package/styles/v2/components/Grid/Grid.jsx +0 -25
  216. package/styles/v2/components/Grid/Grid.stories.js +0 -128
  217. package/styles/v2/components/Grid/Grid.styles.js +0 -12
  218. package/styles/v2/components/Grid/GridItem.jsx +0 -10
  219. package/styles/v2/components/Grid/GridItem.styles.js +0 -8
  220. package/styles/v2/components/Grid/index.js +0 -2
  221. package/styles/v2/components/Heading/Heading.jsx +0 -23
  222. package/styles/v2/components/Heading/Heading.stories.js +0 -40
  223. package/styles/v2/components/Heading/Heading.styles.js +0 -61
  224. package/styles/v2/components/Icon/Icon.jsx +0 -1
  225. package/styles/v2/components/Icon/Icon.stories.js +0 -38
  226. package/styles/v2/components/Image/Image.jsx +0 -97
  227. package/styles/v2/components/Image/Image.spec.js +0 -100
  228. package/styles/v2/components/Image/Image.stories.js +0 -142
  229. package/styles/v2/components/Input/Input.jsx +0 -51
  230. package/styles/v2/components/Input/Input.stories.js +0 -60
  231. package/styles/v2/components/Input/index.js +0 -1
  232. package/styles/v2/components/Input/styles/index.js +0 -49
  233. package/styles/v2/components/Link/Link.jsx +0 -1
  234. package/styles/v2/components/Link/Link.stories.js +0 -82
  235. package/styles/v2/components/Link/Link.styles.js +0 -38
  236. package/styles/v2/components/List/List.jsx +0 -57
  237. package/styles/v2/components/List/List.stories.js +0 -96
  238. package/styles/v2/components/List/index.js +0 -2
  239. package/styles/v2/components/List/styles/index.js +0 -12
  240. package/styles/v2/components/List/styles/item.styles.js +0 -5
  241. package/styles/v2/components/Loader/Loader.jsx +0 -75
  242. package/styles/v2/components/Loader/Loader.stories.js +0 -145
  243. package/styles/v2/components/Modal/Modal.jsx +0 -71
  244. package/styles/v2/components/Modal/Modal.stories.js +0 -278
  245. package/styles/v2/components/Modal/index.js +0 -1
  246. package/styles/v2/components/Modal/styles/body.js +0 -24
  247. package/styles/v2/components/Modal/styles/closeButton.js +0 -17
  248. package/styles/v2/components/Modal/styles/dialog.js +0 -10
  249. package/styles/v2/components/Modal/styles/dialogContainer.js +0 -10
  250. package/styles/v2/components/Modal/styles/footer.js +0 -5
  251. package/styles/v2/components/Modal/styles/header.js +0 -7
  252. package/styles/v2/components/Modal/styles/index.js +0 -47
  253. package/styles/v2/components/Modal/styles/overlay.js +0 -4
  254. package/styles/v2/components/Popover/Popover.jsx +0 -28
  255. package/styles/v2/components/Popover/Popover.stories.js +0 -113
  256. package/styles/v2/components/Popover/PopoverArrow.jsx +0 -10
  257. package/styles/v2/components/Popover/PopoverCloseButton.jsx +0 -10
  258. package/styles/v2/components/Popover/PopoverContent.jsx +0 -41
  259. package/styles/v2/components/Popover/index.js +0 -3
  260. package/styles/v2/components/Popover/styles/index.js +0 -21
  261. package/styles/v2/components/Popover/styles/popover-arrow.js +0 -5
  262. package/styles/v2/components/Popover/styles/popover-body.js +0 -5
  263. package/styles/v2/components/Popover/styles/popover-close-button.js +0 -17
  264. package/styles/v2/components/Popover/styles/popover-content.js +0 -16
  265. package/styles/v2/components/Popover/styles/popover-header.js +0 -6
  266. package/styles/v2/components/Popover/styles/popper.js +0 -5
  267. package/styles/v2/components/Radio/Radio.jsx +0 -50
  268. package/styles/v2/components/Radio/Radio.stories.js +0 -155
  269. package/styles/v2/components/Radio/RadioGroup.jsx +0 -69
  270. package/styles/v2/components/Radio/index.js +0 -2
  271. package/styles/v2/components/Radio/styles/index.js +0 -52
  272. package/styles/v2/components/Select/Select.jsx +0 -62
  273. package/styles/v2/components/Select/Select.stories.js +0 -60
  274. package/styles/v2/components/Select/index.js +0 -1
  275. package/styles/v2/components/Select/styles/index.js +0 -29
  276. package/styles/v2/components/Skeleton/Skeleton.stories.jsx +0 -34
  277. package/styles/v2/components/Skeleton/Skeleton.styles.js +0 -3
  278. package/styles/v2/components/Skeleton/index.js +0 -1
  279. package/styles/v2/components/Spinner/Spinner.jsx +0 -40
  280. package/styles/v2/components/Spinner/Spinner.stories.js +0 -98
  281. package/styles/v2/components/Spinner/Spinner.styles.js +0 -57
  282. package/styles/v2/components/Switch/Switch.jsx +0 -52
  283. package/styles/v2/components/Switch/Switch.stories.js +0 -88
  284. package/styles/v2/components/Switch/index.js +0 -1
  285. package/styles/v2/components/Switch/styles/index.js +0 -17
  286. package/styles/v2/components/Table/Table.jsx +0 -1
  287. package/styles/v2/components/Table/Table.stories.js +0 -90
  288. package/styles/v2/components/Table/Table.styles.js +0 -66
  289. package/styles/v2/components/Table/index.js +0 -2
  290. package/styles/v2/components/Tabs/Tabs.jsx +0 -39
  291. package/styles/v2/components/Tabs/Tabs.stories.js +0 -47
  292. package/styles/v2/components/Tabs/combineSizeWithVariant.js +0 -29
  293. package/styles/v2/components/Tabs/index.js +0 -2
  294. package/styles/v2/components/Tabs/styles/index.js +0 -40
  295. package/styles/v2/components/Text/Text.jsx +0 -35
  296. package/styles/v2/components/Text/Text.stories.js +0 -47
  297. package/styles/v2/components/Text/Text.styles.js +0 -33
  298. package/styles/v2/components/Text/combineAsWithVariant.js +0 -106
  299. package/styles/v2/components/Text/options.js +0 -92
  300. package/styles/v2/components/ThemeProvider/ThemeProvider.jsx +0 -39
  301. package/styles/v2/components/ThemeProvider/ThemeProvider.stories.js +0 -85
  302. package/styles/v2/components/index.js +0 -70
  303. package/styles/v2/components/styles.js +0 -21
  304. package/styles/v2/theme/base/breakpoints.js +0 -16
  305. package/styles/v2/theme/base/colors.js +0 -136
  306. package/styles/v2/theme/base/index.js +0 -5
  307. package/styles/v2/theme/base/sizes.js +0 -48
  308. package/styles/v2/theme/base/typography.js +0 -24
  309. package/styles/v2/theme/base/zindices.js +0 -17
  310. package/styles/v2/theme/global.js +0 -118
  311. package/styles/v2/theme/index.js +0 -27
  312. package/styles/v2/utils/Spaces.js +0 -16
  313. package/v1/assets-manifest.json +0 -5
  314. package/v1/index.html +0 -1
  315. package/v1/index.js +0 -3
  316. package/v1/index.js.LICENSE.txt +0 -23
  317. package/v1/index.js.map +0 -1
@@ -1,141 +0,0 @@
1
- import React, {useEffect, useState} from 'react';
2
-
3
- import Table from '../Table';
4
- import TableSortType from '../TableSortType';
5
-
6
- import TableData from './helpers/table-data';
7
- import headers from './helpers/table-headers';
8
-
9
- export default {
10
- component: Table,
11
- title: 'v1/Table/Methods',
12
- };
13
-
14
- const PAGE_SIZE = 3;
15
- const {DESC} = TableSortType;
16
- const PAGE_1_DATA = TableData.slice(0, 3);
17
- const PAGE_2_DATA = TableData.slice(3);
18
-
19
- const whichSort = ({dataKey, sortOrder}) => {
20
- return item => (sortOrder !== DESC ? item[dataKey] : -item[dataKey]);
21
- };
22
-
23
- const sortFirstNameAscending = item => {
24
- if (window.sorting) {
25
- window.sorting(item);
26
- }
27
-
28
- return item.firstName;
29
- };
30
-
31
- export const Pagination = () => {
32
- const [currentPage, setCurrentPage] = useState(1);
33
- const [data, setData] = useState(PAGE_1_DATA);
34
-
35
- const onPageChange = pages => {
36
- if (window.onPageChange) {
37
- window.onPageChange(pages);
38
- }
39
-
40
- setCurrentPage(pages.currentPage);
41
- setData(pages.currentPage === 1 ? PAGE_1_DATA : PAGE_2_DATA);
42
- };
43
-
44
- return (
45
- <Table
46
- data={data}
47
- headers={headers}
48
- pageSize={PAGE_SIZE}
49
- currentPage={currentPage}
50
- className="AvengersTable"
51
- onPageChange={onPageChange}
52
- totalDataRowCount={TableData.length}
53
- />
54
- );
55
- };
56
-
57
- export const AsyncPagination = () => {
58
- const [currentPage, setCurrentPage] = useState(1);
59
- const [data, setData] = useState(PAGE_1_DATA);
60
- const [totalDataRowCount, setTotalDataRowCount] = useState(0);
61
-
62
- const onPageChange = pages => {
63
- if (window.onPageChange) {
64
- window.onPageChange(pages);
65
- }
66
-
67
- setCurrentPage(pages.currentPage);
68
- setData(pages.currentPage === 1 ? PAGE_1_DATA : PAGE_2_DATA);
69
- };
70
-
71
- useEffect(() => {
72
- setTimeout(() => {
73
- setTotalDataRowCount(TableData.length);
74
- }, 500);
75
- }, [])
76
-
77
- return (
78
- <Table
79
- data={data}
80
- headers={headers}
81
- pageSize={PAGE_SIZE}
82
- currentPage={currentPage}
83
- className="AvengersTable"
84
- onPageChange={onPageChange}
85
- totalDataRowCount={totalDataRowCount}
86
- />
87
- );
88
- };
89
-
90
-
91
-
92
- export const WithSortableHeaders = () => {
93
- const [{sortBy, sortOrder, sortDataKey}, setState] = useState({
94
- sortBy: ['-lastName'],
95
- sortDataKey: 'lastName',
96
- sortOrder: DESC,
97
- });
98
-
99
- const HEADERS = headers.map(heading => {
100
- return {
101
- ...heading,
102
- isSortable: heading.dataKey !== 'email',
103
- };
104
- });
105
-
106
- const onSortChange = options => {
107
- if (window.onSortChange) {
108
- window.onSortChange(options);
109
- }
110
-
111
- setState({
112
- sortOrder,
113
- sortDataKey: options.dataKey,
114
- sortBy: whichSort(options),
115
- });
116
- };
117
-
118
- return (
119
- <Table
120
- data={TableData}
121
- sorting={sortBy}
122
- headers={HEADERS}
123
- sortOrder={sortOrder}
124
- className="AvengersTable"
125
- sortDataKey={sortDataKey}
126
- onSortChange={onSortChange}
127
- totalDataRowCount={TableData.length}
128
- />
129
- );
130
- };
131
-
132
- export const WithSortingFunction = () => {
133
- return (
134
- <Table
135
- data={TableData}
136
- headers={headers}
137
- sorting={sortFirstNameAscending}
138
- totalDataRowCount={TableData.length}
139
- />
140
- );
141
- };
@@ -1,25 +0,0 @@
1
- import React from 'react';
2
- import classNames from 'classnames';
3
- import isEmpty from 'lodash/isEmpty';
4
-
5
- import TableCellPropTypes from '../../TableCellPropTypes';
6
-
7
- const TableCellEmail = ({className, headingLabel, value}) => {
8
- const classes = classNames('TableCell', 'TableCellEmail', className);
9
-
10
- return (
11
- <td className={classes} data-label={headingLabel}>
12
- <div>
13
- {!isEmpty(value) ? (
14
- <a href={`mailto:${value}`}>{value}</a>
15
- ) : (
16
- 'N/A'
17
- )}
18
- </div>
19
- </td>
20
- );
21
- };
22
-
23
- TableCellEmail.propTypes = TableCellPropTypes;
24
-
25
- export default TableCellEmail;
@@ -1,35 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
-
4
- const TableCustomRow = ({firstName, lastName, email, age}) => {
5
- return (
6
- <tr colSpan={4}>
7
- <td colSpan={4}>
8
- <table className="TableCustomRow">
9
- <tbody>
10
- <tr>
11
- <td>
12
- <a href={`mailto:${email}`}>{email}</a>
13
- </td>
14
- <td>{firstName}</td>
15
- <td>{lastName}</td>
16
- <td>{age}</td>
17
- </tr>
18
- <tr colSpan={4}>
19
- <td colSpan={4}>This is an Avenger!</td>
20
- </tr>
21
- </tbody>
22
- </table>
23
- </td>
24
- </tr>
25
- );
26
- };
27
-
28
- TableCustomRow.propTypes = {
29
- firstName: PropTypes.string,
30
- lastName: PropTypes.string,
31
- email: PropTypes.string,
32
- age: PropTypes.number,
33
- };
34
-
35
- export default TableCustomRow;
@@ -1,20 +0,0 @@
1
- import React from 'react';
2
- import classNames from 'classnames';
3
- import IconEnvelope from '@spothero/icons/envelope';
4
- import TableHeadingPropTypes from '../../TableHeadingPropTypes';
5
-
6
- const TableHeadingEmail = ({className, label}) => {
7
- const classes = classNames('TableHeading', 'TableHeadingEmail', className);
8
-
9
- return (
10
- <th className={classes}>
11
- {label}
12
- &nbsp;
13
- <IconEnvelope width="12px" height="12px" />
14
- </th>
15
- );
16
- };
17
-
18
- TableHeadingEmail.propTypes = TableHeadingPropTypes;
19
-
20
- export default TableHeadingEmail;
@@ -1,26 +0,0 @@
1
- export default [
2
- {
3
- firstName: 'Tony',
4
- lastName: 'Stark',
5
- email: 'ironman@avengers.com',
6
- age: 38,
7
- },
8
- {
9
- firstName: 'Bruce',
10
- lastName: 'Banner',
11
- email: 'hulksmash@avengers.com',
12
- age: 36,
13
- },
14
- {
15
- firstName: 'Steve',
16
- lastName: 'Rogers',
17
- email: 'captamerica@avengers.com',
18
- age: 104,
19
- },
20
- {
21
- firstName: 'Thor',
22
- lastName: 'Odinson',
23
- email: 'godofthunder@avengers.com',
24
- age: 1015,
25
- },
26
- ];
@@ -1,14 +0,0 @@
1
- export default [
2
- {
3
- label: 'First Name',
4
- dataKey: 'firstName',
5
- className: 'AvengersTableHeading-first-name',
6
- },
7
- {
8
- label: 'Last Name',
9
- dataKey: 'lastName',
10
- className: 'AvengersTableHeading-last-name',
11
- },
12
- {label: 'Email', dataKey: 'email', className: 'AvengersTableHeading-email'},
13
- {label: 'Age', dataKey: 'age', className: 'AvengersTableHeading-age'},
14
- ];
@@ -1,78 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import classNames from 'classnames';
4
-
5
- import deprecate from 'v1/utils/deprecate';
6
-
7
- deprecate({
8
- name: 'TextButton',
9
- newName: 'Button',
10
- changes: [
11
- 'Text button has now become a style variant of the v2 Button component',
12
- 'Since the v1 TextButton was a styled version of the v1 Button, the two have been combined in the v2 Button component. All of the core functionality of both v1 button types has been included in the v2 Button.',
13
- '---- Props ----',
14
- 'iconPosition has been removed, iconLeft and iconRight have replaced it.',
15
- 'color was removed.',
16
- 'block was removed, if full width is needed, use isFullWidth',
17
- 'loading was replaced by isLoading',
18
- ],
19
- });
20
-
21
- const TextButton = ({
22
- className,
23
- children,
24
- href,
25
- iconPosition,
26
- block,
27
- disabled,
28
- loading,
29
- onClick,
30
- ...attrs
31
- }) => {
32
- const classes = classNames(
33
- 'TextButton',
34
- {'TextButton-block': block},
35
- {'TextButton-loading': loading},
36
- {[`TextButton-with-icon-${iconPosition}`]: iconPosition},
37
- className
38
- );
39
- const tag = href ? 'a' : 'button';
40
- const opts = {
41
- className: classes,
42
- disabled,
43
- onClick,
44
- href,
45
- ...attrs,
46
- };
47
-
48
- if (!href) {
49
- opts.type = 'button';
50
- }
51
-
52
- return React.createElement(tag, opts, children);
53
- };
54
-
55
- TextButton.propTypes = {
56
- /** Additional class(es) to add to the component. */
57
- className: PropTypes.string,
58
- /** The markup node to insert into the button. */
59
- children: PropTypes.node,
60
- /** The url to send the link to, if applicable. If provided, will turn button into an anchor element. */
61
- href: PropTypes.node,
62
- /** If an icon is provided, whether to add the margin to the icon on the left or right side. */
63
- iconPosition: PropTypes.oneOf(['left', 'right']),
64
- /** Whether the button should display as a block level element. */
65
- block: PropTypes.bool,
66
- /** Whether the button is disabled or not. */
67
- disabled: PropTypes.bool,
68
- /** Whether to show a loading animation inside of the button. */
69
- loading: PropTypes.bool,
70
- /**
71
- * The handler to execute when the button is clicked.
72
- *
73
- * @param {SyntheticEvent} evt - The React `SyntheticEvent`.
74
- */
75
- onClick: PropTypes.func,
76
- };
77
-
78
- export default TextButton;
@@ -1,95 +0,0 @@
1
- describe('<TextButton />', () => {
2
- context('Display', () => {
3
- context('Default', () => {
4
- beforeEach(() => {
5
- cy.visitStory('v1/TextButton/Display', 'Default', {
6
- onBeforeLoad: contentWindow => {
7
- contentWindow.onDefaultTextButtonClick = evt => {
8
- // eslint-disable-next-line no-console
9
- console.log('clicked default text-button');
10
- };
11
-
12
- cy.stub(contentWindow, 'onDefaultTextButtonClick').as(
13
- 'defaultClick'
14
- );
15
- },
16
- });
17
- });
18
-
19
- it('Calls onClick() properly', () => {
20
- cy.get('.TextButton')
21
- .click()
22
- .get('@defaultClick')
23
- .should('be.called');
24
- });
25
-
26
- it('Renders correctly', () => {
27
- cy.get('.TextButton').contains('Default');
28
- });
29
- });
30
-
31
- context('Block', () => {
32
- it('Has block styles', () => {
33
- cy.visitStory('v1/TextButton/Display', 'Block')
34
- .get('.TextButton')
35
- .should('have.class', 'TextButton-block');
36
- });
37
- });
38
-
39
- context('Disabled', () => {
40
- beforeEach(() => {
41
- cy.visitStory('v1/TextButton/Display', 'Disabled', {
42
- onBeforeLoad: contentWindow => {
43
- contentWindow.onDisabledTextButtonClick = evt => {
44
- // eslint-disable-next-line no-console
45
- console.log('clicked disabled text-button');
46
- };
47
-
48
- cy.stub(contentWindow, 'onDisabledTextButtonClick').as(
49
- 'disabledClick'
50
- );
51
- },
52
- });
53
- });
54
-
55
- it('Has disabled attribute', () => {
56
- cy.get('.TextButton').should(
57
- 'have.attr',
58
- 'disabled',
59
- 'disabled'
60
- );
61
- });
62
-
63
- it(`Doesn't call onClick()`, () => {
64
- cy.get('.TextButton')
65
- .click({force: true})
66
- .get('@disabledClick')
67
- .should('not.be.called');
68
- });
69
- });
70
-
71
- context('Icon Left', () => {
72
- it('Has icon left styles', () => {
73
- cy.visitStory('v1/TextButton/Display', 'IconLeft')
74
- .get('.TextButton')
75
- .should('have.class', 'TextButton-with-icon-left');
76
- });
77
- });
78
-
79
- context('Icon Right', () => {
80
- it('Has icon right styles', () => {
81
- cy.visitStory('v1/TextButton/Display', 'IconRight')
82
- .get('.TextButton')
83
- .should('have.class', 'TextButton-with-icon-right');
84
- });
85
- });
86
-
87
- context('Loading', () => {
88
- it('Has loading styles', () => {
89
- cy.visitStory('v1/TextButton/Display', 'Loading')
90
- .get('.TextButton')
91
- .should('have.class', 'TextButton-loading');
92
- });
93
- });
94
- });
95
- });
@@ -1,114 +0,0 @@
1
- @keyframes TextButton-loading-rotate {
2
- 0% {
3
- transform: rotate(0deg);
4
- }
5
-
6
- 100% {
7
- transform: rotate(360deg);
8
- }
9
- }
10
-
11
- .TextButton {
12
- @include font-family;
13
- display: inline-block;
14
- cursor: pointer;
15
- white-space: nowrap;
16
- appearance: none;
17
- background: none;
18
- border: none;
19
- margin: 0;
20
- padding: 0;
21
- user-select: none;
22
- position: relative;
23
- outline: none;
24
- font-weight: $font-weight-semi-bold;
25
- color: $color-shift;
26
- transition: color $animation;
27
-
28
- &:focus,
29
- &:active {
30
- outline: none;
31
- }
32
-
33
- &:not([disabled]) {
34
- &:hover {
35
- color: $color-shift-hover;
36
- }
37
- }
38
-
39
- &:disabled {
40
- cursor: not-allowed;
41
- color: $color-dashboard;
42
- }
43
-
44
- .Icon {
45
- position: relative;
46
- margin: 0;
47
- width: 10px;
48
- height: 10px;
49
- line-height: 1;
50
- }
51
- }
52
-
53
- .TextButton-block {
54
- display: block;
55
- width: 100%;
56
- }
57
-
58
- .TextButton-with-icon-left {
59
- .Icon {
60
- margin-right: 5px;
61
- }
62
- }
63
-
64
- .TextButton-with-icon-right {
65
- .Icon {
66
- margin-left: 5px;
67
- }
68
- }
69
-
70
- .TextButton-loading {
71
- position: relative;
72
- pointer-events: none;
73
- cursor: not-allowed;
74
-
75
- &::before {
76
- content: "";
77
- position: absolute;
78
- right: 0.5em;
79
- top: 0;
80
- bottom: 0;
81
- margin: auto;
82
- width: 0.5em;
83
- height: 0.5em;
84
- border: 2px solid;
85
- border-left-color: transparent;
86
- border-radius: 50%;
87
- opacity: 1;
88
- animation-duration: 0.5s;
89
- animation-iteration-count: infinite;
90
- animation-name: TextButton-loading-rotate;
91
- animation-timing-function: linear;
92
- }
93
-
94
- &:not([disabled]) {
95
- color: $color-cement;
96
- opacity: 0.8;
97
- }
98
-
99
- &.TextButton {
100
- &::before {
101
- border: 2px solid;
102
- border-left-color: transparent;
103
- right: -1.5em;
104
- width: 1em;
105
- height: 1em;
106
- opacity: 1;
107
- }
108
-
109
- &::after {
110
- transition-delay: 0;
111
- width: 1em;
112
- }
113
- }
114
- }
@@ -1,46 +0,0 @@
1
- import React from 'react';
2
- import IconCheck from '@spothero/icons/check';
3
- import TextButton from 'v1/components/TextButton/TextButton';
4
-
5
- export default {
6
- component: TextButton,
7
- title: 'v1/TextButton/Display',
8
- };
9
-
10
- export const Default = () => {
11
- return (
12
- <TextButton
13
- onClick={window.onDefaultTextButtonClick} // eslint-disable-line react/jsx-handler-names
14
- >
15
- Default
16
- </TextButton>
17
- );
18
- };
19
-
20
- export const Block = () => {
21
- return <TextButton block>Block</TextButton>;
22
- };
23
-
24
- export const Disabled = () => {
25
- return <TextButton disabled>Disabled</TextButton>;
26
- };
27
-
28
- export const Loading = () => {
29
- return <TextButton loading>Loading</TextButton>;
30
- };
31
-
32
- export const IconLeft = () => {
33
- return (
34
- <TextButton iconPosition="left">
35
- <IconCheck /> TextButton with Icon left
36
- </TextButton>
37
- );
38
- };
39
-
40
- export const IconRight = () => {
41
- return (
42
- <TextButton iconPosition="right">
43
- TextButton with Icon right <IconCheck />
44
- </TextButton>
45
- );
46
- };
@@ -1,7 +0,0 @@
1
- export {default as Panel} from './Panel/Panel';
2
- export {default as Button} from './Button/Button';
3
- export {default as Table} from './Table/Table';
4
- export {default as TextButton} from './TextButton/TextButton';
5
- export {default as Image} from './Image/Image';
6
- export {default as Loader} from './Loader/Loader';
7
- export {Modal, ModalContent, ModalFooter} from './Modal';
@@ -1,45 +0,0 @@
1
- /* eslint-disable no-console */
2
- /* eslint-disable no-undef */
3
- /**
4
- * Logs a Deprecation Warning to the console for v1 components.
5
- * @static
6
- * @function deprecationWarningLog
7
- * @param {Object} [deprecationWarningContent={}] - The content of the deprecation warning.
8
- * @param {String} [deprecationWarningContent.componentName=null] - The name of the original component.
9
- * @param {string} [deprecationWarningContent.newComponentName=null] - The name of the new component if the name is significantly different than the original (ie. 'Panel' becomes 'Accordion').
10
- * @param {Array} [deprecationWarningContent.changes=null] - The array of changes to the component.
11
- * @example
12
- * const deprecationWarningContent = {
13
- * name: 'Old Component',
14
- newName: 'New Component',
15
- changes: [
16
- 'Prop 1 changed to Prop A',
17
- 'Prop 2 changed to Prop B',
18
- ],
19
- * };
20
- *
21
- * deprecate(deprecationWarningContent);
22
- * @returns {void}
23
- */
24
-
25
- const DEPRECATION_LIST = [];
26
-
27
- const deprecate = ({name, newName, changes}) => {
28
- if (
29
- process.env.NODE_ENV !== 'development' ||
30
- DEPRECATION_LIST.includes(name)
31
- ) {
32
- return;
33
- }
34
-
35
- console.groupCollapsed(`fe-ui v1 ${name} Deprecation Warning: `);
36
- console.log(
37
- `This component, ${name}, is now deprecated. Please use the v2 ${
38
- newName ? newName : name
39
- } instead.`
40
- );
41
- changes.forEach(change => console.log(change));
42
- console.groupEnd(`fe-ui v1 ${name} Deprecation Warning: `);
43
- };
44
-
45
- export default deprecate;
@@ -1 +0,0 @@
1
- export {Accordion as default} from '@chakra-ui/react';