@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,69 +0,0 @@
1
- import React, {forwardRef} from 'react';
2
- import PropTypes from 'prop-types';
3
- import {RadioGroup as ChakraRadioGroup, Stack} from '@chakra-ui/react';
4
- import FormControl from '../FormControl/FormControl';
5
-
6
- const RadioGroup = forwardRef(
7
- (
8
- {
9
- label,
10
- errorMessage,
11
- defaultValue,
12
- isDisabled,
13
- isInvalid,
14
- isRequired,
15
- name,
16
- onChange,
17
- value,
18
- children,
19
- direction,
20
- ...props
21
- },
22
- ref
23
- ) => {
24
- return (
25
- <FormControl
26
- isInvalid={isInvalid}
27
- isDisabled={isDisabled}
28
- isRequired={isRequired}
29
- errorMessage={errorMessage}
30
- label={label}
31
- inputId={props.id}
32
- isFieldset
33
- >
34
- <ChakraRadioGroup
35
- ref={ref}
36
- defaultValue={defaultValue}
37
- name={name}
38
- onChange={onChange}
39
- value={value}
40
- {...props}
41
- >
42
- <Stack
43
- direction={direction ? direction : 'column'}
44
- spacing={direction === 'row' ? 8 : 4}
45
- >
46
- {children}
47
- </Stack>
48
- </ChakraRadioGroup>
49
- </FormControl>
50
- );
51
- }
52
- );
53
-
54
- RadioGroup.propTypes = {
55
- children: PropTypes.node,
56
- defaultValue: PropTypes.string,
57
- id: PropTypes.string.isRequired,
58
- label: PropTypes.string,
59
- errorMessage: PropTypes.string,
60
- isDisabled: PropTypes.bool,
61
- isInvalid: PropTypes.bool,
62
- isRequired: PropTypes.bool,
63
- name: PropTypes.string,
64
- onChange: PropTypes.func,
65
- value: PropTypes.string,
66
- direction: PropTypes.oneOf(['row', 'column']),
67
- };
68
-
69
- export default RadioGroup;
@@ -1,2 +0,0 @@
1
- export {default as Radio} from './Radio';
2
- export {default as RadioGroup} from './RadioGroup';
@@ -1,52 +0,0 @@
1
- import merge from 'lodash/merge';
2
- import chakraDefaultTheme from '@chakra-ui/theme';
3
-
4
- const parts = ['control', 'label'];
5
-
6
- const baseStyle = {
7
- control: {
8
- borderRadius: '50%',
9
- borderWidth: '1px',
10
- borderColor: 'gray.dark',
11
- backgroundColor: 'white',
12
- minWidth: 5,
13
- minHeight: 5,
14
- marginTop: 1,
15
- _checked: {
16
- borderWidth: 0,
17
- color: 'white',
18
- backgroundColor: 'primary.default',
19
- _before: {
20
- content: '""',
21
- display: 'inline-block',
22
- position: 'relative',
23
- width: 2,
24
- height: 2,
25
- borderRadius: '50%',
26
- background: 'currentcolor',
27
- },
28
- },
29
- _focus: {
30
- boxShadow: t => `0 0 1px 2px ${t.colors.primary['300']}`,
31
- },
32
- _disabled: {
33
- borderColor: 'gray.200',
34
- _checked: {
35
- backgroundColor: 'gray.200',
36
- },
37
- },
38
- },
39
- label: {
40
- fontSize: 'base',
41
- color: 'black',
42
- marginLeft: 3,
43
- _disabled: {
44
- color: 'gray.200',
45
- },
46
- },
47
- };
48
-
49
- export default merge(chakraDefaultTheme.components.Radio, {
50
- parts,
51
- baseStyle,
52
- });
@@ -1,62 +0,0 @@
1
- import cn from 'classnames';
2
- import PropTypes from 'prop-types';
3
- import React, {forwardRef} from 'react';
4
- import {Select as ChakraSelect} from '@chakra-ui/react';
5
- import IconChevronDown from '@spothero/icons/chevron-down';
6
-
7
- import Icon from '../Icon/Icon';
8
- import FormControl from '../FormControl/FormControl';
9
-
10
- const Select = forwardRef(
11
- (
12
- {
13
- label,
14
- helperText,
15
- errorMessage,
16
- isInvalid,
17
- isDisabled,
18
- isRequired,
19
- isOptional,
20
- ...props
21
- },
22
- ref
23
- ) => {
24
- const classes = cn({'FormElement-contains-error': isInvalid});
25
-
26
- return (
27
- <FormControl
28
- isInvalid={isInvalid}
29
- isDisabled={isDisabled}
30
- isRequired={isRequired}
31
- errorMessage={errorMessage}
32
- isOptional={isOptional}
33
- helperText={helperText}
34
- label={label}
35
- inputId={props.id}
36
- >
37
- <ChakraSelect
38
- icon={<Icon as={IconChevronDown} />}
39
- iconSize={12}
40
- fontWeight="regular"
41
- fontSize="sm"
42
- ref={ref}
43
- className={classes}
44
- {...props}
45
- />
46
- </FormControl>
47
- );
48
- }
49
- );
50
-
51
- Select.propTypes = {
52
- id: PropTypes.string.isRequired,
53
- label: PropTypes.string,
54
- helperText: PropTypes.string,
55
- errorMessage: PropTypes.string,
56
- isInvalid: PropTypes.bool,
57
- isDisabled: PropTypes.bool,
58
- isRequired: PropTypes.bool,
59
- isOptional: PropTypes.bool,
60
- };
61
-
62
- export default Select;
@@ -1,60 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
-
4
- import Component from './Select';
5
-
6
- export default {
7
- title: 'v2/Select',
8
- component: Component,
9
- parameters: {
10
- removeBaseHtmlClass: true,
11
- },
12
- };
13
-
14
- const SelectTemplate = props => (
15
- <Component variant="outline" maxWidth="200px" {...props}>
16
- <option value="one">One</option>
17
- <option value="two">Two</option>
18
- <option value="three">Three</option>
19
- <option value="four">Four</option>
20
- </Component>
21
- );
22
-
23
- SelectTemplate.propTypes = {
24
- placeholder: PropTypes.string,
25
- label: PropTypes.string,
26
- helperText: PropTypes.string,
27
- errorMessage: PropTypes.string,
28
- isInvalid: PropTypes.bool,
29
- isDisabled: PropTypes.bool,
30
- isReadOnly: PropTypes.bool,
31
- };
32
-
33
- export const Select = SelectTemplate.bind({});
34
-
35
- Select.argTypes = {
36
- placeholder: {
37
- control: {type: 'text'},
38
- },
39
- label: {
40
- control: {type: 'text'},
41
- },
42
- helperText: {
43
- control: {type: 'text'},
44
- },
45
- errorMessage: {
46
- control: {type: 'text'},
47
- },
48
- };
49
-
50
- Select.args = {
51
- placeholder: 'Placeholder text',
52
- label: 'Label',
53
- helperText: 'Helper text',
54
- errorMessage: 'Error message',
55
- isInvalid: false,
56
- isDisabled: false,
57
- isReadOnly: false,
58
- isRequired: false,
59
- isOptional: false,
60
- };
@@ -1 +0,0 @@
1
- export {default} from './Select';
@@ -1,29 +0,0 @@
1
- import merge from 'lodash/merge';
2
- import chakraDefaultTheme from '@chakra-ui/theme';
3
-
4
- const variants = {
5
- outline: {
6
- field: {
7
- border: '1px solid',
8
- borderColor: 'inherit',
9
- bg: 'inherit',
10
- _hover: {borderColor: 'gray.300'},
11
- _readOnly: {boxShadow: 'none !important', userSelect: 'all'},
12
- _disabled: {opacity: 0.4, cursor: 'not-allowed'},
13
- _invalid: {
14
- borderColor: 'error',
15
- boxShadow: t => `0 0 0 1px ${t.colors.error}`,
16
- },
17
- _focus: {
18
- zIndex: 1,
19
- borderColor: 'primary.400',
20
- boxShadow: t => `0 0 0 1px ${t.colors.primary['400']}`,
21
- },
22
- },
23
- addon: {border: '1px solid', borderColor: 'inherit', bg: 'gray.100'},
24
- },
25
- };
26
-
27
- export default merge(chakraDefaultTheme.components.Select, {
28
- variants,
29
- });
@@ -1,34 +0,0 @@
1
- import React from 'react';
2
-
3
- import {Skeleton as Component, SkeletonCircle as CircleSkeleton, SkeletonText as TextSkeleton} from './index';
4
-
5
- export default {
6
- title: 'v2/Skeleton',
7
- component: Component,
8
- parameters: {
9
- removeBaseHtmlClass: true,
10
- chakraLink: 'https://chakra-ui.com/docs/components/skeleton/',
11
- },
12
- };
13
-
14
- const SkeletonTemplate = props => (
15
- <Component {...props}>
16
- Text
17
- </Component>
18
- );
19
-
20
- const SkeletonCircleTemplate = props => (
21
- <CircleSkeleton>
22
- Text
23
- </CircleSkeleton>
24
- )
25
-
26
- const SkeletonTextTemplate = props => (
27
- <TextSkeleton>
28
- Text
29
- </TextSkeleton>
30
- )
31
-
32
- export const Skeleton = SkeletonTemplate.bind({});
33
- export const SkeletonCircle = SkeletonCircleTemplate.bind({})
34
- export const SkeletonText = SkeletonTextTemplate.bind({})
@@ -1,3 +0,0 @@
1
- import chakraDefaultTheme from '@chakra-ui/theme';
2
-
3
- export default chakraDefaultTheme.components.Skeleton;
@@ -1 +0,0 @@
1
- export {Skeleton, SkeletonCircle, SkeletonText} from '@chakra-ui/react';
@@ -1,40 +0,0 @@
1
- import React, {forwardRef} from 'react';
2
- import PropTypes from 'prop-types';
3
- import {Spinner as ChakraSpinner} from '@chakra-ui/react';
4
-
5
- import {thicknesses, SIZE_MAP} from './Spinner.styles';
6
-
7
- const Spinner = forwardRef(({size, thickness, ...props}, ref) => {
8
- const thicknessString = thickness
9
- ? `${thickness}px`
10
- : thicknesses[size]
11
- ? `${thicknesses[size]}px`
12
- : '2px';
13
-
14
- return (
15
- <ChakraSpinner
16
- ref={ref}
17
- role="status"
18
- color="primary.default"
19
- emptyColor="gray.medium"
20
- thickness={thicknessString}
21
- size={size || SIZE_MAP['2xl']}
22
- {...props}
23
- />
24
- );
25
- });
26
-
27
- Spinner.propTypes = {
28
- /** The main fill color of the spinner */
29
- color: PropTypes.string,
30
- /** The diameter of the spinner ring in pixels */
31
- thickness: PropTypes.number,
32
- /** The empty color of the spinner */
33
- emptyColor: PropTypes.string,
34
- /** The size of the spinner */
35
- size: PropTypes.oneOf(Object.keys(SIZE_MAP)),
36
- /** The speed of the spinner, ex: 10s, 0.1s, 250ms */
37
- speed: PropTypes.string,
38
- };
39
-
40
- export default Spinner;
@@ -1,98 +0,0 @@
1
- import React from 'react';
2
- import colors from 'v2/theme/base/colors';
3
-
4
- import {sizes, SIZE_MAP, thicknesses} from './Spinner.styles';
5
- import {
6
- createSelectControl,
7
- createRangeControl,
8
- } from 'storybook/utils/create-control';
9
- import disableArgs from 'storybook/utils/disable-args';
10
-
11
- import Component from './Spinner';
12
-
13
- export default {
14
- title: 'v2/Spinner',
15
- component: Component,
16
- parameters: {
17
- removeBaseHtmlClass: true,
18
- importBy: 'Spinner',
19
- },
20
- };
21
-
22
- const allColors = Object.entries(colors).reduce((acc, [colorName, color]) => {
23
- if (typeof color === 'string') {
24
- acc.push(colorName);
25
- } else {
26
- Object.keys(color).forEach(stop => {
27
- acc.push(`${colorName}.${stop}`);
28
- });
29
- }
30
-
31
- return acc;
32
- }, []);
33
-
34
- const colorControl = key => createSelectControl(key, allColors);
35
- const Template = props => <Component {...props} />;
36
-
37
- export const Overview = Template.bind({});
38
- Overview.argTypes = {
39
- ...colorControl('color'),
40
- ...colorControl('emptyColor'),
41
- ...createSelectControl('size', Object.keys(sizes)),
42
- ...createRangeControl({name: 'thickness', min: 1, max: 100}),
43
- };
44
- Overview.args = {
45
- speed: '1s',
46
- size: SIZE_MAP['2xl'],
47
- thickness: thicknesses[SIZE_MAP['2xl']],
48
- color: 'primary.default',
49
- emptyColor: 'gray.medium',
50
- };
51
-
52
- export const Speed = Template.bind({});
53
- Speed.argTypes = disableArgs(['size', 'color', 'emptyColor', 'thickness']);
54
- Speed.args = {
55
- speed: '1s',
56
- size: SIZE_MAP['2xl'],
57
- color: 'primary.default',
58
- emptyColor: 'gray.medium',
59
- thickness: thicknesses[SIZE_MAP['2xl']],
60
- };
61
-
62
- export const Size = Template.bind({});
63
- Size.argTypes = {
64
- ...createSelectControl('size', Object.keys(sizes)),
65
- ...disableArgs(['speed', 'color', 'emptyColor', 'thickness']),
66
- };
67
- Size.args = {
68
- size: SIZE_MAP['2xl'],
69
- };
70
- export const Thickness = Template.bind({});
71
- Thickness.argTypes = {
72
- ...disableArgs(['speed', 'size', 'emptyColor', 'color']),
73
- ...createRangeControl({name: 'thickness', min: 1, max: 100}),
74
- };
75
- Thickness.args = {
76
- thickness: thicknesses[SIZE_MAP['5xl']],
77
- };
78
-
79
- export const Color = Template.bind({});
80
- Color.argTypes = {
81
- ...colorControl('color'),
82
- ...disableArgs(['speed', 'size', 'emptyColor', 'thickness']),
83
- };
84
-
85
- Color.args = {
86
- thickness: 6,
87
- color: 'primary.default',
88
- };
89
- export const EmptyColor = Template.bind({});
90
- EmptyColor.argTypes = {
91
- ...colorControl('emptyColor'),
92
- ...disableArgs(['speed', 'size', 'color', 'thickness']),
93
- };
94
-
95
- EmptyColor.args = {
96
- thickness: 6,
97
- emptyColor: 'gray.medium',
98
- };
@@ -1,57 +0,0 @@
1
- import merge from 'lodash/merge';
2
- import chakraDefaultTheme from '@chakra-ui/theme';
3
-
4
- const spinnerStyles = chakraDefaultTheme.components.Spinner;
5
-
6
- export const SIZE_MAP = {
7
- xs: 'xs',
8
- sm: 'sm',
9
- md: 'md',
10
- lg: 'lg',
11
- xl: 'xl',
12
- '2xl': '2xl',
13
- '3xl': '3xl',
14
- '4xl': '4xl',
15
- '5xl': '5xl',
16
- '6xl': '6xl',
17
- '7xl': '7xl',
18
- '8xl': '8xl',
19
- '9xl': '9xl',
20
- '10xl': '10xl',
21
- };
22
-
23
- export const sizes = merge(spinnerStyles.sizes, {
24
- [SIZE_MAP['2xl']]: {w: '4rem', h: '4rem'},
25
- [SIZE_MAP['3xl']]: {w: '5rem', h: '5rem'},
26
- [SIZE_MAP['4xl']]: {w: '6rem', h: '6rem'},
27
- [SIZE_MAP['5xl']]: {w: '7rem', h: '7rem'},
28
- [SIZE_MAP['6xl']]: {w: '8rem', h: '8rem'},
29
- [SIZE_MAP['7xl']]: {w: '9rem', h: '9rem'},
30
- [SIZE_MAP['8xl']]: {w: '10rem', h: '10rem'},
31
- [SIZE_MAP['9xl']]: {w: '11rem', h: '11rem'},
32
- [SIZE_MAP['10xl']]: {w: '12rem', h: '12rem'},
33
- });
34
-
35
- export const thicknesses = {
36
- [SIZE_MAP.xl]: 3,
37
- [SIZE_MAP['2xl']]: 4,
38
- [SIZE_MAP['3xl']]: 5,
39
- [SIZE_MAP['4xl']]: 6,
40
- [SIZE_MAP['5xl']]: 7,
41
- [SIZE_MAP['6xl']]: 8,
42
- [SIZE_MAP['7xl']]: 9,
43
- [SIZE_MAP['8xl']]: 10,
44
- [SIZE_MAP['9xl']]: 11,
45
- [SIZE_MAP['10xl']]: 12,
46
- };
47
-
48
- const defaultProps = {
49
- speed: '2s',
50
- size: SIZE_MAP['2xl'],
51
- thickness: thicknesses[SIZE_MAP['2xl']],
52
- };
53
-
54
- export default {
55
- sizes,
56
- defaultProps,
57
- };
@@ -1,52 +0,0 @@
1
- import React, {forwardRef} from 'react';
2
- import cn from 'classnames';
3
- import PropTypes from 'prop-types';
4
-
5
- import {Switch as ChakraSwitch} from '@chakra-ui/react';
6
-
7
- import FormControl from '../FormControl/FormControl';
8
-
9
- const Switch = forwardRef(
10
- (
11
- {
12
- label,
13
- helperText,
14
- errorMessage,
15
- isInvalid,
16
- isDisabled,
17
- isRequired,
18
- ...props
19
- },
20
- ref
21
- ) => {
22
- const classes = cn({'FormElement-contains-error': isInvalid});
23
-
24
- return (
25
- <FormControl
26
- isInvalid={isInvalid}
27
- isDisabled={isDisabled}
28
- isRequired={isRequired}
29
- errorMessage={errorMessage}
30
- helperText={helperText}
31
- label={label}
32
- inputId={props.id}
33
- >
34
- <ChakraSwitch ref={ref} className={classes} {...props} />
35
- </FormControl>
36
- );
37
- }
38
- );
39
-
40
- Switch.propTypes = {
41
- isChecked: PropTypes.bool,
42
- defaultChecked: PropTypes.bool,
43
- id: PropTypes.string.isRequired,
44
- label: PropTypes.string,
45
- helperText: PropTypes.string,
46
- errorMessage: PropTypes.string,
47
- isInvalid: PropTypes.bool,
48
- isDisabled: PropTypes.bool,
49
- isRequired: PropTypes.bool,
50
- };
51
-
52
- export default Switch;
@@ -1,88 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
-
4
- import Component from './Switch';
5
-
6
- export default {
7
- title: 'v2/Switch',
8
- component: Component,
9
- parameters: {
10
- removeBaseHtmlClass: true,
11
- },
12
- };
13
-
14
- const SwitchTemplate = props => <Component {...props} />;
15
-
16
- SwitchTemplate.propTypes = {
17
- isChecked: PropTypes.bool,
18
- defaultChecked: PropTypes.bool,
19
- id: PropTypes.string.isRequired,
20
- label: PropTypes.string,
21
- helperText: PropTypes.string,
22
- errorMessage: PropTypes.string,
23
- isInvalid: PropTypes.bool,
24
- isDisabled: PropTypes.bool,
25
- isRequired: PropTypes.bool,
26
- };
27
-
28
- export const Switch = SwitchTemplate.bind({});
29
-
30
- Switch.argTypes = {
31
- isChecked: {
32
- control: {
33
- type: 'boolean',
34
- },
35
- },
36
- defaultChecked: {
37
- control: {
38
- type: 'boolean',
39
- },
40
- },
41
- id: {
42
- control: {
43
- type: 'text',
44
- },
45
- },
46
- label: {
47
- control: {
48
- type: 'text',
49
- },
50
- },
51
- helperText: {
52
- control: {
53
- type: 'text',
54
- },
55
- },
56
- errorMessage: {
57
- control: {
58
- type: 'text',
59
- },
60
- },
61
- isInvalid: {
62
- control: {
63
- type: 'boolean',
64
- },
65
- },
66
- isDisabled: {
67
- control: {
68
- type: 'boolean',
69
- },
70
- },
71
- isRequired: {
72
- control: {
73
- type: 'boolean',
74
- },
75
- },
76
- };
77
-
78
- Switch.args = {
79
- isChecked: true,
80
- defaultChecked: false,
81
- id: 'Switch_Id',
82
- label: 'Label',
83
- helperText: 'Helper Text',
84
- errorMessage: 'Error Message',
85
- isInvalid: false,
86
- isDisabled: false,
87
- isRequired: false,
88
- };
@@ -1 +0,0 @@
1
- export {default} from './Switch';
@@ -1,17 +0,0 @@
1
- import merge from 'lodash/merge';
2
- import chakraDefaultTheme from '@chakra-ui/theme';
3
-
4
- const overrides = {
5
- defaultProps: {
6
- colorScheme: 'primary',
7
- size: 'lg',
8
- },
9
- baseStyle: props =>
10
- merge(chakraDefaultTheme.components.Switch.baseStyle(props), {
11
- track: {
12
- bg: 'gray.medium',
13
- },
14
- }),
15
- };
16
-
17
- export default {...chakraDefaultTheme.components.Switch, ...overrides};
@@ -1 +0,0 @@
1
- export {Table as default} from '@chakra-ui/react';