@jobber/components 6.103.2-JOB-140609-9051081.26 → 6.103.2-JOB-140609-8386817.45
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/Autocomplete.types.d.ts +1 -1
- package/dist/Checkbox/Checkbox.types.d.ts +1 -1
- package/dist/Checkbox/index.cjs +3 -2
- package/dist/Checkbox/index.mjs +3 -2
- package/dist/FormField/FormFieldTypes.d.ts +1 -219
- package/dist/FormField/hooks/useFormFieldWrapperStyles.d.ts +7 -2
- package/dist/InputDate/index.cjs +4 -12
- package/dist/InputDate/index.mjs +4 -12
- package/dist/InputDate/useInputDateActivatorActions.d.ts +4 -8
- package/dist/InputEmail/InputEmail.types.d.ts +3 -6
- package/dist/InputEmail/index.cjs +4 -5
- package/dist/InputEmail/index.mjs +4 -5
- package/dist/InputNumber/InputNumber.rebuilt.types.d.ts +2 -6
- package/dist/InputNumber/index.cjs +1 -4
- package/dist/InputNumber/index.mjs +1 -4
- package/dist/InputPhoneNumber/InputPhoneNumber.types.d.ts +2 -5
- package/dist/InputPhoneNumber/index.cjs +3 -5
- package/dist/InputPhoneNumber/index.mjs +3 -5
- package/dist/InputText/InputText.d.ts +2 -2
- package/dist/InputText/InputText.types.d.ts +3 -6
- package/dist/InputText/index.cjs +36 -7
- package/dist/InputText/index.mjs +37 -8
- package/dist/InputTime/InputTime.types.d.ts +2 -2
- package/dist/InputTime/hooks/useInputTimeActions.d.ts +16 -0
- package/dist/InputTime/index.cjs +56 -31
- package/dist/InputTime/index.mjs +57 -32
- package/dist/Select/Select.types.d.ts +1 -1
- package/dist/Select/index.cjs +2 -1
- package/dist/Select/index.mjs +2 -1
- package/dist/Tabs-es.js +1 -1
- package/dist/debounce-es.js +1 -1
- package/dist/sharedHelpers/types.d.ts +235 -0
- package/dist/useScrollToActive-es.js +1 -1
- package/package.json +2 -2
|
@@ -115,7 +115,6 @@ const DEFAULT_PATTERN = "(***) ***-****";
|
|
|
115
115
|
function useInputPhoneActions({ onChange, inputRef, onFocus, onBlur, onKeyDown, onEnter, }) {
|
|
116
116
|
function handleClear() {
|
|
117
117
|
var _a;
|
|
118
|
-
// Don't call blur handler when programmatically clearing
|
|
119
118
|
onChange && onChange("");
|
|
120
119
|
(_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
121
120
|
}
|
|
@@ -161,13 +160,12 @@ const InputPhoneNumberRebuilt = React.forwardRef(function InputPhoneNumberIntern
|
|
|
161
160
|
value: props.value,
|
|
162
161
|
invalid: props.invalid,
|
|
163
162
|
error: props.error,
|
|
164
|
-
maxLength: undefined, // v2: maxLength not used for width styling
|
|
165
163
|
disabled: props.disabled,
|
|
166
164
|
inline: props.inline,
|
|
167
165
|
type: "tel",
|
|
168
166
|
});
|
|
169
167
|
const generatedId = React.useId();
|
|
170
|
-
const id = props.
|
|
168
|
+
const id = props.id || generatedId;
|
|
171
169
|
const { name } = FormField.useAtlantisFormFieldName({
|
|
172
170
|
nameProp: props.name,
|
|
173
171
|
id: id,
|
|
@@ -187,11 +185,11 @@ const InputPhoneNumberRebuilt = React.forwardRef(function InputPhoneNumberIntern
|
|
|
187
185
|
});
|
|
188
186
|
const descriptionIdentifier = `descriptionUUID--${id}`;
|
|
189
187
|
const hasDescription = props.description && !props.inline;
|
|
190
|
-
const isInvalid = Boolean(props.
|
|
188
|
+
const isInvalid = Boolean(props.error || props.invalid);
|
|
191
189
|
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 },
|
|
192
190
|
React.createElement("input", { id: id, name: name, type: "tel", ref: inputPhoneNumberRef, className: classnames(inputStyle, {
|
|
193
191
|
[styles.emptyValue]: inputValue.length === 0 && pattern[0] === "(",
|
|
194
|
-
}), value: formattedValue, disabled: props.disabled, readOnly: props.readOnly,
|
|
192
|
+
}), 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.ariaLabel, "aria-describedby": hasDescription ? descriptionIdentifier : props.ariaDescribedBy, "aria-invalid": isInvalid ? true : undefined, "aria-controls": props.ariaControls, "aria-expanded": props.ariaExpanded, "aria-activedescendant": props.ariaActiveDescendant, "aria-autocomplete": props.ariaAutocomplete, "aria-required": props.ariaRequired, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, onKeyDown: handleKeyDown }),
|
|
195
193
|
React.createElement(MaskElement, { isMasking: isMasking, formattedValue: formattedValue, placeholderMask: placeholderMask }),
|
|
196
194
|
React.createElement(FormField.FormFieldPostFix, { variation: "spinner", visible: (_e = props.loading) !== null && _e !== void 0 ? _e : false })));
|
|
197
195
|
});
|
|
@@ -113,7 +113,6 @@ const DEFAULT_PATTERN = "(***) ***-****";
|
|
|
113
113
|
function useInputPhoneActions({ onChange, inputRef, onFocus, onBlur, onKeyDown, onEnter, }) {
|
|
114
114
|
function handleClear() {
|
|
115
115
|
var _a;
|
|
116
|
-
// Don't call blur handler when programmatically clearing
|
|
117
116
|
onChange && onChange("");
|
|
118
117
|
(_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
119
118
|
}
|
|
@@ -159,13 +158,12 @@ const InputPhoneNumberRebuilt = forwardRef(function InputPhoneNumberInternal(_a,
|
|
|
159
158
|
value: props.value,
|
|
160
159
|
invalid: props.invalid,
|
|
161
160
|
error: props.error,
|
|
162
|
-
maxLength: undefined, // v2: maxLength not used for width styling
|
|
163
161
|
disabled: props.disabled,
|
|
164
162
|
inline: props.inline,
|
|
165
163
|
type: "tel",
|
|
166
164
|
});
|
|
167
165
|
const generatedId = useId();
|
|
168
|
-
const id = props.
|
|
166
|
+
const id = props.id || generatedId;
|
|
169
167
|
const { name } = useAtlantisFormFieldName({
|
|
170
168
|
nameProp: props.name,
|
|
171
169
|
id: id,
|
|
@@ -185,11 +183,11 @@ const InputPhoneNumberRebuilt = forwardRef(function InputPhoneNumberInternal(_a,
|
|
|
185
183
|
});
|
|
186
184
|
const descriptionIdentifier = `descriptionUUID--${id}`;
|
|
187
185
|
const hasDescription = props.description && !props.inline;
|
|
188
|
-
const isInvalid = Boolean(props.
|
|
186
|
+
const isInvalid = Boolean(props.error || props.invalid);
|
|
189
187
|
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 },
|
|
190
188
|
React__default.createElement("input", { id: id, name: name, type: "tel", ref: inputPhoneNumberRef, className: classnames(inputStyle, {
|
|
191
189
|
[styles.emptyValue]: inputValue.length === 0 && pattern[0] === "(",
|
|
192
|
-
}), value: formattedValue, disabled: props.disabled, readOnly: props.readOnly,
|
|
190
|
+
}), 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.ariaLabel, "aria-describedby": hasDescription ? descriptionIdentifier : props.ariaDescribedBy, "aria-invalid": isInvalid ? true : undefined, "aria-controls": props.ariaControls, "aria-expanded": props.ariaExpanded, "aria-activedescendant": props.ariaActiveDescendant, "aria-autocomplete": props.ariaAutocomplete, "aria-required": props.ariaRequired, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, onKeyDown: handleKeyDown }),
|
|
193
191
|
React__default.createElement(MaskElement, { isMasking: isMasking, formattedValue: formattedValue, placeholderMask: placeholderMask }),
|
|
194
192
|
React__default.createElement(FormFieldPostFix, { variation: "spinner", visible: (_e = props.loading) !== null && _e !== void 0 ? _e : false })));
|
|
195
193
|
});
|
|
@@ -24,11 +24,11 @@ export declare const InputText: React.ForwardRefExoticComponent<({
|
|
|
24
24
|
readonly toolbar?: React.ReactNode;
|
|
25
25
|
readonly defaultValue?: (string | Date) | undefined;
|
|
26
26
|
readonly prefix?: import("../FormField").Affix | undefined;
|
|
27
|
-
readonly maxLength?: number | undefined;
|
|
28
27
|
readonly autofocus?: boolean | undefined;
|
|
29
28
|
readonly autocomplete?: (boolean | import("../FormField").AutocompleteTypes) | undefined;
|
|
30
29
|
inputRef?: React.RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement> | undefined;
|
|
31
30
|
readonly keyboard?: ("numeric" | "decimal") | undefined;
|
|
31
|
+
readonly maxLength?: number | undefined;
|
|
32
32
|
readonly suffix?: import("ts-xor").XOR<import("../FormField").Affix, import("../FormField").Suffix> | undefined;
|
|
33
33
|
onEnter?: ((event: React.KeyboardEvent) => void) | undefined;
|
|
34
34
|
readonly readonly?: boolean | undefined;
|
|
@@ -58,11 +58,11 @@ export declare const InputText: React.ForwardRefExoticComponent<({
|
|
|
58
58
|
readonly toolbar?: React.ReactNode;
|
|
59
59
|
readonly defaultValue?: (string | Date) | undefined;
|
|
60
60
|
readonly prefix?: import("../FormField").Affix | undefined;
|
|
61
|
-
readonly maxLength?: number | undefined;
|
|
62
61
|
readonly autofocus?: boolean | undefined;
|
|
63
62
|
readonly autocomplete?: (boolean | import("../FormField").AutocompleteTypes) | undefined;
|
|
64
63
|
inputRef?: React.RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement> | undefined;
|
|
65
64
|
readonly keyboard?: ("numeric" | "decimal") | undefined;
|
|
65
|
+
readonly maxLength?: number | undefined;
|
|
66
66
|
readonly suffix?: import("ts-xor").XOR<import("../FormField").Affix, import("../FormField").Suffix> | undefined;
|
|
67
67
|
onEnter?: ((event: React.KeyboardEvent) => void) | undefined;
|
|
68
68
|
readonly readonly?: boolean | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { XOR } from "ts-xor";
|
|
2
|
-
import type { CommonFormFieldProps,
|
|
2
|
+
import type { CommonFormFieldProps, FormFieldProps, FormFieldTypes } from "../FormField";
|
|
3
|
+
import type { FocusEvents, HTMLInputBaseProps, InputLengthConstraint, KeyboardEvents, RebuiltInputCommonProps } from "../sharedHelpers/types";
|
|
3
4
|
export interface RowRange {
|
|
4
5
|
min: number;
|
|
5
6
|
max: number;
|
|
@@ -9,7 +10,7 @@ export type InputTextVersion = 1 | 2 | undefined;
|
|
|
9
10
|
* Experimental version 2 of the InputText component.
|
|
10
11
|
* Do not use unless you have talked with Atlantis first.
|
|
11
12
|
*/
|
|
12
|
-
export interface InputTextRebuiltProps extends HTMLInputBaseProps, FocusEvents<HTMLInputElement | HTMLTextAreaElement>, KeyboardEvents<HTMLInputElement | HTMLTextAreaElement>, RebuiltInputCommonProps {
|
|
13
|
+
export interface InputTextRebuiltProps extends HTMLInputBaseProps, FocusEvents<HTMLInputElement | HTMLTextAreaElement>, KeyboardEvents<HTMLInputElement | HTMLTextAreaElement>, RebuiltInputCommonProps, InputLengthConstraint {
|
|
13
14
|
/**
|
|
14
15
|
* Use this when you're expecting a long answer.
|
|
15
16
|
*/
|
|
@@ -47,10 +48,6 @@ export interface InputTextRebuiltProps extends HTMLInputBaseProps, FocusEvents<H
|
|
|
47
48
|
* are being held.
|
|
48
49
|
*/
|
|
49
50
|
readonly onEnter?: FormFieldProps["onEnter"];
|
|
50
|
-
/**
|
|
51
|
-
* @deprecated Use `id` instead. This prop will be removed in a future version.
|
|
52
|
-
*/
|
|
53
|
-
readonly identifier?: string;
|
|
54
51
|
}
|
|
55
52
|
interface BaseProps extends CommonFormFieldProps, Pick<FormFieldProps, "autofocus" | "maxLength" | "readonly" | "autocomplete" | "keyboard" | "onEnter" | "onFocus" | "onBlur" | "onChange" | "inputRef" | "validations" | "defaultValue" | "prefix" | "suffix" | "toolbar" | "toolbarVisibility" | "version"> {
|
|
56
53
|
multiline?: boolean;
|
package/dist/InputText/index.cjs
CHANGED
|
@@ -150,7 +150,6 @@ function insertAtCursor(input, newText) {
|
|
|
150
150
|
function useInputTextActions({ onChange, inputRef, onEnter, onFocus, onBlur, onKeyDown, }) {
|
|
151
151
|
function handleClear() {
|
|
152
152
|
var _a;
|
|
153
|
-
// Don't call blur handler when programmatically clearing
|
|
154
153
|
onChange && onChange("");
|
|
155
154
|
(_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
156
155
|
}
|
|
@@ -202,8 +201,7 @@ const InputTextSPAR = React.forwardRef(function InputTextInternal(props, inputRe
|
|
|
202
201
|
value: props.value,
|
|
203
202
|
invalid: props.invalid,
|
|
204
203
|
error: props.error,
|
|
205
|
-
|
|
206
|
-
maxLength: undefined, // v2: maxLength is for HTML validation only, not for width styling
|
|
204
|
+
maxLength: props.maxLength,
|
|
207
205
|
type: props.multiline ? "textarea" : "text",
|
|
208
206
|
disabled: props.disabled,
|
|
209
207
|
inline: props.inline,
|
|
@@ -222,16 +220,47 @@ const InputTextSPAR = React.forwardRef(function InputTextInternal(props, inputRe
|
|
|
222
220
|
});
|
|
223
221
|
const descriptionIdentifier = `descriptionUUID--${id}`;
|
|
224
222
|
const hasDescription = props.description && !props.inline;
|
|
225
|
-
const isInvalid = Boolean(props.
|
|
226
|
-
|
|
223
|
+
const isInvalid = Boolean(props.error || props.invalid);
|
|
224
|
+
// Shared props for both TextArea and TextInput
|
|
225
|
+
const commonInputProps = {
|
|
226
|
+
id,
|
|
227
|
+
name,
|
|
228
|
+
className: inputStyle,
|
|
229
|
+
value: props.value,
|
|
230
|
+
disabled: props.disabled,
|
|
231
|
+
readOnly: props.readOnly,
|
|
232
|
+
autoFocus: props.autoFocus,
|
|
233
|
+
autoComplete: props.autoComplete,
|
|
234
|
+
inputMode: props.inputMode,
|
|
235
|
+
tabIndex: props.tabIndex,
|
|
236
|
+
maxLength: props.maxLength,
|
|
237
|
+
role: props.role,
|
|
238
|
+
"aria-label": props.ariaLabel,
|
|
239
|
+
"aria-describedby": hasDescription
|
|
240
|
+
? descriptionIdentifier
|
|
241
|
+
: props.ariaDescribedBy,
|
|
242
|
+
"aria-invalid": isInvalid ? true : undefined,
|
|
243
|
+
"aria-controls": props.ariaControls,
|
|
244
|
+
"aria-expanded": props.ariaExpanded,
|
|
245
|
+
"aria-activedescendant": props.ariaActiveDescendant,
|
|
246
|
+
"aria-autocomplete": props.ariaAutocomplete,
|
|
247
|
+
"aria-required": props.ariaRequired,
|
|
248
|
+
onChange: handleChange,
|
|
249
|
+
onBlur: handleBlur,
|
|
250
|
+
onFocus: handleFocus,
|
|
251
|
+
onKeyDown: handleKeyDown,
|
|
252
|
+
onKeyUp: props.onKeyUp,
|
|
253
|
+
ref: FormField.mergeRefs([inputRefs, inputTextRef]),
|
|
254
|
+
};
|
|
255
|
+
return (React.createElement(FormField.FormFieldWrapper, { disabled: props.disabled, size: props.size, align: props.align, inline: props.inline, autofocus: props.autoFocus, 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", maxLength: props.maxLength, onClear: handleClear, type: props.multiline ? "textarea" : "text", placeholder: props.placeholder, value: props.value, prefix: props.prefix, suffix: props.suffix, rows: rowRange.min, toolbar: props.toolbar, toolbarVisibility: props.toolbarVisibility },
|
|
227
256
|
React.createElement(React.Fragment, null,
|
|
228
|
-
props.multiline ? (React.createElement(TextArea, {
|
|
257
|
+
props.multiline ? (React.createElement(TextArea, Object.assign({}, commonInputProps, { rows: rowRange.min }))) : (React.createElement(TextInput, Object.assign({}, commonInputProps, { pattern: props.pattern }))),
|
|
229
258
|
React.createElement(FormField.FormFieldPostFix, { variation: "spinner", visible: (_c = props.loading) !== null && _c !== void 0 ? _c : false }),
|
|
230
259
|
props.children)));
|
|
231
260
|
});
|
|
232
261
|
function useInputTextId(props) {
|
|
233
262
|
const generatedId = React.useId();
|
|
234
|
-
return props.
|
|
263
|
+
return props.id || generatedId;
|
|
235
264
|
}
|
|
236
265
|
const TextArea = React.forwardRef(function TextArea(props, ref) {
|
|
237
266
|
return React.createElement("textarea", Object.assign({}, props, { ref: ref }));
|
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, j as useFormFieldWrapperStyles, b as useAtlantisFormFieldName,
|
|
3
|
+
import { k as FormField, j as useFormFieldWrapperStyles, b as useAtlantisFormFieldName, m as mergeRefs, f as FormFieldWrapper, l as FormFieldPostFix } from '../FormField-es.js';
|
|
4
4
|
import 'classnames';
|
|
5
5
|
import '../tslib.es6-es.js';
|
|
6
6
|
import 'react-hook-form';
|
|
@@ -148,7 +148,6 @@ function insertAtCursor(input, newText) {
|
|
|
148
148
|
function useInputTextActions({ onChange, inputRef, onEnter, onFocus, onBlur, onKeyDown, }) {
|
|
149
149
|
function handleClear() {
|
|
150
150
|
var _a;
|
|
151
|
-
// Don't call blur handler when programmatically clearing
|
|
152
151
|
onChange && onChange("");
|
|
153
152
|
(_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
154
153
|
}
|
|
@@ -200,8 +199,7 @@ const InputTextSPAR = forwardRef(function InputTextInternal(props, inputRefs) {
|
|
|
200
199
|
value: props.value,
|
|
201
200
|
invalid: props.invalid,
|
|
202
201
|
error: props.error,
|
|
203
|
-
|
|
204
|
-
maxLength: undefined, // v2: maxLength is for HTML validation only, not for width styling
|
|
202
|
+
maxLength: props.maxLength,
|
|
205
203
|
type: props.multiline ? "textarea" : "text",
|
|
206
204
|
disabled: props.disabled,
|
|
207
205
|
inline: props.inline,
|
|
@@ -220,16 +218,47 @@ const InputTextSPAR = forwardRef(function InputTextInternal(props, inputRefs) {
|
|
|
220
218
|
});
|
|
221
219
|
const descriptionIdentifier = `descriptionUUID--${id}`;
|
|
222
220
|
const hasDescription = props.description && !props.inline;
|
|
223
|
-
const isInvalid = Boolean(props.
|
|
224
|
-
|
|
221
|
+
const isInvalid = Boolean(props.error || props.invalid);
|
|
222
|
+
// Shared props for both TextArea and TextInput
|
|
223
|
+
const commonInputProps = {
|
|
224
|
+
id,
|
|
225
|
+
name,
|
|
226
|
+
className: inputStyle,
|
|
227
|
+
value: props.value,
|
|
228
|
+
disabled: props.disabled,
|
|
229
|
+
readOnly: props.readOnly,
|
|
230
|
+
autoFocus: props.autoFocus,
|
|
231
|
+
autoComplete: props.autoComplete,
|
|
232
|
+
inputMode: props.inputMode,
|
|
233
|
+
tabIndex: props.tabIndex,
|
|
234
|
+
maxLength: props.maxLength,
|
|
235
|
+
role: props.role,
|
|
236
|
+
"aria-label": props.ariaLabel,
|
|
237
|
+
"aria-describedby": hasDescription
|
|
238
|
+
? descriptionIdentifier
|
|
239
|
+
: props.ariaDescribedBy,
|
|
240
|
+
"aria-invalid": isInvalid ? true : undefined,
|
|
241
|
+
"aria-controls": props.ariaControls,
|
|
242
|
+
"aria-expanded": props.ariaExpanded,
|
|
243
|
+
"aria-activedescendant": props.ariaActiveDescendant,
|
|
244
|
+
"aria-autocomplete": props.ariaAutocomplete,
|
|
245
|
+
"aria-required": props.ariaRequired,
|
|
246
|
+
onChange: handleChange,
|
|
247
|
+
onBlur: handleBlur,
|
|
248
|
+
onFocus: handleFocus,
|
|
249
|
+
onKeyDown: handleKeyDown,
|
|
250
|
+
onKeyUp: props.onKeyUp,
|
|
251
|
+
ref: mergeRefs([inputRefs, inputTextRef]),
|
|
252
|
+
};
|
|
253
|
+
return (React__default.createElement(FormFieldWrapper, { disabled: props.disabled, size: props.size, align: props.align, inline: props.inline, autofocus: props.autoFocus, 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", maxLength: props.maxLength, onClear: handleClear, type: props.multiline ? "textarea" : "text", placeholder: props.placeholder, value: props.value, prefix: props.prefix, suffix: props.suffix, rows: rowRange.min, toolbar: props.toolbar, toolbarVisibility: props.toolbarVisibility },
|
|
225
254
|
React__default.createElement(React__default.Fragment, null,
|
|
226
|
-
props.multiline ? (React__default.createElement(TextArea, {
|
|
255
|
+
props.multiline ? (React__default.createElement(TextArea, Object.assign({}, commonInputProps, { rows: rowRange.min }))) : (React__default.createElement(TextInput, Object.assign({}, commonInputProps, { pattern: props.pattern }))),
|
|
227
256
|
React__default.createElement(FormFieldPostFix, { variation: "spinner", visible: (_c = props.loading) !== null && _c !== void 0 ? _c : false }),
|
|
228
257
|
props.children)));
|
|
229
258
|
});
|
|
230
259
|
function useInputTextId(props) {
|
|
231
260
|
const generatedId = useId();
|
|
232
|
-
return props.
|
|
261
|
+
return props.id || generatedId;
|
|
233
262
|
}
|
|
234
263
|
const TextArea = forwardRef(function TextArea(props, ref) {
|
|
235
264
|
return React__default.createElement("textarea", Object.assign({}, props, { ref: ref }));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommonFormFieldProps, FormFieldProps } from "../FormField";
|
|
2
|
-
import type { AriaInputProps, FocusEvents, KeyboardEvents } from "../
|
|
2
|
+
import type { AriaInputProps, FocusEvents, InputConstraintProps, InputLengthConstraint, KeyboardEvents } from "../sharedHelpers/types";
|
|
3
3
|
export interface InputTimeProps extends Pick<CommonFormFieldProps, "id" | "align" | "description" | "disabled" | "invalid" | "inline" | "loading" | "name" | "onValidation" | "placeholder" | "size" | "clearable">, Pick<FormFieldProps, "maxLength" | "readonly" | "autocomplete" | "max" | "min" | "onEnter" | "onFocus" | "onBlur" | "inputRef" | "validations"> {
|
|
4
4
|
/**
|
|
5
5
|
* Intial value of the input. Only use this when you need to prepopulate the
|
|
@@ -19,7 +19,7 @@ export interface InputTimeProps extends Pick<CommonFormFieldProps, "id" | "align
|
|
|
19
19
|
export interface InputTimeLegacyProps extends InputTimeProps {
|
|
20
20
|
version?: 1;
|
|
21
21
|
}
|
|
22
|
-
export interface InputTimeRebuiltProps extends Omit<InputTimeProps, "defaultValue" | "version" | "validations" | "onValidation" | "readonly" | "autocomplete" | "inputRef" | "onFocus" | "onBlur" | "onEnter">, AriaInputProps, FocusEvents<HTMLInputElement>, KeyboardEvents<HTMLInputElement
|
|
22
|
+
export interface InputTimeRebuiltProps extends Omit<InputTimeProps, "defaultValue" | "version" | "validations" | "onValidation" | "readonly" | "autocomplete" | "inputRef" | "onFocus" | "onBlur" | "onEnter" | "max" | "min" | "maxLength">, AriaInputProps, FocusEvents<HTMLInputElement>, KeyboardEvents<HTMLInputElement>, InputLengthConstraint, InputConstraintProps {
|
|
23
23
|
/**
|
|
24
24
|
* Version 2 is highly experimental, avoid using it unless you have talked with Atlantis first.
|
|
25
25
|
*/
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ChangeEvent, FocusEvent, KeyboardEvent } from "react";
|
|
2
|
+
import type { InputTimeRebuiltProps } from "../InputTime.types";
|
|
3
|
+
export interface UseInputTimeActionsProps extends Pick<InputTimeRebuiltProps, "onChange" | "onFocus" | "onBlur" | "onKeyDown"> {
|
|
4
|
+
readonly value?: Date;
|
|
5
|
+
readonly readOnly?: boolean;
|
|
6
|
+
readonly disabled?: boolean;
|
|
7
|
+
readonly inputRef?: React.RefObject<HTMLInputElement>;
|
|
8
|
+
}
|
|
9
|
+
export declare function useInputTimeActions({ onChange, value, inputRef, onFocus, onBlur, onKeyDown, }: UseInputTimeActionsProps): {
|
|
10
|
+
handleChangeEvent: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
11
|
+
handleChange: (newValue: string) => void;
|
|
12
|
+
handleBlur: (event: FocusEvent<HTMLInputElement>) => void;
|
|
13
|
+
handleClear: () => void;
|
|
14
|
+
handleFocus: (event: FocusEvent<HTMLInputElement>) => void;
|
|
15
|
+
handleKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void;
|
|
16
|
+
};
|
package/dist/InputTime/index.cjs
CHANGED
|
@@ -204,6 +204,43 @@ function timeStringToDate(timeString, baseDate) {
|
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
+
function useInputTimeActions({ onChange, value, inputRef, onFocus, onBlur, onKeyDown, }) {
|
|
208
|
+
function handleChangeEvent(event) {
|
|
209
|
+
handleChange(event.target.value);
|
|
210
|
+
}
|
|
211
|
+
function handleChange(newValue) {
|
|
212
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(timeStringToDate(newValue, value));
|
|
213
|
+
}
|
|
214
|
+
function handleBlur(event) {
|
|
215
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
216
|
+
if (inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) {
|
|
217
|
+
if (!inputRef.current.checkValidity()) {
|
|
218
|
+
inputRef.current.value = "";
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
function handleClear() {
|
|
223
|
+
var _a;
|
|
224
|
+
// Clear the value and refocus without triggering blur event
|
|
225
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(undefined);
|
|
226
|
+
(_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
227
|
+
}
|
|
228
|
+
function handleFocus(event) {
|
|
229
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
|
|
230
|
+
}
|
|
231
|
+
function handleKeyDown(event) {
|
|
232
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);
|
|
233
|
+
}
|
|
234
|
+
return {
|
|
235
|
+
handleChangeEvent,
|
|
236
|
+
handleChange,
|
|
237
|
+
handleBlur,
|
|
238
|
+
handleClear,
|
|
239
|
+
handleFocus,
|
|
240
|
+
handleKeyDown,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
|
|
207
244
|
const InputTimeRebuilt = React.forwardRef(function InputTimeRebuilt(_a, forwardedRef) {
|
|
208
245
|
var _b;
|
|
209
246
|
var { value, onChange, readOnly, autoComplete,
|
|
@@ -218,43 +255,31 @@ const InputTimeRebuilt = React.forwardRef(function InputTimeRebuilt(_a, forwarde
|
|
|
218
255
|
const id = params.id || React.useId();
|
|
219
256
|
const wrapperRef = React.useRef(null);
|
|
220
257
|
const { inputStyle } = FormField.useFormFieldWrapperStyles(params);
|
|
258
|
+
const { handleChangeEvent, handleChange, handleBlur, handleClear, handleFocus, handleKeyDown, } = useInputTimeActions({
|
|
259
|
+
onChange,
|
|
260
|
+
value,
|
|
261
|
+
readOnly,
|
|
262
|
+
disabled: params.disabled,
|
|
263
|
+
inputRef: internalRef,
|
|
264
|
+
onFocus: params.onFocus,
|
|
265
|
+
onBlur: params.onBlur,
|
|
266
|
+
onKeyDown: params.onKeyDown,
|
|
267
|
+
});
|
|
221
268
|
const { setTypedTime } = useTimePredict({
|
|
222
269
|
value,
|
|
223
270
|
handleChange,
|
|
224
271
|
});
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
var _a;
|
|
228
|
-
(_a = params.onKeyUp) === null || _a === void 0 ? void 0 : _a.call(params, e);
|
|
229
|
-
if (params.disabled || readOnly)
|
|
230
|
-
return;
|
|
231
|
-
!isNaN(parseInt(e.key, 10)) && setTypedTime(prev => prev + e.key);
|
|
232
|
-
}, "data-testid": "ATL-InputTime-input", value: dateToTimeString(value), "aria-label": params.ariaLabel, "aria-describedby": params.ariaDescribedBy, "aria-invalid": params.ariaInvalid, "aria-required": params.ariaRequired })));
|
|
233
|
-
function handleChangeEvent(event) {
|
|
234
|
-
handleChange(event.target.value);
|
|
235
|
-
}
|
|
236
|
-
function handleChange(newValue) {
|
|
237
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(timeStringToDate(newValue, value));
|
|
238
|
-
}
|
|
239
|
-
function handleBlur(event) {
|
|
272
|
+
// Kept outside the useInputTimeActions hook to avoid circular dependency via setTypedTime and handleChange
|
|
273
|
+
function handleKeyUp(event) {
|
|
240
274
|
var _a;
|
|
241
|
-
(_a = params.
|
|
242
|
-
if (
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
function handleClear() {
|
|
249
|
-
var _a;
|
|
250
|
-
// Clear the value and refocus without triggering blur event
|
|
251
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(undefined);
|
|
252
|
-
(_a = internalRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
253
|
-
}
|
|
254
|
-
function handleFocus(event) {
|
|
255
|
-
var _a;
|
|
256
|
-
(_a = params.onFocus) === null || _a === void 0 ? void 0 : _a.call(params, event);
|
|
275
|
+
(_a = params.onKeyUp) === null || _a === void 0 ? void 0 : _a.call(params, event);
|
|
276
|
+
if (params.disabled || readOnly)
|
|
277
|
+
return;
|
|
278
|
+
!isNaN(parseInt(event.key, 10)) && setTypedTime(prev => prev + event.key);
|
|
257
279
|
}
|
|
280
|
+
const isInvalid = Boolean(params.error || params.invalid);
|
|
281
|
+
return (React.createElement(FormField.FormFieldWrapper, { disabled: params.disabled, size: params.size, align: params.align, inline: params.inline, name: params.name, error: params.error || "", identifier: id, descriptionIdentifier: `descriptionUUID--${id}`, invalid: Boolean(params.invalid), description: params.description, maxLength: params.maxLength, clearable: (_b = params.clearable) !== null && _b !== void 0 ? _b : "never", onClear: handleClear, type: "time", readonly: readOnly, placeholder: params.placeholder, value: dateToTimeString(value), wrapperRef: wrapperRef },
|
|
282
|
+
React.createElement("input", { ref: mergedRef, type: "time", name: params.name, className: inputStyle, id: id, disabled: params.disabled, readOnly: readOnly, autoComplete: autoComplete, maxLength: params.maxLength, max: params.max, min: params.min, value: dateToTimeString(value), onChange: handleChangeEvent, onBlur: handleBlur, onFocus: handleFocus, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, "data-testid": "ATL-InputTime-input", "aria-label": params.ariaLabel, "aria-describedby": params.ariaDescribedBy, "aria-invalid": isInvalid ? true : undefined, "aria-required": params.ariaRequired })));
|
|
258
283
|
});
|
|
259
284
|
|
|
260
285
|
function InputTime$1(_a) {
|
package/dist/InputTime/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default, { useState, useCallback, useEffect, forwardRef, useRef, useId } from 'react';
|
|
2
2
|
import { _ as __rest } from '../tslib.es6-es.js';
|
|
3
|
-
import {
|
|
3
|
+
import { a as debounce } from '../debounce-es.js';
|
|
4
4
|
import { j as useFormFieldWrapperStyles, f as FormFieldWrapper, m as mergeRefs, k as FormField } from '../FormField-es.js';
|
|
5
5
|
import 'classnames';
|
|
6
6
|
import '@jobber/design';
|
|
@@ -202,6 +202,43 @@ function timeStringToDate(timeString, baseDate) {
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
function useInputTimeActions({ onChange, value, inputRef, onFocus, onBlur, onKeyDown, }) {
|
|
206
|
+
function handleChangeEvent(event) {
|
|
207
|
+
handleChange(event.target.value);
|
|
208
|
+
}
|
|
209
|
+
function handleChange(newValue) {
|
|
210
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(timeStringToDate(newValue, value));
|
|
211
|
+
}
|
|
212
|
+
function handleBlur(event) {
|
|
213
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
214
|
+
if (inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) {
|
|
215
|
+
if (!inputRef.current.checkValidity()) {
|
|
216
|
+
inputRef.current.value = "";
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
function handleClear() {
|
|
221
|
+
var _a;
|
|
222
|
+
// Clear the value and refocus without triggering blur event
|
|
223
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(undefined);
|
|
224
|
+
(_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
225
|
+
}
|
|
226
|
+
function handleFocus(event) {
|
|
227
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
|
|
228
|
+
}
|
|
229
|
+
function handleKeyDown(event) {
|
|
230
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);
|
|
231
|
+
}
|
|
232
|
+
return {
|
|
233
|
+
handleChangeEvent,
|
|
234
|
+
handleChange,
|
|
235
|
+
handleBlur,
|
|
236
|
+
handleClear,
|
|
237
|
+
handleFocus,
|
|
238
|
+
handleKeyDown,
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
|
|
205
242
|
const InputTimeRebuilt = forwardRef(function InputTimeRebuilt(_a, forwardedRef) {
|
|
206
243
|
var _b;
|
|
207
244
|
var { value, onChange, readOnly, autoComplete,
|
|
@@ -216,43 +253,31 @@ const InputTimeRebuilt = forwardRef(function InputTimeRebuilt(_a, forwardedRef)
|
|
|
216
253
|
const id = params.id || useId();
|
|
217
254
|
const wrapperRef = React__default.useRef(null);
|
|
218
255
|
const { inputStyle } = useFormFieldWrapperStyles(params);
|
|
256
|
+
const { handleChangeEvent, handleChange, handleBlur, handleClear, handleFocus, handleKeyDown, } = useInputTimeActions({
|
|
257
|
+
onChange,
|
|
258
|
+
value,
|
|
259
|
+
readOnly,
|
|
260
|
+
disabled: params.disabled,
|
|
261
|
+
inputRef: internalRef,
|
|
262
|
+
onFocus: params.onFocus,
|
|
263
|
+
onBlur: params.onBlur,
|
|
264
|
+
onKeyDown: params.onKeyDown,
|
|
265
|
+
});
|
|
219
266
|
const { setTypedTime } = useTimePredict({
|
|
220
267
|
value,
|
|
221
268
|
handleChange,
|
|
222
269
|
});
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
var _a;
|
|
226
|
-
(_a = params.onKeyUp) === null || _a === void 0 ? void 0 : _a.call(params, e);
|
|
227
|
-
if (params.disabled || readOnly)
|
|
228
|
-
return;
|
|
229
|
-
!isNaN(parseInt(e.key, 10)) && setTypedTime(prev => prev + e.key);
|
|
230
|
-
}, "data-testid": "ATL-InputTime-input", value: dateToTimeString(value), "aria-label": params.ariaLabel, "aria-describedby": params.ariaDescribedBy, "aria-invalid": params.ariaInvalid, "aria-required": params.ariaRequired })));
|
|
231
|
-
function handleChangeEvent(event) {
|
|
232
|
-
handleChange(event.target.value);
|
|
233
|
-
}
|
|
234
|
-
function handleChange(newValue) {
|
|
235
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(timeStringToDate(newValue, value));
|
|
236
|
-
}
|
|
237
|
-
function handleBlur(event) {
|
|
270
|
+
// Kept outside the useInputTimeActions hook to avoid circular dependency via setTypedTime and handleChange
|
|
271
|
+
function handleKeyUp(event) {
|
|
238
272
|
var _a;
|
|
239
|
-
(_a = params.
|
|
240
|
-
if (
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
function handleClear() {
|
|
247
|
-
var _a;
|
|
248
|
-
// Clear the value and refocus without triggering blur event
|
|
249
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(undefined);
|
|
250
|
-
(_a = internalRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
251
|
-
}
|
|
252
|
-
function handleFocus(event) {
|
|
253
|
-
var _a;
|
|
254
|
-
(_a = params.onFocus) === null || _a === void 0 ? void 0 : _a.call(params, event);
|
|
273
|
+
(_a = params.onKeyUp) === null || _a === void 0 ? void 0 : _a.call(params, event);
|
|
274
|
+
if (params.disabled || readOnly)
|
|
275
|
+
return;
|
|
276
|
+
!isNaN(parseInt(event.key, 10)) && setTypedTime(prev => prev + event.key);
|
|
255
277
|
}
|
|
278
|
+
const isInvalid = Boolean(params.error || params.invalid);
|
|
279
|
+
return (React__default.createElement(FormFieldWrapper, { disabled: params.disabled, size: params.size, align: params.align, inline: params.inline, name: params.name, error: params.error || "", identifier: id, descriptionIdentifier: `descriptionUUID--${id}`, invalid: Boolean(params.invalid), description: params.description, maxLength: params.maxLength, clearable: (_b = params.clearable) !== null && _b !== void 0 ? _b : "never", onClear: handleClear, type: "time", readonly: readOnly, placeholder: params.placeholder, value: dateToTimeString(value), wrapperRef: wrapperRef },
|
|
280
|
+
React__default.createElement("input", { ref: mergedRef, type: "time", name: params.name, className: inputStyle, id: id, disabled: params.disabled, readOnly: readOnly, autoComplete: autoComplete, maxLength: params.maxLength, max: params.max, min: params.min, value: dateToTimeString(value), onChange: handleChangeEvent, onBlur: handleBlur, onFocus: handleFocus, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, "data-testid": "ATL-InputTime-input", "aria-label": params.ariaLabel, "aria-describedby": params.ariaDescribedBy, "aria-invalid": isInvalid ? true : undefined, "aria-required": params.ariaRequired })));
|
|
256
281
|
});
|
|
257
282
|
|
|
258
283
|
function InputTime$1(_a) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommonFormFieldProps, FormFieldProps } from "../FormField";
|
|
2
|
-
import type { AriaInputProps, FocusEvents } from "../
|
|
2
|
+
import type { AriaInputProps, FocusEvents } from "../sharedHelpers/types";
|
|
3
3
|
export interface SelectLegacyProps extends Pick<CommonFormFieldProps, "id" | "align" | "description" | "disabled" | "invalid" | "inline" | "name" | "onValidation" | "placeholder" | "size" | "value" | "onChange">, Pick<FormFieldProps, "autofocus" | "onEnter" | "onBlur" | "onFocus" | "inputRef" | "wrapperRef" | "validations" | "children" | "prefix" | "suffix" | "defaultValue" | "version"> {
|
|
4
4
|
/**
|
|
5
5
|
* Changes the width to roughly the same size as the maximum character length
|
package/dist/Select/index.cjs
CHANGED
|
@@ -80,12 +80,13 @@ const SelectRebuilt = React.forwardRef(function SelectRebuilt(props, forwardedRe
|
|
|
80
80
|
onBlur: props.onBlur,
|
|
81
81
|
onFocus: props.onFocus,
|
|
82
82
|
});
|
|
83
|
+
const isInvalid = Boolean(props.error || props.invalid);
|
|
83
84
|
return (React.createElement(FormField.FormFieldWrapper, { disabled: props.disabled, size: props.size, align: props.align, inline: props.inline, autofocus: props.autoFocus, name: name, wrapperRef: wrapperRef, error: (_a = props.error) !== null && _a !== void 0 ? _a : "", invalid: props.invalid, identifier: id, descriptionIdentifier: descriptionIdentifier, description: props.description, type: "select", placeholder: props.placeholder, value: props.value, prefix: props.prefix, suffix: props.suffix, clearable: "never", maxLength: props.maxLength },
|
|
84
85
|
React.createElement(React.Fragment, null,
|
|
85
86
|
React.createElement("select", { id: id, name: name, disabled: props.disabled, autoFocus: props.autoFocus, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, value: props.value, "aria-label": props.ariaLabel, "aria-describedby": props.ariaDescribedBy ||
|
|
86
87
|
(props.description && !props.inline
|
|
87
88
|
? descriptionIdentifier
|
|
88
|
-
: undefined), "aria-invalid":
|
|
89
|
+
: undefined), "aria-invalid": isInvalid ? true : undefined, "aria-required": props.ariaRequired, ref: mergedRef, className: classnames(inputStyle, props.UNSAFE_experimentalStyles && styles.select) }, props.children),
|
|
89
90
|
React.createElement(FormField.FormFieldPostFix, { variation: "select", className: styles.selectPostfix }))));
|
|
90
91
|
});
|
|
91
92
|
function useSelectId(props) {
|
package/dist/Select/index.mjs
CHANGED
|
@@ -78,12 +78,13 @@ const SelectRebuilt = forwardRef(function SelectRebuilt(props, forwardedRef) {
|
|
|
78
78
|
onBlur: props.onBlur,
|
|
79
79
|
onFocus: props.onFocus,
|
|
80
80
|
});
|
|
81
|
+
const isInvalid = Boolean(props.error || props.invalid);
|
|
81
82
|
return (React__default.createElement(FormFieldWrapper, { disabled: props.disabled, size: props.size, align: props.align, inline: props.inline, autofocus: props.autoFocus, name: name, wrapperRef: wrapperRef, error: (_a = props.error) !== null && _a !== void 0 ? _a : "", invalid: props.invalid, identifier: id, descriptionIdentifier: descriptionIdentifier, description: props.description, type: "select", placeholder: props.placeholder, value: props.value, prefix: props.prefix, suffix: props.suffix, clearable: "never", maxLength: props.maxLength },
|
|
82
83
|
React__default.createElement(React__default.Fragment, null,
|
|
83
84
|
React__default.createElement("select", { id: id, name: name, disabled: props.disabled, autoFocus: props.autoFocus, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, value: props.value, "aria-label": props.ariaLabel, "aria-describedby": props.ariaDescribedBy ||
|
|
84
85
|
(props.description && !props.inline
|
|
85
86
|
? descriptionIdentifier
|
|
86
|
-
: undefined), "aria-invalid":
|
|
87
|
+
: undefined), "aria-invalid": isInvalid ? true : undefined, "aria-required": props.ariaRequired, ref: mergedRef, className: classnames(inputStyle, props.UNSAFE_experimentalStyles && styles.select) }, props.children),
|
|
87
88
|
React__default.createElement(FormFieldPostFix, { variation: "select", className: styles.selectPostfix }))));
|
|
88
89
|
});
|
|
89
90
|
function useSelectId(props) {
|
package/dist/Tabs-es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { useState, useRef, useCallback, useEffect } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import { g as getDefaultExportFromCjs } from './_commonjsHelpers-es.js';
|
|
4
|
-
import {
|
|
4
|
+
import { d as debounce_1 } from './debounce-es.js';
|
|
5
5
|
import { a as isObject_1 } from './isObjectLike-es.js';
|
|
6
6
|
import { T as Typography } from './Typography-es.js';
|
|
7
7
|
|
package/dist/debounce-es.js
CHANGED