@jobber/components 7.5.0 → 7.7.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/index.cjs +6 -5
- package/dist/Autocomplete/index.mjs +3 -2
- package/dist/DataList/components/DataListSearch/index.cjs +1 -0
- package/dist/DataList/components/DataListSearch/index.mjs +1 -0
- package/dist/DataList/index.cjs +1 -0
- package/dist/DataList/index.mjs +1 -0
- package/dist/DataTable/index.cjs +2 -14
- package/dist/DataTable/index.mjs +2 -14
- package/dist/DataTable-cjs.js +3 -3
- package/dist/DataTable-es.js +1 -1
- package/dist/FormField/index.cjs +14 -13
- package/dist/FormField/index.mjs +5 -4
- package/dist/FormField-cjs.js +8 -281
- package/dist/FormField-es.js +3 -263
- package/dist/InputDate/InputDate.d.ts +1 -1
- package/dist/InputDate/InputDate.types.d.ts +2 -30
- package/dist/InputDate/index.cjs +22 -163
- package/dist/InputDate/index.d.ts +2 -4
- package/dist/InputDate/index.mjs +21 -166
- package/dist/InputDate/useInputDateActivatorActions.d.ts +2 -2
- package/dist/InputDate-cjs.js +96 -0
- package/dist/InputDate-es.js +94 -0
- package/dist/InputEmail/index.cjs +7 -6
- package/dist/InputEmail/index.mjs +4 -3
- package/dist/InputNumber/index.cjs +1 -0
- package/dist/InputNumber/index.mjs +2 -1
- package/dist/InputPassword/index.cjs +1 -0
- package/dist/InputPassword/index.mjs +1 -0
- package/dist/InputPassword-es.js +1 -1
- package/dist/InputPhoneNumber/index.cjs +6 -5
- package/dist/InputPhoneNumber/index.mjs +2 -1
- package/dist/InputText/index.cjs +8 -7
- package/dist/InputText/index.mjs +4 -3
- package/dist/InputTime/index.cjs +5 -4
- package/dist/InputTime/index.mjs +2 -1
- package/dist/RecurringSelect/index.cjs +3 -14
- package/dist/RecurringSelect/index.mjs +3 -14
- package/dist/RecurringSelect-cjs.js +6 -6
- package/dist/RecurringSelect-es.js +1 -1
- package/dist/Select/Select.d.ts +6 -2
- package/dist/Select/Select.types.d.ts +2 -16
- package/dist/Select/index.cjs +11 -103
- package/dist/Select/index.d.ts +2 -9
- package/dist/Select/index.mjs +9 -105
- package/dist/Select-cjs.js +78 -0
- package/dist/Select-es.js +75 -0
- package/dist/docs/InputDate/InputDate.md +31 -19
- package/dist/docs/Select/Select.md +69 -33
- package/dist/docs/usage-guidelines/usage-guidelines.md +9 -13
- package/dist/index.cjs +16 -15
- package/dist/index.mjs +4 -3
- package/dist/mergeRefs-cjs.js +279 -0
- package/dist/mergeRefs-es.js +265 -0
- package/package.json +2 -2
- package/dist/InputDate/InputDate.rebuilt.d.ts +0 -3
- package/dist/Select/Select.rebuilt.d.ts +0 -3
|
@@ -19,10 +19,8 @@ date.
|
|
|
19
19
|
```tsx
|
|
20
20
|
import React from "react";
|
|
21
21
|
import { InputDate } from "@jobber/components/InputDate";
|
|
22
|
-
|
|
23
|
-
import type { InputDateProps } from "../InputDate.types";
|
|
22
|
+
import type { InputDateProps } from "@jobber/components/InputDate";
|
|
24
23
|
|
|
25
|
-
// eslint-disable-next-line import/no-deprecated
|
|
26
24
|
export function InputDateDisabledExample(props: InputDateProps) {
|
|
27
25
|
return <InputDate placeholder="Start Date" disabled={true} {...props} />;
|
|
28
26
|
}
|
|
@@ -42,7 +40,6 @@ export function InputDateInvalidExample(props: InputDateProps) {
|
|
|
42
40
|
error="Start Date is required"
|
|
43
41
|
invalid={true}
|
|
44
42
|
{...props}
|
|
45
|
-
version={2}
|
|
46
43
|
/>
|
|
47
44
|
);
|
|
48
45
|
}
|
|
@@ -116,28 +113,43 @@ at the root of the application, populated with the applicable value.
|
|
|
116
113
|
|
|
117
114
|
| Prop | Type | Required | Default | Description |
|
|
118
115
|
|------|------|----------|---------|-------------|
|
|
119
|
-
| `onChange` | `(newValue: Date) => void` | Yes | — |
|
|
116
|
+
| `onChange` | `(newValue: Date, event?: ChangeEvent<HTMLInputElement>) => void` | Yes | — | Callback for value changes. @param newValue - The new Date value @param event - Optional change event |
|
|
120
117
|
| `align` | `"center" | "right"` | No | — | Determines the alignment of the text inside the input. |
|
|
118
|
+
| `aria-activedescendant` | `string` | No | — | ID of the currently active descendant element. Used for composite widgets like combobox or listbox. @see {@link https... |
|
|
119
|
+
| `aria-autocomplete` | `"inline" | "none" | "list" | "both"` | No | — | Indicates the type of autocomplete interaction. @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-autocomplete} |
|
|
120
|
+
| `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} |
|
|
121
|
+
| `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-... |
|
|
122
|
+
| `aria-details` | `string` | No | — | Identifies the element (or elements) that provide a detailed, extended description. @see {@link https://www.w3.org/TR... |
|
|
123
|
+
| `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} |
|
|
124
|
+
| `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} |
|
|
125
|
+
| `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/... |
|
|
126
|
+
| `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... |
|
|
127
|
+
| `autoComplete` | `string` | No | — | Autocomplete behavior for the input (React casing, string values only). Use standard HTML autocomplete values or "on"... |
|
|
128
|
+
| `autoFocus` | `boolean` | No | — | Whether the input should be auto-focused (React casing). |
|
|
121
129
|
| `description` | `ReactNode` | No | — | Further description of the input, can be used for a hint. |
|
|
122
|
-
| `disabled` | `boolean` | No | — |
|
|
130
|
+
| `disabled` | `boolean` | No | — | Whether the input is disabled. |
|
|
123
131
|
| `emptyValueLabel` | `string` | No | — | Text to display instead of a date value |
|
|
124
|
-
| `
|
|
125
|
-
| `
|
|
126
|
-
| `
|
|
132
|
+
| `error` | `string` | No | — | Error message to display. This also highlights the field red. |
|
|
133
|
+
| `id` | `string` | No | — | The unique identifier for the input element. |
|
|
134
|
+
| `inline` | `boolean` | No | — | Adjusts the form field to go inline with content. |
|
|
135
|
+
| `inputMode` | `"none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search"` | No | — | Input mode hint for virtual keyboards. |
|
|
127
136
|
| `invalid` | `boolean` | No | — | Highlights the field red to indicate an error. |
|
|
128
|
-
| `loading` | `boolean` | No | — | Show a spinner to indicate loading |
|
|
137
|
+
| `loading` | `boolean` | No | — | Show a spinner to indicate loading. |
|
|
129
138
|
| `maxDate` | `Date` | No | — | The maximum selectable date. |
|
|
130
139
|
| `minDate` | `Date` | No | — | The minimum selectable date. |
|
|
131
|
-
| `name` | `string` | No | — |
|
|
132
|
-
| `onBlur` | `(event
|
|
133
|
-
| `onEnter` | `(event: KeyboardEvent<Element>) => void` | No | — |
|
|
134
|
-
| `onFocus` | `(event
|
|
135
|
-
| `
|
|
140
|
+
| `name` | `string` | No | — | The name attribute for the input element. |
|
|
141
|
+
| `onBlur` | `(event: FocusEvent<HTMLInputElement | HTMLTextAreaElement, Element>) => void` | No | — | Blur event handler. |
|
|
142
|
+
| `onEnter` | `(event: KeyboardEvent<Element>) => void` | No | — | @deprecated Use `onKeyDown` or `onKeyUp` instead. |
|
|
143
|
+
| `onFocus` | `(event: FocusEvent<HTMLInputElement | HTMLTextAreaElement, Element>) => void` | No | — | Focus event handler. |
|
|
144
|
+
| `onKeyDown` | `(event: KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => void` | No | — | Key down event handler. |
|
|
145
|
+
| `onKeyUp` | `(event: KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => void` | No | — | Key up event handler. |
|
|
146
|
+
| `pattern` | `string` | No | — | Validation pattern (regex) for the input. |
|
|
136
147
|
| `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... |
|
|
137
|
-
| `
|
|
148
|
+
| `readOnly` | `boolean` | No | — | Whether the input is read-only (HTML standard casing). |
|
|
149
|
+
| `ref` | `Ref<HTMLInputElement>` | No | — | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (... |
|
|
150
|
+
| `required` | `boolean` | No | — | Whether the input is required before form submission. |
|
|
151
|
+
| `role` | `string` | No | — | Role attribute for accessibility. |
|
|
138
152
|
| `showIcon` | `boolean` | No | `true` | Whether to show the calendar icon |
|
|
139
|
-
| `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... |
|
|
140
153
|
| `size` | `"small" | "large"` | No | — | Adjusts the interface to either have small or large spacing. |
|
|
141
|
-
| `
|
|
154
|
+
| `tabIndex` | `number` | No | — | Tab index for keyboard navigation. |
|
|
142
155
|
| `value` | `Date` | No | — | A Date object value (e.g., `new Date("11/11/2011")`) |
|
|
143
|
-
| `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... |
|
|
@@ -9,9 +9,9 @@ selected. For grouping options with section headers, use Select.OptionGroup.
|
|
|
9
9
|
|
|
10
10
|
#### Custom grouped menu and browser support
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
To enable the enhanced grouped menu styling (bold section headers, edge‑to‑edge
|
|
13
|
+
dividers and hover backgrounds), set the `UNSAFE_experimentalStyles` prop on
|
|
14
|
+
`Select`.
|
|
15
15
|
|
|
16
16
|
* When `UNSAFE_experimentalStyles` is true and the browser supports
|
|
17
17
|
`appearance: base-select` (Chromium 123+), the select renders with the
|
|
@@ -20,21 +20,19 @@ the `UNSAFE_experimentalStyles` prop on `Select`.
|
|
|
20
20
|
the select remains native while still rendering the same `OptionGroup`
|
|
21
21
|
structure.
|
|
22
22
|
|
|
23
|
-
#### Option Props
|
|
24
|
-
|
|
25
|
-
#### OptionGroup Props
|
|
26
|
-
|
|
27
23
|
## States
|
|
28
24
|
|
|
29
25
|
### Invalid
|
|
30
26
|
|
|
31
27
|
```tsx
|
|
32
|
-
import React from "react";
|
|
28
|
+
import React, { useState } from "react";
|
|
33
29
|
import { Option, Select } from "@jobber/components/Select";
|
|
34
30
|
|
|
35
31
|
export function SelectInvalidExample() {
|
|
32
|
+
const [value, setValue] = useState<string | number | undefined>("");
|
|
33
|
+
|
|
36
34
|
return (
|
|
37
|
-
<Select invalid={true}>
|
|
35
|
+
<Select invalid={true} value={value} onChange={setValue}>
|
|
38
36
|
<Option value="sad">Tony</Option>
|
|
39
37
|
<Option value="old">Steve</Option>
|
|
40
38
|
</Select>
|
|
@@ -45,12 +43,14 @@ export function SelectInvalidExample() {
|
|
|
45
43
|
### Disabled
|
|
46
44
|
|
|
47
45
|
```tsx
|
|
48
|
-
import React from "react";
|
|
46
|
+
import React, { useState } from "react";
|
|
49
47
|
import { Option, Select } from "@jobber/components/Select";
|
|
50
48
|
|
|
51
49
|
export function SelectDisabledExample() {
|
|
50
|
+
const [value, setValue] = useState<string | number | undefined>("");
|
|
51
|
+
|
|
52
52
|
return (
|
|
53
|
-
<Select disabled={true}>
|
|
53
|
+
<Select disabled={true} value={value} onChange={setValue}>
|
|
54
54
|
<Option value="sad">Tony</Option>
|
|
55
55
|
<Option value="old">Steve</Option>
|
|
56
56
|
</Select>
|
|
@@ -67,15 +67,18 @@ provides the section header text.
|
|
|
67
67
|
### Basic Option Groups
|
|
68
68
|
|
|
69
69
|
```tsx
|
|
70
|
-
import React from "react";
|
|
70
|
+
import React, { useState } from "react";
|
|
71
71
|
import { Select } from "@jobber/components/Select";
|
|
72
72
|
|
|
73
73
|
export function SelectCustomOptionGroupsExample() {
|
|
74
|
+
const [value, setValue] = useState<string | number | undefined>("");
|
|
75
|
+
|
|
74
76
|
return (
|
|
75
77
|
<Select
|
|
76
78
|
placeholder="Select an option"
|
|
77
|
-
version={2}
|
|
78
79
|
UNSAFE_experimentalStyles={true}
|
|
80
|
+
value={value}
|
|
81
|
+
onChange={setValue}
|
|
79
82
|
>
|
|
80
83
|
<Select.OptionGroup label="Team A">
|
|
81
84
|
<Select.Option value="alice">Alice</Select.Option>
|
|
@@ -100,15 +103,18 @@ export function SelectCustomOptionGroupsExample() {
|
|
|
100
103
|
### Disabled Option Groups
|
|
101
104
|
|
|
102
105
|
```tsx
|
|
103
|
-
import React from "react";
|
|
106
|
+
import React, { useState } from "react";
|
|
104
107
|
import { Select } from "@jobber/components/Select";
|
|
105
108
|
|
|
106
109
|
export function SelectCustomOptionGroupDisabledExample() {
|
|
110
|
+
const [value, setValue] = useState<string | number | undefined>("");
|
|
111
|
+
|
|
107
112
|
return (
|
|
108
113
|
<Select
|
|
109
|
-
version={2}
|
|
110
114
|
UNSAFE_experimentalStyles
|
|
111
115
|
placeholder="Select an option"
|
|
116
|
+
value={value}
|
|
117
|
+
onChange={setValue}
|
|
112
118
|
>
|
|
113
119
|
<Select.OptionGroup label="Available Items">
|
|
114
120
|
<Select.Option value="option1">Option 1</Select.Option>
|
|
@@ -132,7 +138,7 @@ export function SelectCustomOptionGroupDisabledExample() {
|
|
|
132
138
|
|
|
133
139
|
### Custom (Chromium) vs native
|
|
134
140
|
|
|
135
|
-
Select
|
|
141
|
+
Select is native by default. Opt into the customizable Chrome UI with
|
|
136
142
|
`UNSAFE_experimentalStyles`. This enhances grouped menus in Chromium 123+ when
|
|
137
143
|
the browser supports `appearance: base-select`.
|
|
138
144
|
|
|
@@ -186,30 +192,60 @@ dropdown content is stylable; the closed value alignment is not.
|
|
|
186
192
|
|
|
187
193
|
### Web
|
|
188
194
|
|
|
195
|
+
#### Select
|
|
196
|
+
|
|
189
197
|
| Prop | Type | Required | Default | Description |
|
|
190
198
|
|------|------|----------|---------|-------------|
|
|
191
199
|
| `align` | `"center" | "right"` | No | — | Determines the alignment of the text inside the input. |
|
|
192
|
-
| `
|
|
200
|
+
| `aria-activedescendant` | `string` | No | — | ID of the currently active descendant element. Used for composite widgets like combobox or listbox. @see {@link https... |
|
|
201
|
+
| `aria-autocomplete` | `"inline" | "none" | "list" | "both"` | No | — | Indicates the type of autocomplete interaction. @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-autocomplete} |
|
|
202
|
+
| `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} |
|
|
203
|
+
| `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-... |
|
|
204
|
+
| `aria-details` | `string` | No | — | Identifies the element (or elements) that provide a detailed, extended description. @see {@link https://www.w3.org/TR... |
|
|
205
|
+
| `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} |
|
|
206
|
+
| `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} |
|
|
207
|
+
| `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/... |
|
|
208
|
+
| `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... |
|
|
209
|
+
| `autoComplete` | `string` | No | — | Autocomplete behavior for the input (React casing, string values only). Use standard HTML autocomplete values or "on"... |
|
|
210
|
+
| `autoFocus` | `boolean` | No | — | Whether the input should be auto-focused (React casing). |
|
|
193
211
|
| `children` | `ReactNode` | No | — | If you need to pass in a children. For example, `<options>` inside `<select>`. |
|
|
194
|
-
| `defaultValue` | `string | Date` | No | — | Initial value of the input. Only use this when you need to pre-populate the field with a data that is not controlled ... |
|
|
195
212
|
| `description` | `ReactNode` | No | — | Further description of the input, can be used for a hint. |
|
|
196
|
-
| `disabled` | `boolean` | No | — |
|
|
197
|
-
| `
|
|
198
|
-
| `
|
|
199
|
-
| `
|
|
213
|
+
| `disabled` | `boolean` | No | — | Whether the input is disabled. |
|
|
214
|
+
| `error` | `string` | No | — | Error message to display. This also highlights the field red. |
|
|
215
|
+
| `id` | `string` | No | — | The unique identifier for the input element. |
|
|
216
|
+
| `inline` | `boolean` | No | — | Adjusts the form field to go inline with content. |
|
|
217
|
+
| `inputMode` | `"none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search"` | No | — | Input mode hint for virtual keyboards. |
|
|
218
|
+
| `inputRef` | `Ref<HTMLSelectElement>` | No | — | |
|
|
200
219
|
| `invalid` | `boolean` | No | — | Highlights the field red to indicate an error. |
|
|
201
|
-
| `
|
|
202
|
-
| `name` | `string` | No | — |
|
|
203
|
-
| `onBlur` | `(event
|
|
204
|
-
| `onChange` | `(newValue
|
|
205
|
-
| `onEnter` | `(event: KeyboardEvent<Element>) => void` | No | — |
|
|
206
|
-
| `onFocus` | `(event
|
|
207
|
-
| `
|
|
220
|
+
| `loading` | `boolean` | No | — | Show a spinner to indicate loading. |
|
|
221
|
+
| `name` | `string` | No | — | The name attribute for the input element. |
|
|
222
|
+
| `onBlur` | `(event: FocusEvent<HTMLSelectElement, Element>) => void` | No | — | Blur event handler. |
|
|
223
|
+
| `onChange` | `(newValue?: string | number) => void` | No | — | |
|
|
224
|
+
| `onEnter` | `(event: KeyboardEvent<Element>) => void` | No | — | @deprecated Use `onKeyDown` or `onKeyUp` instead. |
|
|
225
|
+
| `onFocus` | `(event: FocusEvent<HTMLSelectElement, Element>) => void` | No | — | Focus event handler. |
|
|
226
|
+
| `pattern` | `string` | No | — | Validation pattern (regex) for the input. |
|
|
208
227
|
| `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... |
|
|
209
228
|
| `prefix` | `Affix` | No | — | Adds a prefix label and icon to the field |
|
|
229
|
+
| `required` | `boolean` | No | — | Whether the input is required before form submission. |
|
|
230
|
+
| `role` | `string` | No | — | Role attribute for accessibility. |
|
|
210
231
|
| `size` | `"small" | "large"` | No | — | Adjusts the interface to either have small or large spacing. |
|
|
211
232
|
| `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 |
|
|
212
|
-
| `
|
|
213
|
-
| `
|
|
214
|
-
| `
|
|
215
|
-
|
|
233
|
+
| `tabIndex` | `number` | No | — | Tab index for keyboard navigation. |
|
|
234
|
+
| `UNSAFE_experimentalStyles` | `boolean` | No | — | Opt-in to the customizable select UI (Chromium 123+). When true, the component will apply the custom select styles De... |
|
|
235
|
+
| `value` | `string | number` | No | — | |
|
|
236
|
+
|
|
237
|
+
#### Select.Option
|
|
238
|
+
|
|
239
|
+
| Prop | Type | Required | Default | Description |
|
|
240
|
+
|------|------|----------|---------|-------------|
|
|
241
|
+
| `disabled` | `boolean` | No | — | |
|
|
242
|
+
| `value` | `string` | No | — | The content of this attribute represents the value to be submitted with the form, should this option be selected. |
|
|
243
|
+
|
|
244
|
+
#### Select.OptionGroup
|
|
245
|
+
|
|
246
|
+
| Prop | Type | Required | Default | Description |
|
|
247
|
+
|------|------|----------|---------|-------------|
|
|
248
|
+
| `label` | `string` | Yes | — | |
|
|
249
|
+
| `disabled` | `boolean` | No | — | |
|
|
250
|
+
| `UNSAFE_className` | `string` | No | — | Use at your own risk: Custom classnames for specific elements. This should only be used as a last resort. Using this ... |
|
|
251
|
+
| `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 this may r... |
|
|
@@ -11,17 +11,15 @@ The following components have a v2 implementation. **Always pass
|
|
|
11
11
|
`version={2}`**. Never generate v1 usage for these components — v1 is
|
|
12
12
|
deprecated.
|
|
13
13
|
|
|
14
|
-
| Component | Import | v2 prop
|
|
15
|
-
| ---------------- | ------------------------------------------------------------------------ |
|
|
16
|
-
| Autocomplete | `import { Autocomplete } from "@jobber/components/Autocomplete"` | `version={2}` — fully controlled, async support
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
| Modal | `import { Modal } from "@jobber/components/Modal"` | `version={2}` — uses `Modal.Provider` composition |
|
|
24
|
-
| Select | `import { Select } from "@jobber/components/Select"` | `version={2}` — native `<select>`; opt into the customizable Chromium UI with `UNSAFE_experimentalStyles` |
|
|
14
|
+
| Component | Import | v2 prop |
|
|
15
|
+
| ---------------- | ------------------------------------------------------------------------ | ------------------------------------------------- |
|
|
16
|
+
| Autocomplete | `import { Autocomplete } from "@jobber/components/Autocomplete"` | `version={2}` — fully controlled, async support |
|
|
17
|
+
| InputEmail | `import { InputEmail } from "@jobber/components/InputEmail"` | `version={2}` |
|
|
18
|
+
| InputNumber | `import { InputNumber } from "@jobber/components/InputNumber"` | `version={2}` |
|
|
19
|
+
| InputPhoneNumber | `import { InputPhoneNumber } from "@jobber/components/InputPhoneNumber"` | `version={2}` |
|
|
20
|
+
| InputText | `import { InputText } from "@jobber/components/InputText"` | `version={2}` |
|
|
21
|
+
| InputTime | `import { InputTime } from "@jobber/components/InputTime"` | `version={2}` |
|
|
22
|
+
| Modal | `import { Modal } from "@jobber/components/Modal"` | `version={2}` — uses `Modal.Provider` composition |
|
|
25
23
|
|
|
26
24
|
## Deprecated components — do not use
|
|
27
25
|
|
|
@@ -39,7 +37,6 @@ deprecated.
|
|
|
39
37
|
| `Card` | `title` | Use the `header` prop, or compose with `Card.Header` and `Card.Body`. |
|
|
40
38
|
| `Toast` | `action`, `actionLabel` | Both will be removed in the next major version. Trigger follow-up work from outside the toast. |
|
|
41
39
|
| Text inputs (`InputText` v2 etc.) | `onEnter` | Use `onKeyDown` or `onKeyUp` and check the key. |
|
|
42
|
-
| `Select` v2 | `onEnter` | Use `onKeyDown` or `onKeyUp`. |
|
|
43
40
|
| `FormField` (`maxLength` on v1 inputs) | `maxLength` | Flagged in source as flawed; only kept for v1 backwards compatibility. |
|
|
44
41
|
|
|
45
42
|
## Import pattern
|
|
@@ -118,7 +115,6 @@ parent reads its compound children to wire up state, accessibility, and styling.
|
|
|
118
115
|
| `Banner` | `Banner.Provider`, `Banner.Content`, `Banner.Icon`, `Banner.DismissButton`, `Banner.Action` | Either the simple `<Banner type="...">children</Banner>` form, or the Provider form: `Banner.Provider` > `Banner.Content` (+ optional `Banner.Icon` / `Banner.Action` / `Banner.DismissButton`). |
|
|
119
116
|
| `Card` | `Card.Header`, `Card.Body` | `Card` > `Card.Header` + `Card.Body`. The legacy `header` string/element prop still works for simple cases. Use composition for any header that needs richer markup. |
|
|
120
117
|
| `Combobox` | `Combobox.Activator`, `Combobox.Option`, `Combobox.Action` | `Combobox` > optional `Combobox.Activator`, one or more `Combobox.Option`, optional `Combobox.Action`. Omitting `Combobox.Activator` renders the default activator. |
|
|
121
|
-
| `Select` v2 | `Select.Option`, `Select.OptionGroup` | These map directly to native `<option>` and `<optgroup>`. Use `UNSAFE_experimentalStyles` to opt into the customizable Chromium UI for grouped menus. |
|
|
122
118
|
| `DataTable` | `DataTable.Container`, `DataTable.Table`, `DataTable.Header`, `DataTable.HeaderCell`, `DataTable.SortableHeader`, `DataTable.Body`, `DataTable.Row`, `DataTable.Cell`, `DataTable.RowActions`, `DataTable.Actions`, `DataTable.Footer`, `DataTable.Pagination`, `DataTable.PaginationButton` | `DataTable.Footer` is a sibling of `DataTable.Body`, not a child. Place pagination outside the table (not inside the footer). For `layout="fixed"`, pass explicit widths via `style={{ width: "..." }}` on each `HeaderCell`. |
|
|
123
119
|
| `Menu` (web composable) | `Menu.Trigger`, `Menu.Content`, `Menu.Section`, `Menu.Header`, `Menu.HeaderLabel`, `Menu.Item`, `Menu.ItemIcon`, `Menu.ItemLabel`, `Menu.Separator` | `Menu` > `Menu.Trigger` + `Menu.Content` containing `Menu.Item`s (optionally grouped in `Menu.Section`s). Each `Menu.Item` must include `textValue` for type-ahead and screen readers. |
|
|
124
120
|
| `Page` | `Page.Header`, `Page.HeaderContent`, `Page.TitleBar`, `Page.Title`, `Page.Subtitle`, `Page.Intro`, `Page.Actions`, `Page.ActionPrimary`, `Page.ActionSecondary`, `Page.ActionMenu`, `Page.PrimaryButton`, `Page.SecondaryButton`, `Page.Menu`, `Page.Body` | Composable `Page` API: `Page` > `Page.Header` (containing `Page.HeaderContent` with `Page.TitleBar` > `Page.Title` / `Page.Subtitle`, and `Page.Actions` with `Page.ActionPrimary` / `Page.ActionSecondary` / `Page.ActionMenu`) + `Page.Body`. The legacy props-based API (`title`, `subtitle`, `intro`, etc.) still works. |
|
package/dist/index.cjs
CHANGED
|
@@ -43,6 +43,7 @@ var FeatureSwitch = require('./FeatureSwitch-cjs.js');
|
|
|
43
43
|
var Flex = require('./Flex-cjs.js');
|
|
44
44
|
var Form = require('./Form-cjs.js');
|
|
45
45
|
var FormField = require('./FormField-cjs.js');
|
|
46
|
+
var mergeRefs = require('./mergeRefs-cjs.js');
|
|
46
47
|
var FormatDate = require('./FormatDate-cjs.js');
|
|
47
48
|
var FormatEmail = require('./FormatEmail-cjs.js');
|
|
48
49
|
var FormatFile = require('./FormatFile-cjs.js');
|
|
@@ -55,7 +56,7 @@ var Grid = require('./Grid-cjs.js');
|
|
|
55
56
|
var Heading = require('./Heading-cjs.js');
|
|
56
57
|
var InlineLabel = require('./InlineLabel-cjs.js');
|
|
57
58
|
var InputAvatar = require('./InputAvatar-cjs.js');
|
|
58
|
-
var
|
|
59
|
+
var InputDate = require('./InputDate-cjs.js');
|
|
59
60
|
var InputEmail_index = require('./InputEmail/index.cjs');
|
|
60
61
|
var InputFile = require('./InputFile-cjs.js');
|
|
61
62
|
var InputGroup = require('./InputGroup-cjs.js');
|
|
@@ -79,7 +80,7 @@ var RadioGroup = require('./RadioGroup-cjs.js');
|
|
|
79
80
|
var RecurringSelect = require('./RecurringSelect-cjs.js');
|
|
80
81
|
var DayOfMonthSelect = require('./DayOfMonthSelect-cjs.js');
|
|
81
82
|
var ResponsiveSwitcher = require('./ResponsiveSwitcher-cjs.js');
|
|
82
|
-
var
|
|
83
|
+
var Select = require('./Select-cjs.js');
|
|
83
84
|
var SegmentedControl = require('./SegmentedControl-cjs.js');
|
|
84
85
|
var SideDrawer = require('./SideDrawer-cjs.js');
|
|
85
86
|
var SideKick = require('./SideKick-cjs.js');
|
|
@@ -251,20 +252,20 @@ exports.Emphasis = Emphasis.Emphasis;
|
|
|
251
252
|
exports.FeatureSwitch = FeatureSwitch.FeatureSwitch;
|
|
252
253
|
exports.Flex = Flex.Flex;
|
|
253
254
|
exports.Form = Form.Form;
|
|
254
|
-
exports.AffixIcon = FormField.AffixIcon;
|
|
255
|
-
exports.AffixLabel = FormField.AffixLabel;
|
|
256
255
|
exports.FormField = FormField.FormField;
|
|
257
|
-
exports.FormFieldInputHorizontalWrapper = FormField.FormFieldInputHorizontalWrapper;
|
|
258
|
-
exports.FormFieldInputWrapperStyles = FormField.FormFieldInputWrapperStyles;
|
|
259
|
-
exports.FormFieldLabel = FormField.FormFieldLabel;
|
|
260
|
-
exports.FormFieldWrapper = FormField.FormFieldWrapper;
|
|
261
|
-
exports.FormFieldWrapperMain = FormField.FormFieldWrapperMain;
|
|
262
|
-
exports.FormFieldWrapperToolbar = FormField.FormFieldWrapperToolbar;
|
|
263
256
|
exports.useAtlantisFormField = FormField.useAtlantisFormField;
|
|
264
257
|
exports.useAtlantisFormFieldActions = FormField.useAtlantisFormFieldActions;
|
|
265
|
-
exports.useAtlantisFormFieldName = FormField.useAtlantisFormFieldName;
|
|
266
258
|
exports.useAtlantisReactHookForm = FormField.useAtlantisReactHookForm;
|
|
267
|
-
exports.
|
|
259
|
+
exports.AffixIcon = mergeRefs.AffixIcon;
|
|
260
|
+
exports.AffixLabel = mergeRefs.AffixLabel;
|
|
261
|
+
exports.FormFieldInputHorizontalWrapper = mergeRefs.FormFieldInputHorizontalWrapper;
|
|
262
|
+
exports.FormFieldInputWrapperStyles = mergeRefs.FormFieldInputWrapperStyles;
|
|
263
|
+
exports.FormFieldLabel = mergeRefs.FormFieldLabel;
|
|
264
|
+
exports.FormFieldWrapper = mergeRefs.FormFieldWrapper;
|
|
265
|
+
exports.FormFieldWrapperMain = mergeRefs.FormFieldWrapperMain;
|
|
266
|
+
exports.FormFieldWrapperToolbar = mergeRefs.FormFieldWrapperToolbar;
|
|
267
|
+
exports.useAtlantisFormFieldName = mergeRefs.useAtlantisFormFieldName;
|
|
268
|
+
exports.useFormFieldWrapperStyles = mergeRefs.useFormFieldWrapperStyles;
|
|
268
269
|
exports.FormatDate = FormatDate.FormatDate;
|
|
269
270
|
exports.strFormatDate = FormatDate.strFormatDate;
|
|
270
271
|
exports.FormatEmail = FormatEmail.FormatEmail;
|
|
@@ -282,7 +283,7 @@ exports.Grid = Grid.Grid;
|
|
|
282
283
|
exports.Heading = Heading.Heading;
|
|
283
284
|
exports.InlineLabel = InlineLabel.InlineLabel;
|
|
284
285
|
exports.InputAvatar = InputAvatar.InputAvatar;
|
|
285
|
-
exports.InputDate =
|
|
286
|
+
exports.InputDate = InputDate.InputDate;
|
|
286
287
|
exports.InputEmail = InputEmail_index.InputEmail;
|
|
287
288
|
exports.InputFile = InputFile.InputFile;
|
|
288
289
|
exports.InputFileContentContext = InputFile.InputFileContentContext;
|
|
@@ -323,8 +324,8 @@ Object.defineProperty(exports, "WeekDay", {
|
|
|
323
324
|
get: function () { return DayOfMonthSelect.WeekDay; }
|
|
324
325
|
});
|
|
325
326
|
exports.ResponsiveSwitcher = ResponsiveSwitcher.ResponsiveSwitcher;
|
|
326
|
-
exports.Option =
|
|
327
|
-
exports.Select =
|
|
327
|
+
exports.Option = Select.SelectOption;
|
|
328
|
+
exports.Select = Select.Select;
|
|
328
329
|
exports.SegmentedControl = SegmentedControl.SegmentedControl;
|
|
329
330
|
exports.SegmentedControlContext = SegmentedControl.SegmentedControlContext;
|
|
330
331
|
exports.SegmentedControlProvider = SegmentedControl.SegmentedControlProvider;
|
package/dist/index.mjs
CHANGED
|
@@ -40,7 +40,8 @@ export { E as Emphasis } from './Emphasis-es.js';
|
|
|
40
40
|
export { F as FeatureSwitch } from './FeatureSwitch-es.js';
|
|
41
41
|
export { F as Flex } from './Flex-es.js';
|
|
42
42
|
export { F as Form } from './Form-es.js';
|
|
43
|
-
export {
|
|
43
|
+
export { F as FormField, u as useAtlantisFormField, a as useAtlantisFormFieldActions, b as useAtlantisReactHookForm } from './FormField-es.js';
|
|
44
|
+
export { A as AffixIcon, f as AffixLabel, F as FormFieldInputHorizontalWrapper, a as FormFieldInputWrapperStyles, b as FormFieldLabel, c as FormFieldWrapper, d as FormFieldWrapperMain, e as FormFieldWrapperToolbar, u as useAtlantisFormFieldName, g as useFormFieldWrapperStyles } from './mergeRefs-es.js';
|
|
44
45
|
export { F as FormatDate, s as strFormatDate } from './FormatDate-es.js';
|
|
45
46
|
export { F as FormatEmail } from './FormatEmail-es.js';
|
|
46
47
|
export { F as FormatFile, u as useFormatFile, a as useFormatFileStyles } from './FormatFile-es.js';
|
|
@@ -53,7 +54,7 @@ export { G as GRID_TEST_ID, a as Grid } from './Grid-es.js';
|
|
|
53
54
|
export { H as Heading } from './Heading-es.js';
|
|
54
55
|
export { I as InlineLabel } from './InlineLabel-es.js';
|
|
55
56
|
export { I as InputAvatar } from './InputAvatar-es.js';
|
|
56
|
-
export { InputDate } from './InputDate
|
|
57
|
+
export { I as InputDate } from './InputDate-es.js';
|
|
57
58
|
export { InputEmail } from './InputEmail/index.mjs';
|
|
58
59
|
export { I as InputFile, a as InputFileContentContext, u as updateFiles, b as useInputFileContentContext } from './InputFile-es.js';
|
|
59
60
|
export { I as InputGroup } from './InputGroup-es.js';
|
|
@@ -77,7 +78,7 @@ export { R as RadioGroup, a as RadioOption } from './RadioGroup-es.js';
|
|
|
77
78
|
export { R as RecurringSelect } from './RecurringSelect-es.js';
|
|
78
79
|
export { D as DurationPeriod, W as WeekDay } from './DayOfMonthSelect-es.js';
|
|
79
80
|
export { R as ResponsiveSwitcher } from './ResponsiveSwitcher-es.js';
|
|
80
|
-
export { Option, Select } from './Select
|
|
81
|
+
export { S as Option, a as Select } from './Select-es.js';
|
|
81
82
|
export { S as SegmentedControl, a as SegmentedControlContext, b as SegmentedControlProvider, u as useSegmentedControl } from './SegmentedControl-es.js';
|
|
82
83
|
export { S as SideDrawer } from './SideDrawer-es.js';
|
|
83
84
|
export { S as SideKick } from './SideKick-es.js';
|