@jobber/components 6.58.4 → 6.58.6
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 +26 -16
- package/dist/Autocomplete/index.mjs +26 -16
- package/dist/Autocomplete-cjs.js +19 -0
- package/dist/Autocomplete-es.js +19 -0
- package/dist/FormField-cjs.js +1 -2
- package/dist/FormField-es.js +1 -2
- package/dist/Modal/useModal.d.ts +1 -1
- package/dist/Tooltip/useTooltipPositioning.d.ts +1 -1
- package/dist/styles.css +1753 -1758
- package/package.json +2 -2
|
@@ -3,38 +3,48 @@
|
|
|
3
3
|
var Autocomplete = require('../Autocomplete-cjs.js');
|
|
4
4
|
require('../tslib.es6-cjs.js');
|
|
5
5
|
require('react');
|
|
6
|
-
require('
|
|
7
|
-
require('../useIsMounted-cjs.js');
|
|
8
|
-
require('../useSafeLayoutEffect-cjs.js');
|
|
6
|
+
require('../Modal/index.cjs');
|
|
9
7
|
require('react-dom');
|
|
10
|
-
require('
|
|
8
|
+
require('classnames');
|
|
9
|
+
require('framer-motion');
|
|
10
|
+
require('../useRefocusOnActivator-cjs.js');
|
|
11
|
+
require('../useOnKeyDown-cjs.js');
|
|
12
|
+
require('../useFocusTrap-cjs.js');
|
|
11
13
|
require('../Heading-cjs.js');
|
|
12
14
|
require('../Typography-cjs.js');
|
|
13
|
-
require('../
|
|
15
|
+
require('../Button-cjs.js');
|
|
16
|
+
require('react-router-dom');
|
|
14
17
|
require('../Icon-cjs.js');
|
|
15
18
|
require('@jobber/design');
|
|
16
|
-
require('../
|
|
19
|
+
require('../ButtonDismiss-cjs.js');
|
|
20
|
+
require('../noop-cjs.js');
|
|
21
|
+
require('../_commonjsHelpers-cjs.js');
|
|
22
|
+
require('../floating-ui.react-cjs.js');
|
|
23
|
+
require('../AtlantisPortalContent-cjs.js');
|
|
24
|
+
require('../AtlantisThemeContext-cjs.js');
|
|
25
|
+
require('../identity-cjs.js');
|
|
26
|
+
require('../isTypedArray-cjs.js');
|
|
27
|
+
require('../isObjectLike-cjs.js');
|
|
28
|
+
require('../_baseAssignValue-cjs.js');
|
|
29
|
+
require('../_baseFor-cjs.js');
|
|
30
|
+
require('../keysIn-cjs.js');
|
|
31
|
+
require('../_isIterateeCall-cjs.js');
|
|
32
|
+
require('../_setToString-cjs.js');
|
|
33
|
+
require('../useIsMounted-cjs.js');
|
|
34
|
+
require('../useSafeLayoutEffect-cjs.js');
|
|
35
|
+
require('react-popper');
|
|
36
|
+
require('../Text-cjs.js');
|
|
17
37
|
require('../InputText/index.cjs');
|
|
18
38
|
require('../FormField-cjs.js');
|
|
19
|
-
require('framer-motion');
|
|
20
|
-
require('../Button-cjs.js');
|
|
21
|
-
require('react-router-dom');
|
|
22
39
|
require('../useFormFieldFocus-cjs.js');
|
|
23
40
|
require('../InputValidation-cjs.js');
|
|
24
41
|
require('../Spinner-cjs.js');
|
|
25
42
|
require('react-hook-form');
|
|
26
43
|
require('../omit-cjs.js');
|
|
27
|
-
require('../_commonjsHelpers-cjs.js');
|
|
28
44
|
require('../_baseGet-cjs.js');
|
|
29
|
-
require('../isTypedArray-cjs.js');
|
|
30
|
-
require('../isObjectLike-cjs.js');
|
|
31
|
-
require('../identity-cjs.js');
|
|
32
45
|
require('../_getTag-cjs.js');
|
|
33
46
|
require('../isSymbol-cjs.js');
|
|
34
|
-
require('../keysIn-cjs.js');
|
|
35
|
-
require('../_baseAssignValue-cjs.js');
|
|
36
47
|
require('../_baseFlatten-cjs.js');
|
|
37
|
-
require('../_setToString-cjs.js');
|
|
38
48
|
require('../useDebounce-cjs.js');
|
|
39
49
|
require('../debounce-cjs.js');
|
|
40
50
|
|
|
@@ -1,37 +1,47 @@
|
|
|
1
1
|
export { A as Autocomplete, d as BaseAutocompleteMenuWrapper, a as BaseMenuGroupOption, B as BaseMenuOption, K as KeyboardAction, M as MenuOption, g as getRequestedIndexChange, f as isOptionGroup, i as isOptionSelected, e as useAutocompleteMenu, b as useCustomKeyboardNavigation, u as useKeyboardNavigation, c as useRepositionMenu } from '../Autocomplete-es.js';
|
|
2
2
|
import '../tslib.es6-es.js';
|
|
3
3
|
import 'react';
|
|
4
|
-
import '
|
|
5
|
-
import '../useIsMounted-es.js';
|
|
6
|
-
import '../useSafeLayoutEffect-es.js';
|
|
4
|
+
import '../Modal/index.mjs';
|
|
7
5
|
import 'react-dom';
|
|
8
|
-
import '
|
|
6
|
+
import 'classnames';
|
|
7
|
+
import 'framer-motion';
|
|
8
|
+
import '../useRefocusOnActivator-es.js';
|
|
9
|
+
import '../useOnKeyDown-es.js';
|
|
10
|
+
import '../useFocusTrap-es.js';
|
|
9
11
|
import '../Heading-es.js';
|
|
10
12
|
import '../Typography-es.js';
|
|
11
|
-
import '../
|
|
13
|
+
import '../Button-es.js';
|
|
14
|
+
import 'react-router-dom';
|
|
12
15
|
import '../Icon-es.js';
|
|
13
16
|
import '@jobber/design';
|
|
14
|
-
import '../
|
|
17
|
+
import '../ButtonDismiss-es.js';
|
|
18
|
+
import '../noop-es.js';
|
|
19
|
+
import '../_commonjsHelpers-es.js';
|
|
20
|
+
import '../floating-ui.react-es.js';
|
|
21
|
+
import '../AtlantisPortalContent-es.js';
|
|
22
|
+
import '../AtlantisThemeContext-es.js';
|
|
23
|
+
import '../identity-es.js';
|
|
24
|
+
import '../isTypedArray-es.js';
|
|
25
|
+
import '../isObjectLike-es.js';
|
|
26
|
+
import '../_baseAssignValue-es.js';
|
|
27
|
+
import '../_baseFor-es.js';
|
|
28
|
+
import '../keysIn-es.js';
|
|
29
|
+
import '../_isIterateeCall-es.js';
|
|
30
|
+
import '../_setToString-es.js';
|
|
31
|
+
import '../useIsMounted-es.js';
|
|
32
|
+
import '../useSafeLayoutEffect-es.js';
|
|
33
|
+
import 'react-popper';
|
|
34
|
+
import '../Text-es.js';
|
|
15
35
|
import '../InputText/index.mjs';
|
|
16
36
|
import '../FormField-es.js';
|
|
17
|
-
import 'framer-motion';
|
|
18
|
-
import '../Button-es.js';
|
|
19
|
-
import 'react-router-dom';
|
|
20
37
|
import '../useFormFieldFocus-es.js';
|
|
21
38
|
import '../InputValidation-es.js';
|
|
22
39
|
import '../Spinner-es.js';
|
|
23
40
|
import 'react-hook-form';
|
|
24
41
|
import '../omit-es.js';
|
|
25
|
-
import '../_commonjsHelpers-es.js';
|
|
26
42
|
import '../_baseGet-es.js';
|
|
27
|
-
import '../isTypedArray-es.js';
|
|
28
|
-
import '../isObjectLike-es.js';
|
|
29
|
-
import '../identity-es.js';
|
|
30
43
|
import '../_getTag-es.js';
|
|
31
44
|
import '../isSymbol-es.js';
|
|
32
|
-
import '../keysIn-es.js';
|
|
33
|
-
import '../_baseAssignValue-es.js';
|
|
34
45
|
import '../_baseFlatten-es.js';
|
|
35
|
-
import '../_setToString-es.js';
|
|
36
46
|
import '../useDebounce-es.js';
|
|
37
47
|
import '../debounce-es.js';
|
package/dist/Autocomplete-cjs.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var tslib_es6 = require('./tslib.es6-cjs.js');
|
|
4
4
|
var React = require('react');
|
|
5
|
+
var Modal_index = require('./Modal/index.cjs');
|
|
5
6
|
var classnames = require('classnames');
|
|
6
7
|
var useIsMounted = require('./useIsMounted-cjs.js');
|
|
7
8
|
var ReactDOM = require('react-dom');
|
|
@@ -210,6 +211,24 @@ function DefaultMenu({ options, selectedOption, onOptionSelect, attachTo, visibl
|
|
|
210
211
|
}
|
|
211
212
|
|
|
212
213
|
function Menu({ options, selectedOption, onOptionSelect, inputFocused, attachTo, inputRef, customRenderMenu, }) {
|
|
214
|
+
const { open: isWithinOpenModal } = Modal_index.useModalContext();
|
|
215
|
+
/**
|
|
216
|
+
* Experimental/temporary workaround for Autocompletes within Modals. This is only necessary
|
|
217
|
+
* when an Autocomplete uses `customRenderMenu` and is rendered within the composable version
|
|
218
|
+
* of Modal (aka Modal.Provider).
|
|
219
|
+
*
|
|
220
|
+
* If `customRenderMenu` contains clickable elements such as Buttons, the consumer must ALSO
|
|
221
|
+
* replace any `onClick` handlers with `onMouseDown` handlers on those Buttons.
|
|
222
|
+
*
|
|
223
|
+
* The check below prevents Autocomplete from rendering the `customRenderMenu` when it's not visible
|
|
224
|
+
* (when the input isn't focused). This prevents Modals (FloatingUI) from marking the Autocomplete's
|
|
225
|
+
* menu as data-floating-ui-inert and aria-hidden="true". As a result, this prevents the bug where clicking
|
|
226
|
+
* within its menu would cause FloatingUI to close the parent Modal because it determined the click was
|
|
227
|
+
* outside of the Modal.
|
|
228
|
+
*/
|
|
229
|
+
const specialModalWorkaround = isWithinOpenModal && customRenderMenu;
|
|
230
|
+
if (specialModalWorkaround && !inputFocused)
|
|
231
|
+
return null;
|
|
213
232
|
if (customRenderMenu) {
|
|
214
233
|
return (React.createElement(CustomMenu, { attachTo: attachTo, inputFocused: inputFocused, inputRef: inputRef, customRenderMenu: customRenderMenu, options: options, onOptionSelect: onOptionSelect, selectedOption: selectedOption }));
|
|
215
234
|
}
|
package/dist/Autocomplete-es.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { _ as __rest, a as __awaiter } from './tslib.es6-es.js';
|
|
2
2
|
import React__default, { useState, useCallback, useEffect, forwardRef, useMemo, useRef } from 'react';
|
|
3
|
+
import { useModalContext } from './Modal/index.mjs';
|
|
3
4
|
import classnames from 'classnames';
|
|
4
5
|
import { u as useIsMounted_2 } from './useIsMounted-es.js';
|
|
5
6
|
import { createPortal } from 'react-dom';
|
|
@@ -208,6 +209,24 @@ function DefaultMenu({ options, selectedOption, onOptionSelect, attachTo, visibl
|
|
|
208
209
|
}
|
|
209
210
|
|
|
210
211
|
function Menu({ options, selectedOption, onOptionSelect, inputFocused, attachTo, inputRef, customRenderMenu, }) {
|
|
212
|
+
const { open: isWithinOpenModal } = useModalContext();
|
|
213
|
+
/**
|
|
214
|
+
* Experimental/temporary workaround for Autocompletes within Modals. This is only necessary
|
|
215
|
+
* when an Autocomplete uses `customRenderMenu` and is rendered within the composable version
|
|
216
|
+
* of Modal (aka Modal.Provider).
|
|
217
|
+
*
|
|
218
|
+
* If `customRenderMenu` contains clickable elements such as Buttons, the consumer must ALSO
|
|
219
|
+
* replace any `onClick` handlers with `onMouseDown` handlers on those Buttons.
|
|
220
|
+
*
|
|
221
|
+
* The check below prevents Autocomplete from rendering the `customRenderMenu` when it's not visible
|
|
222
|
+
* (when the input isn't focused). This prevents Modals (FloatingUI) from marking the Autocomplete's
|
|
223
|
+
* menu as data-floating-ui-inert and aria-hidden="true". As a result, this prevents the bug where clicking
|
|
224
|
+
* within its menu would cause FloatingUI to close the parent Modal because it determined the click was
|
|
225
|
+
* outside of the Modal.
|
|
226
|
+
*/
|
|
227
|
+
const specialModalWorkaround = isWithinOpenModal && customRenderMenu;
|
|
228
|
+
if (specialModalWorkaround && !inputFocused)
|
|
229
|
+
return null;
|
|
211
230
|
if (customRenderMenu) {
|
|
212
231
|
return (React__default.createElement(CustomMenu, { attachTo: attachTo, inputFocused: inputFocused, inputRef: inputRef, customRenderMenu: customRenderMenu, options: options, onOptionSelect: onOptionSelect, selectedOption: selectedOption }));
|
|
213
232
|
}
|
package/dist/FormField-cjs.js
CHANGED
|
@@ -33,7 +33,7 @@ function useShowClear({ clearable, multiline, focused, hasValue, readonly, disab
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
var styles$1 = {"container":"YL-mNv-Bl6g-","wrapper":"_8lhbGTQ-hhg-","disabled":"Tz9LK9ABKMk-","horizontalWrapper":"b5mv1x1H7YE-","textarea":"hGr6YW4AeLM-","safari":"QBCWi9GBgMs-","timeInputLabel":"_0pmqVa2zSE4-","miniLabel":"F1t76G6bDKo-","large":"_9tjyT9QUtP8-","text":"QmMiyoAWp-g-","invalid":"XWDSfe6weSY-","small":"Sw5O4I0lMJg-","inline":"SaORbL7SYWY-","center":"ozy2UoT2vsg-","right":"_3TJdT91YD3c-","maxLength":"W6GrMqLy2qk-","inputWrapper":"-LmjnYRU0r0-","childrenWrapper":"yVXYv6hkuOA-","input":"vtSDcuzNr9Q-","emptyPhoneNumber":"MVhuQuzUBUs-","label":"Dgk00tzlODA-","select":"NwQGiWBWIsc-","externalLabel":"Qb8zQ8n-8vc-","postfix":"yTDzs9h1otI-","affixIcon":"m0YpdssD2dY-","suffix":"_-3mMnjSh6ok-","
|
|
36
|
+
var styles$1 = {"container":"YL-mNv-Bl6g-","wrapper":"_8lhbGTQ-hhg-","disabled":"Tz9LK9ABKMk-","horizontalWrapper":"b5mv1x1H7YE-","textarea":"hGr6YW4AeLM-","safari":"QBCWi9GBgMs-","timeInputLabel":"_0pmqVa2zSE4-","miniLabel":"F1t76G6bDKo-","large":"_9tjyT9QUtP8-","text":"QmMiyoAWp-g-","invalid":"XWDSfe6weSY-","small":"Sw5O4I0lMJg-","inline":"SaORbL7SYWY-","center":"ozy2UoT2vsg-","right":"_3TJdT91YD3c-","maxLength":"W6GrMqLy2qk-","inputWrapper":"-LmjnYRU0r0-","childrenWrapper":"yVXYv6hkuOA-","input":"vtSDcuzNr9Q-","emptyPhoneNumber":"MVhuQuzUBUs-","label":"Dgk00tzlODA-","select":"NwQGiWBWIsc-","externalLabel":"Qb8zQ8n-8vc-","postfix":"yTDzs9h1otI-","affixIcon":"m0YpdssD2dY-","suffix":"_-3mMnjSh6ok-","affixLabel":"-Wzcb0pBh5I-","description":"DHX5ijY3xIw-","toolbar":"AL-2brNI7dk-","spinning":"_8Rzv7CcDW80-"};
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* @internal Reach out to UX Foundations if using this component since it is possible it might change
|
|
@@ -49,7 +49,6 @@ function AffixLabel({ label, variation = "prefix", labelRef, }) {
|
|
|
49
49
|
function AffixIcon({ icon, onClick, ariaLabel, variation = "prefix", size, }) {
|
|
50
50
|
const affixIconClass = classnames(styles$1.affixIcon, {
|
|
51
51
|
[styles$1.suffix]: variation === "suffix",
|
|
52
|
-
[styles$1.hasAction]: onClick,
|
|
53
52
|
});
|
|
54
53
|
const iconSize = size === "small" ? "small" : "base";
|
|
55
54
|
if (!icon)
|
package/dist/FormField-es.js
CHANGED
|
@@ -31,7 +31,7 @@ function useShowClear({ clearable, multiline, focused, hasValue, readonly, disab
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
var styles$1 = {"container":"YL-mNv-Bl6g-","wrapper":"_8lhbGTQ-hhg-","disabled":"Tz9LK9ABKMk-","horizontalWrapper":"b5mv1x1H7YE-","textarea":"hGr6YW4AeLM-","safari":"QBCWi9GBgMs-","timeInputLabel":"_0pmqVa2zSE4-","miniLabel":"F1t76G6bDKo-","large":"_9tjyT9QUtP8-","text":"QmMiyoAWp-g-","invalid":"XWDSfe6weSY-","small":"Sw5O4I0lMJg-","inline":"SaORbL7SYWY-","center":"ozy2UoT2vsg-","right":"_3TJdT91YD3c-","maxLength":"W6GrMqLy2qk-","inputWrapper":"-LmjnYRU0r0-","childrenWrapper":"yVXYv6hkuOA-","input":"vtSDcuzNr9Q-","emptyPhoneNumber":"MVhuQuzUBUs-","label":"Dgk00tzlODA-","select":"NwQGiWBWIsc-","externalLabel":"Qb8zQ8n-8vc-","postfix":"yTDzs9h1otI-","affixIcon":"m0YpdssD2dY-","suffix":"_-3mMnjSh6ok-","
|
|
34
|
+
var styles$1 = {"container":"YL-mNv-Bl6g-","wrapper":"_8lhbGTQ-hhg-","disabled":"Tz9LK9ABKMk-","horizontalWrapper":"b5mv1x1H7YE-","textarea":"hGr6YW4AeLM-","safari":"QBCWi9GBgMs-","timeInputLabel":"_0pmqVa2zSE4-","miniLabel":"F1t76G6bDKo-","large":"_9tjyT9QUtP8-","text":"QmMiyoAWp-g-","invalid":"XWDSfe6weSY-","small":"Sw5O4I0lMJg-","inline":"SaORbL7SYWY-","center":"ozy2UoT2vsg-","right":"_3TJdT91YD3c-","maxLength":"W6GrMqLy2qk-","inputWrapper":"-LmjnYRU0r0-","childrenWrapper":"yVXYv6hkuOA-","input":"vtSDcuzNr9Q-","emptyPhoneNumber":"MVhuQuzUBUs-","label":"Dgk00tzlODA-","select":"NwQGiWBWIsc-","externalLabel":"Qb8zQ8n-8vc-","postfix":"yTDzs9h1otI-","affixIcon":"m0YpdssD2dY-","suffix":"_-3mMnjSh6ok-","affixLabel":"-Wzcb0pBh5I-","description":"DHX5ijY3xIw-","toolbar":"AL-2brNI7dk-","spinning":"_8Rzv7CcDW80-"};
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* @internal Reach out to UX Foundations if using this component since it is possible it might change
|
|
@@ -47,7 +47,6 @@ function AffixLabel({ label, variation = "prefix", labelRef, }) {
|
|
|
47
47
|
function AffixIcon({ icon, onClick, ariaLabel, variation = "prefix", size, }) {
|
|
48
48
|
const affixIconClass = classnames(styles$1.affixIcon, {
|
|
49
49
|
[styles$1.suffix]: variation === "suffix",
|
|
50
|
-
[styles$1.hasAction]: onClick,
|
|
51
50
|
});
|
|
52
51
|
const iconSize = size === "small" ? "small" : "base";
|
|
53
52
|
if (!icon)
|
package/dist/Modal/useModal.d.ts
CHANGED
|
@@ -15,9 +15,9 @@ export declare function useModal({ open, activatorRef: refProp, onRequestClose,
|
|
|
15
15
|
y: number;
|
|
16
16
|
placement: import("@floating-ui/utils").Placement;
|
|
17
17
|
strategy: import("@floating-ui/utils").Strategy;
|
|
18
|
-
update: () => void;
|
|
19
18
|
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
20
19
|
isPositioned: boolean;
|
|
20
|
+
update: () => void;
|
|
21
21
|
floatingStyles: React.CSSProperties;
|
|
22
22
|
open: boolean;
|
|
23
23
|
onOpenChange: (open: boolean, event?: Event, reason?: import("@floating-ui/react").OpenChangeReason) => void;
|
|
@@ -3,7 +3,7 @@ interface ToolTipPositionOptions {
|
|
|
3
3
|
readonly preferredPlacement?: Placement;
|
|
4
4
|
}
|
|
5
5
|
export declare function useTooltipPositioning({ preferredPlacement, }: ToolTipPositionOptions): {
|
|
6
|
-
placement: "bottom" | "left" | "right" | "top" | "auto" | "
|
|
6
|
+
placement: "bottom" | "left" | "right" | "top" | "auto" | "bottom-end" | "bottom-start" | "left-end" | "left-start" | "right-end" | "right-start" | "top-end" | "top-start" | "auto-start" | "auto-end";
|
|
7
7
|
shadowRef: import("react").RefObject<HTMLSpanElement>;
|
|
8
8
|
setArrowRef: import("react").Dispatch<import("react").SetStateAction<HTMLDivElement | null | undefined>>;
|
|
9
9
|
setTooltipRef: import("react").Dispatch<import("react").SetStateAction<HTMLDivElement | null | undefined>>;
|