@jobber/components 8.2.0 → 8.4.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.
Files changed (56) hide show
  1. package/ActivityIndicator.d.ts +1 -0
  2. package/ActivityIndicator.js +17 -0
  3. package/dist/ActivityIndicator/ActivityIndicator.d.ts +38 -0
  4. package/dist/ActivityIndicator/index.cjs +9 -0
  5. package/dist/ActivityIndicator/index.d.ts +2 -0
  6. package/dist/ActivityIndicator/index.mjs +3 -0
  7. package/dist/ActivityIndicator-cjs.js +27 -0
  8. package/dist/ActivityIndicator-es.js +25 -0
  9. package/dist/Autocomplete/Autocomplete.d.ts +2 -3
  10. package/dist/Autocomplete/Autocomplete.types.d.ts +4 -9
  11. package/dist/Autocomplete/index.cjs +7 -8
  12. package/dist/Autocomplete/index.d.ts +3 -4
  13. package/dist/Autocomplete/index.mjs +6 -7
  14. package/dist/DataList/components/DataListSearch/index.cjs +1 -2
  15. package/dist/DataList/components/DataListSearch/index.mjs +1 -2
  16. package/dist/DataList/index.cjs +1 -2
  17. package/dist/DataList/index.mjs +1 -2
  18. package/dist/DataListSearch-cjs.js +12 -6
  19. package/dist/DataListSearch-es.js +11 -5
  20. package/dist/InputDate/index.cjs +1 -2
  21. package/dist/InputDate/index.mjs +1 -2
  22. package/dist/InputDate-cjs.js +2 -2
  23. package/dist/InputDate-es.js +2 -2
  24. package/dist/InputText/InputText.d.ts +2 -70
  25. package/dist/InputText/InputText.types.d.ts +2 -30
  26. package/dist/InputText/index.cjs +12 -268
  27. package/dist/InputText/index.d.ts +2 -5
  28. package/dist/InputText/index.mjs +11 -271
  29. package/dist/InputText/useInputTextActions.d.ts +2 -2
  30. package/dist/InputText-cjs.js +199 -0
  31. package/dist/InputText-es.js +197 -0
  32. package/dist/Spinner/Spinner.d.ts +6 -0
  33. package/dist/Spinner-cjs.js +3 -0
  34. package/dist/Spinner-es.js +3 -0
  35. package/dist/docs/ActivityIndicator/ActivityIndicator.md +67 -0
  36. package/dist/docs/Autocomplete/AutocompleteV1.md +1 -2
  37. package/dist/docs/Autocomplete/AutocompleteV2.md +1 -1
  38. package/dist/docs/Banner/Banner.md +2 -2
  39. package/dist/docs/Box/Box.md +2 -2
  40. package/dist/docs/Glimmer/Glimmer.md +1 -1
  41. package/dist/docs/Icon/Icon.md +1 -1
  42. package/dist/docs/InputText/InputText.md +152 -106
  43. package/dist/docs/Menu/Menu.md +1 -1
  44. package/dist/docs/Modal/Modal.md +1 -1
  45. package/dist/docs/Spinner/Spinner.md +9 -1
  46. package/dist/docs/Stack/Stack.md +1 -1
  47. package/dist/docs/index.md +1 -0
  48. package/dist/docs/usage-guidelines/usage-guidelines.md +0 -2
  49. package/dist/index.cjs +5 -3
  50. package/dist/index.d.mts +1 -0
  51. package/dist/index.d.ts +1 -0
  52. package/dist/index.mjs +3 -2
  53. package/dist/styles.css +279 -0
  54. package/dist/utils/meta/meta.json +1 -0
  55. package/package.json +8 -3
  56. 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 { InputTextRebuiltProps } from "@jobber/components/InputText";
13
+ import type { InputTextProps } from "@jobber/components/InputText";
14
14
  import { InputText } from "@jobber/components/InputText";
15
15
 
16
- export const ControlledExample = ({
16
+ export const InputTextBasicExample = ({
17
17
  onChange,
18
18
  ...props
19
- }: Partial<InputTextRebuiltProps>) => {
20
- const [age, setAge] = useState("Veintisiete");
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={age}
27
+ value={value}
29
28
  onChange={newValue => {
30
- setAge(newValue);
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 { InputTextLegacyProps } from "@jobber/components/InputText";
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<InputTextLegacyProps, "multiline">>,
53
+ props: Partial<Omit<InputTextProps, "multiline">>,
55
54
  ) {
55
+ const [value, setValue] = useState<string>(props.value ?? "");
56
+
56
57
  return (
57
- <InputText multiline={true} placeholder="Describe your age" {...props} />
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 { InputTextLegacyProps } from "@jobber/components/InputText";
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<InputTextLegacyProps, "multiline" | "rows">>,
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 { InputTextLegacyProps } from "@jobber/components/InputText";
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<InputTextLegacyProps, "multiline" | "rows">>,
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
- validations={{
132
- required: {
133
- value: true,
134
- message: "You have to tell us your age",
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 { InputTextLegacyProps } from "@jobber/components/InputText";
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<InputTextLegacyProps, "multiline" | "rows">>,
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<InputTextLegacyProps, "multiline" | "rows">>,
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 { InputTextLegacyProps } from "@jobber/components/InputText";
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<InputTextLegacyProps, "multiline" | "rows">>,
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 { InputTextLegacyProps } from "@jobber/components/InputText";
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<InputTextLegacyProps, "multiline" | "rows">>,
290
+ props: Partial<Omit<InputTextProps, "multiline" | "rows">>,
240
291
  ) {
292
+ const [value, setValue] = useState<string>(props.value ?? "");
293
+
241
294
  return (
242
- <InputText placeholder="Describe your age" keyboard="numeric" {...props} />
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
- | `autocomplete` | `AutocompleteTypes | boolean` | No | — | Determines if browser form autocomplete is enabled. Note that "one-time-code" is experimental and should not be used ... |
291
- | `autofocus` | `boolean` | No | — | Determines if the input should be auto-focused, using the HTML attribute |
292
- | `clearable` | `Clearable` | No | — | Add a clear action on the input that clears the value. You should always use `while-editing` if you want the input t... |
293
- | `defaultValue` | `Date | string` | No | — | Initial value of the input. Only use this when you need to pre-populate the field with a data that is not controlled ... |
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 | — | Disable the input |
296
- | `id` | `string` | No | — | A unique identifier for the input. |
297
- | `inline` | `boolean` | No | — | Adjusts the form field to go inline with a content. This also silences the given `validations` prop. You'd have to us... |
298
- | `inputRef` | `RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>` | No | | |
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
- | `keyboard` | `"decimal" | "numeric"` | No | — | Determines what kind of keyboard appears on mobile web. |
301
- | `loading` | `boolean` | No | — | Show a spinner to indicate loading |
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 | — | Name of the input. |
305
- | `onBlur` | `(event?: FocusEvent<Element, Element>) => void` | No | — | Blur callback. |
306
- | `onChange` | `(newValue: string | number | boolean | Date, event?: ChangeEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>) => void` | No | — | onChange handler that provides the new value (or event) @param newValue @param event |
307
- | `onEnter` | `(event: KeyboardEvent<Element>) => void` | No | — | A callback to handle "Enter" keypress. This will only run if Enter is the only key. Will not run if Shift or Control ... |
308
- | `onFocus` | `(event?: FocusEvent<Element, Element>) => void` | No | — | Focus callback. |
309
- | `onValidation` | `(message: string) => void` | No | — | Callback to get the the status and message when validating a field @param message |
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
- | `readonly` | `boolean` | No | — | Prevents users from editing the value. |
313
- | `ref` | `Ref<InputTextRef>` | No | — | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (... |
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` | Controls the visibility of the mini label that appears inside the input when a value is entered. By default, the plac... |
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... |
@@ -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" | "disabled" | "success" | "blue" | "green" | "yellow" | "red" | "grey" | "white" | "greyBlue" | "lightBlue" | "orange" | "navy" | "interactive" | ... 32 more ... | "brandHighlight"` | No | — | Determines the color of the icon. Some icons have a default system colour like quotes, jobs, and invoices. Others tha... |
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 |
@@ -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" />
@@ -1,5 +1,13 @@
1
1
  # Spinner
2
2
 
3
+ > **Deprecated.** Use
4
+ > [ActivityIndicator](../ActivityIndicator/ActivityIndicator.md) for new work.
5
+ > `ActivityIndicator` is the supported indeterminate loading indicator going
6
+ > forward — it offers the same semantic with a cleaner prop surface, a polite
7
+ > `role="status"`, theme-adaptive tokens, Material-style three-layer
8
+ > animation, and a `prefers-reduced-motion` fallback. `Spinner` continues to
9
+ > work unchanged for existing call sites.
10
+
3
11
  Spinner is used to indicate the loading of content where the actual amount of
4
12
  loading time or progress is unknown.
5
13
 
@@ -32,7 +40,7 @@ If the amount of progress or loading time is known, use
32
40
  process.
33
41
 
34
42
  To indicate loading content in mobile applications, refer to
35
- [ActivityIndicator](/components/ActivityIndicator).
43
+ [ActivityIndicator](../ActivityIndicator/ActivityIndicator.md).
36
44
 
37
45
 
38
46
  ## Props
@@ -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 | 5 | 3 | 4 | 6 | 11 | 7 | 8 | 9 | 10 | 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... |
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... |
@@ -1,3 +1,4 @@
1
+ [ActivityIndicator](./ActivityIndicator/ActivityIndicator.md)
1
2
  [AnimatedPresence](./AnimatedPresence/AnimatedPresence.md)
2
3
  [AnimatedSwitcher](./AnimatedSwitcher/AnimatedSwitcher.md)
3
4
  [Animation](./Animation/Animation.md)
@@ -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
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ var ActivityIndicator = require('./ActivityIndicator-cjs.js');
3
4
  var AnimatedPresence = require('./AnimatedPresence-cjs.js');
4
5
  var AnimatedSwitcher = require('./AnimatedSwitcher-cjs.js');
5
6
  var AtlantisContext = require('./AtlantisContext-cjs.js');
@@ -61,7 +62,7 @@ var InputGroup = require('./InputGroup-cjs.js');
61
62
  var InputNumber = require('./InputNumber-cjs.js');
62
63
  var InputPassword = require('./InputPassword-cjs.js');
63
64
  var InputPhoneNumber = require('./InputPhoneNumber-cjs.js');
64
- var InputText_index = require('./InputText/index.cjs');
65
+ var InputText = require('./InputText-cjs.js');
65
66
  var InputTime = require('./InputTime-cjs.js');
66
67
  var InputValidation = require('./InputValidation-cjs.js');
67
68
  var LightBox = require('./LightBox-cjs.js');
@@ -93,6 +94,7 @@ var Tiles = require('./Tiles-cjs.js');
93
94
  var showToast = require('./showToast-cjs.js');
94
95
  var Tooltip = require('./Tooltip-cjs.js');
95
96
  var Typography = require('./Typography-cjs.js');
97
+ require('classnames');
96
98
  require('framer-motion');
97
99
  require('@jobber/design');
98
100
  require('./_commonjsHelpers-cjs.js');
@@ -110,7 +112,6 @@ require('./index.esm-cjs.js');
110
112
  require('react/jsx-runtime');
111
113
  require('react-dom');
112
114
  require('./floating-ui.react-dom-cjs.js');
113
- require('classnames');
114
115
  require('./maxHeight-cjs.js');
115
116
  require('./tslib.es6-cjs.js');
116
117
  require('react-hook-form');
@@ -205,6 +206,7 @@ function isNormalClick(evt) {
205
206
  !evt.altKey);
206
207
  }
207
208
 
209
+ exports.ActivityIndicator = ActivityIndicator.ActivityIndicator;
208
210
  exports.AnimatedPresence = AnimatedPresence.AnimatedPresence;
209
211
  exports.AnimatedSwitcher = AnimatedSwitcher.AnimatedSwitcher;
210
212
  exports.AtlantisContext = AtlantisContext.AtlantisContext;
@@ -300,7 +302,7 @@ exports.InputGroup = InputGroup.InputGroup;
300
302
  exports.InputNumber = InputNumber.InputNumber;
301
303
  exports.InputPassword = InputPassword.InputPassword;
302
304
  exports.InputPhoneNumber = InputPhoneNumber.InputPhoneNumber;
303
- exports.InputText = InputText_index.InputText;
305
+ exports.InputText = InputText.InputText;
304
306
  exports.InputTime = InputTime.InputTime;
305
307
  exports.InputValidation = InputValidation.InputValidation;
306
308
  exports.LightBox = LightBox.LightBox;
package/dist/index.d.mts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "./ActivityIndicator";
1
2
  export * from "./AnimatedPresence";
2
3
  export * from "./AnimatedSwitcher";
3
4
  export * from "./AtlantisContext";
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "./ActivityIndicator";
1
2
  export * from "./AnimatedPresence";
2
3
  export * from "./AnimatedSwitcher";
3
4
  export * from "./AtlantisContext";
package/dist/index.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ export { A as ActivityIndicator } from './ActivityIndicator-es.js';
1
2
  export { A as AnimatedPresence } from './AnimatedPresence-es.js';
2
3
  export { A as AnimatedSwitcher } from './AnimatedSwitcher-es.js';
3
4
  export { A as AtlantisContext, a as atlantisContextDefaultValues, u as useAtlantisContext } from './AtlantisContext-es.js';
@@ -59,7 +60,7 @@ export { I as InputGroup } from './InputGroup-es.js';
59
60
  export { I as InputNumber } from './InputNumber-es.js';
60
61
  export { I as InputPassword } from './InputPassword-es.js';
61
62
  export { I as InputPhoneNumber } from './InputPhoneNumber-es.js';
62
- export { InputText } from './InputText/index.mjs';
63
+ export { I as InputText } from './InputText-es.js';
63
64
  export { I as InputTime } from './InputTime-es.js';
64
65
  export { I as InputValidation } from './InputValidation-es.js';
65
66
  export { L as LightBox, u as useLightBoxContext } from './LightBox-es.js';
@@ -91,6 +92,7 @@ export { T as Tiles } from './Tiles-es.js';
91
92
  export { T as Toast, s as showToast } from './showToast-es.js';
92
93
  export { T as Tooltip } from './Tooltip-es.js';
93
94
  export { T as Typography } from './Typography-es.js';
95
+ import 'classnames';
94
96
  import 'framer-motion';
95
97
  import '@jobber/design';
96
98
  import './_commonjsHelpers-es.js';
@@ -108,7 +110,6 @@ import './index.esm-es.js';
108
110
  import 'react/jsx-runtime';
109
111
  import 'react-dom';
110
112
  import './floating-ui.react-dom-es.js';
111
- import 'classnames';
112
113
  import './maxHeight-es.js';
113
114
  import './tslib.es6-es.js';
114
115
  import 'react-hook-form';