@jobber/components 6.71.1 → 6.71.2
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-es.js
CHANGED
|
@@ -2,7 +2,7 @@ import { _ as __rest, a as __awaiter } from './tslib.es6-es.js';
|
|
|
2
2
|
import React__default, { useCallback, useEffect, useState, forwardRef, useMemo, useRef } from 'react';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { u as useIsMounted_2 } from './useIsMounted-es.js';
|
|
5
|
-
import { b as useFloating, o as offset, i as flip,
|
|
5
|
+
import { b as useFloating, o as offset, i as flip, q as size, d as autoUpdate, h as FloatingPortal } from './floating-ui.react-es.js';
|
|
6
6
|
import { u as useSafeLayoutEffect_1 } from './useSafeLayoutEffect-es.js';
|
|
7
7
|
import { H as Heading } from './Heading-es.js';
|
|
8
8
|
import { T as Text } from './Text-es.js';
|
package/dist/Modal/index.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import { H as Heading } from '../Heading-es.js';
|
|
|
9
9
|
import { B as Button } from '../Button-es.js';
|
|
10
10
|
import { B as ButtonDismiss } from '../ButtonDismiss-es.js';
|
|
11
11
|
import { n as noop } from '../noop-es.js';
|
|
12
|
-
import { a as useFloatingNodeId, b as useFloating, k as useClick, e as useDismiss,
|
|
12
|
+
import { a as useFloatingNodeId, b as useFloating, k as useClick, e as useDismiss, m as useRole, f as useInteractions, u as useFloatingParentNodeId, F as FloatingTree, g as FloatingNode, h as FloatingPortal, n as FloatingOverlay, p as FloatingFocusManager } from '../floating-ui.react-es.js';
|
|
13
13
|
import { b as identity } from '../identity-es.js';
|
|
14
14
|
import { A as AtlantisPortalContent } from '../AtlantisPortalContent-es.js';
|
|
15
15
|
import '../Typography-es.js';
|
package/dist/Popover-cjs.js
CHANGED
package/dist/Popover-es.js
CHANGED
|
@@ -2,7 +2,7 @@ import { _ as __rest } from './tslib.es6-es.js';
|
|
|
2
2
|
import React__default, { useState, useMemo, createContext, useContext } from 'react';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import ReactDOM__default from 'react-dom';
|
|
5
|
-
import { o as offset, s as shift, c as autoPlacement, i as flip, j as arrow, b as useFloating, d as autoUpdate } from './floating-ui.react-es.js';
|
|
5
|
+
import { o as offset, s as shift, l as limitShift, c as autoPlacement, i as flip, j as arrow, b as useFloating, d as autoUpdate } from './floating-ui.react-es.js';
|
|
6
6
|
import { u as useRefocusOnActivator_2 } from './useRefocusOnActivator-es.js';
|
|
7
7
|
import { A as AtlantisPortalContent } from './AtlantisPortalContent-es.js';
|
|
8
8
|
import { B as ButtonDismiss } from './ButtonDismiss-es.js';
|
|
@@ -19,6 +19,7 @@ const usePopover = ({ preferredPlacement, attachTo, open, }) => {
|
|
|
19
19
|
mainAxis: true,
|
|
20
20
|
crossAxis: false,
|
|
21
21
|
padding: POPOVER_SHIFT_PADDING,
|
|
22
|
+
limiter: limitShift(),
|
|
22
23
|
}),
|
|
23
24
|
];
|
|
24
25
|
const placementMiddleware = preferredPlacement === "auto"
|
|
@@ -2919,6 +2919,74 @@ const shift$1 = function (options) {
|
|
|
2919
2919
|
}
|
|
2920
2920
|
};
|
|
2921
2921
|
};
|
|
2922
|
+
/**
|
|
2923
|
+
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
2924
|
+
*/
|
|
2925
|
+
const limitShift$1 = function (options) {
|
|
2926
|
+
if (options === void 0) {
|
|
2927
|
+
options = {};
|
|
2928
|
+
}
|
|
2929
|
+
return {
|
|
2930
|
+
options,
|
|
2931
|
+
fn(state) {
|
|
2932
|
+
const {
|
|
2933
|
+
x,
|
|
2934
|
+
y,
|
|
2935
|
+
placement,
|
|
2936
|
+
rects,
|
|
2937
|
+
middlewareData
|
|
2938
|
+
} = state;
|
|
2939
|
+
const {
|
|
2940
|
+
offset = 0,
|
|
2941
|
+
mainAxis: checkMainAxis = true,
|
|
2942
|
+
crossAxis: checkCrossAxis = true
|
|
2943
|
+
} = evaluate(options, state);
|
|
2944
|
+
const coords = {
|
|
2945
|
+
x,
|
|
2946
|
+
y
|
|
2947
|
+
};
|
|
2948
|
+
const crossAxis = getSideAxis(placement);
|
|
2949
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
2950
|
+
let mainAxisCoord = coords[mainAxis];
|
|
2951
|
+
let crossAxisCoord = coords[crossAxis];
|
|
2952
|
+
const rawOffset = evaluate(offset, state);
|
|
2953
|
+
const computedOffset = typeof rawOffset === 'number' ? {
|
|
2954
|
+
mainAxis: rawOffset,
|
|
2955
|
+
crossAxis: 0
|
|
2956
|
+
} : {
|
|
2957
|
+
mainAxis: 0,
|
|
2958
|
+
crossAxis: 0,
|
|
2959
|
+
...rawOffset
|
|
2960
|
+
};
|
|
2961
|
+
if (checkMainAxis) {
|
|
2962
|
+
const len = mainAxis === 'y' ? 'height' : 'width';
|
|
2963
|
+
const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
|
|
2964
|
+
const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
|
|
2965
|
+
if (mainAxisCoord < limitMin) {
|
|
2966
|
+
mainAxisCoord = limitMin;
|
|
2967
|
+
} else if (mainAxisCoord > limitMax) {
|
|
2968
|
+
mainAxisCoord = limitMax;
|
|
2969
|
+
}
|
|
2970
|
+
}
|
|
2971
|
+
if (checkCrossAxis) {
|
|
2972
|
+
var _middlewareData$offse, _middlewareData$offse2;
|
|
2973
|
+
const len = mainAxis === 'y' ? 'width' : 'height';
|
|
2974
|
+
const isOriginSide = ['top', 'left'].includes(getSide(placement));
|
|
2975
|
+
const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
|
|
2976
|
+
const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
|
|
2977
|
+
if (crossAxisCoord < limitMin) {
|
|
2978
|
+
crossAxisCoord = limitMin;
|
|
2979
|
+
} else if (crossAxisCoord > limitMax) {
|
|
2980
|
+
crossAxisCoord = limitMax;
|
|
2981
|
+
}
|
|
2982
|
+
}
|
|
2983
|
+
return {
|
|
2984
|
+
[mainAxis]: mainAxisCoord,
|
|
2985
|
+
[crossAxis]: crossAxisCoord
|
|
2986
|
+
};
|
|
2987
|
+
}
|
|
2988
|
+
};
|
|
2989
|
+
};
|
|
2922
2990
|
|
|
2923
2991
|
/**
|
|
2924
2992
|
* Provides data that allows you to change the size of the floating element —
|
|
@@ -4011,6 +4079,14 @@ const shift = (options, deps) => ({
|
|
|
4011
4079
|
options: [options, deps]
|
|
4012
4080
|
});
|
|
4013
4081
|
|
|
4082
|
+
/**
|
|
4083
|
+
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
4084
|
+
*/
|
|
4085
|
+
const limitShift = (options, deps) => ({
|
|
4086
|
+
...limitShift$1(options),
|
|
4087
|
+
options: [options, deps]
|
|
4088
|
+
});
|
|
4089
|
+
|
|
4014
4090
|
/**
|
|
4015
4091
|
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
4016
4092
|
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
@@ -5983,6 +6059,7 @@ exports.arrow = arrow;
|
|
|
5983
6059
|
exports.autoPlacement = autoPlacement;
|
|
5984
6060
|
exports.autoUpdate = autoUpdate;
|
|
5985
6061
|
exports.flip = flip;
|
|
6062
|
+
exports.limitShift = limitShift;
|
|
5986
6063
|
exports.offset = offset;
|
|
5987
6064
|
exports.shift = shift;
|
|
5988
6065
|
exports.size = size;
|
|
@@ -2898,6 +2898,74 @@ const shift$1 = function (options) {
|
|
|
2898
2898
|
}
|
|
2899
2899
|
};
|
|
2900
2900
|
};
|
|
2901
|
+
/**
|
|
2902
|
+
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
2903
|
+
*/
|
|
2904
|
+
const limitShift$1 = function (options) {
|
|
2905
|
+
if (options === void 0) {
|
|
2906
|
+
options = {};
|
|
2907
|
+
}
|
|
2908
|
+
return {
|
|
2909
|
+
options,
|
|
2910
|
+
fn(state) {
|
|
2911
|
+
const {
|
|
2912
|
+
x,
|
|
2913
|
+
y,
|
|
2914
|
+
placement,
|
|
2915
|
+
rects,
|
|
2916
|
+
middlewareData
|
|
2917
|
+
} = state;
|
|
2918
|
+
const {
|
|
2919
|
+
offset = 0,
|
|
2920
|
+
mainAxis: checkMainAxis = true,
|
|
2921
|
+
crossAxis: checkCrossAxis = true
|
|
2922
|
+
} = evaluate(options, state);
|
|
2923
|
+
const coords = {
|
|
2924
|
+
x,
|
|
2925
|
+
y
|
|
2926
|
+
};
|
|
2927
|
+
const crossAxis = getSideAxis(placement);
|
|
2928
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
2929
|
+
let mainAxisCoord = coords[mainAxis];
|
|
2930
|
+
let crossAxisCoord = coords[crossAxis];
|
|
2931
|
+
const rawOffset = evaluate(offset, state);
|
|
2932
|
+
const computedOffset = typeof rawOffset === 'number' ? {
|
|
2933
|
+
mainAxis: rawOffset,
|
|
2934
|
+
crossAxis: 0
|
|
2935
|
+
} : {
|
|
2936
|
+
mainAxis: 0,
|
|
2937
|
+
crossAxis: 0,
|
|
2938
|
+
...rawOffset
|
|
2939
|
+
};
|
|
2940
|
+
if (checkMainAxis) {
|
|
2941
|
+
const len = mainAxis === 'y' ? 'height' : 'width';
|
|
2942
|
+
const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
|
|
2943
|
+
const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
|
|
2944
|
+
if (mainAxisCoord < limitMin) {
|
|
2945
|
+
mainAxisCoord = limitMin;
|
|
2946
|
+
} else if (mainAxisCoord > limitMax) {
|
|
2947
|
+
mainAxisCoord = limitMax;
|
|
2948
|
+
}
|
|
2949
|
+
}
|
|
2950
|
+
if (checkCrossAxis) {
|
|
2951
|
+
var _middlewareData$offse, _middlewareData$offse2;
|
|
2952
|
+
const len = mainAxis === 'y' ? 'width' : 'height';
|
|
2953
|
+
const isOriginSide = ['top', 'left'].includes(getSide(placement));
|
|
2954
|
+
const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
|
|
2955
|
+
const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
|
|
2956
|
+
if (crossAxisCoord < limitMin) {
|
|
2957
|
+
crossAxisCoord = limitMin;
|
|
2958
|
+
} else if (crossAxisCoord > limitMax) {
|
|
2959
|
+
crossAxisCoord = limitMax;
|
|
2960
|
+
}
|
|
2961
|
+
}
|
|
2962
|
+
return {
|
|
2963
|
+
[mainAxis]: mainAxisCoord,
|
|
2964
|
+
[crossAxis]: crossAxisCoord
|
|
2965
|
+
};
|
|
2966
|
+
}
|
|
2967
|
+
};
|
|
2968
|
+
};
|
|
2901
2969
|
|
|
2902
2970
|
/**
|
|
2903
2971
|
* Provides data that allows you to change the size of the floating element —
|
|
@@ -3990,6 +4058,14 @@ const shift = (options, deps) => ({
|
|
|
3990
4058
|
options: [options, deps]
|
|
3991
4059
|
});
|
|
3992
4060
|
|
|
4061
|
+
/**
|
|
4062
|
+
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
4063
|
+
*/
|
|
4064
|
+
const limitShift = (options, deps) => ({
|
|
4065
|
+
...limitShift$1(options),
|
|
4066
|
+
options: [options, deps]
|
|
4067
|
+
});
|
|
4068
|
+
|
|
3993
4069
|
/**
|
|
3994
4070
|
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
3995
4071
|
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
@@ -5953,4 +6029,4 @@ function useRole(context, props) {
|
|
|
5953
6029
|
} : {}, [enabled, reference, floating, item]);
|
|
5954
6030
|
}
|
|
5955
6031
|
|
|
5956
|
-
export { FloatingTree as F, useFloatingNodeId as a, useFloating as b, autoPlacement as c, autoUpdate as d, useDismiss as e, useInteractions as f, FloatingNode as g, FloatingPortal as h, flip as i, arrow as j, useClick as k,
|
|
6032
|
+
export { FloatingTree as F, useFloatingNodeId as a, useFloating as b, autoPlacement as c, autoUpdate as d, useDismiss as e, useInteractions as f, FloatingNode as g, FloatingPortal as h, flip as i, arrow as j, useClick as k, limitShift as l, useRole as m, FloatingOverlay as n, offset as o, FloatingFocusManager as p, size as q, shift as s, useFloatingParentNodeId as u };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "6.71.
|
|
3
|
+
"version": "6.71.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -542,5 +542,5 @@
|
|
|
542
542
|
"> 1%",
|
|
543
543
|
"IE 10"
|
|
544
544
|
],
|
|
545
|
-
"gitHead": "
|
|
545
|
+
"gitHead": "6aa8ab69238ec2575e71437953092a63ddf99d59"
|
|
546
546
|
}
|