@jobber/components 8.2.0 → 8.3.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.d.ts +2 -3
- package/dist/Autocomplete/Autocomplete.types.d.ts +4 -9
- package/dist/Autocomplete/index.cjs +7 -8
- package/dist/Autocomplete/index.d.ts +3 -4
- package/dist/Autocomplete/index.mjs +6 -7
- package/dist/DataList/components/DataListSearch/index.cjs +1 -2
- package/dist/DataList/components/DataListSearch/index.mjs +1 -2
- package/dist/DataList/index.cjs +1 -2
- package/dist/DataList/index.mjs +1 -2
- package/dist/DataListSearch-cjs.js +12 -6
- package/dist/DataListSearch-es.js +11 -5
- package/dist/InputDate/index.cjs +1 -2
- package/dist/InputDate/index.mjs +1 -2
- package/dist/InputDate-cjs.js +2 -2
- package/dist/InputDate-es.js +2 -2
- package/dist/InputText/InputText.d.ts +2 -70
- package/dist/InputText/InputText.types.d.ts +2 -30
- package/dist/InputText/index.cjs +12 -268
- package/dist/InputText/index.d.ts +2 -5
- package/dist/InputText/index.mjs +11 -271
- package/dist/InputText/useInputTextActions.d.ts +2 -2
- package/dist/InputText-cjs.js +199 -0
- package/dist/InputText-es.js +197 -0
- package/dist/docs/Autocomplete/AutocompleteV1.md +1 -2
- package/dist/docs/Autocomplete/AutocompleteV2.md +1 -1
- package/dist/docs/Banner/Banner.md +2 -2
- package/dist/docs/Box/Box.md +2 -2
- package/dist/docs/Glimmer/Glimmer.md +1 -1
- package/dist/docs/Icon/Icon.md +1 -1
- package/dist/docs/InputText/InputText.md +152 -106
- package/dist/docs/Menu/Menu.md +1 -1
- package/dist/docs/Modal/Modal.md +1 -1
- package/dist/docs/Stack/Stack.md +1 -1
- package/dist/docs/usage-guidelines/usage-guidelines.md +0 -2
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
- package/dist/InputText/InputText.rebuilt.d.ts +0 -3
|
@@ -10,24 +10,23 @@ Use this to allow users to provide short answers.
|
|
|
10
10
|
|
|
11
11
|
```tsx
|
|
12
12
|
import React, { useState } from "react";
|
|
13
|
-
import type {
|
|
13
|
+
import type { InputTextProps } from "@jobber/components/InputText";
|
|
14
14
|
import { InputText } from "@jobber/components/InputText";
|
|
15
15
|
|
|
16
|
-
export const
|
|
16
|
+
export const InputTextBasicExample = ({
|
|
17
17
|
onChange,
|
|
18
18
|
...props
|
|
19
|
-
}: Partial<
|
|
20
|
-
const [
|
|
19
|
+
}: Partial<InputTextProps>) => {
|
|
20
|
+
const [value, setValue] = useState(props.value ?? "");
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
23
|
<InputText
|
|
24
|
-
version={2}
|
|
25
24
|
name="age"
|
|
26
25
|
placeholder="Age in words"
|
|
27
26
|
{...props}
|
|
28
|
-
value={
|
|
27
|
+
value={value}
|
|
29
28
|
onChange={newValue => {
|
|
30
|
-
|
|
29
|
+
setValue(newValue);
|
|
31
30
|
onChange?.(newValue);
|
|
32
31
|
}}
|
|
33
32
|
/>
|
|
@@ -46,15 +45,29 @@ For web, you can set a minimum and maximum number of rows. See:
|
|
|
46
45
|
[Web/rows example](/storybook/web/?path=/story/components-forms-and-inputs-inputtext--multiline).
|
|
47
46
|
|
|
48
47
|
```tsx
|
|
49
|
-
import React from "react";
|
|
50
|
-
import type {
|
|
48
|
+
import React, { useState } from "react";
|
|
49
|
+
import type { InputTextProps } from "@jobber/components/InputText";
|
|
51
50
|
import { InputText } from "@jobber/components/InputText";
|
|
52
51
|
|
|
53
52
|
export function InputTextMultilineExample(
|
|
54
|
-
props: Partial<Omit<
|
|
53
|
+
props: Partial<Omit<InputTextProps, "multiline">>,
|
|
55
54
|
) {
|
|
55
|
+
const [value, setValue] = useState<string>(props.value ?? "");
|
|
56
|
+
|
|
56
57
|
return (
|
|
57
|
-
<InputText
|
|
58
|
+
<InputText
|
|
59
|
+
multiline={true}
|
|
60
|
+
placeholder="Describe your age"
|
|
61
|
+
{...props}
|
|
62
|
+
value={value}
|
|
63
|
+
onChange={(
|
|
64
|
+
newValue: string,
|
|
65
|
+
event?: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,
|
|
66
|
+
) => {
|
|
67
|
+
setValue(newValue);
|
|
68
|
+
props.onChange?.(newValue, event);
|
|
69
|
+
}}
|
|
70
|
+
/>
|
|
58
71
|
);
|
|
59
72
|
}
|
|
60
73
|
```
|
|
@@ -74,19 +87,41 @@ With clearer guidance around the purpose of inputs, the user is able to better
|
|
|
74
87
|
focus on the task at hand.
|
|
75
88
|
|
|
76
89
|
```tsx
|
|
77
|
-
import React from "react";
|
|
78
|
-
import type {
|
|
90
|
+
import React, { useState } from "react";
|
|
91
|
+
import type { InputTextProps } from "@jobber/components/InputText";
|
|
79
92
|
import { InputText } from "@jobber/components/InputText";
|
|
80
93
|
import { Content } from "@jobber/components/Content";
|
|
81
94
|
|
|
82
95
|
export function InputTextPrefixSuffixExample(
|
|
83
|
-
props: Partial<Omit<
|
|
96
|
+
props: Partial<Omit<InputTextProps, "multiline" | "rows">>,
|
|
84
97
|
) {
|
|
98
|
+
const [invoiceTotal, setInvoiceTotal] = useState<string>(
|
|
99
|
+
props.value ?? "1,000,000",
|
|
100
|
+
);
|
|
101
|
+
const [search, setSearch] = useState<string>(props.value ?? "");
|
|
102
|
+
|
|
103
|
+
const handleChange = (
|
|
104
|
+
newValue: string,
|
|
105
|
+
event?: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,
|
|
106
|
+
) => {
|
|
107
|
+
setInvoiceTotal(newValue);
|
|
108
|
+
props.onChange?.(newValue, event);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const handleSearchChange = (
|
|
112
|
+
newValue: string,
|
|
113
|
+
event?: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,
|
|
114
|
+
) => {
|
|
115
|
+
setSearch(newValue);
|
|
116
|
+
props.onChange?.(newValue, event);
|
|
117
|
+
};
|
|
118
|
+
|
|
85
119
|
return (
|
|
86
120
|
<Content>
|
|
87
121
|
<InputText
|
|
88
|
-
defaultValue="1,000,000"
|
|
89
122
|
placeholder="Invoice Total"
|
|
123
|
+
value={invoiceTotal}
|
|
124
|
+
onChange={handleChange}
|
|
90
125
|
prefix={{ label: "$", icon: "invoice" }}
|
|
91
126
|
suffix={{ label: ".00" }}
|
|
92
127
|
{...props}
|
|
@@ -94,6 +129,8 @@ export function InputTextPrefixSuffixExample(
|
|
|
94
129
|
<InputText
|
|
95
130
|
placeholder="Search"
|
|
96
131
|
prefix={{ icon: "search" }}
|
|
132
|
+
value={search}
|
|
133
|
+
onChange={handleSearchChange}
|
|
97
134
|
suffix={{
|
|
98
135
|
icon: "cross",
|
|
99
136
|
ariaLabel: "clear search",
|
|
@@ -118,33 +155,37 @@ Follow the
|
|
|
118
155
|
for guidance on writing helpful error messages.
|
|
119
156
|
|
|
120
157
|
```tsx
|
|
121
|
-
import React from "react";
|
|
122
|
-
import type {
|
|
158
|
+
import React, { useState } from "react";
|
|
159
|
+
import type { InputTextProps } from "@jobber/components/InputText";
|
|
123
160
|
import { InputText } from "@jobber/components/InputText";
|
|
124
161
|
|
|
125
162
|
export function InputTextValidationExample(
|
|
126
|
-
props: Partial<Omit<
|
|
163
|
+
props: Partial<Omit<InputTextProps, "multiline" | "rows">>,
|
|
127
164
|
) {
|
|
165
|
+
const [value, setValue] = useState("");
|
|
166
|
+
const [error, setError] = useState<string | undefined>();
|
|
167
|
+
|
|
168
|
+
function handleChange(newValue: string) {
|
|
169
|
+
setValue(newValue);
|
|
170
|
+
|
|
171
|
+
if (!newValue) {
|
|
172
|
+
setError("You have to tell us your age");
|
|
173
|
+
} else if (!isNaN(Number(newValue))) {
|
|
174
|
+
setError("Type your age in words please.");
|
|
175
|
+
} else if (newValue.length >= 10) {
|
|
176
|
+
setError("That seems too old.");
|
|
177
|
+
} else {
|
|
178
|
+
setError(undefined);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
128
182
|
return (
|
|
129
183
|
<InputText
|
|
130
184
|
placeholder="What's your age"
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
},
|
|
136
|
-
validate: val => {
|
|
137
|
-
if (val.length > 0 && !isNaN(val)) {
|
|
138
|
-
return "Type your age in words please.";
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
if (val.length >= 10) {
|
|
142
|
-
return "That seems too old.";
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
return true;
|
|
146
|
-
},
|
|
147
|
-
}}
|
|
185
|
+
value={value}
|
|
186
|
+
onChange={handleChange}
|
|
187
|
+
invalid={!!error}
|
|
188
|
+
error={error}
|
|
148
189
|
{...props}
|
|
149
190
|
/>
|
|
150
191
|
);
|
|
@@ -157,11 +198,11 @@ export function InputTextValidationExample(
|
|
|
157
198
|
|
|
158
199
|
```tsx
|
|
159
200
|
import React from "react";
|
|
160
|
-
import type {
|
|
201
|
+
import type { InputTextProps } from "@jobber/components/InputText";
|
|
161
202
|
import { InputText } from "@jobber/components/InputText";
|
|
162
203
|
|
|
163
204
|
export function InputTextDisabledExample(
|
|
164
|
-
props: Partial<Omit<
|
|
205
|
+
props: Partial<Omit<InputTextProps, "multiline" | "rows">>,
|
|
165
206
|
) {
|
|
166
207
|
return (
|
|
167
208
|
<InputText
|
|
@@ -182,11 +223,11 @@ See:
|
|
|
182
223
|
|
|
183
224
|
```tsx
|
|
184
225
|
import React from "react";
|
|
185
|
-
import type { InputTextLegacyProps } from "@jobber/components/InputText";
|
|
186
226
|
import { InputText } from "@jobber/components/InputText";
|
|
227
|
+
import type { InputTextProps } from "@jobber/components/InputText";
|
|
187
228
|
|
|
188
229
|
export function InputTextInvalidExample(
|
|
189
|
-
props: Partial<Omit<
|
|
230
|
+
props: Partial<Omit<InputTextProps, "multiline" | "rows">>,
|
|
190
231
|
) {
|
|
191
232
|
return (
|
|
192
233
|
<InputText placeholder="Email" value="atlantis" invalid={true} {...props} />
|
|
@@ -201,14 +242,16 @@ You can use `FormFieldLabel` to provide a label outside of the input. The
|
|
|
201
242
|
appears when a value is provided.
|
|
202
243
|
|
|
203
244
|
```tsx
|
|
204
|
-
import React from "react";
|
|
205
|
-
import type {
|
|
245
|
+
import React, { useState } from "react";
|
|
246
|
+
import type { InputTextProps } from "@jobber/components/InputText";
|
|
206
247
|
import { InputText } from "@jobber/components/InputText";
|
|
207
248
|
import { FormFieldLabel } from "@jobber/components/FormField";
|
|
208
249
|
|
|
209
250
|
export function InputTextExternalLabelExample(
|
|
210
|
-
props: Partial<Omit<
|
|
251
|
+
props: Partial<Omit<InputTextProps, "multiline" | "rows">>,
|
|
211
252
|
) {
|
|
253
|
+
const [value, setValue] = useState<string>(props.value ?? "");
|
|
254
|
+
|
|
212
255
|
return (
|
|
213
256
|
<div style={{ width: "100%" }}>
|
|
214
257
|
<FormFieldLabel external={true} htmlFor="ext-input">
|
|
@@ -220,6 +263,14 @@ export function InputTextExternalLabelExample(
|
|
|
220
263
|
clearable="always"
|
|
221
264
|
showMiniLabel={false}
|
|
222
265
|
{...props}
|
|
266
|
+
value={value}
|
|
267
|
+
onChange={(
|
|
268
|
+
newValue: string,
|
|
269
|
+
event?: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,
|
|
270
|
+
) => {
|
|
271
|
+
setValue(newValue);
|
|
272
|
+
props.onChange?.(newValue, event);
|
|
273
|
+
}}
|
|
223
274
|
/>
|
|
224
275
|
</div>
|
|
225
276
|
);
|
|
@@ -231,92 +282,87 @@ export function InputTextExternalLabelExample(
|
|
|
231
282
|
Determine what default keyboard appears on mobile.
|
|
232
283
|
|
|
233
284
|
```tsx
|
|
234
|
-
import React from "react";
|
|
235
|
-
import type {
|
|
285
|
+
import React, { useState } from "react";
|
|
286
|
+
import type { InputTextProps } from "@jobber/components/InputText";
|
|
236
287
|
import { InputText } from "@jobber/components/InputText";
|
|
237
288
|
|
|
238
289
|
export function InputTextKeyboardExample(
|
|
239
|
-
props: Partial<Omit<
|
|
290
|
+
props: Partial<Omit<InputTextProps, "multiline" | "rows">>,
|
|
240
291
|
) {
|
|
292
|
+
const [value, setValue] = useState<string>(props.value ?? "");
|
|
293
|
+
|
|
241
294
|
return (
|
|
242
|
-
<InputText
|
|
295
|
+
<InputText
|
|
296
|
+
placeholder="Describe your age"
|
|
297
|
+
inputMode="numeric"
|
|
298
|
+
{...props}
|
|
299
|
+
value={value}
|
|
300
|
+
onChange={(
|
|
301
|
+
newValue: string,
|
|
302
|
+
event?: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,
|
|
303
|
+
) => {
|
|
304
|
+
setValue(newValue);
|
|
305
|
+
props.onChange?.(newValue, event);
|
|
306
|
+
}}
|
|
307
|
+
/>
|
|
243
308
|
);
|
|
244
309
|
}
|
|
245
310
|
```
|
|
246
311
|
|
|
247
312
|
|
|
248
|
-
## Configuration
|
|
249
|
-
|
|
250
|
-
### react-hook-form
|
|
251
|
-
|
|
252
|
-
Atlantis utilizes [React Hook Form](https://react-hook-form.com/) to handle
|
|
253
|
-
`input` and `form` validation. This means that the
|
|
254
|
-
[React Hook Form validation options](https://react-hook-form.com/api#register)
|
|
255
|
-
are available out of the box.
|
|
256
|
-
|
|
257
|
-
This includes, but is not limited to:
|
|
258
|
-
|
|
259
|
-
* `required` - A Boolean which, if true, indicates that the input must have a
|
|
260
|
-
value.
|
|
261
|
-
* `maxLength` - The maximum length of the value to accept for this input.
|
|
262
|
-
* `minLength` - The minimum length of the value to accept for this input.
|
|
263
|
-
* `pattern` - The regex pattern for the input.
|
|
264
|
-
* `validate` - You can pass a callback function as the argument to validate, or
|
|
265
|
-
you can pass an object of callback functions to validate all of them.
|
|
266
|
-
|
|
267
|
-
### Using onValidation (Web)
|
|
268
|
-
|
|
269
|
-
If you need to capture the error message and render it outside of the component.
|
|
270
|
-
Read the [InputValidation](../InputValidation/InputValidation.md) documentation.
|
|
271
|
-
|
|
272
|
-
### Version 2 Shim (Experimental)
|
|
273
|
-
|
|
274
|
-
If you need to use the version 2 shim, you can pass `version={2}` to the
|
|
275
|
-
`InputText` and provide the required props. Due to issues with typescript
|
|
276
|
-
[see](https://github.com/microsoft/TypeScript/issues/32447) the aria attributes
|
|
277
|
-
(and other props separated by `-`) are not typed correctly. This means that the
|
|
278
|
-
shim will not enforce the version to be set to `2` when using these props. As a
|
|
279
|
-
result version 1 usages will have these props appear in the intellisense but
|
|
280
|
-
they will not do anything.
|
|
281
|
-
|
|
282
|
-
|
|
283
313
|
## Props
|
|
284
314
|
|
|
285
315
|
### Web
|
|
286
316
|
|
|
287
317
|
| Prop | Type | Required | Default | Description |
|
|
288
318
|
|------|------|----------|---------|-------------|
|
|
319
|
+
| `value` | `string` | Yes | — | The current value of the input. |
|
|
289
320
|
| `align` | `"center" | "right"` | No | — | Determines the alignment of the text inside the input. |
|
|
290
|
-
| `
|
|
291
|
-
| `
|
|
292
|
-
| `
|
|
293
|
-
| `
|
|
321
|
+
| `aria-activedescendant` | `string` | No | — | ID of the currently active descendant element. Used for composite widgets like combobox or listbox. @see {@link https... |
|
|
322
|
+
| `aria-autocomplete` | `"both" | "inline" | "list" | "none"` | No | — | Indicates the type of autocomplete interaction. @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-autocomplete} |
|
|
323
|
+
| `aria-controls` | `string` | No | — | Indicates the element that controls the current element. @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-controls} |
|
|
324
|
+
| `aria-describedby` | `string` | No | — | Identifies the element (or elements) that describes the object. @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-... |
|
|
325
|
+
| `aria-details` | `string` | No | — | Identifies the element (or elements) that provide a detailed, extended description. @see {@link https://www.w3.org/TR... |
|
|
326
|
+
| `aria-expanded` | `Booleanish` | No | — | Indicates whether the element is expanded or collapsed. @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-expanded} |
|
|
327
|
+
| `aria-label` | `string` | No | — | Defines a string value that labels the current element. @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-label} |
|
|
328
|
+
| `aria-labelledby` | `string` | No | — | Identifies the element (or elements) that labels the current element. @see {@link https://www.w3.org/TR/wai-aria-1.2/... |
|
|
329
|
+
| `aria-required` | `Booleanish` | No | — | Indicates that user input is required before form submission. @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-re... |
|
|
330
|
+
| `autoComplete` | `string` | No | — | Autocomplete behavior for the input (React casing, string values only). Use standard HTML autocomplete values or "on"... |
|
|
331
|
+
| `autoFocus` | `boolean` | No | — | Whether the input should be auto-focused (React casing). |
|
|
332
|
+
| `clearable` | `Clearable` | No | — | Add a clear action on the input that clears the value. |
|
|
294
333
|
| `description` | `ReactNode` | No | — | Further description of the input, can be used for a hint. |
|
|
295
|
-
| `disabled` | `boolean` | No | — |
|
|
296
|
-
| `
|
|
297
|
-
| `
|
|
298
|
-
| `
|
|
334
|
+
| `disabled` | `boolean` | No | — | Whether the input is disabled. |
|
|
335
|
+
| `error` | `string` | No | — | Error message to display. This also highlights the field red. |
|
|
336
|
+
| `id` | `string` | No | — | The unique identifier for the input element. |
|
|
337
|
+
| `inline` | `boolean` | No | — | Adjusts the form field to go inline with content. |
|
|
338
|
+
| `inputMode` | `"decimal" | "email" | "none" | "numeric" | "search" | "tel" | "text" | "url"` | No | — | Input mode hint for virtual keyboards. |
|
|
299
339
|
| `invalid` | `boolean` | No | — | Highlights the field red to indicate an error. |
|
|
300
|
-
| `
|
|
301
|
-
| `
|
|
302
|
-
| `maxLength` | `number` | No | — | Maximum character length for an input. This also changes the width to roughly the same size as the max length. This i... |
|
|
340
|
+
| `loading` | `boolean` | No | — | Show a spinner to indicate loading. |
|
|
341
|
+
| `maxLength` | `number` | No | — | Maximum number of characters allowed in the input. |
|
|
303
342
|
| `multiline` | `boolean` | No | — | Use this when you're expecting a long answer. |
|
|
304
|
-
| `name` | `string` | No | — |
|
|
305
|
-
| `onBlur` | `(event
|
|
306
|
-
| `onChange` | `(newValue: string
|
|
307
|
-
| `
|
|
308
|
-
| `
|
|
309
|
-
| `
|
|
343
|
+
| `name` | `string` | No | — | The name attribute for the input element. |
|
|
344
|
+
| `onBlur` | `(event: FocusEvent<HTMLInputElement | HTMLTextAreaElement, Element>) => void` | No | — | Blur event handler. |
|
|
345
|
+
| `onChange` | `(newValue: string, event?: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void` | No | — | Custom onChange handler that provides the new value as the first argument. |
|
|
346
|
+
| `onClick` | `(event: MouseEvent<HTMLInputElement | HTMLTextAreaElement, MouseEvent>) => void` | No | — | Click event handler. |
|
|
347
|
+
| `onEnter` | `(event: KeyboardEvent<Element>) => void` | No | — | @deprecated Use `onKeyDown` or `onKeyUp` instead. |
|
|
348
|
+
| `onFocus` | `(event: FocusEvent<HTMLInputElement | HTMLTextAreaElement, Element>) => void` | No | — | Focus event handler. |
|
|
349
|
+
| `onKeyDown` | `(event: KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => void` | No | — | Key down event handler. |
|
|
350
|
+
| `onKeyUp` | `(event: KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => void` | No | — | Key up event handler. |
|
|
351
|
+
| `onMouseDown` | `(event: MouseEvent<HTMLInputElement | HTMLTextAreaElement, MouseEvent>) => void` | No | — | Mouse down event handler. |
|
|
352
|
+
| `onMouseUp` | `(event: MouseEvent<HTMLInputElement | HTMLTextAreaElement, MouseEvent>) => void` | No | — | Mouse up event handler. |
|
|
353
|
+
| `onPointerDown` | `(event: PointerEvent<HTMLInputElement | HTMLTextAreaElement>) => void` | No | — | Pointer down event handler. |
|
|
354
|
+
| `onPointerUp` | `(event: PointerEvent<HTMLInputElement | HTMLTextAreaElement>) => void` | No | — | Pointer up event handler. |
|
|
355
|
+
| `pattern` | `string` | No | — | Validation pattern (regex) for the input. |
|
|
310
356
|
| `placeholder` | `string` | No | — | Text that appears inside the input when empty and floats above the value as a mini label once the user enters a value... |
|
|
311
|
-
| `prefix` | `Affix` | No | — | Adds a prefix label and icon to the field |
|
|
312
|
-
| `
|
|
313
|
-
| `ref` | `Ref<
|
|
357
|
+
| `prefix` | `Affix` | No | — | Adds a prefix label and icon to the field. |
|
|
358
|
+
| `readOnly` | `boolean` | No | — | Whether the input is read-only (HTML standard casing). |
|
|
359
|
+
| `ref` | `Ref<HTMLInputElement | HTMLTextAreaElement>` | No | — | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (... |
|
|
360
|
+
| `required` | `boolean` | No | — | Whether the input is required before form submission. |
|
|
361
|
+
| `role` | `string` | No | — | Role attribute for accessibility. |
|
|
314
362
|
| `rows` | `RowRange | number` | No | — | Specifies the visible height of a long answer form field. Can be in the form of a single number to set a static heigh... |
|
|
315
|
-
| `showMiniLabel` | `boolean` | No | `true` |
|
|
363
|
+
| `showMiniLabel` | `boolean` | No | `true` | When false, the placeholder text only serves as a standard placeholder and disappears when the user types, instead of... |
|
|
316
364
|
| `size` | `"large" | "small"` | No | — | Adjusts the interface to either have small or large spacing. |
|
|
317
|
-
| `suffix` | `{ onClick: () => void; readonly ariaLabel: string; readonly icon: IconNames; readonly label?: string; } | { onClick?: never; ariaLabel?: never; readonly label?: string; readonly icon?: IconNames; }` | No | — | Adds a suffix label and icon with an optional action to the field |
|
|
365
|
+
| `suffix` | `{ onClick: () => void; readonly ariaLabel: string; readonly icon: IconNames; readonly label?: string; } | { onClick?: never; ariaLabel?: never; readonly label?: string; readonly icon?: IconNames; }` | No | — | Adds a suffix label and icon with an optional action to the field. |
|
|
366
|
+
| `tabIndex` | `number` | No | — | Tab index for keyboard navigation. |
|
|
318
367
|
| `toolbar` | `ReactNode` | No | — | Toolbar to render content below the input. |
|
|
319
368
|
| `toolbarVisibility` | `"always" | "while-editing"` | No | — | Determines the visibility of the toolbar. |
|
|
320
|
-
| `validations` | `RegisterOptions` | No | — | Show an error message above the field. This also highlights the the field red if an error message shows up. |
|
|
321
|
-
| `value` | `Date | number | string` | No | — | Set the component to the given value. |
|
|
322
|
-
| `version` | `1` | No | — | Experimental: Determine which version of the FormField to use. Right now this isn't used but it will be used in the f... |
|
package/dist/docs/Menu/Menu.md
CHANGED
|
@@ -502,7 +502,7 @@ and should not be used for new implementations.
|
|
|
502
502
|
| Prop | Type | Required | Default | Description |
|
|
503
503
|
|------|------|----------|---------|-------------|
|
|
504
504
|
| `name` | `IconNames` | Yes | — | The icon to show. |
|
|
505
|
-
| `color` | `"task" | "text" | "warning" | "icon" | "
|
|
505
|
+
| `color` | `"task" | "text" | "warning" | "icon" | "success" | "blue" | "green" | "yellow" | "red" | "grey" | "white" | "greyBlue" | "lightBlue" | "orange" | "navy" | "interactive" | "destructive" | ... 32 more ... | "brandHighlight"` | No | — | Determines the color of the icon. Some icons have a default system colour like quotes, jobs, and invoices. Others tha... |
|
|
506
506
|
| `customColor` | `string` | No | — | Sets a custom color for the icon. Can be a rgb() or hex value. |
|
|
507
507
|
| `size` | `"base" | "large" | "small"` | No | `base` | Changes the size to small or large. |
|
|
508
508
|
| `testID` | `string` | No | — | Used to locate this view in end-to-end tests |
|
package/dist/docs/Modal/Modal.md
CHANGED
|
@@ -195,7 +195,7 @@ function ModalWithCustomFocus() {
|
|
|
195
195
|
{!hideActivator && <Button label="Open Modal" onClick={() => setShowModal(true)} />}
|
|
196
196
|
<Modal.Provider open={true} onRequestClose={() => setShowModal(false)}>
|
|
197
197
|
<Modal.Activator>
|
|
198
|
-
<InputText placeholder="Modal will return focus here" />
|
|
198
|
+
<InputText placeholder="Modal will return focus here" value="" />
|
|
199
199
|
</Modal.Activator>
|
|
200
200
|
<Modal.Content>
|
|
201
201
|
<Modal.Header title="Modal Title" />
|
package/dist/docs/Stack/Stack.md
CHANGED
|
@@ -190,6 +190,6 @@ and screen reader compatibility.
|
|
|
190
190
|
| `id` | `string` | No | — | Standard HTML id attribute. |
|
|
191
191
|
| `recursive` | `boolean` | No | — | Whether to recursively apply the stack spacing to all the children, not just the top-level. |
|
|
192
192
|
| `role` | `AriaRole` | No | — | Standard HTML role attribute. |
|
|
193
|
-
| `splitAfter` | `1 | 2 |
|
|
193
|
+
| `splitAfter` | `1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15` | No | — | Setting this will push the stack down to the bottom of the parent container, after the number of children provided (1... |
|
|
194
194
|
| `UNSAFE_className` | `{ container?: string; }` | No | — | **Use at your own risk:** Custom class names for specific elements. This should only be used as a **last resort**. Us... |
|
|
195
195
|
| `UNSAFE_style` | `{ container?: CSSProperties; }` | No | — | **Use at your own risk:** Custom style for specific elements. This should only be used as a **last resort**. Using th... |
|
|
@@ -14,8 +14,6 @@ deprecated.
|
|
|
14
14
|
| Component | Import | v2 prop |
|
|
15
15
|
| ------------ | ---------------------------------------------------------------- | ------------------------------------------------- |
|
|
16
16
|
| Autocomplete | `import { Autocomplete } from "@jobber/components/Autocomplete"` | `version={2}` — fully controlled, async support |
|
|
17
|
-
| InputNumber | `import { InputNumber } from "@jobber/components/InputNumber"` | `version={2}` |
|
|
18
|
-
| InputText | `import { InputText } from "@jobber/components/InputText"` | `version={2}` |
|
|
19
17
|
| Modal | `import { Modal } from "@jobber/components/Modal"` | `version={2}` — uses `Modal.Provider` composition |
|
|
20
18
|
|
|
21
19
|
## Deprecated components — do not use
|
package/dist/index.cjs
CHANGED
|
@@ -61,7 +61,7 @@ var InputGroup = require('./InputGroup-cjs.js');
|
|
|
61
61
|
var InputNumber = require('./InputNumber-cjs.js');
|
|
62
62
|
var InputPassword = require('./InputPassword-cjs.js');
|
|
63
63
|
var InputPhoneNumber = require('./InputPhoneNumber-cjs.js');
|
|
64
|
-
var
|
|
64
|
+
var InputText = require('./InputText-cjs.js');
|
|
65
65
|
var InputTime = require('./InputTime-cjs.js');
|
|
66
66
|
var InputValidation = require('./InputValidation-cjs.js');
|
|
67
67
|
var LightBox = require('./LightBox-cjs.js');
|
|
@@ -300,7 +300,7 @@ exports.InputGroup = InputGroup.InputGroup;
|
|
|
300
300
|
exports.InputNumber = InputNumber.InputNumber;
|
|
301
301
|
exports.InputPassword = InputPassword.InputPassword;
|
|
302
302
|
exports.InputPhoneNumber = InputPhoneNumber.InputPhoneNumber;
|
|
303
|
-
exports.InputText =
|
|
303
|
+
exports.InputText = InputText.InputText;
|
|
304
304
|
exports.InputTime = InputTime.InputTime;
|
|
305
305
|
exports.InputValidation = InputValidation.InputValidation;
|
|
306
306
|
exports.LightBox = LightBox.LightBox;
|
package/dist/index.mjs
CHANGED
|
@@ -59,7 +59,7 @@ export { I as InputGroup } from './InputGroup-es.js';
|
|
|
59
59
|
export { I as InputNumber } from './InputNumber-es.js';
|
|
60
60
|
export { I as InputPassword } from './InputPassword-es.js';
|
|
61
61
|
export { I as InputPhoneNumber } from './InputPhoneNumber-es.js';
|
|
62
|
-
export { InputText } from './InputText
|
|
62
|
+
export { I as InputText } from './InputText-es.js';
|
|
63
63
|
export { I as InputTime } from './InputTime-es.js';
|
|
64
64
|
export { I as InputValidation } from './InputValidation-es.js';
|
|
65
65
|
export { L as LightBox, u as useLightBoxContext } from './LightBox-es.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.3.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -563,5 +563,5 @@
|
|
|
563
563
|
"> 1%",
|
|
564
564
|
"IE 10"
|
|
565
565
|
],
|
|
566
|
-
"gitHead": "
|
|
566
|
+
"gitHead": "2829a8684a94528cf087b63fa471c531c95d01c8"
|
|
567
567
|
}
|