@jobber/components 6.105.2 → 6.105.3
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.
- package/dist/Autocomplete/index.mjs +1 -1
- package/dist/FormField-cjs.js +28 -27
- package/dist/FormField-es.js +28 -28
- package/dist/InputEmail/index.cjs +2 -13
- package/dist/InputEmail/index.mjs +3 -14
- package/dist/InputPhoneNumber/index.cjs +1 -12
- package/dist/InputPhoneNumber/index.mjs +2 -13
- package/dist/InputText/index.cjs +2 -14
- package/dist/InputText/index.mjs +3 -15
- package/dist/InputTime/index.cjs +1 -2
- package/dist/InputTime/index.mjs +2 -3
- package/dist/Select/index.cjs +1 -2
- package/dist/Select/index.mjs +2 -3
- package/package.json +2 -2
|
@@ -10,7 +10,7 @@ import { T as Typography } from '../Typography-es.js';
|
|
|
10
10
|
import { I as Icon } from '../Icon-es.js';
|
|
11
11
|
import { InputText } from '../InputText/index.mjs';
|
|
12
12
|
import { G as Glimmer } from '../Glimmer-es.js';
|
|
13
|
-
import {
|
|
13
|
+
import { n as mergeRefs } from '../FormField-es.js';
|
|
14
14
|
import { f as filterDataAttributes } from '../filterDataAttributes-es.js';
|
|
15
15
|
import { _ as __rest, a as __awaiter } from '../tslib.es6-es.js';
|
|
16
16
|
import 'react/jsx-runtime';
|
package/dist/FormField-cjs.js
CHANGED
|
@@ -14,22 +14,22 @@ var Spinner = require('./Spinner-cjs.js');
|
|
|
14
14
|
var tslib_es6 = require('./tslib.es6-cjs.js');
|
|
15
15
|
var reactHookForm = require('react-hook-form');
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var formFieldStyles = {"container":"YL-mNv-Bl6g-","wrapper":"_8lhbGTQ-hhg-","disabled":"Tz9LK9ABKMk-","horizontalWrapper":"b5mv1x1H7YE-","textarea":"hGr6YW4AeLM-","safari":"QBCWi9GBgMs-","timeInputLabel":"_0pmqVa2zSE4-","miniLabel":"F1t76G6bDKo-","large":"_9tjyT9QUtP8-","text":"QmMiyoAWp-g-","invalid":"XWDSfe6weSY-","small":"Sw5O4I0lMJg-","inline":"SaORbL7SYWY-","center":"ozy2UoT2vsg-","right":"_3TJdT91YD3c-","maxLength":"W6GrMqLy2qk-","inputWrapper":"-LmjnYRU0r0-","childrenWrapper":"yVXYv6hkuOA-","input":"vtSDcuzNr9Q-","emptyPhoneNumber":"MVhuQuzUBUs-","label":"Dgk00tzlODA-","select":"NwQGiWBWIsc-","externalLabel":"Qb8zQ8n-8vc-","postfix":"yTDzs9h1otI-","affixIcon":"m0YpdssD2dY-","suffix":"_-3mMnjSh6ok-","affixLabel":"-Wzcb0pBh5I-","description":"DHX5ijY3xIw-","toolbar":"AL-2brNI7dk-","spinning":"_8Rzv7CcDW80-"};
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* @internal Reach out to UX Foundations if using this component since it is possible it might change
|
|
21
21
|
*/
|
|
22
22
|
function AffixLabel({ label, variation = "prefix", labelRef, }) {
|
|
23
|
-
const affixLabelClass = classnames(
|
|
24
|
-
[
|
|
23
|
+
const affixLabelClass = classnames(formFieldStyles.affixLabel, {
|
|
24
|
+
[formFieldStyles.suffix]: variation === "suffix",
|
|
25
25
|
});
|
|
26
26
|
if (!label)
|
|
27
27
|
return null;
|
|
28
28
|
return (React.createElement("div", { ref: labelRef, className: affixLabelClass }, label));
|
|
29
29
|
}
|
|
30
30
|
function AffixIcon({ icon, onClick, ariaLabel, variation = "prefix", size, }) {
|
|
31
|
-
const affixIconClass = classnames(
|
|
32
|
-
[
|
|
31
|
+
const affixIconClass = classnames(formFieldStyles.affixIcon, {
|
|
32
|
+
[formFieldStyles.suffix]: variation === "suffix",
|
|
33
33
|
});
|
|
34
34
|
const iconSize = size === "small" ? "small" : "base";
|
|
35
35
|
if (!icon)
|
|
@@ -51,7 +51,7 @@ function FormFieldDescription({ id, description, visible = true, }) {
|
|
|
51
51
|
if (!visible)
|
|
52
52
|
return null;
|
|
53
53
|
const useStringFormat = !description || typeof description === "string";
|
|
54
|
-
return (React.createElement("div", { id: id, className:
|
|
54
|
+
return (React.createElement("div", { id: id, className: formFieldStyles.description }, useStringFormat ? (React.createElement(Text.Text, { size: "small", variation: "subdued" }, description)) : (description)));
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
var styles = {"clearInput":"YmRTd-KeXv4-","spinning":"B25z9B8I3gs-"};
|
|
@@ -86,22 +86,22 @@ function useIsSafari() {
|
|
|
86
86
|
*/
|
|
87
87
|
function useFormFieldWrapperStyles({ size, align, placeholder, value, invalid, error, max, prefixRef, suffixRef, maxLength, type, disabled, inline, showMiniLabel = true, }) {
|
|
88
88
|
const isSafari = useIsSafari();
|
|
89
|
-
const wrapperClasses = classnames(
|
|
90
|
-
[
|
|
89
|
+
const wrapperClasses = classnames(formFieldStyles.wrapper, size && formFieldStyles[size], align && formFieldStyles[align], {
|
|
90
|
+
[formFieldStyles.miniLabel]: (showMiniLabel && placeholder && value !== "") ||
|
|
91
91
|
(placeholder && type === "select") ||
|
|
92
92
|
// Naively assume that if the the type is tel, it is the InputPhoneNumber
|
|
93
93
|
(placeholder && type === "tel"),
|
|
94
|
-
[
|
|
95
|
-
[
|
|
96
|
-
[
|
|
97
|
-
[
|
|
98
|
-
[
|
|
99
|
-
[
|
|
100
|
-
[
|
|
101
|
-
[
|
|
94
|
+
[formFieldStyles.text]: type === "textarea" || type === "text",
|
|
95
|
+
[formFieldStyles.textarea]: type === "textarea",
|
|
96
|
+
[formFieldStyles.safari]: isSafari && type === "textarea",
|
|
97
|
+
[formFieldStyles.select]: type === "select",
|
|
98
|
+
[formFieldStyles.invalid]: invalid !== null && invalid !== void 0 ? invalid : error,
|
|
99
|
+
[formFieldStyles.disabled]: disabled,
|
|
100
|
+
[formFieldStyles.maxLength]: maxLength,
|
|
101
|
+
[formFieldStyles.timeInputLabel]: placeholder && type === "time" && placeholder && value === "",
|
|
102
102
|
});
|
|
103
|
-
const containerClasses = classnames(
|
|
104
|
-
[
|
|
103
|
+
const containerClasses = classnames(formFieldStyles.container, {
|
|
104
|
+
[formFieldStyles.inline]: inline,
|
|
105
105
|
});
|
|
106
106
|
const wrapperInlineStyle = {
|
|
107
107
|
["--formField-maxLength"]: maxLength || max,
|
|
@@ -120,7 +120,7 @@ function useFormFieldWrapperStyles({ size, align, placeholder, value, invalid, e
|
|
|
120
120
|
}));
|
|
121
121
|
}, [value]);
|
|
122
122
|
return {
|
|
123
|
-
inputStyle:
|
|
123
|
+
inputStyle: formFieldStyles.input,
|
|
124
124
|
wrapperClasses,
|
|
125
125
|
containerClasses,
|
|
126
126
|
wrapperInlineStyle,
|
|
@@ -203,24 +203,24 @@ function FormFieldWrapper({ align, description, descriptionIdentifier, placehold
|
|
|
203
203
|
* @internal Reach out to UX Foundations if using this component since it is possible it might change
|
|
204
204
|
*/
|
|
205
205
|
function FormFieldInputHorizontalWrapper({ children, }) {
|
|
206
|
-
return React.createElement("div", { className:
|
|
206
|
+
return React.createElement("div", { className: formFieldStyles.horizontalWrapper }, children);
|
|
207
207
|
}
|
|
208
208
|
/**
|
|
209
209
|
* @internal Reach out to UX Foundations if using this component since it is possible it might change
|
|
210
210
|
*/
|
|
211
211
|
function FormFieldInputWrapperStyles({ children, }) {
|
|
212
|
-
return React.createElement("div", { className:
|
|
212
|
+
return React.createElement("div", { className: formFieldStyles.inputWrapper }, children);
|
|
213
213
|
}
|
|
214
214
|
/**
|
|
215
215
|
* @internal Reach out to UX Foundations if using this component since it is possible it might change
|
|
216
216
|
*/
|
|
217
217
|
function FormFieldWrapperMain({ children, tabIndex = -1, }) {
|
|
218
|
-
return (React.createElement("div", { className:
|
|
218
|
+
return (React.createElement("div", { className: formFieldStyles.childrenWrapper, tabIndex: tabIndex }, children));
|
|
219
219
|
}
|
|
220
220
|
function FormFieldLabel({ children, htmlFor, style, external = false, }) {
|
|
221
221
|
if (!children)
|
|
222
222
|
return null;
|
|
223
|
-
return (React.createElement("label", { className: external ?
|
|
223
|
+
return (React.createElement("label", { className: external ? formFieldStyles.externalLabel : formFieldStyles.label, htmlFor: htmlFor, style: style }, children));
|
|
224
224
|
}
|
|
225
225
|
/**
|
|
226
226
|
* @internal Reach out to UX Foundations if using this component since it is possible it might change
|
|
@@ -230,13 +230,13 @@ function FormFieldWrapperToolbar({ toolbar, isToolbarVisible, toolbarAnimationEn
|
|
|
230
230
|
duration: design.tokens["timing-base"] / 1000,
|
|
231
231
|
ease: "easeInOut",
|
|
232
232
|
}, tabIndex: -1 },
|
|
233
|
-
React.createElement("div", { className:
|
|
233
|
+
React.createElement("div", { className: formFieldStyles.toolbar, "data-testid": "ATL-InputText-Toolbar" }, toolbar)))));
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
function FormFieldPostFix({ variation, visible = true, className, }) {
|
|
237
237
|
if (!visible)
|
|
238
238
|
return null;
|
|
239
|
-
return (React.createElement("span", { className: classnames(
|
|
239
|
+
return (React.createElement("span", { className: classnames(formFieldStyles.postfix, className) }, variation === "select" ? (React.createElement(Icon.Icon, { name: "arrowDown" })) : (React.createElement(Spinner.Spinner, { size: "small" }))));
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
/**
|
|
@@ -299,8 +299,8 @@ function useAtlantisFormFieldActions({ name, onChange, inputRef, onControllerCha
|
|
|
299
299
|
*/
|
|
300
300
|
function useAtlantisFormField({ id, nameProp, name, useControllerField: useControllerField, description, disabled, readonly, keyboard, autofocus, pattern, type, value, handleChange, handleBlur, handleFocus, inline, validations, handleKeyDown, handleValidation, errorMessage, }) {
|
|
301
301
|
const descriptionIdentifier = `descriptionUUID--${id}`;
|
|
302
|
-
const fieldProps = Object.assign(Object.assign(Object.assign({}, useControllerField), { id, className: classnames(
|
|
303
|
-
[
|
|
302
|
+
const fieldProps = Object.assign(Object.assign(Object.assign({}, useControllerField), { id, className: classnames(formFieldStyles.input, {
|
|
303
|
+
[formFieldStyles.emptyPhoneNumber]: shouldAddPhoneNumberClass(type, value, pattern),
|
|
304
304
|
}), name: (validations || nameProp) && name, disabled: disabled, readOnly: readonly, inputMode: keyboard, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, autoFocus: autofocus }), (description &&
|
|
305
305
|
!inline && { "aria-describedby": descriptionIdentifier }));
|
|
306
306
|
const textFieldProps = Object.assign(Object.assign({}, fieldProps), { autoFocus: autofocus, onKeyDown: handleKeyDown });
|
|
@@ -470,6 +470,7 @@ exports.FormFieldPostFix = FormFieldPostFix;
|
|
|
470
470
|
exports.FormFieldWrapper = FormFieldWrapper;
|
|
471
471
|
exports.FormFieldWrapperMain = FormFieldWrapperMain;
|
|
472
472
|
exports.FormFieldWrapperToolbar = FormFieldWrapperToolbar;
|
|
473
|
+
exports.formFieldStyles = formFieldStyles;
|
|
473
474
|
exports.mergeRefs = mergeRefs;
|
|
474
475
|
exports.useAtlantisFormField = useAtlantisFormField;
|
|
475
476
|
exports.useAtlantisFormFieldActions = useAtlantisFormFieldActions;
|
package/dist/FormField-es.js
CHANGED
|
@@ -12,22 +12,22 @@ import { S as Spinner } from './Spinner-es.js';
|
|
|
12
12
|
import { _ as __rest } from './tslib.es6-es.js';
|
|
13
13
|
import { useFormContext, useForm, useController } from 'react-hook-form';
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var formFieldStyles = {"container":"YL-mNv-Bl6g-","wrapper":"_8lhbGTQ-hhg-","disabled":"Tz9LK9ABKMk-","horizontalWrapper":"b5mv1x1H7YE-","textarea":"hGr6YW4AeLM-","safari":"QBCWi9GBgMs-","timeInputLabel":"_0pmqVa2zSE4-","miniLabel":"F1t76G6bDKo-","large":"_9tjyT9QUtP8-","text":"QmMiyoAWp-g-","invalid":"XWDSfe6weSY-","small":"Sw5O4I0lMJg-","inline":"SaORbL7SYWY-","center":"ozy2UoT2vsg-","right":"_3TJdT91YD3c-","maxLength":"W6GrMqLy2qk-","inputWrapper":"-LmjnYRU0r0-","childrenWrapper":"yVXYv6hkuOA-","input":"vtSDcuzNr9Q-","emptyPhoneNumber":"MVhuQuzUBUs-","label":"Dgk00tzlODA-","select":"NwQGiWBWIsc-","externalLabel":"Qb8zQ8n-8vc-","postfix":"yTDzs9h1otI-","affixIcon":"m0YpdssD2dY-","suffix":"_-3mMnjSh6ok-","affixLabel":"-Wzcb0pBh5I-","description":"DHX5ijY3xIw-","toolbar":"AL-2brNI7dk-","spinning":"_8Rzv7CcDW80-"};
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @internal Reach out to UX Foundations if using this component since it is possible it might change
|
|
19
19
|
*/
|
|
20
20
|
function AffixLabel({ label, variation = "prefix", labelRef, }) {
|
|
21
|
-
const affixLabelClass = classnames(
|
|
22
|
-
[
|
|
21
|
+
const affixLabelClass = classnames(formFieldStyles.affixLabel, {
|
|
22
|
+
[formFieldStyles.suffix]: variation === "suffix",
|
|
23
23
|
});
|
|
24
24
|
if (!label)
|
|
25
25
|
return null;
|
|
26
26
|
return (React__default.createElement("div", { ref: labelRef, className: affixLabelClass }, label));
|
|
27
27
|
}
|
|
28
28
|
function AffixIcon({ icon, onClick, ariaLabel, variation = "prefix", size, }) {
|
|
29
|
-
const affixIconClass = classnames(
|
|
30
|
-
[
|
|
29
|
+
const affixIconClass = classnames(formFieldStyles.affixIcon, {
|
|
30
|
+
[formFieldStyles.suffix]: variation === "suffix",
|
|
31
31
|
});
|
|
32
32
|
const iconSize = size === "small" ? "small" : "base";
|
|
33
33
|
if (!icon)
|
|
@@ -49,7 +49,7 @@ function FormFieldDescription({ id, description, visible = true, }) {
|
|
|
49
49
|
if (!visible)
|
|
50
50
|
return null;
|
|
51
51
|
const useStringFormat = !description || typeof description === "string";
|
|
52
|
-
return (React__default.createElement("div", { id: id, className:
|
|
52
|
+
return (React__default.createElement("div", { id: id, className: formFieldStyles.description }, useStringFormat ? (React__default.createElement(Text, { size: "small", variation: "subdued" }, description)) : (description)));
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
var styles = {"clearInput":"YmRTd-KeXv4-","spinning":"B25z9B8I3gs-"};
|
|
@@ -84,22 +84,22 @@ function useIsSafari() {
|
|
|
84
84
|
*/
|
|
85
85
|
function useFormFieldWrapperStyles({ size, align, placeholder, value, invalid, error, max, prefixRef, suffixRef, maxLength, type, disabled, inline, showMiniLabel = true, }) {
|
|
86
86
|
const isSafari = useIsSafari();
|
|
87
|
-
const wrapperClasses = classnames(
|
|
88
|
-
[
|
|
87
|
+
const wrapperClasses = classnames(formFieldStyles.wrapper, size && formFieldStyles[size], align && formFieldStyles[align], {
|
|
88
|
+
[formFieldStyles.miniLabel]: (showMiniLabel && placeholder && value !== "") ||
|
|
89
89
|
(placeholder && type === "select") ||
|
|
90
90
|
// Naively assume that if the the type is tel, it is the InputPhoneNumber
|
|
91
91
|
(placeholder && type === "tel"),
|
|
92
|
-
[
|
|
93
|
-
[
|
|
94
|
-
[
|
|
95
|
-
[
|
|
96
|
-
[
|
|
97
|
-
[
|
|
98
|
-
[
|
|
99
|
-
[
|
|
92
|
+
[formFieldStyles.text]: type === "textarea" || type === "text",
|
|
93
|
+
[formFieldStyles.textarea]: type === "textarea",
|
|
94
|
+
[formFieldStyles.safari]: isSafari && type === "textarea",
|
|
95
|
+
[formFieldStyles.select]: type === "select",
|
|
96
|
+
[formFieldStyles.invalid]: invalid !== null && invalid !== void 0 ? invalid : error,
|
|
97
|
+
[formFieldStyles.disabled]: disabled,
|
|
98
|
+
[formFieldStyles.maxLength]: maxLength,
|
|
99
|
+
[formFieldStyles.timeInputLabel]: placeholder && type === "time" && placeholder && value === "",
|
|
100
100
|
});
|
|
101
|
-
const containerClasses = classnames(
|
|
102
|
-
[
|
|
101
|
+
const containerClasses = classnames(formFieldStyles.container, {
|
|
102
|
+
[formFieldStyles.inline]: inline,
|
|
103
103
|
});
|
|
104
104
|
const wrapperInlineStyle = {
|
|
105
105
|
["--formField-maxLength"]: maxLength || max,
|
|
@@ -118,7 +118,7 @@ function useFormFieldWrapperStyles({ size, align, placeholder, value, invalid, e
|
|
|
118
118
|
}));
|
|
119
119
|
}, [value]);
|
|
120
120
|
return {
|
|
121
|
-
inputStyle:
|
|
121
|
+
inputStyle: formFieldStyles.input,
|
|
122
122
|
wrapperClasses,
|
|
123
123
|
containerClasses,
|
|
124
124
|
wrapperInlineStyle,
|
|
@@ -201,24 +201,24 @@ function FormFieldWrapper({ align, description, descriptionIdentifier, placehold
|
|
|
201
201
|
* @internal Reach out to UX Foundations if using this component since it is possible it might change
|
|
202
202
|
*/
|
|
203
203
|
function FormFieldInputHorizontalWrapper({ children, }) {
|
|
204
|
-
return React__default.createElement("div", { className:
|
|
204
|
+
return React__default.createElement("div", { className: formFieldStyles.horizontalWrapper }, children);
|
|
205
205
|
}
|
|
206
206
|
/**
|
|
207
207
|
* @internal Reach out to UX Foundations if using this component since it is possible it might change
|
|
208
208
|
*/
|
|
209
209
|
function FormFieldInputWrapperStyles({ children, }) {
|
|
210
|
-
return React__default.createElement("div", { className:
|
|
210
|
+
return React__default.createElement("div", { className: formFieldStyles.inputWrapper }, children);
|
|
211
211
|
}
|
|
212
212
|
/**
|
|
213
213
|
* @internal Reach out to UX Foundations if using this component since it is possible it might change
|
|
214
214
|
*/
|
|
215
215
|
function FormFieldWrapperMain({ children, tabIndex = -1, }) {
|
|
216
|
-
return (React__default.createElement("div", { className:
|
|
216
|
+
return (React__default.createElement("div", { className: formFieldStyles.childrenWrapper, tabIndex: tabIndex }, children));
|
|
217
217
|
}
|
|
218
218
|
function FormFieldLabel({ children, htmlFor, style, external = false, }) {
|
|
219
219
|
if (!children)
|
|
220
220
|
return null;
|
|
221
|
-
return (React__default.createElement("label", { className: external ?
|
|
221
|
+
return (React__default.createElement("label", { className: external ? formFieldStyles.externalLabel : formFieldStyles.label, htmlFor: htmlFor, style: style }, children));
|
|
222
222
|
}
|
|
223
223
|
/**
|
|
224
224
|
* @internal Reach out to UX Foundations if using this component since it is possible it might change
|
|
@@ -228,13 +228,13 @@ function FormFieldWrapperToolbar({ toolbar, isToolbarVisible, toolbarAnimationEn
|
|
|
228
228
|
duration: tokens["timing-base"] / 1000,
|
|
229
229
|
ease: "easeInOut",
|
|
230
230
|
}, tabIndex: -1 },
|
|
231
|
-
React__default.createElement("div", { className:
|
|
231
|
+
React__default.createElement("div", { className: formFieldStyles.toolbar, "data-testid": "ATL-InputText-Toolbar" }, toolbar)))));
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
function FormFieldPostFix({ variation, visible = true, className, }) {
|
|
235
235
|
if (!visible)
|
|
236
236
|
return null;
|
|
237
|
-
return (React__default.createElement("span", { className: classnames(
|
|
237
|
+
return (React__default.createElement("span", { className: classnames(formFieldStyles.postfix, className) }, variation === "select" ? (React__default.createElement(Icon, { name: "arrowDown" })) : (React__default.createElement(Spinner, { size: "small" }))));
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
/**
|
|
@@ -297,8 +297,8 @@ function useAtlantisFormFieldActions({ name, onChange, inputRef, onControllerCha
|
|
|
297
297
|
*/
|
|
298
298
|
function useAtlantisFormField({ id, nameProp, name, useControllerField: useControllerField, description, disabled, readonly, keyboard, autofocus, pattern, type, value, handleChange, handleBlur, handleFocus, inline, validations, handleKeyDown, handleValidation, errorMessage, }) {
|
|
299
299
|
const descriptionIdentifier = `descriptionUUID--${id}`;
|
|
300
|
-
const fieldProps = Object.assign(Object.assign(Object.assign({}, useControllerField), { id, className: classnames(
|
|
301
|
-
[
|
|
300
|
+
const fieldProps = Object.assign(Object.assign(Object.assign({}, useControllerField), { id, className: classnames(formFieldStyles.input, {
|
|
301
|
+
[formFieldStyles.emptyPhoneNumber]: shouldAddPhoneNumberClass(type, value, pattern),
|
|
302
302
|
}), name: (validations || nameProp) && name, disabled: disabled, readOnly: readonly, inputMode: keyboard, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, autoFocus: autofocus }), (description &&
|
|
303
303
|
!inline && { "aria-describedby": descriptionIdentifier }));
|
|
304
304
|
const textFieldProps = Object.assign(Object.assign({}, fieldProps), { autoFocus: autofocus, onKeyDown: handleKeyDown });
|
|
@@ -458,4 +458,4 @@ function setAutocomplete(autocompleteSetting) {
|
|
|
458
458
|
return autocompleteSetting;
|
|
459
459
|
}
|
|
460
460
|
|
|
461
|
-
export { AffixIcon as A, FormFieldInputHorizontalWrapper as F, useAtlantisFormFieldActions as a, useAtlantisFormFieldName as b, useAtlantisReactHookForm as c, FormFieldInputWrapperStyles as d, FormFieldLabel as e, FormFieldWrapper as f, FormFieldWrapperMain as g, FormFieldWrapperToolbar as h, AffixLabel as i, useFormFieldWrapperStyles as j, FormField as k,
|
|
461
|
+
export { AffixIcon as A, FormFieldInputHorizontalWrapper as F, useAtlantisFormFieldActions as a, useAtlantisFormFieldName as b, useAtlantisReactHookForm as c, FormFieldInputWrapperStyles as d, FormFieldLabel as e, FormFieldWrapper as f, FormFieldWrapperMain as g, FormFieldWrapperToolbar as h, AffixLabel as i, useFormFieldWrapperStyles as j, FormField as k, formFieldStyles as l, FormFieldPostFix as m, mergeRefs as n, useAtlantisFormField as u };
|
|
@@ -101,17 +101,6 @@ const InputEmailRebuilt = React.forwardRef(function InputEmailInternal(props, re
|
|
|
101
101
|
const id = props.id || generatedId;
|
|
102
102
|
const inputRef = (_a = ref) !== null && _a !== void 0 ? _a : React.useRef(null);
|
|
103
103
|
const wrapperRef = React.useRef(null);
|
|
104
|
-
const { inputStyle } = FormField.useFormFieldWrapperStyles({
|
|
105
|
-
size: props.size,
|
|
106
|
-
inline: props.inline,
|
|
107
|
-
align: props.align,
|
|
108
|
-
type: "email",
|
|
109
|
-
value: props.value,
|
|
110
|
-
invalid: props.invalid,
|
|
111
|
-
error: props.error,
|
|
112
|
-
disabled: props.disabled,
|
|
113
|
-
placeholder: props.placeholder,
|
|
114
|
-
});
|
|
115
104
|
const { name } = FormField.useAtlantisFormFieldName({
|
|
116
105
|
nameProp: props.name,
|
|
117
106
|
id,
|
|
@@ -134,8 +123,8 @@ const InputEmailRebuilt = React.forwardRef(function InputEmailInternal(props, re
|
|
|
134
123
|
const descriptionVisible = props.description && !props.inline;
|
|
135
124
|
const isInvalid = Boolean(props.error || props.invalid);
|
|
136
125
|
const dataAttrs = filterDataAttributes.filterDataAttributes(props);
|
|
137
|
-
return (React.createElement(FormField.FormFieldWrapper, { error: props.error || "", invalid: props.invalid, identifier: id, descriptionIdentifier: descriptionIdentifier, size: props.size, inline: props.inline, align: props.align, prefix: props.prefix, suffix: props.suffix, description: props.description, clearable: (_b = props.clearable) !== null && _b !== void 0 ? _b : "never", onClear: handleClear, wrapperRef: wrapperRef, disabled: props.disabled, type: "email", value: props.value, placeholder: props.placeholder, name: name },
|
|
138
|
-
React.createElement("input", Object.assign({ id: id, name: name, type: "email", ref: inputRef, className:
|
|
126
|
+
return (React.createElement(FormField.FormFieldWrapper, { error: props.error || "", invalid: props.invalid, identifier: id, descriptionIdentifier: descriptionIdentifier, size: props.size, inline: props.inline, align: props.align, prefix: props.prefix, suffix: props.suffix, description: props.description, clearable: (_b = props.clearable) !== null && _b !== void 0 ? _b : "never", onClear: handleClear, readonly: props.readOnly, wrapperRef: wrapperRef, disabled: props.disabled, type: "email", value: props.value, placeholder: props.placeholder, name: name },
|
|
127
|
+
React.createElement("input", Object.assign({ id: id, name: name, type: "email", ref: inputRef, className: FormField.formFieldStyles.input, value: props.value, disabled: props.disabled, readOnly: props.readOnly, autoFocus: props.autoFocus, autoComplete: props.autoComplete, pattern: props.pattern, inputMode: props.inputMode, tabIndex: props.tabIndex, role: props.role, "aria-label": props["aria-label"], "aria-describedby": descriptionVisible ? descriptionIdentifier : props["aria-describedby"], "aria-invalid": isInvalid ? true : undefined, "aria-controls": props["aria-controls"], "aria-expanded": props["aria-expanded"], "aria-activedescendant": props["aria-activedescendant"], "aria-autocomplete": props["aria-autocomplete"], "aria-required": props["aria-required"], onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onClick: handleClick, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, onPointerDown: handlePointerDown, onPointerUp: handlePointerUp, "data-testid": "ATL-InputEmail-input" }, dataAttrs)),
|
|
139
128
|
React.createElement(FormField.FormFieldPostFix, { variation: "spinner", visible: (_c = props.loading) !== null && _c !== void 0 ? _c : false })));
|
|
140
129
|
});
|
|
141
130
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React__default, { forwardRef, useId, useRef } from 'react';
|
|
2
|
-
import { k as FormField,
|
|
2
|
+
import { k as FormField, b as useAtlantisFormFieldName, f as FormFieldWrapper, l as formFieldStyles, m as FormFieldPostFix } from '../FormField-es.js';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import '../tslib.es6-es.js';
|
|
5
5
|
import 'react-hook-form';
|
|
@@ -99,17 +99,6 @@ const InputEmailRebuilt = forwardRef(function InputEmailInternal(props, ref) {
|
|
|
99
99
|
const id = props.id || generatedId;
|
|
100
100
|
const inputRef = (_a = ref) !== null && _a !== void 0 ? _a : useRef(null);
|
|
101
101
|
const wrapperRef = useRef(null);
|
|
102
|
-
const { inputStyle } = useFormFieldWrapperStyles({
|
|
103
|
-
size: props.size,
|
|
104
|
-
inline: props.inline,
|
|
105
|
-
align: props.align,
|
|
106
|
-
type: "email",
|
|
107
|
-
value: props.value,
|
|
108
|
-
invalid: props.invalid,
|
|
109
|
-
error: props.error,
|
|
110
|
-
disabled: props.disabled,
|
|
111
|
-
placeholder: props.placeholder,
|
|
112
|
-
});
|
|
113
102
|
const { name } = useAtlantisFormFieldName({
|
|
114
103
|
nameProp: props.name,
|
|
115
104
|
id,
|
|
@@ -132,8 +121,8 @@ const InputEmailRebuilt = forwardRef(function InputEmailInternal(props, ref) {
|
|
|
132
121
|
const descriptionVisible = props.description && !props.inline;
|
|
133
122
|
const isInvalid = Boolean(props.error || props.invalid);
|
|
134
123
|
const dataAttrs = filterDataAttributes(props);
|
|
135
|
-
return (React__default.createElement(FormFieldWrapper, { error: props.error || "", invalid: props.invalid, identifier: id, descriptionIdentifier: descriptionIdentifier, size: props.size, inline: props.inline, align: props.align, prefix: props.prefix, suffix: props.suffix, description: props.description, clearable: (_b = props.clearable) !== null && _b !== void 0 ? _b : "never", onClear: handleClear, wrapperRef: wrapperRef, disabled: props.disabled, type: "email", value: props.value, placeholder: props.placeholder, name: name },
|
|
136
|
-
React__default.createElement("input", Object.assign({ id: id, name: name, type: "email", ref: inputRef, className:
|
|
124
|
+
return (React__default.createElement(FormFieldWrapper, { error: props.error || "", invalid: props.invalid, identifier: id, descriptionIdentifier: descriptionIdentifier, size: props.size, inline: props.inline, align: props.align, prefix: props.prefix, suffix: props.suffix, description: props.description, clearable: (_b = props.clearable) !== null && _b !== void 0 ? _b : "never", onClear: handleClear, readonly: props.readOnly, wrapperRef: wrapperRef, disabled: props.disabled, type: "email", value: props.value, placeholder: props.placeholder, name: name },
|
|
125
|
+
React__default.createElement("input", Object.assign({ id: id, name: name, type: "email", ref: inputRef, className: formFieldStyles.input, value: props.value, disabled: props.disabled, readOnly: props.readOnly, autoFocus: props.autoFocus, autoComplete: props.autoComplete, pattern: props.pattern, inputMode: props.inputMode, tabIndex: props.tabIndex, role: props.role, "aria-label": props["aria-label"], "aria-describedby": descriptionVisible ? descriptionIdentifier : props["aria-describedby"], "aria-invalid": isInvalid ? true : undefined, "aria-controls": props["aria-controls"], "aria-expanded": props["aria-expanded"], "aria-activedescendant": props["aria-activedescendant"], "aria-autocomplete": props["aria-autocomplete"], "aria-required": props["aria-required"], onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onClick: handleClick, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, onPointerDown: handlePointerDown, onPointerUp: handlePointerUp, "data-testid": "ATL-InputEmail-input" }, dataAttrs)),
|
|
137
126
|
React__default.createElement(FormFieldPostFix, { variation: "spinner", visible: (_c = props.loading) !== null && _c !== void 0 ? _c : false })));
|
|
138
127
|
});
|
|
139
128
|
|
|
@@ -174,17 +174,6 @@ const InputPhoneNumberRebuilt = React.forwardRef(function InputPhoneNumberIntern
|
|
|
174
174
|
var { pattern = DEFAULT_PATTERN } = _a, props = tslib_es6.__rest(_a, ["pattern"]);
|
|
175
175
|
const inputPhoneNumberRef = (_b = ref) !== null && _b !== void 0 ? _b : React.useRef(null);
|
|
176
176
|
const wrapperRef = React.useRef(null);
|
|
177
|
-
const { inputStyle } = FormField.useFormFieldWrapperStyles({
|
|
178
|
-
size: props.size,
|
|
179
|
-
align: props.align,
|
|
180
|
-
placeholder: props.placeholder,
|
|
181
|
-
value: props.value,
|
|
182
|
-
invalid: props.invalid,
|
|
183
|
-
error: props.error,
|
|
184
|
-
disabled: props.disabled,
|
|
185
|
-
inline: props.inline,
|
|
186
|
-
type: "tel",
|
|
187
|
-
});
|
|
188
177
|
const generatedId = React.useId();
|
|
189
178
|
const id = props.id || generatedId;
|
|
190
179
|
const { name } = FormField.useAtlantisFormFieldName({
|
|
@@ -214,7 +203,7 @@ const InputPhoneNumberRebuilt = React.forwardRef(function InputPhoneNumberIntern
|
|
|
214
203
|
const isInvalid = Boolean(props.error || props.invalid);
|
|
215
204
|
const dataAttrs = filterDataAttributes.filterDataAttributes(props);
|
|
216
205
|
return (React.createElement(FormField.FormFieldWrapper, { disabled: props.disabled, size: props.size, inline: props.inline, wrapperRef: wrapperRef, error: (_c = props.error) !== null && _c !== void 0 ? _c : "", invalid: Boolean(props.error || props.invalid), identifier: id, descriptionIdentifier: descriptionIdentifier, description: props.description, clearable: (_d = props.clearable) !== null && _d !== void 0 ? _d : "never", onClear: handleClear, type: "tel", placeholder: props.placeholder, value: formattedValue, prefix: props.prefix, suffix: props.suffix, readonly: props.readOnly, loading: props.loading },
|
|
217
|
-
React.createElement("input", Object.assign({ id: id, name: name, type: "tel", ref: inputPhoneNumberRef, className: classnames(
|
|
206
|
+
React.createElement("input", Object.assign({ id: id, name: name, type: "tel", ref: inputPhoneNumberRef, className: classnames(FormField.formFieldStyles.input, {
|
|
218
207
|
[styles.emptyValue]: inputValue.length === 0 && pattern[0] === "(",
|
|
219
208
|
}), value: formattedValue, disabled: props.disabled, readOnly: props.readOnly, autoFocus: props.autoFocus, autoComplete: props.autoComplete, inputMode: props.inputMode, tabIndex: props.tabIndex, role: props.role, "aria-label": props["aria-label"], "aria-describedby": descriptionVisible
|
|
220
209
|
? descriptionIdentifier
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { useState, useMemo, useCallback, useEffect, cloneElement, forwardRef, useId } from 'react';
|
|
2
2
|
import { _ as __rest } from '../tslib.es6-es.js';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
|
-
import {
|
|
4
|
+
import { b as useAtlantisFormFieldName, f as FormFieldWrapper, l as formFieldStyles, m as FormFieldPostFix, k as FormField } from '../FormField-es.js';
|
|
5
5
|
import { useFormContext, useForm } from 'react-hook-form';
|
|
6
6
|
import '../Button-es.js';
|
|
7
7
|
import '@jobber/design';
|
|
@@ -172,17 +172,6 @@ const InputPhoneNumberRebuilt = forwardRef(function InputPhoneNumberInternal(_a,
|
|
|
172
172
|
var { pattern = DEFAULT_PATTERN } = _a, props = __rest(_a, ["pattern"]);
|
|
173
173
|
const inputPhoneNumberRef = (_b = ref) !== null && _b !== void 0 ? _b : React__default.useRef(null);
|
|
174
174
|
const wrapperRef = React__default.useRef(null);
|
|
175
|
-
const { inputStyle } = useFormFieldWrapperStyles({
|
|
176
|
-
size: props.size,
|
|
177
|
-
align: props.align,
|
|
178
|
-
placeholder: props.placeholder,
|
|
179
|
-
value: props.value,
|
|
180
|
-
invalid: props.invalid,
|
|
181
|
-
error: props.error,
|
|
182
|
-
disabled: props.disabled,
|
|
183
|
-
inline: props.inline,
|
|
184
|
-
type: "tel",
|
|
185
|
-
});
|
|
186
175
|
const generatedId = useId();
|
|
187
176
|
const id = props.id || generatedId;
|
|
188
177
|
const { name } = useAtlantisFormFieldName({
|
|
@@ -212,7 +201,7 @@ const InputPhoneNumberRebuilt = forwardRef(function InputPhoneNumberInternal(_a,
|
|
|
212
201
|
const isInvalid = Boolean(props.error || props.invalid);
|
|
213
202
|
const dataAttrs = filterDataAttributes(props);
|
|
214
203
|
return (React__default.createElement(FormFieldWrapper, { disabled: props.disabled, size: props.size, inline: props.inline, wrapperRef: wrapperRef, error: (_c = props.error) !== null && _c !== void 0 ? _c : "", invalid: Boolean(props.error || props.invalid), identifier: id, descriptionIdentifier: descriptionIdentifier, description: props.description, clearable: (_d = props.clearable) !== null && _d !== void 0 ? _d : "never", onClear: handleClear, type: "tel", placeholder: props.placeholder, value: formattedValue, prefix: props.prefix, suffix: props.suffix, readonly: props.readOnly, loading: props.loading },
|
|
215
|
-
React__default.createElement("input", Object.assign({ id: id, name: name, type: "tel", ref: inputPhoneNumberRef, className: classnames(
|
|
204
|
+
React__default.createElement("input", Object.assign({ id: id, name: name, type: "tel", ref: inputPhoneNumberRef, className: classnames(formFieldStyles.input, {
|
|
216
205
|
[styles.emptyValue]: inputValue.length === 0 && pattern[0] === "(",
|
|
217
206
|
}), value: formattedValue, disabled: props.disabled, readOnly: props.readOnly, autoFocus: props.autoFocus, autoComplete: props.autoComplete, inputMode: props.inputMode, tabIndex: props.tabIndex, role: props.role, "aria-label": props["aria-label"], "aria-describedby": descriptionVisible
|
|
218
207
|
? descriptionIdentifier
|
package/dist/InputText/index.cjs
CHANGED
|
@@ -218,18 +218,6 @@ const InputTextSPAR = React.forwardRef(function InputTextInternal(props, inputRe
|
|
|
218
218
|
inputRef: inputTextRef,
|
|
219
219
|
wrapperRef: wrapperRef,
|
|
220
220
|
});
|
|
221
|
-
const { inputStyle } = FormField.useFormFieldWrapperStyles({
|
|
222
|
-
size: props.size,
|
|
223
|
-
align: props.align,
|
|
224
|
-
placeholder: props.placeholder,
|
|
225
|
-
value: props.value,
|
|
226
|
-
invalid: props.invalid,
|
|
227
|
-
error: props.error,
|
|
228
|
-
maxLength: props.maxLength,
|
|
229
|
-
type: props.multiline ? "textarea" : "text",
|
|
230
|
-
disabled: props.disabled,
|
|
231
|
-
inline: props.inline,
|
|
232
|
-
});
|
|
233
221
|
const { name } = FormField.useAtlantisFormFieldName({
|
|
234
222
|
nameProp: props.name,
|
|
235
223
|
id: id,
|
|
@@ -254,10 +242,10 @@ const InputTextSPAR = React.forwardRef(function InputTextInternal(props, inputRe
|
|
|
254
242
|
const dataAttrs = filterDataAttributes.filterDataAttributes(props);
|
|
255
243
|
// Shared props for both TextArea and TextInput
|
|
256
244
|
const commonInputProps = Object.assign({ id,
|
|
257
|
-
name, className:
|
|
245
|
+
name, className: FormField.formFieldStyles.input, value: props.value, disabled: props.disabled, readOnly: props.readOnly, autoFocus: props.autoFocus, autoComplete: props.autoComplete, inputMode: props.inputMode, tabIndex: props.tabIndex, maxLength: props.maxLength, role: props.role, "aria-label": props["aria-label"], "aria-describedby": descriptionVisible
|
|
258
246
|
? descriptionIdentifier
|
|
259
247
|
: props["aria-describedby"], "aria-invalid": isInvalid ? true : undefined, "aria-controls": props["aria-controls"], "aria-expanded": props["aria-expanded"], "aria-activedescendant": props["aria-activedescendant"], "aria-autocomplete": props["aria-autocomplete"], "aria-required": props["aria-required"], onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, onPointerDown: handlePointerDown, onPointerUp: handlePointerUp, onClick: handleClick, ref: FormField.mergeRefs([inputRef, inputTextRef]) }, dataAttrs);
|
|
260
|
-
return (React.createElement(FormField.FormFieldWrapper, { disabled: props.disabled, size: props.size, align: props.align, inline: props.inline, name: name, wrapperRef: wrapperRef, error: (_a = props.error) !== null && _a !== void 0 ? _a : "", invalid: Boolean(props.error || props.invalid), identifier: id, descriptionIdentifier: descriptionIdentifier, description: props.description, clearable: (_b = props.clearable) !== null && _b !== void 0 ? _b : "never",
|
|
248
|
+
return (React.createElement(FormField.FormFieldWrapper, { disabled: props.disabled, size: props.size, align: props.align, inline: props.inline, name: name, wrapperRef: wrapperRef, error: (_a = props.error) !== null && _a !== void 0 ? _a : "", invalid: Boolean(props.error || props.invalid), identifier: id, descriptionIdentifier: descriptionIdentifier, description: props.description, clearable: (_b = props.clearable) !== null && _b !== void 0 ? _b : "never", onClear: handleClear, type: props.multiline ? "textarea" : "text", placeholder: props.placeholder, value: props.value, prefix: props.prefix, suffix: props.suffix, readonly: props.readOnly, rows: rowRange.min, toolbar: props.toolbar, toolbarVisibility: props.toolbarVisibility },
|
|
261
249
|
React.createElement(React.Fragment, null,
|
|
262
250
|
props.multiline ? (React.createElement(TextArea, Object.assign({}, commonInputProps, { rows: rowRange.min }))) : (React.createElement(TextInput, Object.assign({}, commonInputProps, { pattern: props.pattern }))),
|
|
263
251
|
React.createElement(FormField.FormFieldPostFix, { variation: "spinner", visible: (_c = props.loading) !== null && _c !== void 0 ? _c : false }))));
|
package/dist/InputText/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default, { forwardRef, useRef, useImperativeHandle, useId } from 'react';
|
|
2
2
|
import { useSafeLayoutEffect } from '@jobber/hooks';
|
|
3
|
-
import { k as FormField,
|
|
3
|
+
import { k as FormField, b as useAtlantisFormFieldName, l as formFieldStyles, n as mergeRefs, f as FormFieldWrapper, m as FormFieldPostFix } from '../FormField-es.js';
|
|
4
4
|
import 'classnames';
|
|
5
5
|
import '../tslib.es6-es.js';
|
|
6
6
|
import 'react-hook-form';
|
|
@@ -216,18 +216,6 @@ const InputTextSPAR = forwardRef(function InputTextInternal(props, inputRef) {
|
|
|
216
216
|
inputRef: inputTextRef,
|
|
217
217
|
wrapperRef: wrapperRef,
|
|
218
218
|
});
|
|
219
|
-
const { inputStyle } = useFormFieldWrapperStyles({
|
|
220
|
-
size: props.size,
|
|
221
|
-
align: props.align,
|
|
222
|
-
placeholder: props.placeholder,
|
|
223
|
-
value: props.value,
|
|
224
|
-
invalid: props.invalid,
|
|
225
|
-
error: props.error,
|
|
226
|
-
maxLength: props.maxLength,
|
|
227
|
-
type: props.multiline ? "textarea" : "text",
|
|
228
|
-
disabled: props.disabled,
|
|
229
|
-
inline: props.inline,
|
|
230
|
-
});
|
|
231
219
|
const { name } = useAtlantisFormFieldName({
|
|
232
220
|
nameProp: props.name,
|
|
233
221
|
id: id,
|
|
@@ -252,10 +240,10 @@ const InputTextSPAR = forwardRef(function InputTextInternal(props, inputRef) {
|
|
|
252
240
|
const dataAttrs = filterDataAttributes(props);
|
|
253
241
|
// Shared props for both TextArea and TextInput
|
|
254
242
|
const commonInputProps = Object.assign({ id,
|
|
255
|
-
name, className:
|
|
243
|
+
name, className: formFieldStyles.input, value: props.value, disabled: props.disabled, readOnly: props.readOnly, autoFocus: props.autoFocus, autoComplete: props.autoComplete, inputMode: props.inputMode, tabIndex: props.tabIndex, maxLength: props.maxLength, role: props.role, "aria-label": props["aria-label"], "aria-describedby": descriptionVisible
|
|
256
244
|
? descriptionIdentifier
|
|
257
245
|
: props["aria-describedby"], "aria-invalid": isInvalid ? true : undefined, "aria-controls": props["aria-controls"], "aria-expanded": props["aria-expanded"], "aria-activedescendant": props["aria-activedescendant"], "aria-autocomplete": props["aria-autocomplete"], "aria-required": props["aria-required"], onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, onPointerDown: handlePointerDown, onPointerUp: handlePointerUp, onClick: handleClick, ref: mergeRefs([inputRef, inputTextRef]) }, dataAttrs);
|
|
258
|
-
return (React__default.createElement(FormFieldWrapper, { disabled: props.disabled, size: props.size, align: props.align, inline: props.inline, name: name, wrapperRef: wrapperRef, error: (_a = props.error) !== null && _a !== void 0 ? _a : "", invalid: Boolean(props.error || props.invalid), identifier: id, descriptionIdentifier: descriptionIdentifier, description: props.description, clearable: (_b = props.clearable) !== null && _b !== void 0 ? _b : "never",
|
|
246
|
+
return (React__default.createElement(FormFieldWrapper, { disabled: props.disabled, size: props.size, align: props.align, inline: props.inline, name: name, wrapperRef: wrapperRef, error: (_a = props.error) !== null && _a !== void 0 ? _a : "", invalid: Boolean(props.error || props.invalid), identifier: id, descriptionIdentifier: descriptionIdentifier, description: props.description, clearable: (_b = props.clearable) !== null && _b !== void 0 ? _b : "never", onClear: handleClear, type: props.multiline ? "textarea" : "text", placeholder: props.placeholder, value: props.value, prefix: props.prefix, suffix: props.suffix, readonly: props.readOnly, rows: rowRange.min, toolbar: props.toolbar, toolbarVisibility: props.toolbarVisibility },
|
|
259
247
|
React__default.createElement(React__default.Fragment, null,
|
|
260
248
|
props.multiline ? (React__default.createElement(TextArea, Object.assign({}, commonInputProps, { rows: rowRange.min }))) : (React__default.createElement(TextInput, Object.assign({}, commonInputProps, { pattern: props.pattern }))),
|
|
261
249
|
React__default.createElement(FormFieldPostFix, { variation: "spinner", visible: (_c = props.loading) !== null && _c !== void 0 ? _c : false }))));
|
package/dist/InputTime/index.cjs
CHANGED
|
@@ -268,7 +268,6 @@ function InputTimeRebuilt(_a) {
|
|
|
268
268
|
const { internalRef, mergedRef, wrapperRef } = useInputTimeRefs(inputRef);
|
|
269
269
|
const generatedId = React.useId();
|
|
270
270
|
const id = props.id || generatedId;
|
|
271
|
-
const { inputStyle } = FormField.useFormFieldWrapperStyles(props);
|
|
272
271
|
const { handleChangeEvent, handleChange, handleBlur, handleClear, handleFocus, handleKeyDown, handleClick, handleMouseDown, handleMouseUp, handlePointerDown, handlePointerUp, } = useInputTimeActions({
|
|
273
272
|
onChange,
|
|
274
273
|
value,
|
|
@@ -301,7 +300,7 @@ function InputTimeRebuilt(_a) {
|
|
|
301
300
|
const descriptionVisible = props.description && !props.inline;
|
|
302
301
|
const isInvalid = Boolean(props.error || props.invalid);
|
|
303
302
|
return (React.createElement(FormField.FormFieldWrapper, { disabled: props.disabled, size: props.size, align: props.align, inline: props.inline, name: props.name, error: props.error || "", identifier: id, descriptionIdentifier: descriptionIdentifier, invalid: props.invalid, description: props.description, clearable: (_b = props.clearable) !== null && _b !== void 0 ? _b : "never", onClear: handleClear, type: "time", readonly: readOnly, placeholder: props.placeholder, value: dateToTimeString(value), wrapperRef: wrapperRef },
|
|
304
|
-
React.createElement("input", Object.assign({ ref: mergedRef, type: "time", name: props.name, className:
|
|
303
|
+
React.createElement("input", Object.assign({ ref: mergedRef, type: "time", name: props.name, className: FormField.formFieldStyles.input, id: id, disabled: props.disabled, readOnly: readOnly, autoComplete: autoComplete, autoFocus: props.autoFocus, max: props.max, min: props.min, value: dateToTimeString(value), onChange: handleChangeEvent, onBlur: handleBlur, onFocus: handleFocus, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onClick: handleClick, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, onPointerDown: handlePointerDown, onPointerUp: handlePointerUp, "data-testid": "ATL-InputTime-input", "aria-label": props["aria-label"], "aria-describedby": descriptionVisible ? descriptionIdentifier : props["aria-describedby"], "aria-invalid": isInvalid ? true : undefined, "aria-required": props["aria-required"] }, dataAttrs))));
|
|
305
304
|
}
|
|
306
305
|
function useInputTimeRefs(inputRef) {
|
|
307
306
|
const internalRef = React.useRef(null);
|
package/dist/InputTime/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { useState, useCallback, useEffect, useId, useRef } from 'react';
|
|
2
2
|
import { _ as __rest } from '../tslib.es6-es.js';
|
|
3
3
|
import { a as debounce } from '../debounce-es.js';
|
|
4
|
-
import {
|
|
4
|
+
import { f as FormFieldWrapper, l as formFieldStyles, n as mergeRefs, k as FormField } from '../FormField-es.js';
|
|
5
5
|
import 'classnames';
|
|
6
6
|
import '@jobber/design';
|
|
7
7
|
import 'react-hook-form';
|
|
@@ -266,7 +266,6 @@ function InputTimeRebuilt(_a) {
|
|
|
266
266
|
const { internalRef, mergedRef, wrapperRef } = useInputTimeRefs(inputRef);
|
|
267
267
|
const generatedId = useId();
|
|
268
268
|
const id = props.id || generatedId;
|
|
269
|
-
const { inputStyle } = useFormFieldWrapperStyles(props);
|
|
270
269
|
const { handleChangeEvent, handleChange, handleBlur, handleClear, handleFocus, handleKeyDown, handleClick, handleMouseDown, handleMouseUp, handlePointerDown, handlePointerUp, } = useInputTimeActions({
|
|
271
270
|
onChange,
|
|
272
271
|
value,
|
|
@@ -299,7 +298,7 @@ function InputTimeRebuilt(_a) {
|
|
|
299
298
|
const descriptionVisible = props.description && !props.inline;
|
|
300
299
|
const isInvalid = Boolean(props.error || props.invalid);
|
|
301
300
|
return (React__default.createElement(FormFieldWrapper, { disabled: props.disabled, size: props.size, align: props.align, inline: props.inline, name: props.name, error: props.error || "", identifier: id, descriptionIdentifier: descriptionIdentifier, invalid: props.invalid, description: props.description, clearable: (_b = props.clearable) !== null && _b !== void 0 ? _b : "never", onClear: handleClear, type: "time", readonly: readOnly, placeholder: props.placeholder, value: dateToTimeString(value), wrapperRef: wrapperRef },
|
|
302
|
-
React__default.createElement("input", Object.assign({ ref: mergedRef, type: "time", name: props.name, className:
|
|
301
|
+
React__default.createElement("input", Object.assign({ ref: mergedRef, type: "time", name: props.name, className: formFieldStyles.input, id: id, disabled: props.disabled, readOnly: readOnly, autoComplete: autoComplete, autoFocus: props.autoFocus, max: props.max, min: props.min, value: dateToTimeString(value), onChange: handleChangeEvent, onBlur: handleBlur, onFocus: handleFocus, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onClick: handleClick, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, onPointerDown: handlePointerDown, onPointerUp: handlePointerUp, "data-testid": "ATL-InputTime-input", "aria-label": props["aria-label"], "aria-describedby": descriptionVisible ? descriptionIdentifier : props["aria-describedby"], "aria-invalid": isInvalid ? true : undefined, "aria-required": props["aria-required"] }, dataAttrs))));
|
|
303
302
|
}
|
|
304
303
|
function useInputTimeRefs(inputRef) {
|
|
305
304
|
const internalRef = useRef(null);
|
package/dist/Select/index.cjs
CHANGED
|
@@ -61,7 +61,6 @@ var styles = {"select":"-hmXAsAfH9U-","selectPostfix":"_5ST4c1fXDYU-","spinning"
|
|
|
61
61
|
function SelectRebuilt(props) {
|
|
62
62
|
var _a;
|
|
63
63
|
const { mergedRef, wrapperRef } = useSelectRefs(props.inputRef);
|
|
64
|
-
const { inputStyle } = FormField.useFormFieldWrapperStyles(Object.assign({}, omit.omit(props, ["version"])));
|
|
65
64
|
const dataAttrs = filterDataAttributes.filterDataAttributes(props);
|
|
66
65
|
const generatedId = React.useId();
|
|
67
66
|
const id = props.id || generatedId;
|
|
@@ -81,7 +80,7 @@ function SelectRebuilt(props) {
|
|
|
81
80
|
React.createElement(React.Fragment, null,
|
|
82
81
|
React.createElement("select", Object.assign({ id: id, name: name, disabled: props.disabled, autoFocus: props.autoFocus, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, value: props.value, "aria-label": props["aria-label"], "aria-describedby": descriptionVisible
|
|
83
82
|
? descriptionIdentifier
|
|
84
|
-
: props["aria-describedby"], "aria-invalid": isInvalid ? true : undefined, "aria-required": props["aria-required"], ref: mergedRef, className: classnames(
|
|
83
|
+
: props["aria-describedby"], "aria-invalid": isInvalid ? true : undefined, "aria-required": props["aria-required"], ref: mergedRef, className: classnames(FormField.formFieldStyles.input, props.UNSAFE_experimentalStyles && styles.select) }, dataAttrs), props.children),
|
|
85
84
|
React.createElement(FormField.FormFieldPostFix, { variation: "select", className: styles.selectPostfix }))));
|
|
86
85
|
}
|
|
87
86
|
function useSelectRefs(inputRef) {
|
package/dist/Select/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default, { useId, useRef } from 'react';
|
|
2
2
|
import { o as omit } from '../omit-es.js';
|
|
3
|
-
import { k as FormField,
|
|
3
|
+
import { k as FormField, b as useAtlantisFormFieldName, f as FormFieldWrapper, l as formFieldStyles, m as FormFieldPostFix, n as mergeRefs } from '../FormField-es.js';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import '../tslib.es6-es.js';
|
|
6
6
|
import 'react-hook-form';
|
|
@@ -59,7 +59,6 @@ var styles = {"select":"-hmXAsAfH9U-","selectPostfix":"_5ST4c1fXDYU-","spinning"
|
|
|
59
59
|
function SelectRebuilt(props) {
|
|
60
60
|
var _a;
|
|
61
61
|
const { mergedRef, wrapperRef } = useSelectRefs(props.inputRef);
|
|
62
|
-
const { inputStyle } = useFormFieldWrapperStyles(Object.assign({}, omit(props, ["version"])));
|
|
63
62
|
const dataAttrs = filterDataAttributes(props);
|
|
64
63
|
const generatedId = useId();
|
|
65
64
|
const id = props.id || generatedId;
|
|
@@ -79,7 +78,7 @@ function SelectRebuilt(props) {
|
|
|
79
78
|
React__default.createElement(React__default.Fragment, null,
|
|
80
79
|
React__default.createElement("select", Object.assign({ id: id, name: name, disabled: props.disabled, autoFocus: props.autoFocus, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, value: props.value, "aria-label": props["aria-label"], "aria-describedby": descriptionVisible
|
|
81
80
|
? descriptionIdentifier
|
|
82
|
-
: props["aria-describedby"], "aria-invalid": isInvalid ? true : undefined, "aria-required": props["aria-required"], ref: mergedRef, className: classnames(
|
|
81
|
+
: props["aria-describedby"], "aria-invalid": isInvalid ? true : undefined, "aria-required": props["aria-required"], ref: mergedRef, className: classnames(formFieldStyles.input, props.UNSAFE_experimentalStyles && styles.select) }, dataAttrs), props.children),
|
|
83
82
|
React__default.createElement(FormFieldPostFix, { variation: "select", className: styles.selectPostfix }))));
|
|
84
83
|
}
|
|
85
84
|
function useSelectRefs(inputRef) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "6.105.
|
|
3
|
+
"version": "6.105.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -538,5 +538,5 @@
|
|
|
538
538
|
"> 1%",
|
|
539
539
|
"IE 10"
|
|
540
540
|
],
|
|
541
|
-
"gitHead": "
|
|
541
|
+
"gitHead": "56e20f9af118bc4640fdb6e648a227ab803f6d38"
|
|
542
542
|
}
|