@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,103 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import {Box} from '@chakra-ui/react';
4
-
5
- import Text from 'v2/components/Text/Text';
6
- import Heading from 'v2/components/Heading/Heading';
7
-
8
- import Component from './Accordion';
9
- import {
10
- AccordionIcon,
11
- AccordionItem,
12
- AccordionPanel,
13
- AccordionButton,
14
- } from './index';
15
-
16
- export default {
17
- title: 'v2/Accordion',
18
- parameters: {
19
- removeBaseHtmlClass: true,
20
- },
21
- argTypes: {
22
- accordionText: {
23
- control: {
24
- type: 'text',
25
- },
26
- },
27
- allowMultiple: {
28
- control: {
29
- type: 'boolean',
30
- },
31
- },
32
- allowToggle: {
33
- control: {
34
- type: 'boolean',
35
- },
36
- },
37
- index: {
38
- control: {
39
- type: 'number',
40
- },
41
- },
42
- },
43
- };
44
-
45
- const AccordionTemplate = ({
46
- accordionText,
47
- allowMultiple,
48
- index,
49
- allowToggle,
50
- }) => {
51
- const multipleOptions = allowMultiple
52
- ? {allowMultiple, defaultIndex: index}
53
- : '';
54
-
55
- const toggleOptions = allowToggle ? {allowToggle} : '';
56
-
57
- return (
58
- <Component {...toggleOptions} {...multipleOptions}>
59
- <AccordionItem>
60
- <Heading as="h3">
61
- <AccordionButton>
62
- <Box flex="1" textAlign="left">
63
- Accordion Item 1 Title
64
- </Box>
65
- <AccordionIcon />
66
- </AccordionButton>
67
- </Heading>
68
- <AccordionPanel>
69
- <Text>{accordionText}</Text>
70
- </AccordionPanel>
71
- </AccordionItem>
72
- <AccordionItem>
73
- <Heading as="h3">
74
- <AccordionButton>
75
- <Box flex="1" textAlign="left">
76
- Accordion Item 2 Title
77
- </Box>
78
- <AccordionIcon />
79
- </AccordionButton>
80
- </Heading>
81
- <AccordionPanel>
82
- <Text>{accordionText}</Text>
83
- </AccordionPanel>
84
- </AccordionItem>
85
- </Component>
86
- );
87
- };
88
-
89
- AccordionTemplate.propTypes = {
90
- allowToggle: PropTypes.bool,
91
- allowMultiple: PropTypes.bool,
92
- accordionText: PropTypes.string,
93
- index: PropTypes.oneOfType([PropTypes.number, PropTypes.array]),
94
- defaultIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.array]),
95
- };
96
-
97
- export const Accordion = AccordionTemplate.bind({});
98
- Accordion.args = {
99
- accordionText: `You must come along now, Artoo. There's really nothing more we can do. And my joints are freezing up. Don't say thing like that! Of course we'll see Master Luke again. He'll be quite all right, you'll see. Stupid little short-circuit. He'll be quite all right. Sir, all the patrols are in. There's still no contact from Skywalker or Solo. Mistress Leia, Artoo says he's been quite unable to pick up any signals, although he does admit that his own range is far too weak to abandon all hope. Your Highness, there's nothing more we can do tonight. The shield doors must be closed. Close the doors. Yes, sir.`,
100
- allowMultiple: true,
101
- allowToggle: true,
102
- index: [1],
103
- };
@@ -1,7 +0,0 @@
1
- export {default} from './Accordion';
2
- export {
3
- AccordionIcon,
4
- AccordionItem,
5
- AccordionPanel,
6
- AccordionButton,
7
- } from '@chakra-ui/react';
@@ -1,16 +0,0 @@
1
- import {variants as headingVariants} from 'v2/components/Heading/Heading.styles';
2
-
3
- const button = {
4
- fontSize: headingVariants.h4.fontSize,
5
- fontWeight: 'semibold',
6
- px: 0,
7
- py: {
8
- base: 4,
9
- tablet: 6,
10
- },
11
- '& svg': {
12
- color: 'primary.default',
13
- },
14
- };
15
-
16
- export default button;
@@ -1,9 +0,0 @@
1
- const container = {
2
- borderTopWidth: '1px',
3
- borderColor: 'gray.medium',
4
- _last: {
5
- borderBottomWidth: '1px',
6
- },
7
- };
8
-
9
- export default container;
@@ -1,19 +0,0 @@
1
- import merge from 'lodash/merge';
2
- import chakraDefaultTheme from '@chakra-ui/theme';
3
-
4
- import panel from './panel';
5
- import button from './button';
6
- import container from './container';
7
-
8
- const parts = ['container', 'button', 'panel'];
9
-
10
- const baseStyle = {
11
- panel,
12
- button,
13
- container,
14
- };
15
-
16
- export default merge(chakraDefaultTheme.components.Accordion, {
17
- parts,
18
- baseStyle,
19
- });
@@ -1,7 +0,0 @@
1
- const panel = {
2
- pt: 0,
3
- px: 0,
4
- pb: 6,
5
- };
6
-
7
- export default panel;
@@ -1,121 +0,0 @@
1
- import React from 'react';
2
- import {
3
- Alert as ChakraAlert,
4
- AlertTitle,
5
- AlertDescription,
6
- VStack,
7
- Flex,
8
- useStyleConfig,
9
- } from '@chakra-ui/react';
10
- import PropTypes from 'prop-types';
11
- import IconX from '@spothero/icons/times';
12
- import IconInfo from '@spothero/icons/filled-info-circle';
13
- import IconExclamation from '@spothero/icons/filled-exclamation-circle';
14
- import IconCheck from '@spothero/icons/filled-check-circle';
15
- import Button from 'v2/components/Button/Button';
16
- import Icon from 'v2/components/Icon/Icon';
17
-
18
- export const STATUSES = {
19
- NEUTRAL: 'neutral',
20
- ERROR: 'error',
21
- WARNING: 'warning',
22
- SUCCESS: 'success',
23
- };
24
-
25
- const statusIconMapping = {
26
- [STATUSES.WARNING]: IconExclamation,
27
- [STATUSES.SUCCESS]: IconCheck,
28
- [STATUSES.ERROR]: IconExclamation,
29
- [STATUSES.NEUTRAL]: IconInfo,
30
- };
31
-
32
- const Alert = ({
33
- status,
34
- title,
35
- buttonProps,
36
- buttonText,
37
- buttonOnBottom,
38
- showDismiss,
39
- onDismissClick,
40
- showIcon,
41
- description,
42
- ...props
43
- }) => {
44
- const style = useStyleConfig('Alert', {'data-status': status});
45
- const IconVariant = statusIconMapping[status];
46
-
47
- return (
48
- <ChakraAlert data-status={status} {...props}>
49
- {showIcon ? <Icon sx={style.icon} as={IconVariant} /> : null}
50
- <VStack spacing={0} alignItems="flex-start">
51
- {title ? <AlertTitle>{title}</AlertTitle> : null}
52
- {description ? (
53
- <AlertDescription>{description}</AlertDescription>
54
- ) : null}
55
- {buttonOnBottom && buttonText && buttonProps ? (
56
- <Button
57
- sx={style.actionButton}
58
- variant="tertiary"
59
- {...buttonProps}
60
- >
61
- {buttonText}
62
- </Button>
63
- ) : null}
64
- </VStack>
65
- <Flex alignItems="center" marginLeft="auto">
66
- {!buttonOnBottom && buttonText && buttonProps ? (
67
- <Button
68
- sx={style.actionButton}
69
- variant="tertiary"
70
- {...buttonProps}
71
- >
72
- {buttonText}
73
- </Button>
74
- ) : null}
75
- {showDismiss ? (
76
- <Button sx={style.dismissButton} onClick={onDismissClick}>
77
- <Icon width={3} height="auto" as={IconX} />
78
- </Button>
79
- ) : null}
80
- </Flex>
81
- </ChakraAlert>
82
- );
83
- };
84
-
85
- Alert.propTypes = {
86
- /** Status. One of: success, neutral, warning, or error */
87
- status: PropTypes.oneOf(['neutral', 'success', 'warning', 'error']),
88
- /** Title Text. Will not display title if empty */
89
- title: PropTypes.node,
90
- /** Props to pass to button (like onClick). Will not display button if this or buttonText empty */
91
- buttonProps: PropTypes.object,
92
- /** Text of button. Will not display button if this or buttonProps empty */
93
- buttonText: PropTypes.string,
94
- /** Whether action button should be under description (as opposed to on right) */
95
- buttonOnBottom: PropTypes.bool,
96
- /** Whether or not to show X dismiss button */
97
- showDismiss: PropTypes.bool,
98
- /** Callback when X clicked */
99
- onDismissClick: PropTypes.func,
100
- /** Whether or not to show the icon */
101
- showIcon: PropTypes.bool,
102
- /** Description text. Will not display description if empty */
103
- description: PropTypes.node,
104
- /** Size of the text */
105
- size: PropTypes.oneOf(['sm', 'md', 'lg']),
106
- };
107
-
108
- Alert.defaultProps = {
109
- status: 'neutral',
110
- title: null,
111
- buttonProps: null,
112
- buttonText: null,
113
- buttonOnBottom: false,
114
- showDismiss: false,
115
- onDismissClick: null,
116
- showIcon: true,
117
- description: null,
118
- size: 'md',
119
- };
120
-
121
- export default Alert;
@@ -1,50 +0,0 @@
1
- import React from 'react';
2
- import {VStack, Text} from '@chakra-ui/react';
3
- import {createSelectControl} from 'storybook/utils/create-control';
4
- import disableArgs from 'storybook/utils/disable-args';
5
-
6
- import Component from './Alert';
7
-
8
- export default {
9
- title: 'v2/Alert',
10
- component: Component,
11
- parameters: {
12
- removeBaseHtmlClass: true,
13
- },
14
- };
15
-
16
- const AlertTemplate = props => (
17
- <VStack alignItems="flex-start">
18
- <Text>Status: Success</Text>
19
- <Component status="success" {...props} />
20
- <Text>Status: Error</Text>
21
- <Component status="error" {...props} />
22
- <Text>Status: Warning</Text>
23
- <Component status="warning" {...props} />
24
- <Text>Status: Neutral</Text>
25
- <Component status="neutral" {...props} />
26
- </VStack>
27
- );
28
-
29
- AlertTemplate.propTypes = {};
30
-
31
- export const Alert = AlertTemplate.bind({});
32
-
33
- Alert.argTypes = {
34
- ...createSelectControl('size', ['sm', 'md', 'lg']),
35
- ...disableArgs(['buttonProps', 'onDismissClick', 'status']),
36
- };
37
-
38
- Alert.args = {
39
- title: 'Hello',
40
- buttonOnBottom: false,
41
- buttonText: 'Action',
42
- description: 'This is an alert.',
43
- buttonProps: {
44
- onClick: () => console.log('Action clicked'),
45
- },
46
- showDismiss: true,
47
- onDismissClick: () => console.log('dismissed'),
48
- showIcon: true,
49
- size: 'md',
50
- };
@@ -1 +0,0 @@
1
- export {default} from './Alert';
@@ -1,166 +0,0 @@
1
- import merge from 'lodash/merge';
2
- import chakraDefaultTheme from '@chakra-ui/theme';
3
- import {STATUSES} from '../Alert';
4
-
5
- const baseStyle = {
6
- container: {
7
- paddingY: 2,
8
- borderRadius: 'base',
9
- },
10
- actionButton: {
11
- fontSize: 'sm',
12
- height: 'fit-content',
13
- lineHeight: '1.4',
14
- color: 'primary.600',
15
- _hover: {
16
- color: 'primary.700',
17
- },
18
- },
19
- dismissButton: {
20
- color: 'gray.600',
21
- borderColor: 'transparent',
22
- borderWidth: '2px',
23
- padding: 0,
24
- width: 10,
25
- height: 10,
26
- backgroundColor: 'transparent',
27
- borderRadius: 'base',
28
- marginLeft: 2,
29
- _hover: {
30
- color: 'gray.700',
31
- },
32
- _focus: {
33
- color: 'gray.700',
34
- borderColor: 'white',
35
- boxShadow: 'outline',
36
- },
37
- },
38
- icon: {
39
- width: 6,
40
- marginRight: 2,
41
- height: 'auto',
42
- },
43
- description: {
44
- lineHeight: 1.4,
45
- },
46
- title: {
47
- lineHeight: 1.4,
48
- },
49
- };
50
-
51
- const statusStyles = status => {
52
- switch (status) {
53
- case STATUSES.NEUTRAL:
54
- return {
55
- container: {
56
- background: 'gray.light',
57
- },
58
- icon: {
59
- color: 'gray.dark',
60
- },
61
- dismissButton: {
62
- _hover: {
63
- background: 'gray.200',
64
- },
65
- _focus: {
66
- background: 'gray.200',
67
- },
68
- },
69
- };
70
- case STATUSES.WARNING:
71
- return {
72
- container: {
73
- background: 'yellow.100',
74
- },
75
- icon: {
76
- color: 'yellow.500',
77
- },
78
- dismissButton: {
79
- _hover: {
80
- background: 'yellow.200',
81
- },
82
- _focus: {
83
- background: 'yellow.200',
84
- },
85
- },
86
- };
87
- case STATUSES.ERROR:
88
- return {
89
- container: {
90
- background: 'red.100',
91
- },
92
- icon: {
93
- color: 'red.700',
94
- },
95
- dismissButton: {
96
- _hover: {
97
- background: 'red.200',
98
- },
99
- _focus: {
100
- background: 'red.200',
101
- },
102
- },
103
- };
104
- case STATUSES.SUCCESS:
105
- return {
106
- container: {
107
- background: 'green.100',
108
- },
109
- icon: {
110
- color: 'green.700',
111
- },
112
- dismissButton: {
113
- _hover: {
114
- background: 'green.200',
115
- },
116
- _focus: {
117
- background: 'green.200',
118
- },
119
- },
120
- };
121
-
122
- default:
123
- return {};
124
- }
125
- };
126
-
127
- const overrides = {
128
- baseStyle: props => {
129
- return merge(
130
- {
131
- ...chakraDefaultTheme.components.Alert.baseStyle,
132
- },
133
- baseStyle,
134
- statusStyles(props['data-status'])
135
- );
136
- },
137
- variants: {},
138
- sizes: {
139
- sm: {
140
- title: {
141
- fontSize: 'xs',
142
- },
143
- description: {
144
- fontSize: 'xs',
145
- },
146
- },
147
- md: {
148
- title: {
149
- fontSize: 'sm',
150
- },
151
- description: {
152
- fontSize: 'sm',
153
- },
154
- },
155
- lg: {
156
- title: {
157
- fontSize: 'base',
158
- },
159
- description: {
160
- fontSize: 'base',
161
- },
162
- },
163
- },
164
- };
165
-
166
- export default {...chakraDefaultTheme.components.Alert, ...overrides};
@@ -1,187 +0,0 @@
1
- import React, {forwardRef} from 'react';
2
- import PropTypes from 'prop-types';
3
- import FormControl from '../FormControl/FormControl';
4
- import AsyncSelect from 'react-select/async';
5
- import {useTheme} from '@chakra-ui/react';
6
- import IconTimesCircle from '@spothero/icons/times-circle';
7
-
8
- const AutoSuggestSelect = forwardRef(
9
- (
10
- {
11
- id,
12
- label,
13
- helperText,
14
- errorMessage,
15
- isInvalid,
16
- isDisabled,
17
- isRequired,
18
- getOptions,
19
- onChange,
20
- iconSrc,
21
- placeholder,
22
- },
23
- ref
24
- ) => {
25
- const {colors, fontSizes, sizes} = useTheme();
26
-
27
- const handleChange = selectedOption => {
28
- onChange(selectedOption);
29
- };
30
-
31
- const icon = (color = 'transparent') => ({
32
- alignItems: 'center',
33
- display: 'flex',
34
-
35
- ':before': {
36
- backgroundColor: color,
37
- content: '" "',
38
- display: 'block',
39
- marginRight: sizes['3'],
40
- height: sizes['4'],
41
- width: sizes['5'],
42
- mask: `url(${iconSrc}) no-repeat 50% 50%`,
43
- maskSize: 'contain',
44
- },
45
- });
46
-
47
- const baseText = {
48
- fontSize: fontSizes.base,
49
- color: colors.black,
50
- };
51
-
52
- /** React Select doesn't use Chakra but it does use Emotion so it's not too difficult to use values from our Chakra theme. Here is the documentation for React Select styling: https://react-select.com/styles */
53
- const customStyles = {
54
- menu: provided => ({
55
- ...provided,
56
- ...baseText,
57
- }),
58
- control: (provided, state) => ({
59
- ...provided,
60
- borderColor: isInvalid
61
- ? colors.error
62
- : state.isFocused
63
- ? colors.primary.default
64
- : colors.gray['200'],
65
- borderWidth: '1px',
66
- boxShadow: 'none',
67
- '&:hover': {
68
- borderColor: isInvalid
69
- ? colors.error
70
- : state.isFocused
71
- ? colors.primary.default
72
- : colors.gray['200'],
73
- },
74
- }),
75
- input: (provided, state) => ({
76
- ...provided,
77
- ...baseText,
78
- padding: sizes['2'],
79
- backgroundColor: state.isDisabled
80
- ? colors.gray['200']
81
- : 'transparent',
82
- ...(iconSrc && icon(colors.gray['600'])),
83
- }),
84
- placeholder: provided => ({
85
- ...provided,
86
- padding: sizes['2'],
87
- fontSize: fontSizes.base,
88
- color: colors.gray['600'],
89
- ...(iconSrc && icon()),
90
- }),
91
- singleValue: provided => ({
92
- ...provided,
93
- ...baseText,
94
- padding: sizes['2'],
95
- ...(iconSrc && icon()),
96
- }),
97
- option: (provided, state) => ({
98
- ...provided,
99
- backgroundColor: state.isSelected
100
- ? colors.gray['200']
101
- : state.isFocused
102
- ? colors.gray['50']
103
- : 'transparent',
104
- color: colors.black,
105
- }),
106
- clearIndicator: provided => ({
107
- ...provided,
108
- color: colors.gray['600'],
109
- }),
110
- dropdownIndicator: provided => ({
111
- ...provided,
112
- color: colors.gray['600'],
113
- }),
114
- };
115
-
116
- const clearIndicatorStyles = {
117
- width: sizes['5'],
118
- display: 'flex',
119
- marginRight: sizes['3'],
120
- color: colors.gray['600'],
121
- cursor: 'pointer',
122
- };
123
-
124
- /** React Select allows you to override the clear indicator with your own custom component: https://react-select.com/components */
125
- const ClearIndicator = ({innerRef, innerProps}) => (
126
- <div style={clearIndicatorStyles} ref={innerRef} {...innerProps}>
127
- <IconTimesCircle />
128
- </div>
129
- );
130
-
131
- return (
132
- <FormControl
133
- errorMessage={errorMessage}
134
- isRequired={isRequired}
135
- helperText={helperText}
136
- label={label}
137
- inputId={id}
138
- >
139
- <AsyncSelect
140
- closeMenuOnSelect
141
- isClearable
142
- cacheOptions
143
- components={{
144
- DropdownIndicator: () => null,
145
- IndicatorSeparator: () => null,
146
- ClearIndicator,
147
- }}
148
- openMenuOnClick={false}
149
- loadOptions={getOptions}
150
- onChange={handleChange}
151
- isDisabled={isDisabled}
152
- id={id}
153
- placeholder={placeholder}
154
- styles={customStyles}
155
- ref={ref}
156
- />
157
- </FormControl>
158
- );
159
- }
160
- );
161
-
162
- AutoSuggestSelect.propTypes = {
163
- /** ID applied to the select and label */
164
- id: PropTypes.string.isRequired,
165
- /** Label that describes the select */
166
- label: PropTypes.string,
167
- /** Text to use as placeholder in the input */
168
- placeholder: PropTypes.string,
169
- /** Optional helper text displayed below the select */
170
- helperText: PropTypes.string,
171
- /** Error message that would display under the select */
172
- errorMessage: PropTypes.string,
173
- /** Boolean that sets whether the select is valid */
174
- isInvalid: PropTypes.bool,
175
- /** Boolean that sets whether the select is disabled */
176
- isDisabled: PropTypes.bool,
177
- /** Boolean that sets whether the select is required */
178
- isRequired: PropTypes.bool,
179
- /** Function that is called with the value typed into the input that returns a list of options for the select */
180
- getOptions: PropTypes.func.isRequired,
181
- /** Function that is called when an option is selected, it returns the label and value of the selection */
182
- onChange: PropTypes.func.isRequired,
183
- /** Optional src to SVG to use as search icon */
184
- iconSrc: PropTypes.string,
185
- };
186
-
187
- export default AutoSuggestSelect;
@@ -1 +0,0 @@
1
- export {default as AutoSuggestSelect} from './AutoSuggestSelect';