@jobber/components 6.104.0 → 6.105.0
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 +9 -51
- package/dist/Autocomplete/index.cjs +10 -20
- package/dist/Autocomplete/index.mjs +10 -20
- package/dist/Autocomplete/tests/Autocomplete.setup.d.ts +1 -1
- package/dist/Autocomplete/useAutocomplete.d.ts +2 -2
- package/dist/Checkbox/Checkbox.rebuilt.d.ts +2 -2
- package/dist/Checkbox/Checkbox.types.d.ts +24 -18
- package/dist/Checkbox/index.cjs +9 -2
- package/dist/Checkbox/index.mjs +9 -2
- package/dist/Chips/InternalChipDismissible/hooks/index.cjs +2 -2
- package/dist/Chips/InternalChipDismissible/hooks/index.mjs +2 -2
- package/dist/Chips/InternalChipDismissible/index.cjs +2 -2
- package/dist/Chips/InternalChipDismissible/index.mjs +2 -2
- package/dist/Chips/index.cjs +2 -2
- package/dist/Chips/index.mjs +2 -2
- package/dist/DataList/components/DataListHeader/index.cjs +1 -0
- package/dist/DataList/components/DataListHeader/index.mjs +1 -0
- package/dist/DataList/components/DataListItem/index.cjs +1 -0
- package/dist/DataList/components/DataListItem/index.mjs +1 -0
- package/dist/DataList/components/DataListItems/index.cjs +1 -0
- package/dist/DataList/components/DataListItems/index.mjs +1 -0
- package/dist/DataList/components/DataListLayout/index.cjs +1 -0
- package/dist/DataList/components/DataListLayout/index.mjs +1 -0
- package/dist/DataList/components/DataListSearch/index.cjs +2 -12
- package/dist/DataList/components/DataListSearch/index.mjs +2 -12
- package/dist/DataList/index.cjs +1 -8
- package/dist/DataList/index.mjs +1 -8
- package/dist/DataTable/index.cjs +3 -2
- package/dist/DataTable/index.mjs +3 -2
- package/dist/DatePicker/index.cjs +2 -2
- package/dist/DatePicker/index.mjs +2 -2
- package/dist/FormField/FormFieldTypes.d.ts +0 -2
- package/dist/FormField/hooks/useFormFieldWrapperStyles.d.ts +7 -2
- package/dist/FormField-cjs.js +0 -1
- package/dist/FormField-es.js +1 -1
- package/dist/InputDate/InputDate.types.d.ts +12 -7
- package/dist/InputDate/index.cjs +6 -9
- package/dist/InputDate/index.mjs +6 -9
- package/dist/InputDate/useInputDateActivatorActions.d.ts +4 -8
- package/dist/InputEmail/InputEmail.types.d.ts +10 -20
- package/dist/InputEmail/hooks/useInputEmailActions.d.ts +10 -4
- package/dist/InputEmail/index.cjs +43 -49
- package/dist/InputEmail/index.mjs +43 -49
- package/dist/InputNumber/InputNumber.rebuilt.types.d.ts +7 -15
- package/dist/InputNumber/index.cjs +6 -4
- package/dist/InputNumber/index.mjs +6 -4
- package/dist/InputPhoneNumber/InputPhoneNumber.types.d.ts +12 -28
- package/dist/InputPhoneNumber/hooks/useInputPhoneActions.d.ts +9 -4
- package/dist/InputPhoneNumber/index.cjs +48 -36
- package/dist/InputPhoneNumber/index.mjs +48 -36
- package/dist/InputText/InputText.types.d.ts +31 -25
- package/dist/InputText/index.cjs +66 -62
- package/dist/InputText/index.mjs +67 -63
- package/dist/InputText/useInputTextActions.d.ts +10 -4
- package/dist/InputTime/InputTime.rebuilt.d.ts +1 -1
- package/dist/InputTime/InputTime.types.d.ts +13 -4
- package/dist/InputTime/hooks/useInputTimeActions.d.ts +21 -0
- package/dist/InputTime/index.cjs +91 -30
- package/dist/InputTime/index.mjs +94 -33
- package/dist/List/index.cjs +2 -2
- package/dist/List/index.mjs +2 -2
- package/dist/MultiSelect/index.cjs +1 -0
- package/dist/MultiSelect/index.mjs +1 -0
- package/dist/RecurringSelect/index.cjs +3 -2
- package/dist/RecurringSelect/index.mjs +3 -2
- package/dist/Select/Select.types.d.ts +7 -3
- package/dist/Select/hooks/useSelectActions.d.ts +5 -5
- package/dist/Select/index.cjs +27 -41
- package/dist/Select/index.mjs +29 -43
- package/dist/Tabs-es.js +1 -1
- package/dist/_baseEach-cjs.js +12 -12
- package/dist/_baseEach-es.js +1 -1
- package/dist/_baseFlatten-cjs.js +2 -2
- package/dist/_baseFlatten-es.js +1 -1
- package/dist/{_baseGet-cjs.js → _getAllKeys-cjs.js} +181 -181
- package/dist/{_baseGet-es.js → _getAllKeys-es.js} +182 -182
- package/dist/debounce-es.js +1 -1
- package/dist/filterDataAttributes-cjs.js +26 -0
- package/dist/filterDataAttributes-es.js +24 -0
- package/dist/index.cjs +3 -2
- package/dist/index.mjs +3 -2
- package/dist/omit-cjs.js +14 -14
- package/dist/omit-es.js +1 -1
- package/dist/sharedHelpers/filterDataAttributes.d.ts +17 -0
- package/dist/sharedHelpers/types.d.ts +231 -0
- package/dist/useScrollToActive-cjs.js +3 -3
- package/dist/useScrollToActive-es.js +2 -2
- package/package.json +2 -2
- package/dist/InputEmail/hooks/useInputEmailFormField.d.ts +0 -32
- package/dist/InputPhoneNumber/hooks/useInputPhoneFormField.d.ts +0 -71
- package/dist/InputText/useInputTextFormField.d.ts +0 -366
- package/dist/Select/hooks/useSelectFormField.d.ts +0 -34
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import type { AriaAttributes, ReactNode } from "react";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
import type { XOR } from "ts-xor";
|
|
4
|
+
import type { Clearable } from "@jobber/hooks";
|
|
5
|
+
import type { IconNames } from "../Icon";
|
|
1
6
|
export interface CommonAtlantisProps {
|
|
2
7
|
/** Standard HTML data attributes. Accepts anything in a {{"data-key":"value"}} format. */
|
|
3
8
|
dataAttributes?: {
|
|
@@ -10,8 +15,234 @@ export interface CommonAtlantisProps {
|
|
|
10
15
|
/** Standard HTML id attribute. */
|
|
11
16
|
id?: string;
|
|
12
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Core ARIA attributes for input elements.
|
|
20
|
+
* Uses hyphenated naming to match HTML standard syntax.
|
|
21
|
+
* Based on React's canonical ARIA type definitions.
|
|
22
|
+
*/
|
|
23
|
+
export interface AriaInputProps {
|
|
24
|
+
/**
|
|
25
|
+
* Defines a string value that labels the current element.
|
|
26
|
+
* @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-label}
|
|
27
|
+
*/
|
|
28
|
+
readonly "aria-label"?: AriaAttributes["aria-label"];
|
|
29
|
+
/**
|
|
30
|
+
* Identifies the element (or elements) that labels the current element.
|
|
31
|
+
* @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-labelledby}
|
|
32
|
+
*/
|
|
33
|
+
readonly "aria-labelledby"?: AriaAttributes["aria-labelledby"];
|
|
34
|
+
/**
|
|
35
|
+
* Identifies the element (or elements) that describes the object.
|
|
36
|
+
* @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-describedby}
|
|
37
|
+
*/
|
|
38
|
+
readonly "aria-describedby"?: AriaAttributes["aria-describedby"];
|
|
39
|
+
/**
|
|
40
|
+
* Identifies the element (or elements) that provide a detailed, extended description.
|
|
41
|
+
* @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-details}
|
|
42
|
+
*/
|
|
43
|
+
readonly "aria-details"?: AriaAttributes["aria-details"];
|
|
44
|
+
/**
|
|
45
|
+
* ID of the currently active descendant element.
|
|
46
|
+
* Used for composite widgets like combobox or listbox.
|
|
47
|
+
* @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-activedescendant}
|
|
48
|
+
*/
|
|
49
|
+
readonly "aria-activedescendant"?: AriaAttributes["aria-activedescendant"];
|
|
50
|
+
/**
|
|
51
|
+
* Indicates the element that controls the current element.
|
|
52
|
+
* @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-controls}
|
|
53
|
+
*/
|
|
54
|
+
readonly "aria-controls"?: AriaAttributes["aria-controls"];
|
|
55
|
+
/**
|
|
56
|
+
* Indicates whether the element is expanded or collapsed.
|
|
57
|
+
* @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-expanded}
|
|
58
|
+
*/
|
|
59
|
+
readonly "aria-expanded"?: AriaAttributes["aria-expanded"];
|
|
60
|
+
/**
|
|
61
|
+
* Indicates the type of autocomplete interaction.
|
|
62
|
+
* @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-autocomplete}
|
|
63
|
+
*/
|
|
64
|
+
readonly "aria-autocomplete"?: AriaAttributes["aria-autocomplete"];
|
|
65
|
+
/**
|
|
66
|
+
* Indicates that user input is required before form submission.
|
|
67
|
+
* @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-required}
|
|
68
|
+
*/
|
|
69
|
+
readonly "aria-required"?: AriaAttributes["aria-required"];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Focus event handlers for input elements.
|
|
73
|
+
* Generic interface that can be specialized for different element types.
|
|
74
|
+
*/
|
|
75
|
+
export interface FocusEvents<Target = HTMLElement> {
|
|
76
|
+
/**
|
|
77
|
+
* Focus event handler.
|
|
78
|
+
*/
|
|
79
|
+
readonly onFocus?: (event: React.FocusEvent<Target>) => void;
|
|
80
|
+
/**
|
|
81
|
+
* Blur event handler.
|
|
82
|
+
*/
|
|
83
|
+
readonly onBlur?: (event: React.FocusEvent<Target>) => void;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Mouse event handlers for input elements.
|
|
87
|
+
* Generic interface that can be specialized for different element types.
|
|
88
|
+
*/
|
|
89
|
+
export interface MouseEvents<Target = HTMLElement> {
|
|
90
|
+
/**
|
|
91
|
+
* Mouse down event handler.
|
|
92
|
+
*/
|
|
93
|
+
readonly onMouseDown?: (event: React.MouseEvent<Target>) => void;
|
|
94
|
+
/**
|
|
95
|
+
* Mouse up event handler.
|
|
96
|
+
*/
|
|
97
|
+
readonly onMouseUp?: (event: React.MouseEvent<Target>) => void;
|
|
98
|
+
/**
|
|
99
|
+
* Pointer down event handler.
|
|
100
|
+
*/
|
|
101
|
+
readonly onPointerDown?: (event: React.PointerEvent<Target>) => void;
|
|
102
|
+
/**
|
|
103
|
+
* Pointer up event handler.
|
|
104
|
+
*/
|
|
105
|
+
readonly onPointerUp?: (event: React.PointerEvent<Target>) => void;
|
|
106
|
+
/**
|
|
107
|
+
* Click event handler.
|
|
108
|
+
*/
|
|
109
|
+
readonly onClick?: (event: React.MouseEvent<Target>) => void;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Keyboard event handlers for input elements.
|
|
113
|
+
* Generic interface that can be specialized for different element types.
|
|
114
|
+
*/
|
|
115
|
+
export interface KeyboardEvents<Target = HTMLElement> {
|
|
116
|
+
/**
|
|
117
|
+
* Key down event handler.
|
|
118
|
+
*/
|
|
119
|
+
readonly onKeyDown?: (event: React.KeyboardEvent<Target>) => void;
|
|
120
|
+
/**
|
|
121
|
+
* Key up event handler.
|
|
122
|
+
*/
|
|
123
|
+
readonly onKeyUp?: (event: React.KeyboardEvent<Target>) => void;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Curated set of HTML input attributes for rebuilt input components.
|
|
127
|
+
* This provides a whitelist of standard HTML/React props we want to support,
|
|
128
|
+
* avoiding the issues of extending React.InputHTMLAttributes directly.
|
|
129
|
+
* Note: Event handlers and ARIA attributes are separate - use FocusEvents, KeyboardEvents, and AriaInputProps.
|
|
130
|
+
*/
|
|
131
|
+
export interface HTMLInputBaseProps extends AriaInputProps {
|
|
132
|
+
/**
|
|
133
|
+
* The unique identifier for the input element.
|
|
134
|
+
*/
|
|
135
|
+
readonly id?: string;
|
|
136
|
+
/**
|
|
137
|
+
* The name attribute for the input element.
|
|
138
|
+
*/
|
|
139
|
+
readonly name?: string;
|
|
140
|
+
/**
|
|
141
|
+
* Whether the input is disabled.
|
|
142
|
+
*/
|
|
143
|
+
readonly disabled?: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Whether the input is read-only (HTML standard casing).
|
|
146
|
+
*/
|
|
147
|
+
readonly readOnly?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Whether the input should be auto-focused (React casing).
|
|
150
|
+
*/
|
|
151
|
+
readonly autoFocus?: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Autocomplete behavior for the input (React casing, string values only).
|
|
154
|
+
* Use standard HTML autocomplete values or "on"/"off".
|
|
155
|
+
*/
|
|
156
|
+
readonly autoComplete?: string;
|
|
157
|
+
/**
|
|
158
|
+
* Validation pattern (regex) for the input.
|
|
159
|
+
*/
|
|
160
|
+
readonly pattern?: string;
|
|
161
|
+
/**
|
|
162
|
+
* Input mode hint for virtual keyboards.
|
|
163
|
+
*/
|
|
164
|
+
readonly inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search";
|
|
165
|
+
/**
|
|
166
|
+
* Role attribute for accessibility.
|
|
167
|
+
*/
|
|
168
|
+
readonly role?: string;
|
|
169
|
+
/**
|
|
170
|
+
* Tab index for keyboard navigation.
|
|
171
|
+
*/
|
|
172
|
+
readonly tabIndex?: number;
|
|
173
|
+
}
|
|
174
|
+
export interface Affix {
|
|
175
|
+
readonly label?: string;
|
|
176
|
+
readonly icon?: IconNames;
|
|
177
|
+
}
|
|
178
|
+
interface BaseSuffix extends Affix {
|
|
179
|
+
readonly icon: IconNames;
|
|
180
|
+
onClick?(): void;
|
|
181
|
+
}
|
|
182
|
+
export interface Suffix extends BaseSuffix {
|
|
183
|
+
onClick(): void;
|
|
184
|
+
readonly ariaLabel: string;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Common props shared across all rebuilt input components.
|
|
188
|
+
* These are Atlantis-specific features not part of standard HTML inputs.
|
|
189
|
+
*/
|
|
190
|
+
export interface RebuiltInputCommonProps {
|
|
191
|
+
/**
|
|
192
|
+
* Text that appears inside the input when empty and floats above the value
|
|
193
|
+
* as a mini label once the user enters a value.
|
|
194
|
+
* When showMiniLabel is false, this text only serves as a standard placeholder and
|
|
195
|
+
* disappears when the user types.
|
|
196
|
+
*/
|
|
197
|
+
readonly placeholder?: string;
|
|
198
|
+
/**
|
|
199
|
+
* Error message to display. This also highlights the field red.
|
|
200
|
+
*/
|
|
201
|
+
readonly error?: string;
|
|
202
|
+
/**
|
|
203
|
+
* Highlights the field red to indicate an error.
|
|
204
|
+
*/
|
|
205
|
+
readonly invalid?: boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Show a spinner to indicate loading.
|
|
208
|
+
*/
|
|
209
|
+
readonly loading?: boolean;
|
|
210
|
+
/**
|
|
211
|
+
* Add a clear action on the input that clears the value.
|
|
212
|
+
*/
|
|
213
|
+
readonly clearable?: Clearable;
|
|
214
|
+
/**
|
|
215
|
+
* Adjusts the interface to either have small or large spacing.
|
|
216
|
+
*/
|
|
217
|
+
readonly size?: "small" | "large";
|
|
218
|
+
/**
|
|
219
|
+
* Adjusts the form field to go inline with content.
|
|
220
|
+
*/
|
|
221
|
+
readonly inline?: boolean;
|
|
222
|
+
/**
|
|
223
|
+
* Determines the alignment of the text inside the input.
|
|
224
|
+
*/
|
|
225
|
+
readonly align?: "center" | "right";
|
|
226
|
+
/**
|
|
227
|
+
* Adds a prefix label and icon to the field.
|
|
228
|
+
*/
|
|
229
|
+
readonly prefix?: Affix;
|
|
230
|
+
/**
|
|
231
|
+
* Adds a suffix label and icon with an optional action to the field.
|
|
232
|
+
*/
|
|
233
|
+
readonly suffix?: XOR<Affix, Suffix>;
|
|
234
|
+
/**
|
|
235
|
+
* Further description of the input, can be used for a hint.
|
|
236
|
+
*/
|
|
237
|
+
readonly description?: ReactNode;
|
|
238
|
+
/**
|
|
239
|
+
* Version 2 is highly experimental. Avoid using it unless you have talked with Atlantis first.
|
|
240
|
+
*/
|
|
241
|
+
readonly version: 2;
|
|
242
|
+
}
|
|
13
243
|
/** Represents a day of the week as a number where 0 = Sunday, 1 = Monday, etc. */
|
|
14
244
|
export type DayOfWeek = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
15
245
|
export type CommonAllowedElements = "section" | "p" | "article" | "ul" | "li" | "div" | "span" | "dl" | "dd" | "dt";
|
|
16
246
|
export type Spaces = "none" | "minuscule" | "slim" | "smallest" | "smaller" | "small" | "base" | "large" | "larger" | "largest" | "extravagant";
|
|
17
247
|
export type GapSpacing = Spaces | (string & NonNullable<unknown>);
|
|
248
|
+
export {};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var _commonjsHelpers = require('./_commonjsHelpers-cjs.js');
|
|
5
5
|
var _baseFlatten = require('./_baseFlatten-cjs.js');
|
|
6
|
-
var
|
|
6
|
+
var _getAllKeys = require('./_getAllKeys-cjs.js');
|
|
7
7
|
var _baseEach = require('./_baseEach-cjs.js');
|
|
8
8
|
var isTypedArray = require('./isTypedArray-cjs.js');
|
|
9
9
|
var isSymbol$1 = require('./isSymbol-cjs.js');
|
|
@@ -148,8 +148,8 @@ function compareMultiple$1(object, other, orders) {
|
|
|
148
148
|
|
|
149
149
|
var _compareMultiple = compareMultiple$1;
|
|
150
150
|
|
|
151
|
-
var arrayMap =
|
|
152
|
-
baseGet =
|
|
151
|
+
var arrayMap = _getAllKeys._arrayMap,
|
|
152
|
+
baseGet = _getAllKeys._baseGet,
|
|
153
153
|
baseIteratee = _baseEach._baseIteratee,
|
|
154
154
|
baseMap = _baseMap,
|
|
155
155
|
baseSortBy = _baseSortBy,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React__default, { useState, useId, useEffect, useRef } from 'react';
|
|
2
2
|
import { g as getDefaultExportFromCjs } from './_commonjsHelpers-es.js';
|
|
3
3
|
import { _ as _baseFlatten } from './_baseFlatten-es.js';
|
|
4
|
-
import { a as _arrayMap, b as _baseGet } from './
|
|
4
|
+
import { a as _arrayMap, b as _baseGet } from './_getAllKeys-es.js';
|
|
5
5
|
import { _ as _baseEach, a as _baseIteratee } from './_baseEach-es.js';
|
|
6
6
|
import { b as isArrayLike_1, k as _baseUnary, a as isArray_1 } from './isTypedArray-es.js';
|
|
7
7
|
import { i as isSymbol_1 } from './isSymbol-es.js';
|
|
8
8
|
import { i as identity_1 } from './identity-es.js';
|
|
9
9
|
import { _ as _baseRest, a as _isIterateeCall } from './_isIterateeCall-es.js';
|
|
10
10
|
import { useLiveAnnounce } from '@jobber/hooks';
|
|
11
|
-
import {
|
|
11
|
+
import { a as debounce } from './debounce-es.js';
|
|
12
12
|
import { I as Icon } from './Icon-es.js';
|
|
13
13
|
import { u as useFloating, o as offset, f as flip, c as size, b as autoUpdate } from './floating-ui.react-es.js';
|
|
14
14
|
import { c as calculateMaxHeight } from './maxHeight-es.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.105.0",
|
|
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": "928e7dfed0ad62e2c9e54e94a84d04bb2e686b6e"
|
|
542
542
|
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { ChangeEvent, FocusEvent, KeyboardEvent, ReactNode } from "react";
|
|
2
|
-
export interface UseInputEmailFormFieldProps {
|
|
3
|
-
readonly id: string;
|
|
4
|
-
readonly name: string;
|
|
5
|
-
readonly disabled?: boolean;
|
|
6
|
-
readonly autofocus?: boolean;
|
|
7
|
-
readonly error?: string;
|
|
8
|
-
readonly inline?: boolean;
|
|
9
|
-
readonly description?: ReactNode;
|
|
10
|
-
readonly invalid?: boolean;
|
|
11
|
-
readonly value?: string;
|
|
12
|
-
readonly handleChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
13
|
-
readonly handleBlur: (event?: FocusEvent<HTMLInputElement>) => void;
|
|
14
|
-
readonly handleFocus: (event: FocusEvent<HTMLInputElement>) => void;
|
|
15
|
-
readonly handleKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void;
|
|
16
|
-
}
|
|
17
|
-
export interface UseInputEmailFormFieldReturn {
|
|
18
|
-
readonly fieldProps: {
|
|
19
|
-
readonly id: string;
|
|
20
|
-
readonly name: string;
|
|
21
|
-
readonly disabled?: boolean;
|
|
22
|
-
readonly autofocus?: boolean;
|
|
23
|
-
readonly onChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
24
|
-
readonly onBlur: (event?: FocusEvent<HTMLInputElement>) => void;
|
|
25
|
-
readonly onFocus: (event: FocusEvent<HTMLInputElement>) => void;
|
|
26
|
-
readonly onKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void;
|
|
27
|
-
readonly value?: string;
|
|
28
|
-
readonly "aria-describedby"?: string;
|
|
29
|
-
};
|
|
30
|
-
readonly descriptionIdentifier: string;
|
|
31
|
-
}
|
|
32
|
-
export declare function useInputEmailFormField({ id, name, disabled, autofocus, description, inline, value, handleChange, handleBlur, handleFocus, handleKeyDown, error, ...rest }: UseInputEmailFormFieldProps): UseInputEmailFormFieldReturn;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { ChangeEvent, FocusEvent, KeyboardEvent, ReactNode } from "react";
|
|
2
|
-
export interface useInputPhoneFormFieldProps {
|
|
3
|
-
/**
|
|
4
|
-
* The html id for the field
|
|
5
|
-
*/
|
|
6
|
-
readonly id: string;
|
|
7
|
-
/**
|
|
8
|
-
* The auto-generated name for the html input field if a nameProp is not provided
|
|
9
|
-
*/
|
|
10
|
-
readonly name: string;
|
|
11
|
-
/**
|
|
12
|
-
* The error message for the field
|
|
13
|
-
*/
|
|
14
|
-
readonly error?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Adjusts the form field to go inline with a content. This also silences the
|
|
17
|
-
* given `validations` prop. You'd have to used the `onValidate` prop to
|
|
18
|
-
* capture the message and render it somewhere else using the
|
|
19
|
-
* `InputValidation` component.
|
|
20
|
-
*/
|
|
21
|
-
readonly inline?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Further description of the input, can be used for a hint.
|
|
24
|
-
*/
|
|
25
|
-
readonly description?: ReactNode;
|
|
26
|
-
/**
|
|
27
|
-
* Callback for when the field value changes
|
|
28
|
-
*/
|
|
29
|
-
handleChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
30
|
-
/**
|
|
31
|
-
* Callback for when the field loses focus
|
|
32
|
-
*/
|
|
33
|
-
handleBlur: () => void;
|
|
34
|
-
/**
|
|
35
|
-
* Callback for when the field gains focus
|
|
36
|
-
*/
|
|
37
|
-
handleFocus: (event: FocusEvent<HTMLInputElement>) => void;
|
|
38
|
-
/**
|
|
39
|
-
* Callback for when keydown event is triggered on the field
|
|
40
|
-
*/
|
|
41
|
-
handleKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void;
|
|
42
|
-
readonly invalid?: boolean;
|
|
43
|
-
readonly disabled?: boolean;
|
|
44
|
-
readonly autofocus?: boolean;
|
|
45
|
-
readonly value?: string;
|
|
46
|
-
readonly readonly?: boolean;
|
|
47
|
-
}
|
|
48
|
-
export interface UseInputPhoneFormFieldReturn {
|
|
49
|
-
fieldProps: React.InputHTMLAttributes<HTMLInputElement>;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Provides the props for the html fields rendered by the html input.
|
|
53
|
-
* DO not repeat this pattern. We are doing this as a proof of concept relating to the refactoring of Form inputs to see what can be removed.
|
|
54
|
-
*/
|
|
55
|
-
export declare function useInputPhoneFormField({ id, name, description, inline, handleChange, handleBlur, handleFocus, handleKeyDown, error, disabled, autofocus, value, readonly, ...rest }: useInputPhoneFormFieldProps): {
|
|
56
|
-
fieldProps: {
|
|
57
|
-
readOnly: boolean | undefined;
|
|
58
|
-
"aria-describedby"?: string | undefined;
|
|
59
|
-
id: string;
|
|
60
|
-
name: string;
|
|
61
|
-
disabled: boolean | undefined;
|
|
62
|
-
autoFocus: boolean | undefined;
|
|
63
|
-
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
64
|
-
onBlur: () => void;
|
|
65
|
-
onFocus: (event: FocusEvent<HTMLInputElement>) => void;
|
|
66
|
-
onKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void;
|
|
67
|
-
value: string | undefined;
|
|
68
|
-
invalid: string | undefined;
|
|
69
|
-
};
|
|
70
|
-
descriptionIdentifier: string;
|
|
71
|
-
};
|