@spothero/ui 15.0.0-beta.2 → 15.0.0-beta.4

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 (49) hide show
  1. package/backlog/Chart/Chart.js +2 -2
  2. package/backlog/DateTime/DatePicker.js +4 -4
  3. package/backlog/DateTime/DatePickerCalendar.js +8 -8
  4. package/backlog/DateTime/DatePickerCalendarWithRange.js +6 -6
  5. package/backlog/DateTime/DateTimeRangePicker.js +6 -4
  6. package/backlog/DateTime/TimePicker.js +3 -3
  7. package/backlog/ErrorBoundary/ErrorBoundary.js +3 -3
  8. package/backlog/Flyout/Flyout.js +5 -5
  9. package/backlog/Form/Form.js +5 -3
  10. package/backlog/GooglePlacesSearchInput/GooglePlacesSearchInput.js +2 -2
  11. package/backlog/Notification/Notification.js +4 -4
  12. package/backlog/Portal/Portal.js +3 -3
  13. package/backlog/RenderInBody/RenderInBody.js +2 -2
  14. package/backlog/Select/Select.js +3 -3
  15. package/backlog/SelectControlled/SelectControlled.js +3 -3
  16. package/backlog/Tooltip/Tooltip.js +6 -6
  17. package/backlog/v1/components/Image/Image.js +2 -2
  18. package/backlog/v1/components/Modal/Modal.js +12 -12
  19. package/backlog/v1/components/Modal/ModalContent.js +3 -3
  20. package/package.json +21 -12
  21. package/styles/Chart/Chart.jsx +1 -1
  22. package/styles/DateTime/DatePicker.jsx +1 -1
  23. package/styles/DateTime/DatePickerCalendar.jsx +1 -1
  24. package/styles/DateTime/DatePickerCalendarWithRange.jsx +1 -1
  25. package/styles/DateTime/DateTimeRangePicker.jsx +2 -1
  26. package/styles/DateTime/TimePicker.jsx +1 -1
  27. package/styles/ErrorBoundary/ErrorBoundary.jsx +1 -1
  28. package/styles/Flyout/Flyout.jsx +1 -1
  29. package/styles/Form/Form.jsx +2 -1
  30. package/styles/GooglePlacesSearchInput/GooglePlacesSearchInput.jsx +1 -1
  31. package/styles/Notification/Notification.jsx +1 -1
  32. package/styles/Portal/Portal.jsx +1 -1
  33. package/styles/RenderInBody/RenderInBody.jsx +1 -1
  34. package/styles/Select/Select.jsx +1 -1
  35. package/styles/SelectControlled/SelectControlled.jsx +1 -1
  36. package/styles/Tooltip/Tooltip.jsx +1 -1
  37. package/styles/v1/components/Image/Image.jsx +1 -1
  38. package/styles/v1/components/Modal/Modal.jsx +1 -1
  39. package/styles/v1/components/Modal/ModalContent.jsx +1 -1
  40. package/styles/v1/components/Modal/stories/Content.stories.js +1 -1
  41. package/styles/v2/components/Image/Image.jsx +1 -1
  42. package/styles/v2/components/Modal/Modal.jsx +2 -2
  43. package/styles/v2/components/Modal/Modal.stories.js +4 -7
  44. package/v1/index.js +1 -1
  45. package/v1/index.js.LICENSE.txt +0 -29
  46. package/v1/index.js.map +1 -1
  47. package/v2/index.js +1 -1
  48. package/v2/index.js.LICENSE.txt +0 -29
  49. package/v2/index.js.map +1 -1
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@spothero/ui",
3
- "version": "15.0.0-beta.2",
3
+ "version": "15.0.0-beta.4",
4
4
  "description": "SpotHero's React component UI library.",
5
5
  "main": "v2/index.js",
6
- "module": "v2/index.js",
7
6
  "repository": "https://github.com/spothero/fe-monorepo",
8
7
  "babel": {
9
8
  "presets": [
@@ -81,15 +80,15 @@
81
80
  "@babel/runtime-corejs3": "7.14.7",
82
81
  "@cypress/browserify-preprocessor": "3.0.1",
83
82
  "@jackfranklin/test-data-bot": "1.3.0",
84
- "@spothero/babel-preset-spothero": "3.0.0",
85
- "@spothero/browserslist-config": "2.0.0",
86
- "@spothero/core": "5.0.0",
87
- "@spothero/dex": "4.0.0",
88
- "@spothero/eslint-config": "4.0.0",
89
- "@spothero/icons": "4.2.0",
90
- "@spothero/npm-publisher": "5.0.0",
91
- "@spothero/prettier-config": "2.1.0",
92
- "@spothero/stylelint-config": "4.0.0",
83
+ "@spothero/babel-preset-spothero": "*",
84
+ "@spothero/browserslist-config": "*",
85
+ "@spothero/core": "*",
86
+ "@spothero/dex": "*",
87
+ "@spothero/eslint-config": "*",
88
+ "@spothero/icons": "*",
89
+ "@spothero/npm-publisher": "*",
90
+ "@spothero/prettier-config": "*",
91
+ "@spothero/stylelint-config": "*",
93
92
  "@storybook/addon-actions": "6.3.13",
94
93
  "@storybook/addon-essentials": "6.3.13",
95
94
  "@storybook/addon-links": "6.3.13",
@@ -133,7 +132,7 @@
133
132
  "@chakra-ui/theme-tools": "1.3.6",
134
133
  "@emotion/react": "11.1.5",
135
134
  "@emotion/styled": "11.1.5",
136
- "@spothero/utils": "10.1.0-beta.2",
135
+ "@spothero/utils": "*",
137
136
  "@storybook/addon-a11y": "6.3.4",
138
137
  "axe-core": "4.1.3",
139
138
  "chartist": "0.11.4",
@@ -154,5 +153,15 @@
154
153
  "ssr-window": "1.0.1",
155
154
  "transitionEnd": "1.0.2",
156
155
  "uuid": "3.3.3"
156
+ },
157
+ "peerDependencies": {
158
+ "classnames": "^2.2.6",
159
+ "lodash": "4.17.21",
160
+ "moment": "^2.27.0",
161
+ "prop-types": "^15.7.2",
162
+ "react": ">=16.0.0",
163
+ "react-dom": ">=16.0.0",
164
+ "react-redux": ">=7.0.0",
165
+ "redux": ">=4.0.0"
157
166
  }
158
167
  }
@@ -4,7 +4,7 @@ import React, {Component} from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import classNames from 'classnames';
6
6
  import Chartist from 'chartist';
7
- import {DOMUtils} from '@spothero/utils';
7
+ import DOMUtils from '@spothero/utils/dom';
8
8
 
9
9
  export default class Chart extends Component {
10
10
  static propTypes = {
@@ -6,7 +6,7 @@ import {document} from 'ssr-window';
6
6
  import TetherComponent from 'react-tether';
7
7
  import omit from 'lodash/omit';
8
8
  import IconCalendar from '@spothero/icons/calendar';
9
- import {DOMUtils} from '@spothero/utils';
9
+ import DOMUtils from '@spothero/utils/dom';
10
10
  import DatePickerCalendar from './DatePickerCalendar';
11
11
  import TextInput from '../TextInput/TextInput';
12
12
  import Portal from '../Portal/Portal';
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
4
4
  import classNames from 'classnames';
5
5
  import moment from 'moment';
6
6
  import DayPicker, {DateUtils as DayPickerDateUtils} from 'react-day-picker';
7
- import {DateUtils} from '@spothero/utils';
7
+ import DateUtils from '@spothero/utils/date';
8
8
  import DatePickerCalendarNavigation from './DatePickerCalendarNavigation';
9
9
 
10
10
  const DATE = new Date();
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import classNames from 'classnames';
4
4
  import moment from 'moment';
5
5
  import DayPicker, {DateUtils as DayPickerDateUtils} from 'react-day-picker';
6
- import {DateUtils} from '@spothero/utils';
6
+ import DateUtils from '@spothero/utils/date';
7
7
  import DatePickerCalendarNavigation from './DatePickerCalendarNavigation';
8
8
 
9
9
  const DATE = new Date();
@@ -2,7 +2,8 @@ import React, {Component} from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import classNames from 'classnames';
4
4
  import uuidV4 from 'uuid/v4';
5
- import {DateUtils, TimeUtils} from '@spothero/utils';
5
+ import DateUtils from '@spothero/utils/date';
6
+ import TimeUtils from '@spothero/utils/time';
6
7
  import DateTimePicker from './DateTimePicker';
7
8
 
8
9
  const TOOLTIP_TYPES = ['date', 'time', 'none'];
@@ -4,7 +4,7 @@ import classNames from 'classnames';
4
4
  import moment from 'moment';
5
5
  import omit from 'lodash/omit';
6
6
  import IconClock from '@spothero/icons/clock';
7
- import {TimeUtils} from '@spothero/utils';
7
+ import TimeUtils from '@spothero/utils/time';
8
8
  import Select from '../Select/Select';
9
9
 
10
10
  export default class TimePicker extends Component {
@@ -1,7 +1,7 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import classNames from 'classnames';
3
3
  import React, {Component} from 'react';
4
- import {SentryUtils} from '@spothero/utils';
4
+ import SentryUtils from '@spothero/utils/sentry';
5
5
 
6
6
  export default class ErrorBoundary extends Component {
7
7
  static propTypes = {
@@ -3,7 +3,7 @@ import React, {Component} from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import classNames from 'classnames';
5
5
  import IconTimes from '@spothero/icons/times';
6
- import {DOMUtils} from '@spothero/utils';
6
+ import DOMUtils from '@spothero/utils/dom';
7
7
  import Button from 'v1/components/Button/Button';
8
8
  import Portal from '../Portal/Portal';
9
9
 
@@ -2,7 +2,8 @@ import React, {Component} from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import classNames from 'classnames';
4
4
  import serialize from 'form-serialize';
5
- import {DOMUtils, AnimationUtils} from '@spothero/utils';
5
+ import AnimationUtils from '@spothero/utils/animation';
6
+ import DOMUtils from '@spothero/utils/dom';
6
7
 
7
8
  export default class Form extends Component {
8
9
  static propTypes = {
@@ -3,7 +3,7 @@ import React, {Component} from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import classNames from 'classnames';
5
5
  import IconSearch from '@spothero/icons/search';
6
- import {EnvironmentUtils} from '@spothero/utils';
6
+ import EnvironmentUtils from '@spothero/utils/environment';
7
7
  import AutoSuggestInput from '../AutoSuggestInput/AutoSuggestInput';
8
8
  import TextInputPropTypes from '../TextInput/TextInputPropTypes';
9
9
 
@@ -8,7 +8,7 @@ import IconExclamationCircle from '@spothero/icons/exclamation-circle';
8
8
  import IconExclamationTriangle from '@spothero/icons/exclamation-triangle';
9
9
  import IconHeroCar from '@spothero/icons/hero-car';
10
10
  import IconTimes from '@spothero/icons/times';
11
- import {DOMUtils} from '@spothero/utils';
11
+ import DOMUtils from '@spothero/utils/dom';
12
12
  import Button from 'v1/components/Button/Button';
13
13
  import NotificationPropTypes from './NotificationPropTypes';
14
14
 
@@ -5,7 +5,7 @@ import {createPortal} from 'react-dom';
5
5
  import PropTypes from 'prop-types';
6
6
  import {Provider} from 'react-redux';
7
7
  import {document} from 'ssr-window';
8
- import {DOMUtils} from '@spothero/utils';
8
+ import DOMUtils from '@spothero/utils/dom';
9
9
 
10
10
  export default class Portal extends PureComponent {
11
11
  static propTypes = {
@@ -2,7 +2,7 @@ import React, {Component} from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import {unmountComponentAtNode, render as renderDOM} from 'react-dom';
4
4
  import {Provider} from 'react-redux';
5
- import {DOMUtils} from '@spothero/utils';
5
+ import DOMUtils from '@spothero/utils/dom';
6
6
 
7
7
  export default class RenderInBody extends Component {
8
8
  static propTypes = {
@@ -3,7 +3,7 @@ import React, {Component, cloneElement} from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import cn from 'classnames';
5
5
  import IconChevronDown from '@spothero/icons/chevron-down';
6
- import {DOMUtils} from '@spothero/utils';
6
+ import DOMUtils from '@spothero/utils/dom';
7
7
  import Loader from 'v1/components/Loader/Loader';
8
8
  import omit from 'lodash/omit';
9
9
  // import {
@@ -3,7 +3,7 @@ import React, {Component, cloneElement} from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import cn from 'classnames';
5
5
  import IconChevronDown from '@spothero/icons/chevron-down';
6
- import {DOMUtils} from '@spothero/utils';
6
+ import DOMUtils from '@spothero/utils/dom';
7
7
  import Loader from 'v1/components/Loader/Loader';
8
8
  // import {
9
9
  // SelectItemPropTypes,
@@ -3,7 +3,7 @@ import React, {Component} from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import classNames from 'classnames';
5
5
  import IconTimes from '@spothero/icons/times';
6
- import {DOMUtils} from '@spothero/utils';
6
+ import DOMUtils from '@spothero/utils/dom';
7
7
  import Button from 'v1/components/Button/Button';
8
8
  import Portal from '../Portal/Portal';
9
9
 
@@ -4,7 +4,7 @@ import React, {Component} from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import classNames from 'classnames';
6
6
  import LazyLoad from 'react-lazy-load';
7
- import {EnvironmentUtils} from '@spothero/utils';
7
+ import EnvironmentUtils from '@spothero/utils/environment';
8
8
  import PulseLoader from '../../../PulseLoader/PulseLoader';
9
9
 
10
10
  export default class Image extends Component {
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
5
5
  import classNames from 'classnames';
6
6
  import IconChevronLeft from '@spothero/icons/chevron-left';
7
7
  import IconTimes from '@spothero/icons/times';
8
- import {DOMUtils} from '@spothero/utils';
8
+ import DOMUtils from '@spothero/utils/dom';
9
9
  import Button from 'v1/components/Button/Button';
10
10
  import Portal from '../../../Portal/Portal';
11
11
 
@@ -5,7 +5,7 @@ import React, {Component} from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import classNames from 'classnames';
7
7
  import {document, window} from 'ssr-window';
8
- import {DOMUtils} from '@spothero/utils';
8
+ import DOMUtils from '@spothero/utils/dom';
9
9
 
10
10
  export default class ModalContent extends Component {
11
11
  static propTypes = {
@@ -3,7 +3,7 @@ import Button from 'v1/components/Button/Button';
3
3
  import Modal from '../Modal';
4
4
  import ModalContent from '../ModalContent';
5
5
  import ErrorBoundary from '../../../../ErrorBoundary/ErrorBoundary';
6
- import {DOMUtils} from '@spothero/utils';
6
+ import DOMUtils from '@spothero/utils/dom';
7
7
 
8
8
  export default {
9
9
  component: Modal,
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import {Image as ChakraImage, Img as ChakraImg} from '@chakra-ui/react';
4
- import {EnvironmentUtils} from '@spothero/utils';
4
+ import EnvironmentUtils from '@spothero/utils/environment';
5
5
  import template from 'lodash/template';
6
6
 
7
7
  const buildCloudinarySrc = ({
@@ -14,7 +14,7 @@ import {
14
14
  import headerStyles from './styles/header';
15
15
 
16
16
  /**
17
- * @param {boolean} isMobile - Whether or not the device is a mobile
17
+ * @param {boolean} isMobile - Whether or not the Modal is opened in a mobile viewport
18
18
  * @param {boolean} isOpen - Whether or not the Modal is open
19
19
  * @param {React.ReactNode} children - The header text of the modal
20
20
  * @param {()=>void} [onClose] - Callback invoked to close the Modal. Not required, but strongly suggested.
@@ -52,7 +52,7 @@ const Modal = forwardRef((props, ref) => {
52
52
  export default Modal;
53
53
 
54
54
  Modal.propTypes = {
55
- /** Whether or not the device is a mobile */
55
+ /** Whether or not the Modal is opened in a mobile viewport */
56
56
  isMobile: PropTypes.bool.isRequired,
57
57
  /** Whether or not the Modal is open */
58
58
  isOpen: PropTypes.bool.isRequired,
@@ -45,8 +45,7 @@ export default {
45
45
 
46
46
  export const Transactional = props => {
47
47
  const [open, setOpen] = useState(false);
48
- const breakpoint = useBreakpointValue(styleProps.maxW);
49
- const isMobile = breakpoint?.includes('base');
48
+ const isMobile = useBreakpointValue({base: true, tablet: false});
50
49
 
51
50
  return (
52
51
  <Box>
@@ -58,7 +57,6 @@ export const Transactional = props => {
58
57
 
59
58
  <Modal
60
59
  {...props}
61
- isMobile={isMobile}
62
60
  footer={
63
61
  <>
64
62
  <Button
@@ -76,6 +74,7 @@ export const Transactional = props => {
76
74
  </Button>
77
75
  </>
78
76
  }
77
+ isMobile={isMobile}
79
78
  isOpen={open}
80
79
  onClose={() => setOpen(false)}
81
80
  >
@@ -97,8 +96,7 @@ Transactional.args = {
97
96
 
98
97
  export const Passive = props => {
99
98
  const [open, setOpen] = useState(false);
100
- const breakpoint = useBreakpointValue(styleProps.maxW);
101
- const isMobile = breakpoint?.includes('base');
99
+ const isMobile = useBreakpointValue({base: true, tablet: false});
102
100
 
103
101
  return (
104
102
  <Box>
@@ -128,8 +126,7 @@ Passive.args = {
128
126
  export const TransactionalWithExpandingContent = props => {
129
127
  const [open, setOpen] = useState(false);
130
128
  const accordionRefs = [React.createRef(), React.createRef()];
131
- const breakpoint = useBreakpointValue(styleProps.maxW);
132
- const isMobile = breakpoint?.includes('base');
129
+ const isMobile = useBreakpointValue({base: true, tablet: false});
133
130
 
134
131
  const handleAccordionChange = index => {
135
132
  if (accordionRefs[index]) {