@spothero/ui 15.0.0-beta.3 → 15.0.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 (60) hide show
  1. package/README.md +2 -2
  2. package/backlog/Chart/Chart.js +1 -1
  3. package/backlog/DateTime/DatePicker.js +1 -1
  4. package/backlog/DateTime/DatePickerCalendar.js +1 -1
  5. package/backlog/DateTime/DatePickerCalendarWithRange.js +1 -1
  6. package/backlog/DateTime/DateTimeRangePicker.js +2 -2
  7. package/backlog/DateTime/TimePicker.js +1 -1
  8. package/backlog/ErrorBoundary/ErrorBoundary.js +9 -7
  9. package/backlog/Flyout/Flyout.js +1 -1
  10. package/backlog/Form/Form.js +2 -2
  11. package/backlog/GooglePlacesSearchInput/GooglePlacesSearchInput.js +4 -1
  12. package/backlog/Notification/Notification.js +1 -1
  13. package/backlog/Portal/Portal.js +1 -1
  14. package/backlog/RenderInBody/RenderInBody.js +1 -1
  15. package/backlog/Select/Select.js +1 -1
  16. package/backlog/SelectControlled/SelectControlled.js +1 -1
  17. package/backlog/Tooltip/Tooltip.js +1 -1
  18. package/backlog/v1/components/Image/Image.js +1 -1
  19. package/backlog/v1/components/Modal/Modal.js +1 -1
  20. package/backlog/v1/components/Modal/ModalContent.js +1 -1
  21. package/package.json +21 -11
  22. package/styles/Chart/Chart.jsx +1 -1
  23. package/styles/DateTime/DatePicker.jsx +1 -1
  24. package/styles/DateTime/DatePickerCalendar.jsx +1 -1
  25. package/styles/DateTime/DatePickerCalendarWithRange.jsx +1 -1
  26. package/styles/DateTime/DateTimeRangePicker.jsx +2 -2
  27. package/styles/DateTime/TimePicker.jsx +1 -1
  28. package/styles/ErrorBoundary/ErrorBoundary.jsx +6 -7
  29. package/styles/Flyout/Flyout.jsx +1 -1
  30. package/styles/Form/Form.jsx +2 -2
  31. package/styles/GooglePlacesSearchInput/GooglePlacesSearchInput.jsx +2 -2
  32. package/styles/Notification/Notification.jsx +1 -1
  33. package/styles/Portal/Portal.jsx +1 -1
  34. package/styles/RenderInBody/RenderInBody.jsx +1 -1
  35. package/styles/Select/Select.jsx +1 -1
  36. package/styles/SelectControlled/SelectControlled.jsx +1 -1
  37. package/styles/Tooltip/Tooltip.jsx +1 -1
  38. package/styles/v1/components/Image/Image.jsx +1 -1
  39. package/styles/v1/components/Modal/Modal.jsx +1 -1
  40. package/styles/v1/components/Modal/ModalContent.jsx +1 -1
  41. package/styles/v1/components/Modal/stories/Content.stories.js +1 -1
  42. package/styles/v2/components/Image/Image.jsx +1 -1
  43. package/styles/v2/components/Modal/Modal.jsx +2 -2
  44. package/styles/v2/components/Modal/Modal.stories.js +4 -7
  45. package/v1/index.js +1 -1
  46. package/v1/index.js.map +1 -1
  47. package/v2/index.js +1 -1
  48. package/v2/index.js.map +1 -1
  49. package/backlog/utils/animation.js +0 -84
  50. package/backlog/utils/date.js +0 -233
  51. package/backlog/utils/dom.js +0 -441
  52. package/backlog/utils/environment.js +0 -422
  53. package/backlog/utils/number.js +0 -43
  54. package/backlog/utils/time.js +0 -282
  55. package/styles/utils/animation.js +0 -75
  56. package/styles/utils/date.js +0 -226
  57. package/styles/utils/dom.js +0 -428
  58. package/styles/utils/environment.js +0 -425
  59. package/styles/utils/number.js +0 -33
  60. package/styles/utils/time.js +0 -268
@@ -1,84 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
-
10
- var _ssrWindow = require("ssr-window");
11
-
12
- var _isString = _interopRequireDefault(require("lodash/isString"));
13
-
14
- var _dom = _interopRequireDefault(require("./dom"));
15
-
16
- // t = current time, b = start value, c = change in value, d = duration
17
- // http://stackoverflow.com/questions/8917921/cross-browser-javascript-not-jquery-scroll-to-top-animation
18
- Math.easeInOutQuad = function (t, b, c, d) {
19
- /* eslint-disable no-param-reassign, no-mixed-operators */
20
- t /= d / 2;
21
-
22
- if (t < 1) {
23
- return c / 2 * t * t + b;
24
- }
25
-
26
- t--;
27
- return -c / 2 * (t * (t - 2) - 1) + b;
28
- /* eslint-enable no-param-reassign, no-mixed-operators */
29
- };
30
- /**
31
- * Utilities for working with animations.
32
- * @module AnimationUtils
33
- */
34
-
35
-
36
- var AnimationUtils = {
37
- /**
38
- * Scrolls the specified element to the specified position.
39
- * @static
40
- * @function scrollTo
41
- * @param {String|Element} el - The selector or element to scroll to.
42
- * @param {Number} [position=0] - The position to scroll the element to.
43
- * @param {Number} [duration=400] - The time (in milliseconds) to scroll.
44
- * @param {String} [axis='y'] - The axis to scroll on.
45
- * @param {Function} [cb] - A callback function to call when the animation finishes.
46
- * @example
47
- * AnimationUtils.scrollTo(window, 0, 1000);
48
- * @returns {void}
49
- */
50
- scrollTo: function scrollTo(el) {
51
- var position = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
52
- var duration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 400;
53
- var axis = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'y';
54
- var cb = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
55
- var element = (0, _isString.default)(el) ? _dom.default.el(el) : el;
56
- var start = axis === 'y' ? element.scrollTop : element.scrollLeft;
57
- var change = position - start;
58
- var increment = 20;
59
- var currentTime = 0;
60
-
61
- var animateScroll = function animateScroll() {
62
- currentTime += increment;
63
- var val = Math.easeInOutQuad(currentTime, start, change, duration);
64
-
65
- if (axis === 'y') {
66
- element.scrollTop = val;
67
- } else {
68
- element.scrollLeft = val;
69
- }
70
-
71
- if (currentTime < duration) {
72
- _ssrWindow.window.setTimeout(animateScroll, increment);
73
- } else {
74
- if (cb) {
75
- cb();
76
- }
77
- }
78
- };
79
-
80
- animateScroll();
81
- }
82
- };
83
- var _default = AnimationUtils;
84
- exports.default = _default;
@@ -1,233 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
-
10
- var _ssrWindow = require("ssr-window");
11
-
12
- var _isDate = _interopRequireDefault(require("lodash/isDate"));
13
-
14
- var _isObject = _interopRequireDefault(require("lodash/isObject"));
15
-
16
- var _isString = _interopRequireDefault(require("lodash/isString"));
17
-
18
- var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
19
-
20
- var splitTextDate = function splitTextDate(date, delimeter) {
21
- var d = date.split(delimeter);
22
- return new Date(d[2], d[0] - 1, d[1]);
23
- };
24
-
25
- var splitMobileDate = function splitMobileDate(date) {
26
- var d = date.split('-');
27
- return new Date(d[0], d[1] - 1, d[2]);
28
- };
29
- /**
30
- * Utilities for working with dates.
31
- * @module DateUtils
32
- */
33
-
34
-
35
- var DateUtils = {
36
- // /**
37
- // * Check whether input type of 'date' is supported in the current browser.
38
- // * @static
39
- // * @function supportsDateInput
40
- // * @example
41
- // * DateUtils.supportsDateInput();
42
- // * @returns {Boolean} - Whether the input type is supported.
43
- // */
44
- // supportsDateInput() {
45
- // const fakeValue = 'not-a-date';
46
- // const input = document.createElement('input');
47
- //
48
- // input.setAttribute('type', 'date');
49
- // input.setAttribute('value', fakeValue);
50
- //
51
- // return input.value !== fakeValue;
52
- // },
53
- // /**
54
- // * Gets the closest match to the user's current time zone.
55
- // * @static
56
- // * @function getTimeZone
57
- // * @example
58
- // * DateUtils.getTimeZone(); // 'America/Chicago'
59
- // * @returns {String} - The user's current time zone.
60
- // */
61
- // getTimeZone() {
62
- // if (
63
- // window.Intl &&
64
- // isObject(window.Intl) &&
65
- // window.Intl.DateTimeFormat().resolvedOptions().timeZone
66
- // ) {
67
- // return window.Intl.DateTimeFormat().resolvedOptions().timeZone;
68
- // } else {
69
- // return moment.tz.guess();
70
- // }
71
- // },
72
- // /**
73
- // * Converts a mobile input date to a string using the specified format.
74
- // * @static
75
- // * @function convertToDesktop
76
- // * @param {String} date - The input value in the format YYYY-MM-DD.
77
- // * @param {String} [format='MM/DD/YYYY'] - The output format.
78
- // * @example
79
- // * DateUtils.convertToDesktop('1983-01-19');
80
- // * @returns {String} - The formatted date.
81
- // */
82
- // convertToDesktop(date, format = 'MM/DD/YYYY') {
83
- // if (!isString(date)) {
84
- // throw new Error('The supplied date is not a string.');
85
- // }
86
- //
87
- // if (date.indexOf('-') !== -1) {
88
- // return moment(splitMobileDate(date)).format(format);
89
- // } else {
90
- // return date;
91
- // }
92
- // },
93
- // /**
94
- // * Converts a desktop input date to the native mobile date format.
95
- // * @static
96
- // * @function convertToMobile
97
- // * @param {String} date - The input value in the format MM/DD/YYYY.
98
- // * @example
99
- // * DateUtils.convertToMobile('01/19/1983');
100
- // * @returns {String} - The mobile formatted date.
101
- // */
102
- // convertToMobile(date) {
103
- // if (!isString(date)) {
104
- // throw new Error('The supplied date is not a string.');
105
- // }
106
- //
107
- // if (date.indexOf('/') !== -1) {
108
- // return moment(splitTextDate(date, '/')).format('YYYY-MM-DD');
109
- // } else {
110
- // return date;
111
- // }
112
- // },
113
-
114
- /**
115
- * Converts a string date from a text or date input to a date object.
116
- * @static
117
- * @function getAsDate
118
- * @param {String} date - The date in the format MM/DD/YYYY (text input) or YYYY-MM-DD (date input).
119
- * @example
120
- * DateUtils.getAsDate('1983-01-19');
121
- * DateUtils.getAsDate('01/19/1983');
122
- * @returns {Date} - The date object.
123
- */
124
- getAsDate: function getAsDate(date) {
125
- if (!(0, _isString.default)(date)) {
126
- throw new Error('The supplied date is not a string.');
127
- }
128
-
129
- if (date.indexOf('-') !== -1) {
130
- // date input
131
- return splitMobileDate(date);
132
- } else {
133
- // text input
134
- return splitTextDate(date, '/');
135
- }
136
- },
137
-
138
- /**
139
- * Converts a string date from a text or date input to a moment instance.
140
- * @static
141
- * @function getAsMoment
142
- * @param {String} date - The date in the format MM/DD/YYYY (text input) or YYYY-MM-DD (date input).
143
- * @example
144
- * DateUtils.getAsMoment('1983-01-19');
145
- * DateUtils.getAsMoment('01/19/1983');
146
- * @returns {Moment} - The moment instance.
147
- */
148
- getAsMoment: function getAsMoment(date) {
149
- if (!(0, _isString.default)(date)) {
150
- throw new Error('The supplied date is not a string.');
151
- }
152
-
153
- if (date.indexOf('-') !== -1) {
154
- // date input
155
- return (0, _momentTimezone.default)(splitMobileDate(date));
156
- } else {
157
- // text input
158
- return (0, _momentTimezone.default)(splitTextDate(date, '/'));
159
- }
160
- },
161
-
162
- /**
163
- * Combines a date moment with a time moment to return one moment instance.
164
- * @static
165
- * @function combineDateAndTime
166
- * @param {Moment} date - The date as a moment instance.
167
- * @param {Moment} time - The time as a moment instance.
168
- * @example
169
- * DateUtils.combineDateAndTime(moment(), moment().add(7, 'hours').add(23, 'minutes'));
170
- * @returns {Moment} - The combined moment instance.
171
- */
172
- combineDateAndTime: function combineDateAndTime(date, time) {
173
- if (!_momentTimezone.default.isMoment(date) || !_momentTimezone.default.isMoment(time)) {
174
- throw new Error('The date and/or time supplied was not an instance of Moment.');
175
- }
176
-
177
- return date.hours(time.hours()).minutes(time.minutes());
178
- },
179
-
180
- /**
181
- * Checks if one date is before another.
182
- * @static
183
- * @function isBefore
184
- * @param {Date} dateToCheck - The date to check.
185
- * @param {Date} dateToCompare - The date to check against.
186
- * @param {Boolean} [useTime=false] - Whether to use the time in the comparison.
187
- * @example
188
- * DateUtils.isBefore(new Date(2016, 1, 19), new Date(2016, 3, 14));
189
- * @returns {Boolean} - Whether the provided date is before the one being checked against.
190
- */
191
- isBefore: function isBefore(dateToCheck, dateToCompare) {
192
- var useTime = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
193
-
194
- if (!(0, _isDate.default)(dateToCheck) || !(0, _isDate.default)(dateToCompare)) {
195
- throw new Error('The dates supplied must be instances of the Date object.');
196
- }
197
-
198
- if (!useTime) {
199
- dateToCheck.setHours(0, 0, 0, 0);
200
- dateToCompare.setHours(0, 0, 0, 0);
201
- }
202
-
203
- return dateToCheck < dateToCompare;
204
- },
205
-
206
- /**
207
- * Checks if one date is after another.
208
- * @static
209
- * @function isAfter
210
- * @param {Date} dateToCheck - The date to check.
211
- * @param {Date} dateToCompare - The date to check against.
212
- * @param {Boolean} [useTime=false] - Whether to use the time in the comparison.
213
- * @example
214
- * DateUtils.isAfter(new Date(2016, 1, 19), new Date(2016, 3, 14));
215
- * @returns {Boolean} - Whether the provided date is after the one being checked against.
216
- */
217
- isAfter: function isAfter(dateToCheck, dateToCompare) {
218
- var useTime = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
219
-
220
- if (!(0, _isDate.default)(dateToCheck) || !(0, _isDate.default)(dateToCompare)) {
221
- throw new Error('The dates supplied must be instances of the Date object.');
222
- }
223
-
224
- if (!useTime) {
225
- dateToCheck.setHours(0, 0, 0, 0);
226
- dateToCompare.setHours(0, 0, 0, 0);
227
- }
228
-
229
- return dateToCheck > dateToCompare;
230
- }
231
- };
232
- var _default = DateUtils;
233
- exports.default = _default;