@jobber/components 4.60.0 → 4.60.1-JOB-76584.1

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.
@@ -7,7 +7,6 @@ var React = require('react');
7
7
  var debounce = require('lodash/debounce');
8
8
  var styleInject_es = require('../style-inject.es-9d2f5f4e.js');
9
9
  var classnames = require('classnames');
10
- var useEventListener = require('@use-it/event-listener');
11
10
  var ReactDOM = require('react-dom');
12
11
  var reactPopper = require('react-popper');
13
12
  var Text = require('../Text-54334431.js');
@@ -30,7 +29,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
30
29
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
31
30
  var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce);
32
31
  var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
33
- var useEventListener__default = /*#__PURE__*/_interopDefaultLegacy(useEventListener);
34
32
 
35
33
  var css_248z = ".v0Cys9vQ-NE- {\n position: relative;\n width: 100%;\n}\n\n.CX-N-e0e6og- {\n display: none;\n position: absolute;\n z-index: calc(6 + 1001);\n z-index: calc(var(--elevation-menu) + var(--elevation-modal));\n width: 100%;\n /* Unfortunately this is how we define our line item picker height in jobber online.\n This is a concession to maintain visual parity. */\n max-height: 300px;\n box-shadow: 0px calc(16px / 16) calc(16px / 4) 0px\n rgba(0, 0, 0, 0.1),\n 0px calc(16px / 4) 12px 0px rgba(0, 0, 0, 0.05);\n box-shadow: var(--shadow-base);\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: calc(16px / 16) solid var(--color-color-border);\n border: var(--border-base) solid var(--color-color-border);\n border-radius: calc(16px / 8);\n border-radius: var(--radius-base);\n overflow: auto;\n scroll-behavior: smooth;\n background-color: rgba(255, 255, 255, 1);\n background-color: var(--color-surface);\n}\n\n.CX-N-e0e6og- h5 {\n padding: calc(16px / 2) 0 calc(16px / 4) calc(16px / 2);\n padding: var(--space-small) 0 var(--space-smaller) var(--space-small);\n border-bottom: calc(16px / 16) solid rgb(1, 41, 57);\n border-bottom: var(--border-base) solid var(--color-border--section);\n}\n\n.CX-N-e0e6og-._4PlUaegVpkk- {\n display: block;\n}\n\n.CX-N-e0e6og-._4PlUaegVpkk-:empty {\n display: none;\n}\n\n.ucQtG0iwqbo- {\n display: -ms-flexbox;\n display: flex;\n width: 100%;\n -ms-flex-direction: row;\n flex-direction: row;\n -ms-flex-wrap: nowrap;\n flex-wrap: nowrap;\n -ms-flex-pack: start;\n justify-content: flex-start;\n -ms-flex-line-pack: stretch;\n align-content: stretch;\n -ms-flex-align: center;\n align-items: center;\n padding: calc(16px / 2);\n padding: var(--space-small);\n border: none;\n border-radius: calc(16px / 8);\n border-radius: var(--radius-base);\n text-align: left;\n list-style: none;\n background-color: transparent;\n cursor: pointer;\n transition: all 200ms;\n transition: all var(--timing-base);\n}\n\n.ucQtG0iwqbo-:hover,\n.ucQtG0iwqbo-:focus,\n.ucQtG0iwqbo-.r8HS-ma79QE- {\n background-color: rgb(250, 246, 219);\n background-color: var(--color-surface--hover);\n outline-color: rgb(231, 213, 87);\n outline-color: var(--color-focus);\n}\n\n.ucQtG0iwqbo-.ydwLX44YFZc-:not(:last-child) {\n border-bottom: calc(16px / 16) solid rgb(225, 225, 225);\n border-bottom: var(--border-base) solid var(--color-border);\n}\n\n.CX-N-e0e6og-:hover .ucQtG0iwqbo-.r8HS-ma79QE-:not(:hover) {\n background-color: transparent;\n outline-color: transparent;\n}\n\n.v0Cys9vQ-NE- .PvUgNoAUG7A-:not(:first-child) {\n padding-top: calc(16px / 2);\n padding-top: var(--space-small);\n}\n\n.ucQtG0iwqbo- .DAOOFUZ1BRM- {\n -ms-flex: 0 1 auto;\n flex: 0 1 auto;\n -ms-flex-item-align: auto;\n align-self: auto;\n width: calc(16px * 1.5);\n width: var(--space-large);\n}\n\n.ucQtG0iwqbo- .cjKJFup6hGY- {\n display: -ms-inline-flexbox;\n display: inline-flex;\n -ms-flex: 1 100%;\n flex: 1 100%;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n}\n\n.ucQtG0iwqbo- .hG5zNBuI2wA- {\n -ms-flex: 2;\n flex: 2;\n}\n\n.ucQtG0iwqbo- ._3CwjFCbhqi4- {\n -ms-flex: 1;\n flex: 1;\n -ms-flex-item-align: end;\n align-self: flex-end;\n text-align: right;\n}\n";
36
34
  var styles = {"autocomplete":"v0Cys9vQ-NE-","options":"CX-N-e0e6og-","visible":"_4PlUaegVpkk-","option":"ucQtG0iwqbo-","active":"r8HS-ma79QE-","separator":"ydwLX44YFZc-","heading":"PvUgNoAUG7A-","icon":"DAOOFUZ1BRM-","text":"cjKJFup6hGY-","label":"hG5zNBuI2wA-","details":"_3CwjFCbhqi4-"};
@@ -114,14 +112,17 @@ function isOptionSelected(selectedOption, option) {
114
112
  }
115
113
  // Split this out into a hooks package.
116
114
  function useOnKeyDown(keyName, handler) {
117
- // Pending: https://github.com/donavon/use-event-listener/pull/12
118
- // The types in useEventListener mistakenly require a SyntheticEvent for the passed generic.
119
- useEventListener__default["default"]("keydown", event => {
120
- const newEvent = event;
121
- if (newEvent.key === keyName) {
122
- handler(newEvent);
123
- }
124
- });
115
+ React.useEffect(() => {
116
+ window.addEventListener('keydown', event => {
117
+ const newEvent = event;
118
+ if (newEvent.key === keyName) {
119
+ handler(newEvent);
120
+ }
121
+ });
122
+ return () => {
123
+ window.removeEventListener('keydown', handler);
124
+ };
125
+ }, []);
125
126
  }
126
127
  function isGroup(option) {
127
128
  if (option.options)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "4.60.0",
3
+ "version": "4.60.1-JOB-76584.1+dd348d15",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  ],
21
21
  "dependencies": {
22
22
  "@jobber/design": "^0.47.0",
23
- "@jobber/formatters": "*",
23
+ "@jobber/formatters": "^0.2.2",
24
24
  "@jobber/hooks": "^2.7.0",
25
25
  "@popperjs/core": "^2.0.6",
26
26
  "@std-proposal/temporal": "0.0.1",
@@ -31,7 +31,6 @@
31
31
  "@types/react-router": "5.1.7",
32
32
  "@types/react-router-dom": "^5.3.3",
33
33
  "@types/uuid": "^8.3.3",
34
- "@use-it/event-listener": "^0.1.3",
35
34
  "axios": "^0.21.2",
36
35
  "classnames": "^2.3.2",
37
36
  "color": "^3.1.2",
@@ -84,5 +83,5 @@
84
83
  "> 1%",
85
84
  "IE 10"
86
85
  ],
87
- "gitHead": "6d278cdff3de74aca7c90d7da59ac9c365dbd69c"
86
+ "gitHead": "dd348d15faf17c44a03dbb5c95bb9dd9a6e2b626"
88
87
  }
package/rollup.config.js CHANGED
@@ -63,7 +63,6 @@ export default {
63
63
  "uuid",
64
64
  new RegExp("lodash/.*"),
65
65
  "@std-proposal/temporal",
66
- "@use-it/event-listener",
67
66
  "@jobber/design",
68
67
  "@jobber/design/foundation",
69
68
  "@jobber/formatters",