@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.
- package/backlog/Chart/Chart.js +2 -2
- package/backlog/DateTime/DatePicker.js +4 -4
- package/backlog/DateTime/DatePickerCalendar.js +8 -8
- package/backlog/DateTime/DatePickerCalendarWithRange.js +6 -6
- package/backlog/DateTime/DateTimeRangePicker.js +6 -4
- package/backlog/DateTime/TimePicker.js +3 -3
- package/backlog/ErrorBoundary/ErrorBoundary.js +3 -3
- package/backlog/Flyout/Flyout.js +5 -5
- package/backlog/Form/Form.js +5 -3
- package/backlog/GooglePlacesSearchInput/GooglePlacesSearchInput.js +2 -2
- package/backlog/Notification/Notification.js +4 -4
- package/backlog/Portal/Portal.js +3 -3
- package/backlog/RenderInBody/RenderInBody.js +2 -2
- package/backlog/Select/Select.js +3 -3
- package/backlog/SelectControlled/SelectControlled.js +3 -3
- package/backlog/Tooltip/Tooltip.js +6 -6
- package/backlog/v1/components/Image/Image.js +2 -2
- package/backlog/v1/components/Modal/Modal.js +12 -12
- package/backlog/v1/components/Modal/ModalContent.js +3 -3
- package/package.json +21 -12
- package/styles/Chart/Chart.jsx +1 -1
- package/styles/DateTime/DatePicker.jsx +1 -1
- package/styles/DateTime/DatePickerCalendar.jsx +1 -1
- package/styles/DateTime/DatePickerCalendarWithRange.jsx +1 -1
- package/styles/DateTime/DateTimeRangePicker.jsx +2 -1
- package/styles/DateTime/TimePicker.jsx +1 -1
- package/styles/ErrorBoundary/ErrorBoundary.jsx +1 -1
- package/styles/Flyout/Flyout.jsx +1 -1
- package/styles/Form/Form.jsx +2 -1
- package/styles/GooglePlacesSearchInput/GooglePlacesSearchInput.jsx +1 -1
- package/styles/Notification/Notification.jsx +1 -1
- package/styles/Portal/Portal.jsx +1 -1
- package/styles/RenderInBody/RenderInBody.jsx +1 -1
- package/styles/Select/Select.jsx +1 -1
- package/styles/SelectControlled/SelectControlled.jsx +1 -1
- package/styles/Tooltip/Tooltip.jsx +1 -1
- package/styles/v1/components/Image/Image.jsx +1 -1
- package/styles/v1/components/Modal/Modal.jsx +1 -1
- package/styles/v1/components/Modal/ModalContent.jsx +1 -1
- package/styles/v1/components/Modal/stories/Content.stories.js +1 -1
- package/styles/v2/components/Image/Image.jsx +1 -1
- package/styles/v2/components/Modal/Modal.jsx +2 -2
- package/styles/v2/components/Modal/Modal.stories.js +4 -7
- package/v1/index.js +1 -1
- package/v1/index.js.LICENSE.txt +0 -29
- package/v1/index.js.map +1 -1
- package/v2/index.js +1 -1
- package/v2/index.js.LICENSE.txt +0 -29
- 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.
|
|
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": "
|
|
85
|
-
"@spothero/browserslist-config": "
|
|
86
|
-
"@spothero/core": "
|
|
87
|
-
"@spothero/dex": "
|
|
88
|
-
"@spothero/eslint-config": "
|
|
89
|
-
"@spothero/icons": "
|
|
90
|
-
"@spothero/npm-publisher": "
|
|
91
|
-
"@spothero/prettier-config": "
|
|
92
|
-
"@spothero/stylelint-config": "
|
|
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": "
|
|
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
|
}
|
package/styles/Chart/Chart.jsx
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
4
|
+
import SentryUtils from '@spothero/utils/sentry';
|
|
5
5
|
|
|
6
6
|
export default class ErrorBoundary extends Component {
|
|
7
7
|
static propTypes = {
|
package/styles/Flyout/Flyout.jsx
CHANGED
|
@@ -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
|
|
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
|
|
package/styles/Form/Form.jsx
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
11
|
+
import DOMUtils from '@spothero/utils/dom';
|
|
12
12
|
import Button from 'v1/components/Button/Button';
|
|
13
13
|
import NotificationPropTypes from './NotificationPropTypes';
|
|
14
14
|
|
package/styles/Portal/Portal.jsx
CHANGED
|
@@ -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
|
|
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
|
|
5
|
+
import DOMUtils from '@spothero/utils/dom';
|
|
6
6
|
|
|
7
7
|
export default class RenderInBody extends Component {
|
|
8
8
|
static propTypes = {
|
package/styles/Select/Select.jsx
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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]) {
|