@spothero/ui 14.8.5-beta.0 → 15.0.0-beta.0

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 (113) hide show
  1. package/.eslintignore +6 -0
  2. package/CHANGELOG.md +6 -2
  3. package/backlog/Alert/Alert.js +1 -4
  4. package/backlog/AutoSuggestInput/AutoSuggestInput.js +10 -17
  5. package/backlog/AutoSuggestInput/AutoSuggestItem.js +7 -10
  6. package/backlog/AutoSuggestInput/AutoSuggestList.js +9 -12
  7. package/backlog/Badge/Badge.js +1 -4
  8. package/backlog/Chart/Chart.js +12 -19
  9. package/backlog/Checkbox/Checkbox.js +7 -10
  10. package/backlog/DateTime/DatePicker.js +11 -14
  11. package/backlog/DateTime/DatePickerCalendar.js +15 -18
  12. package/backlog/DateTime/DatePickerCalendarNavigation.js +7 -10
  13. package/backlog/DateTime/DatePickerCalendarWithRange.js +16 -23
  14. package/backlog/DateTime/DateTimePicker.js +7 -10
  15. package/backlog/DateTime/DateTimeRangePicker.js +15 -26
  16. package/backlog/DateTime/TimePicker.js +10 -13
  17. package/backlog/DateTime/date-time-assertions.js +1 -4
  18. package/backlog/DateTime/index.js +7 -15
  19. package/backlog/ErrorBoundary/ErrorBoundary.js +10 -13
  20. package/backlog/Flyout/Flyout.js +16 -26
  21. package/backlog/Form/Form.js +11 -18
  22. package/backlog/Form/FormElementError.js +1 -4
  23. package/backlog/Form/FormGroup.js +1 -4
  24. package/backlog/Form/FormGroupError.js +1 -4
  25. package/backlog/Form/index.js +5 -11
  26. package/backlog/GooglePlacesSearchInput/GooglePlacesSearchInput.js +12 -19
  27. package/backlog/GooglePlacesSearchInput/PoweredByGoogle.js +1 -4
  28. package/backlog/GooglePlacesSearchInput/index.js +3 -7
  29. package/backlog/HorizontalRule/HorizontalRule.js +1 -4
  30. package/backlog/Label/Label.js +1 -4
  31. package/backlog/Notification/Notification.js +11 -14
  32. package/backlog/Notification/NotificationContainer.js +7 -10
  33. package/backlog/Notification/NotificationPropTypes.js +1 -4
  34. package/backlog/Notification/index.js +3 -7
  35. package/backlog/PasswordControl/PasswordControl.js +8 -13
  36. package/backlog/Portal/Portal.js +10 -13
  37. package/backlog/PulseLoader/PulseLoader.js +1 -4
  38. package/backlog/Radio/Radio.js +7 -10
  39. package/backlog/Radio/RadioGroup.js +9 -12
  40. package/backlog/Radio/index.js +3 -7
  41. package/backlog/RenderInBody/RenderInBody.js +9 -12
  42. package/backlog/Select/Select.js +13 -18
  43. package/backlog/Select/SelectItemPropTypes.js +1 -4
  44. package/backlog/Select/index.js +3 -7
  45. package/backlog/SelectControlled/SelectControlled.js +13 -18
  46. package/backlog/SelectControlled/index.js +2 -5
  47. package/backlog/Sprite/Sprite.js +1 -4
  48. package/backlog/Tabs/Tab.js +7 -10
  49. package/backlog/Tabs/TabContent.js +6 -9
  50. package/backlog/Tabs/TabNavigation.js +8 -13
  51. package/backlog/Tabs/TabPanel.js +1 -4
  52. package/backlog/Tabs/Tabs.js +7 -10
  53. package/backlog/Tabs/index.js +6 -13
  54. package/backlog/TextArea/TextArea.js +7 -10
  55. package/backlog/TextInput/TextInput.js +9 -12
  56. package/backlog/TextInput/TextInputPropTypes.js +1 -4
  57. package/backlog/TextInput/index.js +3 -7
  58. package/backlog/Tooltip/Tooltip.js +15 -22
  59. package/backlog/index.js +55 -111
  60. package/backlog/v1/components/Button/Button.js +1 -4
  61. package/backlog/v1/components/Button/button-props.js +1 -4
  62. package/backlog/v1/components/Image/Image.js +11 -14
  63. package/backlog/v1/components/Loader/Loader.js +1 -4
  64. package/backlog/v1/components/Modal/Modal.js +24 -34
  65. package/backlog/v1/components/Modal/ModalContent.js +10 -13
  66. package/backlog/v1/components/Modal/ModalFooter.js +7 -10
  67. package/backlog/v1/components/Modal/index.js +4 -9
  68. package/backlog/v1/components/Panel/Panel.js +7 -10
  69. package/backlog/v1/components/Table/Table.js +9 -14
  70. package/backlog/v1/components/Table/TableCell.js +1 -4
  71. package/backlog/v1/components/Table/TableCellPropTypes.js +1 -4
  72. package/backlog/v1/components/Table/TableControls.js +1 -4
  73. package/backlog/v1/components/Table/TableFooter.js +1 -4
  74. package/backlog/v1/components/Table/TableHeading.js +7 -10
  75. package/backlog/v1/components/Table/TableHeadingPropTypes.js +1 -4
  76. package/backlog/v1/components/Table/TableSortSelector.js +7 -10
  77. package/backlog/v1/components/Table/TableSortType.js +1 -4
  78. package/backlog/v1/components/Table/index.js +6 -13
  79. package/backlog/v1/components/TextButton/TextButton.js +7 -14
  80. package/backlog/v1/components/index.js +10 -21
  81. package/backlog/v1/utils/deprecate.js +3 -8
  82. package/dex.config.js +7 -10
  83. package/package.json +18 -35
  84. package/styles/Chart/Chart.jsx +1 -1
  85. package/styles/DateTime/DatePicker.jsx +1 -1
  86. package/styles/DateTime/DatePickerCalendar.jsx +1 -1
  87. package/styles/DateTime/DatePickerCalendarWithRange.jsx +1 -1
  88. package/styles/DateTime/DateTimeRangePicker.jsx +1 -2
  89. package/styles/DateTime/TimePicker.jsx +1 -1
  90. package/styles/ErrorBoundary/ErrorBoundary.jsx +1 -1
  91. package/styles/Flyout/Flyout.jsx +1 -1
  92. package/styles/Form/Form.jsx +1 -2
  93. package/styles/GooglePlacesSearchInput/GooglePlacesSearchInput.jsx +1 -1
  94. package/styles/Notification/Notification.jsx +1 -1
  95. package/styles/Portal/Portal.jsx +1 -1
  96. package/styles/RenderInBody/RenderInBody.jsx +1 -1
  97. package/styles/Select/Select.jsx +1 -1
  98. package/styles/SelectControlled/SelectControlled.jsx +1 -1
  99. package/styles/Tooltip/Tooltip.jsx +1 -1
  100. package/styles/v1/components/Image/Image.jsx +1 -1
  101. package/styles/v1/components/Modal/Modal.jsx +1 -1
  102. package/styles/v1/components/Modal/ModalContent.jsx +1 -1
  103. package/styles/v1/components/Modal/stories/Content.stories.js +1 -1
  104. package/styles/v2/components/Image/Image.jsx +1 -1
  105. package/styles/v2/components/Modal/Modal.jsx +4 -2
  106. package/styles/v2/components/Modal/Modal.stories.js +10 -2
  107. package/v1/index.js +1 -1
  108. package/v1/index.js.LICENSE.txt +29 -0
  109. package/v1/index.js.map +1 -1
  110. package/v2/index.js +1 -1
  111. package/v2/index.js.LICENSE.txt +29 -0
  112. package/v2/index.js.map +1 -1
  113. package/CHANGELOG.tmp +0 -5
@@ -1,27 +1,20 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
-
5
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
6
-
7
- var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
3
+ var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
8
4
 
9
- var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
5
+ var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
10
6
 
11
- var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
7
+ var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
12
8
 
13
9
  var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
14
10
 
15
- var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
16
-
17
- var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
11
+ var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
18
12
 
19
- var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
13
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
20
14
 
21
- _Object$defineProperty(exports, "__esModule", {
15
+ Object.defineProperty(exports, "__esModule", {
22
16
  value: true
23
17
  });
24
-
25
18
  exports.default = void 0;
26
19
 
27
20
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
@@ -38,7 +31,7 @@ var _excluded = ["className", "children", "href", "iconPosition", "block", "disa
38
31
 
39
32
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
40
33
 
41
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
34
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? Object.defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
42
35
 
43
36
  (0, _deprecate.default)({
44
37
  name: 'TextButton',
@@ -2,69 +2,58 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
4
 
5
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
6
-
7
- _Object$defineProperty(exports, "__esModule", {
5
+ Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
-
11
- _Object$defineProperty(exports, "Button", {
8
+ Object.defineProperty(exports, "Button", {
12
9
  enumerable: true,
13
10
  get: function get() {
14
11
  return _Button.default;
15
12
  }
16
13
  });
17
-
18
- _Object$defineProperty(exports, "Image", {
14
+ Object.defineProperty(exports, "Image", {
19
15
  enumerable: true,
20
16
  get: function get() {
21
17
  return _Image.default;
22
18
  }
23
19
  });
24
-
25
- _Object$defineProperty(exports, "Loader", {
20
+ Object.defineProperty(exports, "Loader", {
26
21
  enumerable: true,
27
22
  get: function get() {
28
23
  return _Loader.default;
29
24
  }
30
25
  });
31
-
32
- _Object$defineProperty(exports, "Modal", {
26
+ Object.defineProperty(exports, "Modal", {
33
27
  enumerable: true,
34
28
  get: function get() {
35
29
  return _Modal.Modal;
36
30
  }
37
31
  });
38
-
39
- _Object$defineProperty(exports, "ModalContent", {
32
+ Object.defineProperty(exports, "ModalContent", {
40
33
  enumerable: true,
41
34
  get: function get() {
42
35
  return _Modal.ModalContent;
43
36
  }
44
37
  });
45
-
46
- _Object$defineProperty(exports, "ModalFooter", {
38
+ Object.defineProperty(exports, "ModalFooter", {
47
39
  enumerable: true,
48
40
  get: function get() {
49
41
  return _Modal.ModalFooter;
50
42
  }
51
43
  });
52
-
53
- _Object$defineProperty(exports, "Panel", {
44
+ Object.defineProperty(exports, "Panel", {
54
45
  enumerable: true,
55
46
  get: function get() {
56
47
  return _Panel.default;
57
48
  }
58
49
  });
59
-
60
- _Object$defineProperty(exports, "Table", {
50
+ Object.defineProperty(exports, "Table", {
61
51
  enumerable: true,
62
52
  get: function get() {
63
53
  return _Table.default;
64
54
  }
65
55
  });
66
-
67
- _Object$defineProperty(exports, "TextButton", {
56
+ Object.defineProperty(exports, "TextButton", {
68
57
  enumerable: true,
69
58
  get: function get() {
70
59
  return _TextButton.default;
@@ -2,20 +2,15 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
4
 
5
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
6
-
7
- _Object$defineProperty(exports, "__esModule", {
5
+ Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
-
11
8
  exports.default = void 0;
12
9
 
13
- var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
10
+ var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
14
11
 
15
12
  var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
16
13
 
17
- var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
18
-
19
14
  /* eslint-disable no-console */
20
15
 
21
16
  /* eslint-disable no-undef */
@@ -56,7 +51,7 @@ var deprecate = function deprecate(_ref) {
56
51
 
57
52
  console.group('DEPRECATION WARNING:');
58
53
  console.log((0, _concat.default)(_context = "This component, ".concat(name, ", is now deprecated. Please use the v2 ")).call(_context, newName ? newName : name, " instead."));
59
- (0, _forEach.default)(changes).call(changes, function (change) {
54
+ changes.forEach(function (change) {
60
55
  return console.log(change);
61
56
  });
62
57
  console.groupEnd('DEPRECATION WARNING:');
package/dex.config.js CHANGED
@@ -16,33 +16,30 @@ module.exports = {
16
16
  name: '@spothero/ui',
17
17
  type: 'umd',
18
18
  },
19
- globalObject: 'this'
19
+ globalObject: 'this',
20
20
  },
21
21
  externals: {
22
22
  react: {
23
23
  root: 'React',
24
24
  commonjs2: 'react',
25
25
  commonjs: 'react',
26
- amd: 'react'
26
+ amd: 'react',
27
27
  },
28
28
  'react-dom': {
29
29
  root: 'ReactDOM',
30
30
  commonjs2: 'react-dom',
31
31
  commonjs: 'react-dom',
32
- amd: 'react-dom'
32
+ amd: 'react-dom',
33
33
  },
34
- 'lodash': {
34
+ lodash: {
35
35
  commonjs2: 'lodash',
36
36
  commonjs: 'lodash',
37
37
  amd: 'lodash',
38
- root: '_'
38
+ root: '_',
39
39
  },
40
40
  'prop-types': 'prop-types',
41
- '@chakra-ui/react': '@chakra-ui/react'
42
-
43
- }
41
+ '@chakra-ui/react': '@chakra-ui/react',
42
+ },
44
43
  },
45
-
46
44
  },
47
-
48
45
  };
package/package.json CHANGED
@@ -1,12 +1,10 @@
1
1
  {
2
2
  "name": "@spothero/ui",
3
- "version": "14.8.5-beta.0",
3
+ "version": "15.0.0-beta.0",
4
4
  "description": "SpotHero's React component UI library.",
5
5
  "main": "v2/index.js",
6
6
  "module": "v2/index.js",
7
- "repository": "https://github.com/spothero/fe-ui",
8
- "author": "SpotHero",
9
- "license": "Apache-2.0",
7
+ "repository": "https://github.com/spothero/fe-monorepo",
10
8
  "babel": {
11
9
  "presets": [
12
10
  "@spothero/spothero"
@@ -73,11 +71,6 @@
73
71
  "release": "npm-release",
74
72
  "release:storybook": "npm run build:storybook && push-dir --dir=docs --branch=gh-pages --allow-unclean"
75
73
  },
76
- "husky": {
77
- "hooks": {
78
- "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
79
- }
80
- },
81
74
  "engines": {
82
75
  "node": ">=16.14.2",
83
76
  "npm": ">=8.5.0"
@@ -88,20 +81,19 @@
88
81
  "@babel/runtime-corejs3": "7.14.7",
89
82
  "@cypress/browserify-preprocessor": "3.0.1",
90
83
  "@jackfranklin/test-data-bot": "1.3.0",
91
- "@spothero/babel-preset-spothero": "0.2.0",
92
- "@spothero/browserslist-config": "1.0.0",
93
- "@spothero/commitlint-config": "3.1.1",
94
- "@spothero/core": "4.0.0",
95
- "@spothero/dex": "3.2.1",
96
- "@spothero/eslint-config": "3.0.0",
97
- "@spothero/icons": "2.0.2",
98
- "@spothero/npm-publisher": "4.0.0",
99
- "@spothero/prettier-config": "1.0.0",
100
- "@spothero/stylelint-config": "3.0.0",
101
- "@storybook/addon-actions": "6.3.4",
102
- "@storybook/addon-essentials": "6.3.4",
103
- "@storybook/addon-links": "6.3.4",
104
- "@storybook/react": "6.3.4",
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",
93
+ "@storybook/addon-actions": "6.3.13",
94
+ "@storybook/addon-essentials": "6.3.13",
95
+ "@storybook/addon-links": "6.3.13",
96
+ "@storybook/react": "6.3.13",
105
97
  "@testing-library/jest-dom": "5.11.9",
106
98
  "@testing-library/react": "11.2.5",
107
99
  "@testing-library/user-event": "12.8.1",
@@ -132,7 +124,8 @@
132
124
  "regenerator-runtime": "0.13.7",
133
125
  "start-server-and-test": "1.12.6",
134
126
  "style-loader": "1.2.1",
135
- "webpack-merge": "5.1.4"
127
+ "webpack-merge": "5.1.4",
128
+ "eslint-loader": "4.0.2"
136
129
  },
137
130
  "dependencies": {
138
131
  "@chakra-ui/react": "1.8.8",
@@ -140,7 +133,7 @@
140
133
  "@chakra-ui/theme-tools": "1.3.6",
141
134
  "@emotion/react": "11.1.5",
142
135
  "@emotion/styled": "11.1.5",
143
- "@spothero/utils": "9.1.0",
136
+ "@spothero/utils": "10.0.0",
144
137
  "@storybook/addon-a11y": "6.3.4",
145
138
  "axe-core": "4.1.3",
146
139
  "chartist": "0.11.4",
@@ -161,15 +154,5 @@
161
154
  "ssr-window": "1.0.1",
162
155
  "transitionEnd": "1.0.2",
163
156
  "uuid": "3.3.3"
164
- },
165
- "peerDependencies": {
166
- "classnames": "^2.2.6",
167
- "lodash": "4.17.21",
168
- "moment": "^2.27.0",
169
- "prop-types": "^15.7.2",
170
- "react": ">=16.0.0",
171
- "react-dom": ">=16.0.0",
172
- "react-redux": ">=7.0.0",
173
- "redux": ">=4.0.0"
174
157
  }
175
158
  }
@@ -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/dom';
7
+ import {DOMUtils} from '@spothero/utils';
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/dom';
9
+ import {DOMUtils} from '@spothero/utils';
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/date';
7
+ import {DateUtils} from '@spothero/utils';
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/date';
6
+ import {DateUtils} from '@spothero/utils';
7
7
  import DatePickerCalendarNavigation from './DatePickerCalendarNavigation';
8
8
 
9
9
  const DATE = new Date();
@@ -2,8 +2,7 @@ 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 from '@spothero/utils/date';
6
- import TimeUtils from '@spothero/utils/time';
5
+ import {DateUtils, TimeUtils} from '@spothero/utils';
7
6
  import DateTimePicker from './DateTimePicker';
8
7
 
9
8
  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/time';
7
+ import {TimeUtils} from '@spothero/utils';
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/sentry';
4
+ import {SentryUtils} from '@spothero/utils';
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/dom';
6
+ import {DOMUtils} from '@spothero/utils';
7
7
  import Button from 'v1/components/Button/Button';
8
8
  import Portal from '../Portal/Portal';
9
9
 
@@ -2,8 +2,7 @@ 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 AnimationUtils from '@spothero/utils/animation';
6
- import DOMUtils from '@spothero/utils/dom';
5
+ import {DOMUtils, AnimationUtils} from '@spothero/utils';
7
6
 
8
7
  export default class Form extends Component {
9
8
  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/environment';
6
+ import {EnvironmentUtils} from '@spothero/utils';
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/dom';
11
+ import {DOMUtils} from '@spothero/utils';
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/dom';
8
+ import {DOMUtils} from '@spothero/utils';
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/dom';
5
+ import {DOMUtils} from '@spothero/utils';
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/dom';
6
+ import {DOMUtils} from '@spothero/utils';
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/dom';
6
+ import {DOMUtils} from '@spothero/utils';
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/dom';
6
+ import {DOMUtils} from '@spothero/utils';
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/environment';
7
+ import {EnvironmentUtils} from '@spothero/utils';
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/dom';
8
+ import {DOMUtils} from '@spothero/utils';
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/dom';
8
+ import {DOMUtils} from '@spothero/utils';
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/dom';
6
+ import {DOMUtils} from '@spothero/utils';
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/environment';
4
+ import {EnvironmentUtils} from '@spothero/utils';
5
5
  import template from 'lodash/template';
6
6
 
7
7
  const buildCloudinarySrc = ({
@@ -14,6 +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
18
  * @param {boolean} isOpen - Whether or not the Modal is open
18
19
  * @param {React.ReactNode} children - The header text of the modal
19
20
  * @param {()=>void} [onClose] - Callback invoked to close the Modal. Not required, but strongly suggested.
@@ -24,8 +25,7 @@ import headerStyles from './styles/header';
24
25
  * @returns {React.ReactElement} - The Modal component
25
26
  */
26
27
  const Modal = forwardRef((props, ref) => {
27
- const {header, footer, children, hideCloseButton} = props;
28
- const isMobile = useBreakpointValue({base: true, tablet: false});
28
+ const {header, footer, children, hideCloseButton, isMobile} = props;
29
29
 
30
30
  return (
31
31
  <ChakraModal
@@ -52,6 +52,8 @@ 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 */
56
+ isMobile: PropTypes.bool.isRequired,
55
57
  /** Whether or not the Modal is open */
56
58
  isOpen: PropTypes.bool.isRequired,
57
59
  /** React children. Body of the Modal. */
@@ -1,6 +1,6 @@
1
1
  import React, {useState} from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import {Box} from '@chakra-ui/react';
3
+ import {Box, useBreakpointValue} from '@chakra-ui/react';
4
4
  import disableArgs from 'storybook/utils/disable-args';
5
5
  import {createSelectControl} from 'storybook/utils/create-control';
6
6
 
@@ -45,6 +45,8 @@ 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
50
 
49
51
  return (
50
52
  <Box>
@@ -56,6 +58,7 @@ export const Transactional = props => {
56
58
 
57
59
  <Modal
58
60
  {...props}
61
+ isMobile={isMobile}
59
62
  footer={
60
63
  <>
61
64
  <Button
@@ -94,6 +97,8 @@ Transactional.args = {
94
97
 
95
98
  export const Passive = props => {
96
99
  const [open, setOpen] = useState(false);
100
+ const breakpoint = useBreakpointValue(styleProps.maxW);
101
+ const isMobile = breakpoint?.includes('base');
97
102
 
98
103
  return (
99
104
  <Box>
@@ -103,7 +108,7 @@ export const Passive = props => {
103
108
  </Text>
104
109
  <Button onClick={() => setOpen(true)}>Open Modal</Button>
105
110
 
106
- <Modal {...props} isOpen={open} onClose={() => setOpen(false)}>
111
+ <Modal {...props} isMobile={isMobile} isOpen={open} onClose={() => setOpen(false)}>
107
112
  {props.children}
108
113
  </Modal>
109
114
  </Box>
@@ -123,6 +128,8 @@ Passive.args = {
123
128
  export const TransactionalWithExpandingContent = props => {
124
129
  const [open, setOpen] = useState(false);
125
130
  const accordionRefs = [React.createRef(), React.createRef()];
131
+ const breakpoint = useBreakpointValue(styleProps.maxW);
132
+ const isMobile = breakpoint?.includes('base');
126
133
 
127
134
  const handleAccordionChange = index => {
128
135
  if (accordionRefs[index]) {
@@ -167,6 +174,7 @@ export const TransactionalWithExpandingContent = props => {
167
174
  <Button variant="primary">Submit</Button>
168
175
  </>
169
176
  }
177
+ isMobile={isMobile}
170
178
  isOpen={open}
171
179
  onClose={() => setOpen(false)}
172
180
  >