@spothero/ui 15.0.0-beta.3 → 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 (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,422 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _ssrWindow = require("ssr-window");
9
-
10
- // Most of the methods are pulled from https://is.js.org/. That library has many others that we'll never use so they are added here and made to work with SSR.
11
- // const appVersion = (
12
- // (ssrWindow.navigator && ssrWindow.navigator.appVersion) ||
13
- // ''
14
- // ).toLowerCase();
15
- // const userAgent = (
16
- // (ssrWindow.navigator && ssrWindow.navigator.userAgent) ||
17
- // ''
18
- // ).toLowerCase();
19
- // const vendor = (
20
- // (ssrWindow.navigator && ssrWindow.navigator.vendor) ||
21
- // ''
22
- // ).toLowerCase();
23
- // const comparator = {
24
- // '<': (a, b) => {
25
- // return a < b;
26
- // },
27
- // '<=': (a, b) => {
28
- // return a <= b;
29
- // },
30
- // '>': (a, b) => {
31
- // return a > b;
32
- // },
33
- // '>=': (a, b) => {
34
- // return a >= b;
35
- // },
36
- // };
37
- // const compareVersion = (version, range) => {
38
- // const string = String(range);
39
- // const n = Number(string.match(/\d+/) || NaN);
40
- // const op = string.match(/^[<>]=?|/)[0];
41
- //
42
- // return comparator[op]
43
- // ? comparator[op](version, n)
44
- // : version === n || n !== n; // eslint-disable-line no-self-compare
45
- // };
46
-
47
- /**
48
- * Utilities for working with the execution environment.
49
- * @module EnvironmentUtils
50
- */
51
- var EnvironmentUtils = {
52
- // /**
53
- // * Determines whether the code is being executed in the browser.
54
- // * @static
55
- // * @function isBrowser
56
- // * @example
57
- // * EnvironmentUtils.isBrowser();
58
- // * @returns {Boolean} - Whether the environment is the browser.
59
- // */
60
- // isBrowser() {
61
- // return typeof window !== 'undefined';
62
- // },
63
- //
64
- // /**
65
- // * Determines whether the code is being executed in Google Chrome.
66
- // * @static
67
- // * @function isChrome
68
- // * @param {Number|String} [range] - The version range to test against.
69
- // * @param {String} [ua=navigator.userAgent] - The user agent to test against.
70
- // * @example
71
- // * EnvironmentUtils.isChrome();
72
- // * @returns {Boolean} - Whether the environment is Google Chrome.
73
- // */
74
- // isChrome(range, ua = userAgent) {
75
- // const match = /google inc/.test(vendor)
76
- // ? ua.match(/(?:chrome|crios)\/(\d+)/)
77
- // : null;
78
- //
79
- // return (
80
- // match !== null &&
81
- // !this.isOpera(range, ua) &&
82
- // compareVersion(match[1], range)
83
- // );
84
- // },
85
- //
86
- // /**
87
- // * Determines whether the code is being executed in Mozilla Firefox.
88
- // * @static
89
- // * @function isFirefox
90
- // * @param {Number|String} [range] - The version range to test against.
91
- // * @param {String} [ua=navigator.userAgent] - The user agent to test against.
92
- // * @example
93
- // * EnvironmentUtils.isFirefox();
94
- // * @returns {Boolean} - Whether the environment is Mozilla Firefox.
95
- // */
96
- // isFirefox(range, ua = userAgent) {
97
- // const match = ua.match(/(?:firefox|fxios)\/(\d+)/);
98
- //
99
- // return match !== null && compareVersion(match[1], range);
100
- // },
101
- //
102
- // /**
103
- // * Determines whether the code is being executed in Apple Safari.
104
- // * @static
105
- // * @function isSafari
106
- // * @param {Number|String} [range] - The version range to test against.
107
- // * @param {String} [ua=navigator.userAgent] - The user agent to test against.
108
- // * @example
109
- // * EnvironmentUtils.isSafari();
110
- // * @returns {Boolean} - Whether the environment is Apple Safari.
111
- // */
112
- // isSafari(range, ua = userAgent) {
113
- // const match = ua.match(/version\/(\d+).+?safari/);
114
- //
115
- // return match !== null && compareVersion(match[1], range);
116
- // },
117
- //
118
- // /**
119
- // * Determines whether the code is being executed in Microsoft Edge.
120
- // * @static
121
- // * @function isEdge
122
- // * @param {Number|String} [range] - The version range to test against.
123
- // * @param {String} [ua=navigator.userAgent] - The user agent to test against.
124
- // * @example
125
- // * EnvironmentUtils.isEdge();
126
- // * @returns {Boolean} - Whether the environment is Microsoft Edge.
127
- // */
128
- // isEdge(range, ua = userAgent) {
129
- // const match = ua.match(/edge\/(\d+)/);
130
- //
131
- // return match !== null && compareVersion(match[1], range);
132
- // },
133
- //
134
- // /**
135
- // * Determines whether the code is being executed in Microsoft Internet Explorer.
136
- // * @static
137
- // * @function isIE
138
- // * @param {Number|String} [range] - The version range to test against.
139
- // * @param {String} [ua=navigator.userAgent] - The user agent to test against.
140
- // * @example
141
- // * EnvironmentUtils.isIE();
142
- // * @returns {Boolean} - Whether the environment is Microsoft Internet Explorer.
143
- // */
144
- // isIE(range, ua = userAgent) {
145
- // const match = ua.match(/(?:msie |trident.+?; rv:)(\d+)/);
146
- //
147
- // return match !== null && compareVersion(match[1], range);
148
- // },
149
- //
150
- // /**
151
- // * Determines whether the code is being executed in Opera.
152
- // * @static
153
- // * @function isOpera
154
- // * @param {Number|String} [range] - The version range to test against.
155
- // * @param {String} [ua=navigator.userAgent] - The user agent to test against.
156
- // * @example
157
- // * EnvironmentUtils.isOpera();
158
- // * @returns {Boolean} - Whether the environment is Opera.
159
- // */
160
- // isOpera(range, ua = userAgent) {
161
- // const match = ua.match(/(?:^opera.+?version|opr)\/(\d+)/);
162
- //
163
- // return match !== null && compareVersion(match[1], range);
164
- // },
165
- //
166
- // /**
167
- // * Determines whether the code is being executed in iOS.
168
- // * @static
169
- // * @function isiOS
170
- // * @param {String} [ua=navigator.userAgent] - The user agent to test against.
171
- // * @example
172
- // * EnvironmentUtils.isiOS();
173
- // * @returns {Boolean} - Whether the environment is iOS.
174
- // */
175
- // isiOS(ua = userAgent) {
176
- // return (
177
- // this.isiPhone(null, ua) ||
178
- // this.isiPad(null, ua) ||
179
- // this.isiPod(null, ua)
180
- // );
181
- // },
182
- //
183
- // /**
184
- // * Determines whether the code is being executed on an iPhone.
185
- // * @static
186
- // * @function isiPhone
187
- // * @param {Number|String} [range] - The version range to test against.
188
- // * @param {String} [ua=navigator.userAgent] - The user agent to test against.
189
- // * @example
190
- // * EnvironmentUtils.isiPhone();
191
- // * EnvironmentUtils.isiPhone(9);
192
- // * EnvironmentUtils.isiPhone('>=7');
193
- // * EnvironmentUtils.isiPhone('<8');
194
- // * @returns {Boolean} - Whether the environment is iPhone.
195
- // */
196
- // isiPhone(range, ua = userAgent) {
197
- // // avoid false positive for Facebook in-app browser on ipad;
198
- // // original iphone doesn't have the OS portion of the UA
199
- // const match = this.isiPad(null, ua)
200
- // ? null
201
- // : ua.match(/iphone(?:.+?os (\d+))?/i);
202
- //
203
- // return match !== null && compareVersion(match[1] || 1, range);
204
- // },
205
- //
206
- // /**
207
- // * Determines whether the code is being executed on an iPad.
208
- // * @static
209
- // * @function isiPad
210
- // * @param {Number|String} [range] - The version range to test against.
211
- // * @param {String} [ua=navigator.userAgent] - The user agent to test against.
212
- // * @example
213
- // * EnvironmentUtils.isiPad();
214
- // * EnvironmentUtils.isiPad(9);
215
- // * EnvironmentUtils.isiPad('>=7');
216
- // * EnvironmentUtils.isiPad('<8');
217
- // * @returns {Boolean} - Whether the environment is iPad.
218
- // */
219
- // isiPad(range, ua = userAgent) {
220
- // const match = ua.match(/ipad.+?os (\d+)/i);
221
- //
222
- // return match !== null && compareVersion(match[1], range);
223
- // },
224
- //
225
- // /**
226
- // * Determines whether the code is being executed on an iPod.
227
- // * @static
228
- // * @function isiPod
229
- // * @param {Number|String} [range] - The version range to test against.
230
- // * @param {String} [ua=navigator.userAgent] - The user agent to test against.
231
- // * @example
232
- // * EnvironmentUtils.isiPod();
233
- // * EnvironmentUtils.isiPod(9);
234
- // * EnvironmentUtils.isiPod('>=7');
235
- // * EnvironmentUtils.isiPod('<8');
236
- // * @returns {Boolean} - Whether the environment is iPod.
237
- // */
238
- // isiPod(range, ua = userAgent) {
239
- // const match = ua.match(/ipod.+?os (\d+)/i);
240
- //
241
- // return match !== null && compareVersion(match[1], range);
242
- // },
243
- //
244
- // /**
245
- // * Determines whether the code is being executed in Android.
246
- // * @static
247
- // * @function isAndroid
248
- // * @param {String} [ua=navigator.userAgent] - The user agent to test against.
249
- // * @example
250
- // * EnvironmentUtils.isAndroid();
251
- // * @returns {Boolean} - Whether the environment is Android.
252
- // */
253
- // isAndroid(ua = userAgent) {
254
- // return /android/i.test(ua);
255
- // },
256
- //
257
- // /**
258
- // * Determines whether the code is being executed on an Android phone.
259
- // * @static
260
- // * @function isAndroidPhone
261
- // * @param {String} [ua=navigator.userAgent] - The user agent to test against.
262
- // * @example
263
- // * EnvironmentUtils.isAndroidPhone();
264
- // * @returns {Boolean} - Whether the environment is Android phone.
265
- // */
266
- // isAndroidPhone(ua = userAgent) {
267
- // return /android/i.test(ua) && /mobile/i.test(ua);
268
- // },
269
- //
270
- // /**
271
- // * Determines whether the code is being executed on an Android tablet.
272
- // * @static
273
- // * @function isAndroidTablet
274
- // * @param {String} [ua=navigator.userAgent] - The user agent to test against.
275
- // * @example
276
- // * EnvironmentUtils.isAndroidTablet();
277
- // * @returns {Boolean} - Whether the environment is Android tablet.
278
- // */
279
- // isAndroidTablet(ua = userAgent) {
280
- // return /android/i.test(ua) && !/mobile/i.test(ua);
281
- // },
282
- //
283
- // /**
284
- // * Determines whether the code is being executed on a Blackberry.
285
- // * @static
286
- // * @function isBlackberry
287
- // * @param {String} [ua=navigator.userAgent] - The user agent to test against.
288
- // * @example
289
- // * EnvironmentUtils.isBlackberry();
290
- // * @returns {Boolean} - Whether the environment is Blackberry.
291
- // */
292
- // isBlackberry(ua = userAgent) {
293
- // return /blackberry/i.test(ua) || /bb10/i.test(ua);
294
- // },
295
- //
296
- // /**
297
- // * Determines whether the code is being executed on a Windows phone.
298
- // * @static
299
- // * @function isWindowsPhone
300
- // * @param {String} [ua=navigator.userAgent] - The user agent to test against.
301
- // * @example
302
- // * EnvironmentUtils.isWindowsPhone();
303
- // * @returns {Boolean} - Whether the environment is Windows phone.
304
- // */
305
- // isWindowsPhone(ua = userAgent) {
306
- // return this.isWindows() && /phone/i.test(ua);
307
- // },
308
- //
309
- // /**
310
- // * Determines whether the code is being executed on a Windows tablet.
311
- // * @static
312
- // * @function isWindowsTablet
313
- // * @param {String} [ua=navigator.userAgent] - The user agent to test against.
314
- // * @example
315
- // * EnvironmentUtils.isWindowsTablet();
316
- // * @returns {Boolean} - Whether the environment is Windows tablet.
317
- // */
318
- // isWindowsTablet(ua = userAgent) {
319
- // return (
320
- // this.isWindows() && !this.isWindowsPhone(ua) && /touch/i.test(ua)
321
- // );
322
- // },
323
- //
324
- // /**
325
- // * Determines whether the code is being executed on Windows.
326
- // * @static
327
- // * @function isWindows
328
- // * @param {String} [ua=navigator.userAgent] - The user agent to test against.
329
- // * @example
330
- // * EnvironmentUtils.isWindows();
331
- // * @returns {Boolean} - Whether the environment is Windows.
332
- // */
333
- // isWindows() {
334
- // return /win/i.test(appVersion);
335
- // },
336
- //
337
- // /**
338
- // * Determines whether the code is being executed on a tablet.
339
- // * @static
340
- // * @function isTablet
341
- // * @param {String} [ua=navigator.userAgent] - The user agent to test against.
342
- // * @example
343
- // * EnvironmentUtils.isTablet();
344
- // * @returns {Boolean} - Whether the environment is a tablet.
345
- // */
346
- // isTablet(ua = userAgent) {
347
- // return (
348
- // this.isiPad(null, ua) ||
349
- // this.isAndroidTablet(ua) ||
350
- // this.isWindowsTablet(ua)
351
- // );
352
- // },
353
- //
354
- // /**
355
- // * Determines whether the code is being executed on a mobile device.
356
- // * @static
357
- // * @function isMobileDevice
358
- // * @param {String} [ua=navigator.userAgent] - The user agent to test against.
359
- // * @example
360
- // * EnvironmentUtils.isMobileDevice();
361
- // * @returns {Boolean} - Whether the environment is a mobile device.
362
- // */
363
- // isMobileDevice(ua = userAgent) {
364
- // return (
365
- // this.isiPhone(null, ua) ||
366
- // this.isiPod(null, ua) ||
367
- // this.isAndroidPhone(ua) ||
368
- // this.isBlackberry(ua) ||
369
- // this.isWindowsPhone(ua)
370
- // );
371
- // },
372
- //
373
- // /**
374
- // * Determines whether the code is being executed on a touch device.
375
- // * @static
376
- // * @function isTouchDevice
377
- // * @example
378
- // * EnvironmentUtils.isTouchDevice();
379
- // * @returns {Boolean} - Whether the environment is a touch device.
380
- // */
381
- // isTouchDevice() {
382
- // return (
383
- // Boolean(document) &&
384
- // ('ontouchstart' in document.documentElement ||
385
- // ('DocumentTouch' in document.documentElement &&
386
- // document instanceof window.DocumentTouch))
387
- // );
388
- // },
389
-
390
- /**
391
- * Determines whether the display has a high density.
392
- * @static
393
- * @function isHighDensityDisplay
394
- * @example
395
- * EnvironmentUtils.isHighDensityDisplay();
396
- * @returns {Boolean} - Whether the display is high density.
397
- */
398
- isHighDensityDisplay: function isHighDensityDisplay() {
399
- return _ssrWindow.window.matchMedia && (_ssrWindow.window.matchMedia('only screen and (min-resolution: 124dpi), only screen and (min-resolution: 1.3dppx), only screen and (min-resolution: 48.8dpcm)').matches || _ssrWindow.window.matchMedia('only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 2.6/2), only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (min-device-pixel-ratio: 1.3)').matches) || _ssrWindow.window.devicePixelRatio && _ssrWindow.window.devicePixelRatio > 1.3;
400
- } // /**
401
- // * Returns a string based on browser util booleans, consumed by Segment and Optimizely
402
- // * @static
403
- // * @function getBrowserCategory
404
- // * @returns {String} - The browser string
405
- // */
406
- // getBrowserCategory() {
407
- // if (this.isChrome()) {
408
- // return 'Chrome';
409
- // } else if (this.isFirefox()) {
410
- // return 'Firefox';
411
- // } else if (this.isSafari()) {
412
- // return 'Safari';
413
- // } else if (this.isEdge() || this.isIE()) {
414
- // return 'IE/Edge';
415
- // }
416
- //
417
- // return 'Other';
418
- // },
419
-
420
- };
421
- var _default = EnvironmentUtils;
422
- exports.default = _default;
@@ -1,43 +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 _isNumber = _interopRequireDefault(require("lodash/isNumber"));
11
-
12
- var _isUndefined = _interopRequireDefault(require("lodash/isUndefined"));
13
-
14
- /**
15
- * Utilities for working with numbers.
16
- * @module NumberUtils
17
- */
18
- var NumberUtils = {
19
- /**
20
- * Rounds a given number down to the nearest specified number.
21
- * @static
22
- * @function roundDownToNearestStep
23
- * @param {Number} num - The number to round.
24
- * @param {Number} step - The step to round down to.
25
- * @example
26
- * NumberUtils.roundDownToNearestStep(57, 30); // 30
27
- * NumberUtils.roundDownToNearestStep(161, 15); // 150
28
- * @returns {Number} - The rounded number.
29
- */
30
- roundDownToNearestStep: function roundDownToNearestStep(num, step) {
31
- if (!(0, _isNumber.default)(num)) {
32
- throw new Error('You can only round numbers.');
33
- }
34
-
35
- if ((0, _isUndefined.default)(step)) {
36
- throw new Error('You must provide a step to round down to.');
37
- }
38
-
39
- return step * Math.floor(num / step);
40
- }
41
- };
42
- var _default = NumberUtils;
43
- exports.default = _default;