@jobber/components 6.85.2 → 6.85.3-CLEANUPre-6d043f4.28
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/AtlantisThemeContext/AtlantisThemeContext.d.ts +1 -1
- package/dist/AtlantisThemeContext/index.d.ts +1 -1
- package/dist/AtlantisThemeContext/types.d.ts +17 -0
- package/dist/AtlantisThemeContext-cjs.js +38 -12
- package/dist/AtlantisThemeContext-es.js +40 -14
- package/dist/Autocomplete/Autocomplete.d.ts +3 -3
- package/dist/Autocomplete/Autocomplete.rebuilt.d.ts +8 -0
- package/dist/Autocomplete/Autocomplete.types.d.ts +388 -4
- package/dist/Autocomplete/components/MenuList.d.ts +37 -0
- package/dist/Autocomplete/components/PersistentRegion.d.ts +18 -0
- package/dist/Autocomplete/hooks/useAutocompleteListNav.d.ts +22 -0
- package/dist/Autocomplete/index.cjs +1335 -37
- package/dist/Autocomplete/index.d.ts +32 -2
- package/dist/Autocomplete/index.mjs +1326 -21
- package/dist/Autocomplete/tests/Autocomplete.setup.d.ts +38 -0
- package/dist/Autocomplete/useAutocomplete.d.ts +66 -0
- package/dist/Autocomplete/utils/menuModel.d.ts +14 -0
- package/dist/Banner/index.cjs +1 -6
- package/dist/Banner/index.mjs +1 -6
- package/dist/Banner-cjs.js +2 -2
- package/dist/Banner-es.js +2 -2
- package/dist/Button-cjs.js +2 -2
- package/dist/Button-es.js +2 -2
- package/dist/Card/CardClickable.d.ts +3 -1
- package/dist/Card/CardHeader.d.ts +1 -1
- package/dist/Card/index.cjs +2 -4
- package/dist/Card/index.mjs +2 -4
- package/dist/Card/types.d.ts +19 -1
- package/dist/Card-cjs.js +14 -13
- package/dist/Card-es.js +14 -13
- package/dist/Chip/index.cjs +2 -3
- package/dist/Chip/index.mjs +2 -3
- package/dist/Chip-cjs.js +3 -3
- package/dist/Chip-es.js +3 -3
- package/dist/Chips/InternalChipDismissible/hooks/index.cjs +2 -0
- package/dist/Chips/InternalChipDismissible/hooks/index.mjs +2 -0
- package/dist/Chips/InternalChipDismissible/index.cjs +2 -3
- package/dist/Chips/InternalChipDismissible/index.mjs +2 -3
- package/dist/Chips/index.cjs +2 -3
- package/dist/Chips/index.mjs +2 -3
- package/dist/Combobox/Combobox.types.d.ts +3 -1
- package/dist/Combobox/components/ComboboxActivator/index.cjs +2 -3
- package/dist/Combobox/components/ComboboxActivator/index.mjs +2 -3
- package/dist/Combobox/components/ComboboxContent/ComboboxContentList/index.cjs +1 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxContentList/index.mjs +1 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxLoadMore/index.cjs +1 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxLoadMore/index.mjs +1 -1
- package/dist/Combobox/components/ComboboxContent/index.cjs +2 -3
- package/dist/Combobox/components/ComboboxContent/index.mjs +2 -3
- package/dist/Combobox/components/ComboboxTrigger/index.cjs +2 -3
- package/dist/Combobox/components/ComboboxTrigger/index.mjs +2 -3
- package/dist/Combobox/index.cjs +2 -6
- package/dist/Combobox/index.mjs +2 -6
- package/dist/Combobox-cjs.js +2 -2
- package/dist/Combobox-es.js +2 -2
- package/dist/ComboboxAction-cjs.js +5 -3
- package/dist/ComboboxAction-es.js +5 -3
- package/dist/ComboboxContent-cjs.js +3 -4
- package/dist/ComboboxContent-es.js +4 -5
- package/dist/ComboboxLoadMore-cjs.js +2 -2
- package/dist/ComboboxLoadMore-es.js +2 -2
- package/dist/ComboboxOption-cjs.js +1 -1
- package/dist/ComboboxOption-es.js +1 -1
- package/dist/ConfirmationModal/index.cjs +2 -4
- package/dist/ConfirmationModal/index.mjs +2 -4
- package/dist/ConfirmationModal-cjs.js +2 -2
- package/dist/ConfirmationModal-es.js +2 -2
- package/dist/ContentBlock/index.cjs +1 -6
- package/dist/ContentBlock/index.mjs +1 -6
- package/dist/ContentBlock-cjs.js +2 -2
- package/dist/ContentBlock-es.js +2 -2
- package/dist/Countdown-cjs.js +0 -1
- package/dist/Countdown-es.js +0 -1
- package/dist/DataDump/index.cjs +2 -4
- package/dist/DataDump/index.mjs +2 -4
- package/dist/DataList/components/DataListActions/index.cjs +2 -5
- package/dist/DataList/components/DataListActions/index.mjs +2 -5
- package/dist/DataList/components/DataListActionsMenu/index.cjs +1 -5
- package/dist/DataList/components/DataListActionsMenu/index.mjs +1 -5
- package/dist/DataList/components/DataListBulkActions/index.cjs +2 -5
- package/dist/DataList/components/DataListBulkActions/index.mjs +2 -5
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.cjs +2 -6
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.mjs +2 -6
- package/dist/DataList/components/DataListFilters/index.cjs +2 -7
- package/dist/DataList/components/DataListFilters/index.mjs +2 -7
- package/dist/DataList/components/DataListHeader/DataListHeaderCheckbox.d.ts +1 -2
- package/dist/DataList/components/DataListHeader/index.cjs +2 -5
- package/dist/DataList/components/DataListHeader/index.mjs +2 -5
- package/dist/DataList/components/DataListHeaderTile/components/index.cjs +1 -2
- package/dist/DataList/components/DataListHeaderTile/components/index.mjs +1 -2
- package/dist/DataList/components/DataListHeaderTile/index.cjs +1 -3
- package/dist/DataList/components/DataListHeaderTile/index.mjs +1 -3
- package/dist/DataList/components/DataListItem/index.cjs +2 -5
- package/dist/DataList/components/DataListItem/index.mjs +2 -5
- package/dist/DataList/components/DataListItemActions/index.cjs +2 -5
- package/dist/DataList/components/DataListItemActions/index.mjs +2 -5
- package/dist/DataList/components/DataListItemActionsOverflow/index.cjs +2 -5
- package/dist/DataList/components/DataListItemActionsOverflow/index.mjs +2 -5
- package/dist/DataList/components/DataListItems/index.cjs +2 -5
- package/dist/DataList/components/DataListItems/index.mjs +2 -5
- package/dist/DataList/components/DataListLayout/index.cjs +2 -5
- package/dist/DataList/components/DataListLayout/index.mjs +2 -5
- package/dist/DataList/components/DataListLayoutActions/index.cjs +2 -5
- package/dist/DataList/components/DataListLayoutActions/index.mjs +2 -5
- package/dist/DataList/components/DataListLoadMore/index.cjs +1 -1
- package/dist/DataList/components/DataListLoadMore/index.mjs +1 -1
- package/dist/DataList/components/DataListOverflowFade/index.cjs +1 -1
- package/dist/DataList/components/DataListOverflowFade/index.mjs +1 -1
- package/dist/DataList/components/DataListSearch/index.cjs +1 -2
- package/dist/DataList/components/DataListSearch/index.mjs +1 -2
- package/dist/DataList/components/DataListStatusBar/index.cjs +1 -3
- package/dist/DataList/components/DataListStatusBar/index.mjs +1 -3
- package/dist/DataList/index.cjs +2 -7
- package/dist/DataList/index.mjs +2 -7
- package/dist/DataListActionsMenu-cjs.js +5 -8
- package/dist/DataListActionsMenu-es.js +5 -8
- package/dist/DataListHeaderTile-cjs.js +2 -2
- package/dist/DataListHeaderTile-es.js +2 -2
- package/dist/DataListItem-cjs.js +2 -0
- package/dist/DataListItem-es.js +2 -0
- package/dist/DataListLoadMore-cjs.js +2 -2
- package/dist/DataListLoadMore-es.js +2 -2
- package/dist/DataListOverflowFade-cjs.js +3 -3
- package/dist/DataListOverflowFade-es.js +3 -3
- package/dist/DataListSearch-cjs.js +2 -2
- package/dist/DataListSearch-es.js +2 -2
- package/dist/DataListSortingOptions-cjs.js +3 -4
- package/dist/DataListSortingOptions-es.js +3 -4
- package/dist/DataTable/index.cjs +4 -6
- package/dist/DataTable/index.mjs +4 -6
- package/dist/DataTable/test-utilities/index.cjs +1 -7
- package/dist/DataTable/test-utilities/index.mjs +1 -7
- package/dist/DataTable-cjs.js +4 -4
- package/dist/DataTable-es.js +4 -4
- package/dist/DataTableTable-cjs.js +8 -8
- package/dist/DataTableTable-es.js +8 -8
- package/dist/DatePicker/DatePickerActivator.d.ts +2 -4
- package/dist/DatePicker/index.cjs +5 -3
- package/dist/DatePicker/index.mjs +5 -3
- package/dist/DatePicker-cjs.js +11478 -8531
- package/dist/DatePicker-es.js +11483 -8517
- package/dist/Disclosure/index.cjs +1 -6
- package/dist/Disclosure/index.mjs +1 -6
- package/dist/Disclosure-cjs.js +3 -3
- package/dist/Disclosure-es.js +3 -3
- package/dist/FeatureSwitch/index.cjs +1 -1
- package/dist/FeatureSwitch/index.mjs +1 -1
- package/dist/FormField/FormFieldWrapper.d.ts +1 -1
- package/dist/FormField/hooks/useAtlantisReactHookForm.d.ts +1 -0
- package/dist/FormField/index.cjs +1 -0
- package/dist/FormField/index.mjs +1 -0
- package/dist/FormField-cjs.js +2 -21
- package/dist/FormField-es.js +2 -21
- package/dist/FormatFile/index.cjs +2 -4
- package/dist/FormatFile/index.mjs +2 -4
- package/dist/Gallery/index.cjs +2 -7
- package/dist/Gallery/index.mjs +2 -7
- package/dist/Heading/Heading.d.ts +7 -1
- package/dist/Heading-cjs.js +2 -2
- package/dist/Heading-es.js +2 -2
- package/dist/InlineLabel/InlineLabel.d.ts +1 -1
- package/dist/InlineLabel-cjs.js +2 -1
- package/dist/InlineLabel-es.js +2 -1
- package/dist/InputDate/InputDate.types.d.ts +0 -12
- package/dist/InputDate/index.cjs +9 -30
- package/dist/InputDate/index.mjs +9 -30
- package/dist/InputEmail/index.cjs +1 -0
- package/dist/InputEmail/index.mjs +1 -0
- package/dist/InputFile/InputFile.d.ts +5 -1
- package/dist/InputFile-cjs.js +2 -2
- package/dist/InputFile-es.js +2 -2
- package/dist/InputNumber/index.cjs +3698 -2959
- package/dist/InputNumber/index.mjs +3698 -2959
- package/dist/InputPassword/index.cjs +1 -0
- package/dist/InputPassword/index.mjs +1 -0
- package/dist/InputPassword-cjs.js +1 -0
- package/dist/InputPassword-es.js +1 -0
- package/dist/InputPhoneNumber/InputPhoneNumber.types.d.ts +1 -1
- package/dist/InputPhoneNumber/index.cjs +1 -0
- package/dist/InputPhoneNumber/index.mjs +1 -0
- package/dist/InputText/InputText.d.ts +2 -2
- package/dist/InputText/index.cjs +3 -3
- package/dist/InputText/index.mjs +3 -3
- package/dist/InputText/useInputTextFormField.d.ts +6 -6
- package/dist/InputTime/index.cjs +1 -0
- package/dist/InputTime/index.mjs +2 -1
- package/dist/InternalChipDismissible-cjs.js +1 -0
- package/dist/InternalChipDismissible-es.js +1 -0
- package/dist/LightBox/index.cjs +1 -6
- package/dist/LightBox/index.mjs +1 -6
- package/dist/LightBox-cjs.js +12 -74
- package/dist/LightBox-es.js +12 -74
- package/dist/List/index.cjs +1 -1
- package/dist/List/index.mjs +1 -1
- package/dist/Markdown/index.cjs +1 -1
- package/dist/Markdown/index.mjs +1 -1
- package/dist/Markdown-cjs.js +20540 -18350
- package/dist/Markdown-es.js +20541 -18351
- package/dist/Menu/index.cjs +2 -4
- package/dist/Menu/index.mjs +2 -4
- package/dist/Menu-cjs.js +5 -37
- package/dist/Menu-es.js +6 -38
- package/dist/Modal/Modal.rebuilt.d.ts +1 -1
- package/dist/Modal/index.cjs +25 -22
- package/dist/Modal/index.mjs +26 -23
- package/dist/Page/index.cjs +3 -11
- package/dist/Page/index.mjs +3 -11
- package/dist/Page-cjs.js +5 -5
- package/dist/Page-es.js +5 -5
- package/dist/Popover/index.cjs +2 -1
- package/dist/Popover/index.mjs +2 -1
- package/dist/Popover/usePopover.d.ts +1 -1
- package/dist/Popover-cjs.js +2 -2
- package/dist/Popover-es.js +3 -3
- package/dist/RecurringSelect/index.cjs +2 -0
- package/dist/RecurringSelect/index.mjs +2 -0
- package/dist/Select/index.cjs +1 -0
- package/dist/Select/index.mjs +1 -0
- package/dist/SideDrawer/index.cjs +1 -5
- package/dist/SideDrawer/index.mjs +1 -5
- package/dist/SideDrawer-cjs.js +7 -10
- package/dist/SideDrawer-es.js +7 -10
- package/dist/Tabs/index.cjs +0 -1
- package/dist/Tabs/index.mjs +0 -1
- package/dist/Tabs-cjs.js +76 -2
- package/dist/Tabs-es.js +76 -2
- package/dist/Tooltip/index.cjs +2 -2
- package/dist/Tooltip/index.mjs +2 -2
- package/dist/Tooltip/useTooltipPositioning.d.ts +1 -1
- package/dist/Tooltip-cjs.js +3 -4
- package/dist/Tooltip-es.js +4 -5
- package/dist/_baseEach-es.js +1 -1
- package/dist/_commonjsHelpers-cjs.js +0 -26
- package/dist/_commonjsHelpers-es.js +1 -26
- package/dist/_isIterateeCall-es.js +1 -1
- package/dist/clsx-cjs.js +5 -0
- package/dist/clsx-es.js +3 -0
- package/dist/debounce-es.js +2 -2
- package/dist/floating-ui.react-cjs.js +2106 -2225
- package/dist/floating-ui.react-es.js +2105 -2226
- package/dist/helpers-cjs.js +21 -2
- package/dist/helpers-es.js +1 -1
- package/dist/index.cjs +15 -21
- package/dist/index.mjs +11 -17
- package/dist/isObjectLike-es.js +1 -1
- package/dist/isSymbol-es.js +1 -1
- package/dist/isTypedArray-es.js +1 -1
- package/dist/keysIn-es.js +1 -1
- package/dist/omit-es.js +1 -1
- package/dist/styles.css +719 -509
- package/dist/tslib.es6-cjs.js +3 -3
- package/dist/tslib.es6-es.js +3 -3
- package/dist/useScrollToActive-cjs.js +3 -45
- package/dist/useScrollToActive-es.js +5 -47
- package/dist/utils/mockLargeViewport.d.ts +33 -0
- package/package.json +13 -19
- package/rollup.config.mjs +1 -15
- package/dist/Autocomplete-cjs.js +0 -357
- package/dist/Autocomplete-es.js +0 -344
- package/dist/throttle-cjs.js +0 -80
- package/dist/throttle-es.js +0 -77
- package/dist/useDebounce-cjs.js +0 -4415
- package/dist/useDebounce-es.js +0 -4413
- package/dist/useFocusTrap-cjs.js +0 -75
- package/dist/useFocusTrap-es.js +0 -73
- package/dist/useInView-cjs.js +0 -26
- package/dist/useInView-es.js +0 -24
- package/dist/useIsMounted-cjs.js +0 -51
- package/dist/useIsMounted-es.js +0 -49
- package/dist/useOnKeyDown-cjs.js +0 -41
- package/dist/useOnKeyDown-es.js +0 -39
- package/dist/useRefocusOnActivator-cjs.js +0 -33
- package/dist/useRefocusOnActivator-es.js +0 -31
- package/dist/useResizeObserver-cjs.js +0 -1131
- package/dist/useResizeObserver-es.js +0 -1128
- package/dist/useSafeLayoutEffect-cjs.js +0 -14
- package/dist/useSafeLayoutEffect-es.js +0 -12
package/dist/tslib.es6-cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
14
14
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
15
|
PERFORMANCE OF THIS SOFTWARE.
|
|
16
16
|
***************************************************************************** */
|
|
17
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
17
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
function __rest(s, e) {
|
|
@@ -40,8 +40,8 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
function __generator(thisArg, body) {
|
|
43
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
44
|
-
return g =
|
|
43
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
44
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
45
45
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
46
46
|
function step(op) {
|
|
47
47
|
if (f) throw new TypeError("Generator is already executing.");
|
package/dist/tslib.es6-es.js
CHANGED
|
@@ -12,7 +12,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
12
12
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
13
|
PERFORMANCE OF THIS SOFTWARE.
|
|
14
14
|
***************************************************************************** */
|
|
15
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
15
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
function __rest(s, e) {
|
|
@@ -38,8 +38,8 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
function __generator(thisArg, body) {
|
|
41
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
42
|
-
return g =
|
|
41
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
42
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
43
43
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
44
44
|
function step(op) {
|
|
45
45
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -9,6 +9,7 @@ var isTypedArray = require('./isTypedArray-cjs.js');
|
|
|
9
9
|
var isSymbol$1 = require('./isSymbol-cjs.js');
|
|
10
10
|
var identity$1 = require('./identity-cjs.js');
|
|
11
11
|
var _isIterateeCall = require('./_isIterateeCall-cjs.js');
|
|
12
|
+
var jobberHooks = require('@jobber/hooks');
|
|
12
13
|
var debounce = require('./debounce-cjs.js');
|
|
13
14
|
var Icon = require('./Icon-cjs.js');
|
|
14
15
|
var floatingUi_react = require('./floating-ui.react-cjs.js');
|
|
@@ -248,49 +249,6 @@ var sortBy_1 = sortBy;
|
|
|
248
249
|
|
|
249
250
|
var sortBy$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(sortBy_1);
|
|
250
251
|
|
|
251
|
-
var useLiveAnnounce$1 = {};
|
|
252
|
-
|
|
253
|
-
Object.defineProperty(useLiveAnnounce$1, "__esModule", { value: true });
|
|
254
|
-
var useLiveAnnounce_2 = useLiveAnnounce$1.useLiveAnnounce = useLiveAnnounce;
|
|
255
|
-
const react_1 = React;
|
|
256
|
-
/**
|
|
257
|
-
* Announce a message on voice over whenever you do an action. This is
|
|
258
|
-
* especially helpful when you have an action that adds or deletes an element
|
|
259
|
-
* from the screen.
|
|
260
|
-
*/
|
|
261
|
-
function useLiveAnnounce() {
|
|
262
|
-
const [announcedMessage, setAnnouncedMessage] = (0, react_1.useState)("");
|
|
263
|
-
(0, react_1.useEffect)(() => {
|
|
264
|
-
let target;
|
|
265
|
-
if (announcedMessage) {
|
|
266
|
-
target = createAnnouncedElement();
|
|
267
|
-
setTimeout(() => target.append(announcedMessage), 100);
|
|
268
|
-
}
|
|
269
|
-
return () => target === null || target === void 0 ? void 0 : target.remove();
|
|
270
|
-
}, [announcedMessage]);
|
|
271
|
-
return {
|
|
272
|
-
liveAnnounce: (message) => {
|
|
273
|
-
setAnnouncedMessage(message);
|
|
274
|
-
},
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
// eslint-disable-next-line max-statements
|
|
278
|
-
function createAnnouncedElement() {
|
|
279
|
-
const el = document.createElement("div");
|
|
280
|
-
el.style.position = "absolute";
|
|
281
|
-
el.style.width = "1px";
|
|
282
|
-
el.style.height = "1px";
|
|
283
|
-
el.style.overflow = "hidden";
|
|
284
|
-
el.style.clipPath = " inset(100%)";
|
|
285
|
-
el.style.whiteSpace = " nowrap";
|
|
286
|
-
el.style.top = "0";
|
|
287
|
-
el.setAttribute("role", "status");
|
|
288
|
-
el.setAttribute("aria-atomic", "true");
|
|
289
|
-
el.setAttribute("aria-live", "assertive");
|
|
290
|
-
document.body.appendChild(el);
|
|
291
|
-
return el;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
252
|
/**
|
|
295
253
|
* Recursively finds a focusable element (div or button) in the specified direction
|
|
296
254
|
*/
|
|
@@ -316,7 +274,7 @@ function useInternalChipDismissible({ children, selected, onChange, onClick, onC
|
|
|
316
274
|
const visibleChipOptions = chipOptions.filter(chip => selected.includes(chip.value));
|
|
317
275
|
const sortedVisibleChipOptions = sortBy$1(visibleChipOptions, chip => selected.indexOf(chip.value));
|
|
318
276
|
const availableChipOptions = chipOptions.filter(chip => !selected.includes(chip.value));
|
|
319
|
-
const { liveAnnounce } =
|
|
277
|
+
const { liveAnnounce } = jobberHooks.useLiveAnnounce();
|
|
320
278
|
const actions = {
|
|
321
279
|
handleChipRemove: (value) => {
|
|
322
280
|
return () => {
|
|
@@ -386,7 +344,7 @@ function useInternalChipDismissibleInput({ options, isLoadingMore = false, onCus
|
|
|
386
344
|
const [shouldCancelEnter, setShouldCancelEnter] = React.useState(false);
|
|
387
345
|
const canAddCustomOption = onCustomOptionSelect !== undefined && !isLoadingMore;
|
|
388
346
|
const maxOptionIndex = allOptions.length - 1;
|
|
389
|
-
const { liveAnnounce } =
|
|
347
|
+
const { liveAnnounce } = jobberHooks.useLiveAnnounce();
|
|
390
348
|
React.useEffect(() => {
|
|
391
349
|
setAllOptions(generateOptions(options, searchValue, canAddCustomOption));
|
|
392
350
|
}, [options]);
|
|
@@ -7,9 +7,10 @@ import { b as isArrayLike_1, k as _baseUnary, a as isArray_1 } from './isTypedAr
|
|
|
7
7
|
import { i as isSymbol_1 } from './isSymbol-es.js';
|
|
8
8
|
import { i as identity_1 } from './identity-es.js';
|
|
9
9
|
import { _ as _baseRest, a as _isIterateeCall } from './_isIterateeCall-es.js';
|
|
10
|
-
import {
|
|
10
|
+
import { useLiveAnnounce } from '@jobber/hooks';
|
|
11
|
+
import { d as debounce } from './debounce-es.js';
|
|
11
12
|
import { I as Icon } from './Icon-es.js';
|
|
12
|
-
import { u as useFloating, o as offset, f as flip,
|
|
13
|
+
import { u as useFloating, o as offset, f as flip, s as size, c as autoUpdate } from './floating-ui.react-es.js';
|
|
13
14
|
import { c as calculateMaxHeight } from './maxHeight-es.js';
|
|
14
15
|
|
|
15
16
|
var baseEach = _baseEach,
|
|
@@ -246,49 +247,6 @@ var sortBy_1 = sortBy;
|
|
|
246
247
|
|
|
247
248
|
var sortBy$1 = /*@__PURE__*/getDefaultExportFromCjs(sortBy_1);
|
|
248
249
|
|
|
249
|
-
var useLiveAnnounce$1 = {};
|
|
250
|
-
|
|
251
|
-
Object.defineProperty(useLiveAnnounce$1, "__esModule", { value: true });
|
|
252
|
-
var useLiveAnnounce_2 = useLiveAnnounce$1.useLiveAnnounce = useLiveAnnounce;
|
|
253
|
-
const react_1 = React__default;
|
|
254
|
-
/**
|
|
255
|
-
* Announce a message on voice over whenever you do an action. This is
|
|
256
|
-
* especially helpful when you have an action that adds or deletes an element
|
|
257
|
-
* from the screen.
|
|
258
|
-
*/
|
|
259
|
-
function useLiveAnnounce() {
|
|
260
|
-
const [announcedMessage, setAnnouncedMessage] = (0, react_1.useState)("");
|
|
261
|
-
(0, react_1.useEffect)(() => {
|
|
262
|
-
let target;
|
|
263
|
-
if (announcedMessage) {
|
|
264
|
-
target = createAnnouncedElement();
|
|
265
|
-
setTimeout(() => target.append(announcedMessage), 100);
|
|
266
|
-
}
|
|
267
|
-
return () => target === null || target === void 0 ? void 0 : target.remove();
|
|
268
|
-
}, [announcedMessage]);
|
|
269
|
-
return {
|
|
270
|
-
liveAnnounce: (message) => {
|
|
271
|
-
setAnnouncedMessage(message);
|
|
272
|
-
},
|
|
273
|
-
};
|
|
274
|
-
}
|
|
275
|
-
// eslint-disable-next-line max-statements
|
|
276
|
-
function createAnnouncedElement() {
|
|
277
|
-
const el = document.createElement("div");
|
|
278
|
-
el.style.position = "absolute";
|
|
279
|
-
el.style.width = "1px";
|
|
280
|
-
el.style.height = "1px";
|
|
281
|
-
el.style.overflow = "hidden";
|
|
282
|
-
el.style.clipPath = " inset(100%)";
|
|
283
|
-
el.style.whiteSpace = " nowrap";
|
|
284
|
-
el.style.top = "0";
|
|
285
|
-
el.setAttribute("role", "status");
|
|
286
|
-
el.setAttribute("aria-atomic", "true");
|
|
287
|
-
el.setAttribute("aria-live", "assertive");
|
|
288
|
-
document.body.appendChild(el);
|
|
289
|
-
return el;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
250
|
/**
|
|
293
251
|
* Recursively finds a focusable element (div or button) in the specified direction
|
|
294
252
|
*/
|
|
@@ -314,7 +272,7 @@ function useInternalChipDismissible({ children, selected, onChange, onClick, onC
|
|
|
314
272
|
const visibleChipOptions = chipOptions.filter(chip => selected.includes(chip.value));
|
|
315
273
|
const sortedVisibleChipOptions = sortBy$1(visibleChipOptions, chip => selected.indexOf(chip.value));
|
|
316
274
|
const availableChipOptions = chipOptions.filter(chip => !selected.includes(chip.value));
|
|
317
|
-
const { liveAnnounce } =
|
|
275
|
+
const { liveAnnounce } = useLiveAnnounce();
|
|
318
276
|
const actions = {
|
|
319
277
|
handleChipRemove: (value) => {
|
|
320
278
|
return () => {
|
|
@@ -384,7 +342,7 @@ function useInternalChipDismissibleInput({ options, isLoadingMore = false, onCus
|
|
|
384
342
|
const [shouldCancelEnter, setShouldCancelEnter] = useState(false);
|
|
385
343
|
const canAddCustomOption = onCustomOptionSelect !== undefined && !isLoadingMore;
|
|
386
344
|
const maxOptionIndex = allOptions.length - 1;
|
|
387
|
-
const { liveAnnounce } =
|
|
345
|
+
const { liveAnnounce } = useLiveAnnounce();
|
|
388
346
|
useEffect(() => {
|
|
389
347
|
setAllOptions(generateOptions(options, searchValue, canAddCustomOption));
|
|
390
348
|
}, [options]);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test utility for mocking a large viewport using Jest spies
|
|
3
|
+
* This is useful for testing components that use floating-ui and
|
|
4
|
+
* have flip middleware.
|
|
5
|
+
*/
|
|
6
|
+
interface ViewportMock {
|
|
7
|
+
restore: () => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Mocks a large viewport (2000x2000) for testing tooltips and popovers
|
|
11
|
+
* that need sufficient space for positioning.
|
|
12
|
+
*
|
|
13
|
+
* @returns Object with restore method for cleanup
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* describe("with a preferred placement", () => {
|
|
18
|
+
* let viewportMock: ReturnType<typeof mockLargeViewport>;
|
|
19
|
+
*
|
|
20
|
+
* beforeEach(() => {
|
|
21
|
+
* viewportMock = mockLargeViewport();
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* afterEach(() => {
|
|
25
|
+
* viewportMock.restore();
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* // tests...
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function mockLargeViewport(): ViewportMock;
|
|
33
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "6.85.
|
|
3
|
+
"version": "6.85.3-CLEANUPre-6d043f4.28+6d043f490",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -462,7 +462,7 @@
|
|
|
462
462
|
"prepack": "npm run entryPoints:build",
|
|
463
463
|
"postpack": "npm run entryPoints:clean",
|
|
464
464
|
"storybook": "storybook dev -p 6007 --disable-telemetry",
|
|
465
|
-
"build
|
|
465
|
+
"storybook:build": "storybook build --disable-telemetry"
|
|
466
466
|
},
|
|
467
467
|
"files": [
|
|
468
468
|
"*.js",
|
|
@@ -473,25 +473,24 @@
|
|
|
473
473
|
],
|
|
474
474
|
"dependencies": {
|
|
475
475
|
"@floating-ui/react": "^0.27.5",
|
|
476
|
-
"@jobber/formatters": "^0.4.
|
|
476
|
+
"@jobber/formatters": "^0.4.1-CLEANUPre-6d043f4.476+6d043f490",
|
|
477
477
|
"@tanstack/react-table": "8.5.13",
|
|
478
478
|
"@types/color": "^3.0.1",
|
|
479
479
|
"@types/lodash": "^4.14.136",
|
|
480
|
-
"@types/react-datepicker": "^4.8.0",
|
|
481
480
|
"@types/react-router": "5.1.7",
|
|
482
481
|
"@types/react-router-dom": "^5.3.3",
|
|
483
482
|
"axios": "^1.11.0",
|
|
484
483
|
"classnames": "^2.3.2",
|
|
485
484
|
"color": "^3.1.2",
|
|
486
485
|
"filesize": "^6.1.0",
|
|
487
|
-
"framer-motion": "^11.
|
|
486
|
+
"framer-motion": "^11.11.12",
|
|
488
487
|
"lodash": "^4.17.21",
|
|
489
|
-
"react-aria-components": "^1.
|
|
488
|
+
"react-aria-components": "^1.11.0",
|
|
490
489
|
"react-countdown": "^2.3.2",
|
|
491
|
-
"react-datepicker": "
|
|
490
|
+
"react-datepicker": "^8.7.0",
|
|
492
491
|
"react-dropzone": "^11.0.2",
|
|
493
|
-
"react-hook-form": "^7.
|
|
494
|
-
"react-markdown": "^
|
|
492
|
+
"react-hook-form": "^7.52.0",
|
|
493
|
+
"react-markdown": "^10.1.0",
|
|
495
494
|
"react-router-dom": "^5.3.4",
|
|
496
495
|
"ts-xor": "^1.0.8"
|
|
497
496
|
},
|
|
@@ -504,8 +503,6 @@
|
|
|
504
503
|
"@storybook/addon-a11y": "^9.1.1",
|
|
505
504
|
"@storybook/react-vite": "^9.1.1",
|
|
506
505
|
"@types/glob": "^7.1.1",
|
|
507
|
-
"@types/react": "^18.0.28",
|
|
508
|
-
"@types/react-dom": "^18.0.11",
|
|
509
506
|
"autoprefixer": "^9.5.1",
|
|
510
507
|
"copyfiles": "^2.4.1",
|
|
511
508
|
"glob": "^7.1.4",
|
|
@@ -513,7 +510,6 @@
|
|
|
513
510
|
"postcss": "^8.4.40",
|
|
514
511
|
"postcss-import": "^12.0.1",
|
|
515
512
|
"postcss-preset-env": "^8.3.0",
|
|
516
|
-
"rollup": "^4.13.0",
|
|
517
513
|
"rollup-plugin-copy": "^3.5.0",
|
|
518
514
|
"rollup-plugin-multi-input": "^1.4.1",
|
|
519
515
|
"rollup-plugin-polyfill-node": "^0.13.0",
|
|
@@ -529,14 +525,12 @@
|
|
|
529
525
|
"axios": "^1.11.0",
|
|
530
526
|
"classnames": "^2",
|
|
531
527
|
"color": "^4",
|
|
532
|
-
"date-fns": "^2.30.0",
|
|
533
|
-
"date-fns-tz": "^2.0.0",
|
|
534
528
|
"filesize": "^6",
|
|
535
|
-
"framer-motion": "^11",
|
|
529
|
+
"framer-motion": "^11.11.12",
|
|
536
530
|
"lodash": "^4",
|
|
537
|
-
"react": "^18.
|
|
538
|
-
"react-dom": "^18",
|
|
539
|
-
"react-hook-form": "^7",
|
|
531
|
+
"react": "^18 || ^19.1.0",
|
|
532
|
+
"react-dom": "^18 || ^19.1.0",
|
|
533
|
+
"react-hook-form": "^7.52.0",
|
|
540
534
|
"react-router-dom": "^6"
|
|
541
535
|
},
|
|
542
536
|
"browserslist": [
|
|
@@ -544,5 +538,5 @@
|
|
|
544
538
|
"> 1%",
|
|
545
539
|
"IE 10"
|
|
546
540
|
],
|
|
547
|
-
"gitHead": "
|
|
541
|
+
"gitHead": "6d043f4908d39d779d91ffa9fe2e84418734665c"
|
|
548
542
|
}
|
package/rollup.config.mjs
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
/* eslint-disable import/no-default-export */
|
|
2
|
-
import { fileURLToPath } from "url";
|
|
3
|
-
import { dirname, resolve } from "path";
|
|
4
2
|
import typescript from "@rollup/plugin-typescript";
|
|
5
3
|
import postcss from "rollup-plugin-postcss";
|
|
6
4
|
import commonjs from "@rollup/plugin-commonjs";
|
|
@@ -12,10 +10,6 @@ import tools from "@csstools/postcss-global-data";
|
|
|
12
10
|
import presetenv from "postcss-preset-env";
|
|
13
11
|
import multiInput from "rollup-plugin-multi-input";
|
|
14
12
|
import nodePolyfills from "rollup-plugin-polyfill-node";
|
|
15
|
-
import alias from "@rollup/plugin-alias";
|
|
16
|
-
// comments for manual release
|
|
17
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
18
|
-
const __dirname = dirname(__filename);
|
|
19
13
|
|
|
20
14
|
/**
|
|
21
15
|
* When PREBUILD_CSS is supplied, only build the main index.ts file.
|
|
@@ -31,15 +25,6 @@ export default {
|
|
|
31
25
|
input: PREBUILD_CSS ? "src/index.ts" : `src/**/index.{ts,tsx}`,
|
|
32
26
|
plugins: [
|
|
33
27
|
nodePolyfills(),
|
|
34
|
-
alias({
|
|
35
|
-
entries: [
|
|
36
|
-
{
|
|
37
|
-
find: /@jobber\/hooks\/(.*)/,
|
|
38
|
-
replacement: (_, p1) =>
|
|
39
|
-
resolve(__dirname, `../hooks/dist/${p1}/${p1}.js`),
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
}),
|
|
43
28
|
nodeResolve(),
|
|
44
29
|
multiInput.default(),
|
|
45
30
|
typescript({
|
|
@@ -152,6 +137,7 @@ export default {
|
|
|
152
137
|
],
|
|
153
138
|
external: [
|
|
154
139
|
"react",
|
|
140
|
+
"react/jsx-runtime",
|
|
155
141
|
"react-hook-form",
|
|
156
142
|
"react-router-dom",
|
|
157
143
|
"react-dom",
|