@jobber/components 8.6.0 → 8.7.1

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 (76) hide show
  1. package/dist/Autocomplete/index.cjs +1 -2
  2. package/dist/Autocomplete/index.mjs +1 -2
  3. package/dist/Autocomplete-cjs.js +1 -3
  4. package/dist/Autocomplete-es.js +1 -3
  5. package/dist/DataList/components/DataListSearch/index.cjs +1 -2
  6. package/dist/DataList/components/DataListSearch/index.mjs +1 -2
  7. package/dist/DataList/index.cjs +1 -2
  8. package/dist/DataList/index.mjs +1 -2
  9. package/dist/DataTable/index.cjs +1 -2
  10. package/dist/DataTable/index.mjs +1 -2
  11. package/dist/FormField/FormFieldTypes.d.ts +1 -10
  12. package/dist/FormField/index.cjs +4 -13
  13. package/dist/FormField/index.d.ts +0 -4
  14. package/dist/FormField/index.mjs +4 -9
  15. package/dist/InputDate/index.cjs +1 -2
  16. package/dist/InputDate/index.mjs +1 -2
  17. package/dist/InputEmail/index.cjs +0 -1
  18. package/dist/InputEmail/index.mjs +0 -1
  19. package/dist/InputEmail-cjs.js +1 -3
  20. package/dist/InputEmail-es.js +1 -3
  21. package/dist/InputPhoneNumber/InputMask.d.ts +0 -38
  22. package/dist/InputPhoneNumber/InputPhoneNumber.types.d.ts +1 -2
  23. package/dist/InputPhoneNumber/index.cjs +1 -2
  24. package/dist/InputPhoneNumber/index.mjs +1 -2
  25. package/dist/InputPhoneNumber-cjs.js +11 -12
  26. package/dist/InputPhoneNumber-es.js +11 -12
  27. package/dist/InputText/index.cjs +1 -2
  28. package/dist/InputText/index.mjs +1 -2
  29. package/dist/InputText-cjs.js +3 -5
  30. package/dist/InputText-es.js +3 -5
  31. package/dist/InputTime/index.cjs +0 -1
  32. package/dist/InputTime/index.mjs +0 -1
  33. package/dist/InputTime-cjs.js +1 -2
  34. package/dist/InputTime-es.js +1 -2
  35. package/dist/Select/index.cjs +1 -2
  36. package/dist/Select/index.mjs +1 -2
  37. package/dist/Select-cjs.js +3 -5
  38. package/dist/Select-es.js +3 -5
  39. package/dist/docs/Button/Button.md +1 -1
  40. package/dist/docs/errors/errors.md +1 -1
  41. package/dist/docs/index.md +0 -3
  42. package/dist/index.cjs +2 -12
  43. package/dist/index.d.mts +0 -2
  44. package/dist/index.d.ts +0 -2
  45. package/dist/index.mjs +2 -6
  46. package/dist/prebuildCssEntry.d.ts +13 -0
  47. package/dist/useAtlantisFormFieldName-cjs.js +3 -3
  48. package/dist/useAtlantisFormFieldName-es.js +3 -3
  49. package/dist/utils/meta/meta.json +0 -3
  50. package/package.json +3 -15
  51. package/rollup.config.mjs +15 -17
  52. package/Form.d.ts +0 -1
  53. package/Form.js +0 -17
  54. package/InputPassword.d.ts +0 -1
  55. package/InputPassword.js +0 -17
  56. package/dist/Form/Form.d.ts +0 -18
  57. package/dist/Form/index.cjs +0 -10
  58. package/dist/Form/index.d.ts +0 -1
  59. package/dist/Form/index.mjs +0 -4
  60. package/dist/Form-cjs.js +0 -43
  61. package/dist/Form-es.js +0 -41
  62. package/dist/FormField/FormField.d.ts +0 -3
  63. package/dist/FormField/hooks/useAtlantisFormField.d.ts +0 -91
  64. package/dist/FormField/hooks/useAtlantisFormFieldActions.d.ts +0 -22
  65. package/dist/FormField/hooks/useAtlantisReactHookForm.d.ts +0 -20
  66. package/dist/FormField-cjs.js +0 -209
  67. package/dist/FormField-es.js +0 -204
  68. package/dist/InputPassword/InputPassword.d.ts +0 -13
  69. package/dist/InputPassword/index.cjs +0 -27
  70. package/dist/InputPassword/index.d.ts +0 -1
  71. package/dist/InputPassword/index.mjs +0 -21
  72. package/dist/InputPassword-cjs.js +0 -28
  73. package/dist/InputPassword-es.js +0 -26
  74. package/dist/docs/Form/Form.md +0 -106
  75. package/dist/docs/FormField/FormField.md +0 -92
  76. package/dist/docs/InputPassword/InputPassword.md +0 -51
@@ -1,106 +0,0 @@
1
- # Form
2
-
3
- The Form component is a wrapper component that handles the submission and
4
- validation of forms.
5
-
6
- For more information about `validations` using any of the Input components, see
7
- the [InputText](../InputText/InputText.md) documentation.
8
-
9
- ## Design & usages guidelines
10
-
11
- The Form component has a lot of built-in features which rely on its internal
12
- state. To take advantage of these features, do not bypass the Form's internal
13
- state — the fields or inputs within the Form must have a `name` prop and **NOT**
14
- have a `value` and `onChange` prop.
15
-
16
- ## Content guidelines
17
-
18
- ### Inputs
19
-
20
- Form can accept various inputs and selection elements such as (but not limited
21
- to) [InputText](../InputText/InputText.md), [Select](../Select/Select.md),
22
- [Switch](../Switch/Switch.md), [Checkbox](../Checkbox/Checkbox.md), and
23
- [Chips](../Chips/Chips.md). They should be placed [Cards](../Card/Card.md) to
24
- indicate grouping when relevant, and groups of Cards can be spaced appropriately
25
- using ContentSection.
26
-
27
- ### Save Button label
28
-
29
- The `saveButtonLabel` property defaults to "Save", but should be made more
30
- verbose to add context for the user. Use the format "Save {object}", such as
31
- "Save Job". This helps clarify to the user that tapping the Save Button is not
32
- saving the single input they are editing, but the entire object.
33
-
34
- ### Form errors
35
-
36
- All error messaging should follow our
37
- [Product Vocabulary.](/content/product-vocabulary)
38
-
39
- ## Setup (mobile)
40
-
41
- Consuming apps using the mobile Form must wrap their app root with
42
- `KeyboardProvider` from `react-native-keyboard-controller`.
43
-
44
- ## Accessibility (mobile)
45
-
46
- The individual inputs are responsible for accessibility concerns such as the
47
- labels, types, values, and error messages of each input.
48
-
49
-
50
- ## Platform considerations
51
-
52
- #### iOS
53
-
54
- On iOS, the save button will be fixed to the bottom of the viewport until the
55
- keyboard is opened.
56
-
57
- Once the keyboard is open, the save button will be inline beneath the Form's
58
- inputs, unless the Form is so short that it does not scroll. In this case, the
59
- save button will remain fixed above the keyboard.
60
-
61
- This prevents the user from accidentally submitting the Form before they have
62
- completed entering all the relevant information for their work, especially since
63
- many data points in Jobber cannot be edited once saved.
64
-
65
- #### Android
66
-
67
- On Android, the save button will always be inline with the contents of the Form.
68
-
69
- ### Error handling
70
-
71
- #### Server-side errors
72
-
73
- Server-side error messages will be displayed in a banner at the top the Form
74
- upon a failed submission attempt. These are errors where something has gone
75
- wrong with the data either on the way to, or on the way back from, our servers.
76
- If the user can address the errors, inform them how to do so in the banner.
77
- Otherwise, a generic message informing the user that something went wrong is an
78
- appropriate fallback.
79
-
80
- Note: When a server-side error happens, inside the `onSubmit` function, an error
81
- must be thrown. Throwing an error inside the `onSubmit` function will ensure
82
- that your `onSubmitError` function is called instead of your `onSubmitSuccess`.
83
-
84
- #### Client-side errors
85
-
86
- Client-side errors are issues that we can catch and inform the user of before
87
- they attempt to submit the Form, such as a required field left blank or an
88
- incorrect email address format.
89
-
90
- Error messages for individual inputs should appear inline on each impacted
91
- input. Form will automatically scroll to the first invalid (has an error)
92
- element and display the error message.
93
-
94
- When an error occurs, either server-side or client-side, Form will announce the
95
- message to screen-readers and set focus to the impacted portion of the Form.
96
-
97
-
98
- ## Props
99
-
100
- ### Web
101
-
102
- | Prop | Type | Required | Default | Description |
103
- |------|------|----------|---------|-------------|
104
- | `onStateChange` | `(formState: { isDirty: boolean; isValid: boolean; }) => void` | No | — | |
105
- | `onSubmit` | `() => void` | No | — | Callback for when the form has been sucessfully submitted. |
106
- | `ref` | `Ref<FormRef>` | No | — | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (... |
@@ -1,92 +0,0 @@
1
- # Form Field
2
-
3
- FormField is a helper component that allows other components to use form logic.
4
- Interacting with a component wrapped in a FormField will automatically update
5
- the form value for the field used by the component.
6
-
7
- ## Related components
8
-
9
- Refer to the [Form](../Form/Form.md) documentation to learn more about inputs
10
- within a form.
11
-
12
-
13
- ## Configuration
14
-
15
- ### Mobile
16
-
17
- FormField should not be used to wrap separate instances of a given input
18
- component, it should be done at the component level. For example, say you had
19
- four SpecialInput components on a given form. Instead of the four SpecialInput
20
- components in FormField, it would be better to go to the SpecialInput component
21
- where it is exported and wrap it there.
22
-
23
- ```ts
24
- // The SpecialInput implementation, without any form logic
25
- function SpecialInputInternal(props) {
26
- ...
27
- }
28
-
29
- // This is what would be exported and used by other views or components
30
- export function SpecialInput(props) {
31
- return (
32
- <FormField name={props.name}>
33
- {(field) => {
34
- return (
35
- <SpecialInput
36
- ...props
37
- onChange={field.onChange}
38
- value={field.value}
39
- />
40
- );
41
- }}
42
- </FormField>
43
- );
44
- }
45
- ```
46
-
47
-
48
- ## Props
49
-
50
- ### Web
51
-
52
- | Prop | Type | Required | Default | Description |
53
- |------|------|----------|---------|-------------|
54
- | `actionsRef` | `RefObject<FieldActionsRef>` | No | — | |
55
- | `align` | `"center" | "right"` | No | — | Determines the alignment of the text inside the input. |
56
- | `autocomplete` | `AutocompleteTypes | boolean` | No | — | Determines if browser form autocomplete is enabled. Note that "one-time-code" is experimental and should not be used ... |
57
- | `autofocus` | `boolean` | No | — | Determines if the input should be auto-focused, using the HTML attribute |
58
- | `children` | `ReactNode` | No | — | If you need to pass in a children. For example, `<options>` inside `<select>`. |
59
- | `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... |
60
- | `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 ... |
61
- | `description` | `ReactNode` | No | — | Further description of the input, can be used for a hint. |
62
- | `disabled` | `boolean` | No | — | Disable the input |
63
- | `id` | `string` | No | — | A unique identifier for the input. |
64
- | `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... |
65
- | `inputRef` | `RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>` | No | — | |
66
- | `invalid` | `boolean` | No | — | Highlights the field red to indicate an error. |
67
- | `keyboard` | `"decimal" | "numeric"` | No | — | Determines what kind of keyboard appears on mobile web. |
68
- | `loading` | `boolean` | No | — | Show a spinner to indicate loading |
69
- | `max` | `number` | No | — | Specifies the maximum numerical or date value that a user can type |
70
- | `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... |
71
- | `min` | `number` | No | — | Specifies the minimum numerical or date value that a user can type |
72
- | `name` | `string` | No | — | Name of the input. |
73
- | `onBlur` | `(event?: FocusEvent<Element, Element>) => void` | No | — | Blur callback. |
74
- | `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 |
75
- | `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 ... |
76
- | `onFocus` | `(event?: FocusEvent<Element, Element>) => void` | No | — | Focus callback. |
77
- | `onKeyUp` | `(event: KeyboardEvent<HTMLInputElement>) => void` | No | — | |
78
- | `onValidation` | `(message: string) => void` | No | — | Callback to get the the status and message when validating a field @param message |
79
- | `pattern` | `string` | No | — | Pattern is currently only used for the InputPhone type it is used to determine the format of the phone number and the... |
80
- | `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... |
81
- | `prefix` | `Affix` | No | — | Adds a prefix label and icon to the field |
82
- | `readonly` | `boolean` | No | — | Prevents users from editing the value. |
83
- | `rows` | `number` | No | — | Exclusively for textareas. Specifies the visible height of a textarea. |
84
- | `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... |
85
- | `size` | `"large" | "small"` | No | — | Adjusts the interface to either have small or large spacing. |
86
- | `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 |
87
- | `toolbar` | `ReactNode` | No | — | Toolbar to render content below the input. |
88
- | `toolbarVisibility` | `"always" | "while-editing"` | No | — | Determines the visibility of the toolbar. |
89
- | `type` | `FormFieldTypes` | No | — | Determines what kind of form field should the component give you. |
90
- | `validations` | `RegisterOptions` | No | — | Show an error message above the field. This also highlights the the field red if an error message shows up. |
91
- | `value` | `Date | number | string` | No | — | Set the component to the given value. |
92
- | `wrapperRef` | `RefObject<HTMLDivElement>` | No | — | |
@@ -1,51 +0,0 @@
1
- # Input Password
2
-
3
- InputPassword is used to display a secure password input field.
4
-
5
- ## Design & usage guidelines
6
-
7
- Use InputPassword for authentication flows where the user is required to enter a
8
- password.
9
-
10
- If you are building an experience for authentication that does not require
11
- character-masking or are looking for more information regarding `validations`,
12
- refer to [InputText](../InputText/InputText.md).
13
-
14
- ## Clearable
15
-
16
- * **while-editing**: shows the clear button only while focused and when there is
17
- a value. When focus leaves the field and its controls, the button is hidden.
18
- * **always**: shows the clear button whenever there is a value, even when
19
- blurred. Never shown when the field is empty.
20
- * The clear button is not shown when the field is `disabled` or `readonly`.
21
-
22
-
23
- ## Props
24
-
25
- ### Web
26
-
27
- | Prop | Type | Required | Default | Description |
28
- |------|------|----------|---------|-------------|
29
- | `align` | `"center" | "right"` | No | — | Determines the alignment of the text inside the input. |
30
- | `autocomplete` | `AutocompleteTypes | boolean` | No | — | Determines if browser form autocomplete is enabled. Note that "one-time-code" is experimental and should not be used ... |
31
- | `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... |
32
- | `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 ... |
33
- | `description` | `ReactNode` | No | — | Further description of the input, can be used for a hint. |
34
- | `disabled` | `boolean` | No | — | Disable the input |
35
- | `hasVisibility` | `boolean` | No | `false` | Display toggle to change the visibility of the password input |
36
- | `id` | `string` | No | — | A unique identifier for the input. |
37
- | `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... |
38
- | `inputRef` | `RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>` | No | — | |
39
- | `invalid` | `boolean` | No | — | Highlights the field red to indicate an error. |
40
- | `loading` | `boolean` | No | — | Show a spinner to indicate loading |
41
- | `name` | `string` | No | — | Name of the input. |
42
- | `onBlur` | `(event?: FocusEvent<Element, Element>) => void` | No | — | Blur callback. |
43
- | `onChange` | `(newValue: string) => void` | No | — | onChange handler that provides the new value (or event) |
44
- | `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 ... |
45
- | `onFocus` | `(event?: FocusEvent<Element, Element>) => void` | No | — | Focus callback. |
46
- | `onValidation` | `(message: string) => void` | No | — | Callback to get the the status and message when validating a field @param message |
47
- | `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... |
48
- | `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... |
49
- | `size` | `"large" | "small"` | No | — | Adjusts the interface to either have small or large spacing. |
50
- | `validations` | `RegisterOptions` | No | — | Show an error message above the field. This also highlights the the field red if an error message shows up. |
51
- | `value` | `string` | No | — | Set the component to the given value. |