@jobber/components 4.1.0 → 4.1.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.
Files changed (127) hide show
  1. package/dist/Autocomplete/Autocomplete.d.ts +1 -1
  2. package/dist/Autocomplete/Option.d.ts +2 -2
  3. package/dist/Autocomplete/index.js +51 -67
  4. package/dist/Avatar/Avatar.d.ts +2 -2
  5. package/dist/Avatar/index.js +2 -2
  6. package/dist/{Avatar-cfd04e86.js → Avatar-89cfd0a6.js} +14 -18
  7. package/dist/Banner/Banner.d.ts +1 -1
  8. package/dist/Banner/index.js +15 -19
  9. package/dist/Button/Button.d.ts +1 -1
  10. package/dist/Button/index.js +3 -4
  11. package/dist/{Button-cd30df0f.js → Button-16e043ec.js} +21 -24
  12. package/dist/ButtonDismiss/index.js +4 -5
  13. package/dist/{ButtonDismiss-a9590195.js → ButtonDismiss-3fb1eaf9.js} +2 -3
  14. package/dist/Card/Card.d.ts +1 -1
  15. package/dist/Card/index.js +6 -7
  16. package/dist/Card/types.d.ts +1 -1
  17. package/dist/{Card-b9f8d6f3.js → Card-edab9c3c.js} +18 -22
  18. package/dist/Checkbox/Checkbox.d.ts +1 -1
  19. package/dist/Checkbox/index.js +4 -5
  20. package/dist/{Checkbox-5103d2b9.js → Checkbox-c1efc2f6.js} +10 -12
  21. package/dist/Chips/ChipsTypes.d.ts +1 -1
  22. package/dist/Chips/InternalChipDismissible/InternalChipDismissibleTypes.d.ts +1 -1
  23. package/dist/Chips/InternalChipDismissible/hooks/useInternalChipDismissible.d.ts +1 -1
  24. package/dist/Chips/InternalChipDismissible/hooks/useInternalChipDismissibleInput.d.ts +3 -3
  25. package/dist/Chips/InternalChipMultiSelect.d.ts +1 -1
  26. package/dist/Chips/InternalChipSingleSelect.d.ts +1 -1
  27. package/dist/Chips/index.js +165 -185
  28. package/dist/ConfirmationModal/ConfirmationModal.d.ts +1 -1
  29. package/dist/ConfirmationModal/index.js +11 -12
  30. package/dist/{ConfirmationModal-e95f46d7.js → ConfirmationModal-6a7beee2.js} +28 -31
  31. package/dist/Content/index.js +1 -1
  32. package/dist/{Content-18de5fbb.js → Content-05df8f7f.js} +2 -3
  33. package/dist/Countdown/Countdown.d.ts +1 -1
  34. package/dist/Countdown/computeTimeUnit.d.ts +1 -1
  35. package/dist/Countdown/index.js +15 -18
  36. package/dist/DataDump/index.js +9 -11
  37. package/dist/DataTable/Footer.d.ts +1 -1
  38. package/dist/DataTable/createTableSettings.d.ts +2 -2
  39. package/dist/DataTable/index.js +74 -106
  40. package/dist/DataTable/test-utilities/helpers.d.ts +1 -1
  41. package/dist/DataTable/types.d.ts +2 -2
  42. package/dist/DatePicker/DatePicker.d.ts +1 -1
  43. package/dist/DatePicker/index.js +4 -5
  44. package/dist/{DatePicker-cf813028.js → DatePicker-0696b0f0.js} +31 -36
  45. package/dist/DescriptionList/index.js +5 -10
  46. package/dist/Disclosure/index.js +8 -10
  47. package/dist/Divider/index.js +8 -10
  48. package/dist/Drawer/index.js +10 -14
  49. package/dist/Emphasis/index.js +2 -3
  50. package/dist/{Emphasis-75a3f411.js → Emphasis-23dc2a0a.js} +4 -6
  51. package/dist/FeatureSwitch/index.js +15 -17
  52. package/dist/Form/index.js +23 -33
  53. package/dist/FormField/FormFieldTypes.d.ts +2 -2
  54. package/dist/FormField/index.js +8 -8
  55. package/dist/{FormField-ac310b6f.js → FormField-79a0a375.js} +68 -76
  56. package/dist/FormatDate/index.js +2 -3
  57. package/dist/FormatEmail/index.js +2 -3
  58. package/dist/FormatFile/index.js +13 -14
  59. package/dist/{FormatFile-18e8a54a.js → FormatFile-3512f838.js} +33 -40
  60. package/dist/FormatRelativeDateTime/index.js +5 -6
  61. package/dist/FormatTime/index.js +6 -7
  62. package/dist/Gallery/GalleryTypes.d.ts +2 -2
  63. package/dist/Gallery/index.js +31 -33
  64. package/dist/Heading/index.js +2 -3
  65. package/dist/{Heading-a9a66964.js → Heading-7b203f7f.js} +4 -6
  66. package/dist/Icon/index.js +1 -1
  67. package/dist/{Icon-d5ad1a6d.js → Icon-405a216c.js} +7 -8
  68. package/dist/InlineLabel/InlineLabel.d.ts +1 -1
  69. package/dist/InlineLabel/index.js +4 -6
  70. package/dist/InputAvatar/index.js +15 -20
  71. package/dist/InputDate/index.js +15 -15
  72. package/dist/InputEmail/InputEmail.d.ts +1 -1
  73. package/dist/InputEmail/index.js +12 -12
  74. package/dist/InputFile/index.js +6 -6
  75. package/dist/{InputFile-e108a7f8.js → InputFile-5e0ed2b5.js} +48 -62
  76. package/dist/InputGroup/index.js +4 -5
  77. package/dist/InputNumber/index.js +22 -22
  78. package/dist/InputPassword/index.js +12 -12
  79. package/dist/InputText/InputText.d.ts +1 -1
  80. package/dist/InputText/index.js +9 -9
  81. package/dist/{InputText-70f7d947.js → InputText-95ea24f9.js} +23 -24
  82. package/dist/InputTime/index.js +27 -27
  83. package/dist/InputValidation/index.js +4 -5
  84. package/dist/{InputValidation-06a8a7ba.js → InputValidation-97dd0dcf.js} +7 -8
  85. package/dist/LightBox/index.js +5 -6
  86. package/dist/{LightBox-1ad62669.js → LightBox-dd1afa97.js} +22 -26
  87. package/dist/List/index.js +26 -32
  88. package/dist/Markdown/index.js +6 -7
  89. package/dist/{Markdown-b53e0308.js → Markdown-be2dcd0c.js} +12 -18
  90. package/dist/Menu/index.js +4 -5
  91. package/dist/{Menu-826cfb89.js → Menu-d6a7d17b.js} +31 -36
  92. package/dist/Modal/index.js +6 -7
  93. package/dist/{Modal-cc3bd7bf.js → Modal-757e83fd.js} +13 -17
  94. package/dist/MultiSelect/index.js +53 -60
  95. package/dist/MultiSelect/types.d.ts +1 -1
  96. package/dist/{Option-7d5de76b.js → Option-4b665afd.js} +3 -5
  97. package/dist/Page/Page.d.ts +1 -1
  98. package/dist/Page/index.js +21 -24
  99. package/dist/Popover/index.js +11 -13
  100. package/dist/ProgressBar/index.js +1 -1
  101. package/dist/{ProgressBar-e9a49129.js → ProgressBar-f028b159.js} +3 -4
  102. package/dist/RadioGroup/RadioOption.d.ts +2 -2
  103. package/dist/RadioGroup/index.js +9 -13
  104. package/dist/RecurringSelect/types.d.ts +2 -2
  105. package/dist/Select/Select.d.ts +1 -1
  106. package/dist/Select/index.js +9 -9
  107. package/dist/Spinner/index.js +1 -1
  108. package/dist/{Spinner-e4e9c8eb.js → Spinner-ae4c8a85.js} +5 -7
  109. package/dist/StatusLabel/StatusLabel.d.ts +1 -1
  110. package/dist/StatusLabel/index.js +6 -9
  111. package/dist/Switch/index.js +2 -3
  112. package/dist/{Switch-f03b70fc.js → Switch-7ac32f7b.js} +12 -16
  113. package/dist/Table/index.js +9 -17
  114. package/dist/Tabs/index.js +28 -34
  115. package/dist/Text/index.js +2 -3
  116. package/dist/{Text-e012fb46.js → Text-7ce00adb.js} +4 -5
  117. package/dist/Toast/Toast.d.ts +2 -2
  118. package/dist/Toast/index.js +31 -32
  119. package/dist/Tooltip/index.js +3 -4
  120. package/dist/Tooltip/useTooltipPositioning.d.ts +1 -1
  121. package/dist/{Tooltip-041feb00.js → Tooltip-1090a43d.js} +25 -28
  122. package/dist/Typography/Typography.d.ts +1 -1
  123. package/dist/Typography/index.js +1 -2
  124. package/dist/{Typography-fbe0ed6e.js → Typography-9262511f.js} +5 -7
  125. package/dist/tslib.es6-efe27175.js +38 -0
  126. package/package.json +3 -3
  127. package/dist/tslib.es6-5b50eb8e.js +0 -103
@@ -2,20 +2,20 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var InputFile = require('../InputFile-e108a7f8.js');
6
- require('../tslib.es6-5b50eb8e.js');
5
+ var InputFile = require('../InputFile-5e0ed2b5.js');
6
+ require('../tslib.es6-efe27175.js');
7
7
  require('react');
8
8
  require('classnames');
9
9
  require('react-dropzone');
10
10
  require('axios');
11
11
  require('uuid');
12
12
  require('../style-inject.es-dcee06b6.js');
13
- require('../Button-cd30df0f.js');
13
+ require('../Button-16e043ec.js');
14
14
  require('react-router-dom');
15
- require('../Icon-d5ad1a6d.js');
15
+ require('../Icon-405a216c.js');
16
16
  require('@jobber/design');
17
- require('../Typography-fbe0ed6e.js');
18
- require('../Content-18de5fbb.js');
17
+ require('../Typography-9262511f.js');
18
+ require('../Content-05df8f7f.js');
19
19
 
20
20
 
21
21
 
@@ -1,15 +1,15 @@
1
1
  'use strict';
2
2
 
3
- var tslib_es6 = require('./tslib.es6-5b50eb8e.js');
3
+ var tslib_es6 = require('./tslib.es6-efe27175.js');
4
4
  var React = require('react');
5
5
  var classnames = require('classnames');
6
6
  var reactDropzone = require('react-dropzone');
7
7
  var axios = require('axios');
8
8
  var uuid = require('uuid');
9
9
  var styleInject_es = require('./style-inject.es-dcee06b6.js');
10
- var Button = require('./Button-cd30df0f.js');
11
- var Content = require('./Content-18de5fbb.js');
12
- var Typography = require('./Typography-fbe0ed6e.js');
10
+ var Button = require('./Button-16e043ec.js');
11
+ var Content = require('./Content-05df8f7f.js');
12
+ var Typography = require('./Typography-9262511f.js');
13
13
 
14
14
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
15
 
@@ -21,10 +21,8 @@ var css = "._2CgKZHQp30gXtQyW8h2Ex_ {\n font-size: 0;\n line-height: 0;\n -we
21
21
  var styles = {"dropZoneBase":"_2CgKZHQp30gXtQyW8h2Ex_","dropZone":"_3nre5MPe67v_oDs44x2IDC","active":"_1wLTm5Es7oqZzzwFiOySeN"};
22
22
  styleInject_es.styleInject(css);
23
23
 
24
- function InputFile(_a) {
25
- var _b;
26
- var _c = _a.variation, variation = _c === void 0 ? "dropzone" : _c, _d = _a.size, size = _d === void 0 ? "base" : _d, providedButtonLabel = _a.buttonLabel, _e = _a.allowMultiple, allowMultiple = _e === void 0 ? false : _e, _f = _a.allowedTypes, allowedTypes = _f === void 0 ? "all" : _f, getUploadParams = _a.getUploadParams, onUploadStart = _a.onUploadStart, onUploadProgress = _a.onUploadProgress, onUploadComplete = _a.onUploadComplete;
27
- var options = {
24
+ function InputFile({ variation = "dropzone", size = "base", buttonLabel: providedButtonLabel, allowMultiple = false, allowedTypes = "all", getUploadParams, onUploadStart, onUploadProgress, onUploadComplete, }) {
25
+ const options = {
28
26
  multiple: allowMultiple,
29
27
  onDrop: React.useCallback(handleDrop, []),
30
28
  };
@@ -34,66 +32,54 @@ function InputFile(_a) {
34
32
  else if (allowedTypes === "basicImages") {
35
33
  options.accept = "image/png, image/jpg, image/jpeg";
36
34
  }
37
- var _g = reactDropzone.useDropzone(options), getRootProps = _g.getRootProps, getInputProps = _g.getInputProps, isDragActive = _g.isDragActive;
38
- var _h = getLabels(providedButtonLabel, allowMultiple, allowedTypes), buttonLabel = _h.buttonLabel, hintText = _h.hintText;
39
- var dropZone = classnames__default["default"](styles.dropZoneBase, (_b = {},
40
- _b[styles.dropZone] = variation === "dropzone",
41
- _b[styles.active] = isDragActive,
42
- _b));
43
- return (React__default["default"].createElement("div", tslib_es6.__assign({}, getRootProps({ className: dropZone }), { tabIndex: variation === "button" ? -1 : 0 }),
44
- React__default["default"].createElement("input", tslib_es6.__assign({}, getInputProps())),
35
+ const { getRootProps, getInputProps, isDragActive } = reactDropzone.useDropzone(options);
36
+ const { buttonLabel, hintText } = getLabels(providedButtonLabel, allowMultiple, allowedTypes);
37
+ const dropZone = classnames__default["default"](styles.dropZoneBase, {
38
+ [styles.dropZone]: variation === "dropzone",
39
+ [styles.active]: isDragActive,
40
+ });
41
+ return (React__default["default"].createElement("div", Object.assign({}, getRootProps({ className: dropZone }), { tabIndex: variation === "button" ? -1 : 0 }),
42
+ React__default["default"].createElement("input", Object.assign({}, getInputProps())),
45
43
  variation === "dropzone" && (React__default["default"].createElement(Content.Content, { spacing: "small" },
46
44
  React__default["default"].createElement(Button.Button, { label: buttonLabel, size: "small", type: "secondary" }),
47
45
  size === "base" && (React__default["default"].createElement(Typography.Typography, { size: "small", textColor: "textSecondary" }, hintText)))),
48
46
  variation === "button" && (React__default["default"].createElement(Button.Button, { label: buttonLabel, size: size, type: "secondary", fullWidth: true }))));
49
47
  function handleDrop(acceptedFiles) {
50
- acceptedFiles.forEach(function (file) {
48
+ acceptedFiles.forEach(file => {
51
49
  uploadFile(file);
52
50
  });
53
51
  }
54
52
  function uploadFile(file) {
55
- return tslib_es6.__awaiter(this, void 0, void 0, function () {
56
- var _a, url, _b, key, _c, fields, _d, httpMethod, fileUpload, handleUploadProgress, handleUploadComplete, axiosConfig;
57
- return tslib_es6.__generator(this, function (_e) {
58
- switch (_e.label) {
59
- case 0: return [4 /*yield*/, getUploadParams(file)];
60
- case 1:
61
- _a = _e.sent(), url = _a.url, _b = _a.key, key = _b === void 0 ? uuid.v1() : _b, _c = _a.fields, fields = _c === void 0 ? {} : _c, _d = _a.httpMethod, httpMethod = _d === void 0 ? "POST" : _d;
62
- fileUpload = getFileUpload(file, key);
63
- onUploadStart && onUploadStart(tslib_es6.__assign({}, fileUpload));
64
- handleUploadProgress = function (progressEvent) {
65
- onUploadProgress &&
66
- onUploadProgress(tslib_es6.__assign(tslib_es6.__assign({}, fileUpload), { progress: progressEvent.loaded / progressEvent.total }));
67
- };
68
- handleUploadComplete = function () {
69
- onUploadComplete === null || onUploadComplete === void 0 ? void 0 : onUploadComplete(tslib_es6.__assign(tslib_es6.__assign({}, fileUpload), { progress: 1 }));
70
- };
71
- axiosConfig = createAxiosConfig({
72
- url: url,
73
- httpMethod: httpMethod,
74
- fields: fields,
75
- file: file,
76
- handleUploadProgress: handleUploadProgress,
77
- });
78
- axios__default["default"].request(axiosConfig).then(handleUploadComplete);
79
- return [2 /*return*/];
80
- }
53
+ return tslib_es6.__awaiter(this, void 0, void 0, function* () {
54
+ const { url, key = uuid.v1(), fields = {}, httpMethod = "POST", } = yield getUploadParams(file);
55
+ const fileUpload = getFileUpload(file, key);
56
+ onUploadStart && onUploadStart(Object.assign({}, fileUpload));
57
+ const handleUploadProgress = (progressEvent) => {
58
+ onUploadProgress &&
59
+ onUploadProgress(Object.assign(Object.assign({}, fileUpload), { progress: progressEvent.loaded / progressEvent.total }));
60
+ };
61
+ const handleUploadComplete = () => {
62
+ onUploadComplete === null || onUploadComplete === void 0 ? void 0 : onUploadComplete(Object.assign(Object.assign({}, fileUpload), { progress: 1 }));
63
+ };
64
+ const axiosConfig = createAxiosConfig({
65
+ url,
66
+ httpMethod,
67
+ fields,
68
+ file,
69
+ handleUploadProgress,
81
70
  });
71
+ axios__default["default"].request(axiosConfig).then(handleUploadComplete);
82
72
  });
83
73
  }
84
74
  }
85
- function createAxiosConfig(_a) {
86
- var url = _a.url, _b = _a.httpMethod, httpMethod = _b === void 0 ? "POST" : _b, _c = _a.fields, fields = _c === void 0 ? {} : _c, file = _a.file, handleUploadProgress = _a.handleUploadProgress;
87
- var data;
88
- var headers;
75
+ function createAxiosConfig({ url, httpMethod = "POST", fields = {}, file, handleUploadProgress, }) {
76
+ let data;
77
+ let headers;
89
78
  if (httpMethod === "POST") {
90
- var formData_1 = new FormData();
91
- Object.entries(fields).forEach(function (_a) {
92
- var _b = tslib_es6.__read(_a, 2), field = _b[0], value = _b[1];
93
- return formData_1.append(field, value);
94
- });
95
- formData_1.append("file", file);
96
- data = formData_1;
79
+ const formData = new FormData();
80
+ Object.entries(fields).forEach(([field, value]) => formData.append(field, value));
81
+ formData.append("file", file);
82
+ data = formData;
97
83
  headers = { "X-Requested-With": "XMLHttpRequest" };
98
84
  }
99
85
  else {
@@ -109,8 +95,8 @@ function createAxiosConfig(_a) {
109
95
  };
110
96
  }
111
97
  function getLabels(providedButtonLabel, multiple, allowedTypes) {
112
- var buttonLabel = multiple ? "Upload Files" : "Upload File";
113
- var hintText = multiple
98
+ let buttonLabel = multiple ? "Upload Files" : "Upload File";
99
+ let hintText = multiple
114
100
  ? "or drag files here to upload"
115
101
  : "or drag a file here to upload";
116
102
  if (allowedTypes === "images" || allowedTypes === "basicImages") {
@@ -121,7 +107,7 @@ function getLabels(providedButtonLabel, multiple, allowedTypes) {
121
107
  }
122
108
  if (providedButtonLabel)
123
109
  buttonLabel = providedButtonLabel;
124
- return { buttonLabel: buttonLabel, hintText: hintText };
110
+ return { buttonLabel, hintText };
125
111
  }
126
112
  function getFileUpload(file, key) {
127
113
  return {
@@ -133,9 +119,9 @@ function getFileUpload(file, key) {
133
119
  src: getSrc,
134
120
  };
135
121
  function getSrc() {
136
- var promise = new Promise(function (resolve, reject) {
137
- var reader = new FileReader();
138
- reader.onload = function (event) {
122
+ const promise = new Promise((resolve, reject) => {
123
+ const reader = new FileReader();
124
+ reader.onload = event => {
139
125
  if (event.target &&
140
126
  event.target.result &&
141
127
  typeof event.target.result === "string") {
@@ -159,8 +145,8 @@ function getFileUpload(file, key) {
159
145
  * @returns FileUpload[] updated set of files.
160
146
  */
161
147
  function updateFiles(updatedFile, files) {
162
- var newFiles = tslib_es6.__spread(files);
163
- var index = files.findIndex(function (file) { return file.key === updatedFile.key; });
148
+ const newFiles = [...files];
149
+ const index = files.findIndex(file => file.key === updatedFile.key);
164
150
  if (index !== -1) {
165
151
  newFiles[index] = updatedFile;
166
152
  }
@@ -15,18 +15,17 @@ var css = "._1UKIybTcnyfJQlTx901rF5 > *:not(:last-child) {\n margin-bottom: -1p
15
15
  var styles = {"vertical":"_1UKIybTcnyfJQlTx901rF5","horizontal":"_26qQBed5Rzu9i2ZIDEaESr","inputGroup":"_3kywSyvvwSdmNSTOqX-AQA"};
16
16
  styleInject_es.styleInject(css);
17
17
 
18
- function InputGroup(_a) {
19
- var children = _a.children, _b = _a.flowDirection, flowDirection = _b === void 0 ? "vertical" : _b;
18
+ function InputGroup({ children, flowDirection = "vertical", }) {
20
19
  if (isInvalidGroupNesting(children))
21
20
  return React__default["default"].createElement(React__default["default"].Fragment, null);
22
- var className = classnames__default["default"](styles.inputGroup, styles[flowDirection]);
21
+ const className = classnames__default["default"](styles.inputGroup, styles[flowDirection]);
23
22
  return React__default["default"].createElement("div", { className: className }, children);
24
23
  }
25
24
  function isInvalidGroupNesting(childs) {
26
- return React__default["default"].Children.toArray(childs).some(function (child) {
25
+ return React__default["default"].Children.toArray(childs).some(child => {
27
26
  if (child.type === InputGroup &&
28
27
  child.props.flowDirection != "horizontal") {
29
- console.error("ERROR: InputGroup not rendered: nesting 'flowDirection=\"vertical\"' columns not supported.", "https://atlantis.getjobber.com/components/input-group#nested-example");
28
+ console.error(`ERROR: InputGroup not rendered: nesting 'flowDirection="vertical"' columns not supported.`, `https://atlantis.getjobber.com/components/input-group#nested-example`);
30
29
  return true;
31
30
  }
32
31
  return false;
@@ -2,64 +2,64 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var tslib_es6 = require('../tslib.es6-5b50eb8e.js');
6
5
  var React = require('react');
7
- var FormField = require('../FormField-ac310b6f.js');
6
+ var FormField = require('../FormField-79a0a375.js');
7
+ require('../tslib.es6-efe27175.js');
8
8
  require('uuid');
9
9
  require('react-hook-form');
10
10
  require('../style-inject.es-dcee06b6.js');
11
11
  require('classnames');
12
- require('../Button-cd30df0f.js');
12
+ require('../Button-16e043ec.js');
13
13
  require('react-router-dom');
14
- require('../Icon-d5ad1a6d.js');
14
+ require('../Icon-405a216c.js');
15
15
  require('@jobber/design');
16
- require('../Typography-fbe0ed6e.js');
17
- require('../Text-e012fb46.js');
18
- require('../InputValidation-06a8a7ba.js');
16
+ require('../Typography-9262511f.js');
17
+ require('../Text-7ce00adb.js');
18
+ require('../InputValidation-97dd0dcf.js');
19
19
  require('framer-motion');
20
- require('../Spinner-e4e9c8eb.js');
20
+ require('../Spinner-ae4c8a85.js');
21
21
 
22
22
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
23
23
 
24
24
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
25
25
 
26
26
  function InputNumberInternal(props, ref) {
27
- var inputRef = React.createRef();
28
- React.useImperativeHandle(ref, function () { return ({
29
- blur: function () {
30
- var input = inputRef.current;
27
+ const inputRef = React.createRef();
28
+ React.useImperativeHandle(ref, () => ({
29
+ blur: () => {
30
+ const input = inputRef.current;
31
31
  if (input) {
32
32
  input.blur();
33
33
  }
34
34
  },
35
- focus: function () {
36
- var input = inputRef.current;
35
+ focus: () => {
36
+ const input = inputRef.current;
37
37
  if (input) {
38
38
  input.focus();
39
39
  }
40
40
  },
41
- }); });
42
- return (React__default["default"].createElement(FormField.FormField, tslib_es6.__assign({}, props, { type: "number", inputRef: inputRef, onChange: handleChange, validations: tslib_es6.__assign(tslib_es6.__assign({}, props.validations), { validate: getOverLimitMessage }) })));
41
+ }));
42
+ return (React__default["default"].createElement(FormField.FormField, Object.assign({}, props, { type: "number", inputRef: inputRef, onChange: handleChange, validations: Object.assign(Object.assign({}, props.validations), { validate: getOverLimitMessage }) })));
43
43
  function handleChange(newValue) {
44
44
  props.onChange && props.onChange(newValue);
45
45
  }
46
46
  function getOverLimitMessage(value) {
47
- var isOverMax = props.max != undefined && value && value > props.max;
48
- var isUnderMin = props.min != undefined && value && value < props.min;
47
+ const isOverMax = props.max != undefined && value && value > props.max;
48
+ const isUnderMin = props.min != undefined && value && value < props.min;
49
49
  if (isOverMax || isUnderMin || (value && value.toString() === "")) {
50
50
  if (props.min != undefined && props.max === undefined) {
51
- return "Enter a number that is greater than or equal to " + props.min;
51
+ return `Enter a number that is greater than or equal to ${props.min}`;
52
52
  }
53
53
  else if (props.max != undefined && props.min === undefined) {
54
- return "Enter a number that is less than or equal to " + props.max;
54
+ return `Enter a number that is less than or equal to ${props.max}`;
55
55
  }
56
56
  else if (props.min != undefined && props.max != undefined) {
57
- return "Enter a number between " + props.min + " and " + props.max;
57
+ return `Enter a number between ${props.min} and ${props.max}`;
58
58
  }
59
59
  }
60
60
  return true;
61
61
  }
62
62
  }
63
- var InputNumber = React.forwardRef(InputNumberInternal);
63
+ const InputNumber = React.forwardRef(InputNumberInternal);
64
64
 
65
65
  exports.InputNumber = InputNumber;
@@ -2,35 +2,35 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var tslib_es6 = require('../tslib.es6-5b50eb8e.js');
6
5
  var React = require('react');
7
- var FormField = require('../FormField-ac310b6f.js');
6
+ var FormField = require('../FormField-79a0a375.js');
7
+ require('../tslib.es6-efe27175.js');
8
8
  require('uuid');
9
9
  require('react-hook-form');
10
10
  require('../style-inject.es-dcee06b6.js');
11
11
  require('classnames');
12
- require('../Button-cd30df0f.js');
12
+ require('../Button-16e043ec.js');
13
13
  require('react-router-dom');
14
- require('../Icon-d5ad1a6d.js');
14
+ require('../Icon-405a216c.js');
15
15
  require('@jobber/design');
16
- require('../Typography-fbe0ed6e.js');
17
- require('../Text-e012fb46.js');
18
- require('../InputValidation-06a8a7ba.js');
16
+ require('../Typography-9262511f.js');
17
+ require('../Text-7ce00adb.js');
18
+ require('../InputValidation-97dd0dcf.js');
19
19
  require('framer-motion');
20
- require('../Spinner-e4e9c8eb.js');
20
+ require('../Spinner-ae4c8a85.js');
21
21
 
22
22
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
23
23
 
24
24
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
25
25
 
26
26
  function InputPassword(props) {
27
- var _a = props.hasVisibility, hasVisibility = _a === void 0 ? false : _a;
28
- var _b = tslib_es6.__read(React.useState(false), 2), visible = _b[0], setVisibility = _b[1];
29
- return (React__default["default"].createElement(FormField.FormField, tslib_es6.__assign({}, props, (hasVisibility && {
27
+ const { hasVisibility = false } = props;
28
+ const [visible, setVisibility] = React.useState(false);
29
+ return (React__default["default"].createElement(FormField.FormField, Object.assign({}, props, (hasVisibility && {
30
30
  suffix: {
31
31
  ariaLabel: visible ? "Hide password" : "Show password",
32
32
  icon: visible ? "eye" : "eyeCrossed",
33
- onClick: function () { return setVisibility(!visible); },
33
+ onClick: () => setVisibility(!visible),
34
34
  },
35
35
  }), { type: visible ? "text" : "password", onChange: handleChange })));
36
36
  function handleChange(newValue) {
@@ -25,5 +25,5 @@ interface MultilineProps extends BaseProps {
25
25
  */
26
26
  readonly rows?: number | RowRange;
27
27
  }
28
- export declare const InputText: React.ForwardRefExoticComponent<(import("ts-xor/dist/types/Without.type").Without<BaseProps, MultilineProps> & MultilineProps & React.RefAttributes<InputTextRef>) | (import("ts-xor/dist/types/Without.type").Without<MultilineProps, BaseProps> & BaseProps & React.RefAttributes<InputTextRef>)>;
28
+ export declare const InputText: React.ForwardRefExoticComponent<((import("ts-xor/dist/types/Without.type").Without<BaseProps, MultilineProps> & MultilineProps) | (import("ts-xor/dist/types/Without.type").Without<MultilineProps, BaseProps> & BaseProps)) & React.RefAttributes<InputTextRef>>;
29
29
  export {};
@@ -2,23 +2,23 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var InputText = require('../InputText-70f7d947.js');
6
- require('../tslib.es6-5b50eb8e.js');
5
+ var InputText = require('../InputText-95ea24f9.js');
7
6
  require('react');
8
- require('../FormField-ac310b6f.js');
7
+ require('../FormField-79a0a375.js');
8
+ require('../tslib.es6-efe27175.js');
9
9
  require('uuid');
10
10
  require('react-hook-form');
11
11
  require('../style-inject.es-dcee06b6.js');
12
12
  require('classnames');
13
- require('../Button-cd30df0f.js');
13
+ require('../Button-16e043ec.js');
14
14
  require('react-router-dom');
15
- require('../Icon-d5ad1a6d.js');
15
+ require('../Icon-405a216c.js');
16
16
  require('@jobber/design');
17
- require('../Typography-fbe0ed6e.js');
18
- require('../Text-e012fb46.js');
19
- require('../InputValidation-06a8a7ba.js');
17
+ require('../Typography-9262511f.js');
18
+ require('../Text-7ce00adb.js');
19
+ require('../InputValidation-97dd0dcf.js');
20
20
  require('framer-motion');
21
- require('../Spinner-e4e9c8eb.js');
21
+ require('../Spinner-ae4c8a85.js');
22
22
 
23
23
 
24
24
 
@@ -1,35 +1,34 @@
1
1
  'use strict';
2
2
 
3
- var tslib_es6 = require('./tslib.es6-5b50eb8e.js');
4
3
  var React = require('react');
5
- var FormField = require('./FormField-ac310b6f.js');
4
+ var FormField = require('./FormField-79a0a375.js');
6
5
 
7
6
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
7
 
9
8
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
10
9
 
11
10
  function InputTextInternal(props, ref) {
12
- var inputRef = React.createRef();
13
- var actionsRef = React.createRef();
14
- var rowRange = getRowRange();
15
- React.useImperativeHandle(ref, function () { return ({
16
- insert: function (text) {
11
+ const inputRef = React.createRef();
12
+ const actionsRef = React.createRef();
13
+ const rowRange = getRowRange();
14
+ React.useImperativeHandle(ref, () => ({
15
+ insert: (text) => {
17
16
  insertText(text);
18
17
  },
19
- blur: function () {
20
- var input = inputRef.current;
18
+ blur: () => {
19
+ const input = inputRef.current;
21
20
  if (input) {
22
21
  input.blur();
23
22
  }
24
23
  },
25
- focus: function () {
26
- var input = inputRef.current;
24
+ focus: () => {
25
+ const input = inputRef.current;
27
26
  if (input) {
28
27
  input.focus();
29
28
  }
30
29
  },
31
- }); });
32
- return (React__default["default"].createElement(FormField.FormField, tslib_es6.__assign({}, props, { type: props.multiline ? "textarea" : "text", inputRef: inputRef, actionsRef: actionsRef, onChange: handleChange, rows: rowRange.min })));
30
+ }));
31
+ return (React__default["default"].createElement(FormField.FormField, Object.assign({}, props, { type: props.multiline ? "textarea" : "text", inputRef: inputRef, actionsRef: actionsRef, onChange: handleChange, rows: rowRange.min })));
33
32
  function handleChange(newValue) {
34
33
  props.onChange && props.onChange(newValue);
35
34
  if (inputRef && inputRef.current instanceof HTMLTextAreaElement) {
@@ -54,35 +53,35 @@ function InputTextInternal(props, ref) {
54
53
  textArea.style.height = textAreaHeight(textArea) + "px";
55
54
  }
56
55
  function textAreaHeight(textArea) {
57
- var _a = window.getComputedStyle(textArea), lineHeight = _a.lineHeight, borderBottomWidth = _a.borderBottomWidth, borderTopWidth = _a.borderTopWidth, paddingBottom = _a.paddingBottom, paddingTop = _a.paddingTop;
58
- var maxHeight = rowRange.max * parseFloat(lineHeight) +
56
+ const { lineHeight, borderBottomWidth, borderTopWidth, paddingBottom, paddingTop, } = window.getComputedStyle(textArea);
57
+ const maxHeight = rowRange.max * parseFloat(lineHeight) +
59
58
  parseFloat(borderTopWidth) +
60
59
  parseFloat(borderBottomWidth) +
61
60
  parseFloat(paddingTop) +
62
61
  parseFloat(paddingBottom);
63
- var scrollHeight = textArea.scrollHeight +
62
+ const scrollHeight = textArea.scrollHeight +
64
63
  parseFloat(borderTopWidth) +
65
64
  parseFloat(borderBottomWidth);
66
65
  return Math.min(scrollHeight, maxHeight);
67
66
  }
68
67
  function insertText(text) {
69
68
  var _a;
70
- var input = inputRef.current;
69
+ const input = inputRef.current;
71
70
  if (input) {
72
71
  insertAtCursor(input, text);
73
- var newValue = input.value;
72
+ const newValue = input.value;
74
73
  (_a = actionsRef.current) === null || _a === void 0 ? void 0 : _a.setValue(newValue);
75
74
  props.onChange && props.onChange(newValue);
76
75
  }
77
76
  }
78
77
  }
79
- var InputText = React.forwardRef(InputTextInternal);
78
+ const InputText = React.forwardRef(InputTextInternal);
80
79
  function insertAtCursor(input, newText) {
81
- var start = input.selectionStart || 0;
82
- var end = input.selectionEnd || 0;
83
- var text = input.value;
84
- var before = text.substring(0, start);
85
- var after = text.substring(end, text.length);
80
+ const start = input.selectionStart || 0;
81
+ const end = input.selectionEnd || 0;
82
+ const text = input.value;
83
+ const before = text.substring(0, start);
84
+ const after = text.substring(end, text.length);
86
85
  input.value = before + newText + after;
87
86
  input.selectionStart = input.selectionEnd = start + newText.length;
88
87
  input.focus();
@@ -2,24 +2,24 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var tslib_es6 = require('../tslib.es6-5b50eb8e.js');
5
+ var tslib_es6 = require('../tslib.es6-efe27175.js');
6
6
  var React = require('react');
7
7
  var debounce = require('lodash/debounce');
8
8
  var temporal = require('@std-proposal/temporal');
9
- var FormField = require('../FormField-ac310b6f.js');
9
+ var FormField = require('../FormField-79a0a375.js');
10
10
  require('uuid');
11
11
  require('react-hook-form');
12
12
  require('../style-inject.es-dcee06b6.js');
13
13
  require('classnames');
14
- require('../Button-cd30df0f.js');
14
+ require('../Button-16e043ec.js');
15
15
  require('react-router-dom');
16
- require('../Icon-d5ad1a6d.js');
16
+ require('../Icon-405a216c.js');
17
17
  require('@jobber/design');
18
- require('../Typography-fbe0ed6e.js');
19
- require('../Text-e012fb46.js');
20
- require('../InputValidation-06a8a7ba.js');
18
+ require('../Typography-9262511f.js');
19
+ require('../Text-7ce00adb.js');
20
+ require('../InputValidation-97dd0dcf.js');
21
21
  require('framer-motion');
22
- require('../Spinner-e4e9c8eb.js');
22
+ require('../Spinner-ae4c8a85.js');
23
23
 
24
24
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
25
25
 
@@ -884,7 +884,7 @@ function civilTimeToHTMLTime(civilTime) {
884
884
  if (civilTime == undefined) {
885
885
  return "";
886
886
  }
887
- var timeString = civilTime.toString();
887
+ const timeString = civilTime.toString();
888
888
  return timeString.slice(0, 5);
889
889
  }
890
890
  function htmlTimeToCivilTime(timeString) {
@@ -897,13 +897,13 @@ function htmlTimeToCivilTime(timeString) {
897
897
  }
898
898
 
899
899
  function InputTimeSafari(_a) {
900
- var defaultValue = _a.defaultValue, value = _a.value, onChange = _a.onChange, params = tslib_es6.__rest(_a, ["defaultValue", "value", "onChange"]);
901
- var inputTime = React__default["default"].createRef();
902
- var debouncedHandleChange = debounce__default["default"](handleChange, 1000);
903
- var changeHandler = generateEventHandler(debouncedHandleChange);
904
- var blurHandler = generateEventHandler(handleChange);
905
- React.useLayoutEffect(function () {
906
- var input = inputTime.current;
900
+ var { defaultValue, value, onChange } = _a, params = tslib_es6.__rest(_a, ["defaultValue", "value", "onChange"]);
901
+ const inputTime = React__default["default"].createRef();
902
+ const debouncedHandleChange = debounce__default["default"](handleChange, 1000);
903
+ const changeHandler = generateEventHandler(debouncedHandleChange);
904
+ const blurHandler = generateEventHandler(handleChange);
905
+ React.useLayoutEffect(() => {
906
+ const input = inputTime.current;
907
907
  new TimePolyfill(input);
908
908
  if (value) {
909
909
  input.value = civilTimeToHTMLTime(value);
@@ -915,13 +915,13 @@ function InputTimeSafari(_a) {
915
915
  }
916
916
  input.addEventListener("change", changeHandler);
917
917
  input.addEventListener("blur", blurHandler);
918
- return function () {
918
+ return () => {
919
919
  window.removeEventListener("change", changeHandler);
920
920
  window.removeEventListener("blur", blurHandler);
921
921
  };
922
922
  }, []);
923
- React.useLayoutEffect(function () {
924
- var input = inputTime.current;
923
+ React.useLayoutEffect(() => {
924
+ const input = inputTime.current;
925
925
  if (value) {
926
926
  input.value = civilTimeToHTMLTime(value);
927
927
  input.polyfill.update();
@@ -931,13 +931,13 @@ function InputTimeSafari(_a) {
931
931
  input.polyfill.update();
932
932
  }
933
933
  }, [value, defaultValue]);
934
- return React__default["default"].createElement(FormField.FormField, tslib_es6.__assign({ inputRef: inputTime, type: "time" }, params));
934
+ return React__default["default"].createElement(FormField.FormField, Object.assign({ inputRef: inputTime, type: "time" }, params));
935
935
  function handleChange(newValue) {
936
936
  onChange && onChange(htmlTimeToCivilTime(newValue));
937
937
  }
938
938
  function generateEventHandler(handler) {
939
- return function (event) {
940
- var newValue = event.currentTarget.dataset.value;
939
+ return (event) => {
940
+ const newValue = event.currentTarget.dataset.value;
941
941
  if (newValue != undefined) {
942
942
  handler(newValue);
943
943
  }
@@ -946,16 +946,16 @@ function InputTimeSafari(_a) {
946
946
  }
947
947
 
948
948
  function InputTime(_a) {
949
- var defaultValue = _a.defaultValue, value = _a.value, onChange = _a.onChange, params = tslib_es6.__rest(_a, ["defaultValue", "value", "onChange"]);
950
- var handleChange = function (newValue) {
949
+ var { defaultValue, value, onChange } = _a, params = tslib_es6.__rest(_a, ["defaultValue", "value", "onChange"]);
950
+ const handleChange = (newValue) => {
951
951
  onChange && onChange(htmlTimeToCivilTime(newValue));
952
952
  };
953
953
  if (supportsTime) {
954
- var fieldProps = tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign({ onChange: handleChange }, (defaultValue && { defaultValue: civilTimeToHTMLTime(defaultValue) })), (!defaultValue && { value: civilTimeToHTMLTime(value) })), params);
955
- return React__default["default"].createElement(FormField.FormField, tslib_es6.__assign({ type: "time" }, fieldProps));
954
+ const fieldProps = Object.assign(Object.assign(Object.assign({ onChange: handleChange }, (defaultValue && { defaultValue: civilTimeToHTMLTime(defaultValue) })), (!defaultValue && { value: civilTimeToHTMLTime(value) })), params);
955
+ return React__default["default"].createElement(FormField.FormField, Object.assign({ type: "time" }, fieldProps));
956
956
  }
957
957
  else {
958
- return (React__default["default"].createElement(InputTimeSafari, tslib_es6.__assign({ defaultValue: defaultValue, value: value, onChange: onChange }, params)));
958
+ return (React__default["default"].createElement(InputTimeSafari, Object.assign({ defaultValue: defaultValue, value: value, onChange: onChange }, params)));
959
959
  }
960
960
  }
961
961