@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/InputPassword-es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Clearable } from "@jobber/hooks
|
|
1
|
+
import type { Clearable } from "@jobber/hooks";
|
|
2
2
|
import type { InputMaskProps } from "./InputMask";
|
|
3
3
|
import type { CommonFormFieldProps, FormFieldProps } from "../FormField";
|
|
4
4
|
export interface InputPhoneNumberLegacyProps extends Omit<CommonFormFieldProps, "align">, Pick<FormFieldProps, "autocomplete" | "onEnter" | "onFocus" | "onBlur" | "validations" | "readonly" | "prefix" | "suffix"> {
|
|
@@ -7,6 +7,7 @@ var FormField = require('../FormField-cjs.js');
|
|
|
7
7
|
var reactHookForm = require('react-hook-form');
|
|
8
8
|
require('../Button-cjs.js');
|
|
9
9
|
require('@jobber/design');
|
|
10
|
+
require('@jobber/hooks');
|
|
10
11
|
require('framer-motion');
|
|
11
12
|
require('../Icon-cjs.js');
|
|
12
13
|
require('../Text-cjs.js');
|
|
@@ -5,6 +5,7 @@ import { j as useFormFieldWrapperStyles, b as useAtlantisFormFieldName, f as For
|
|
|
5
5
|
import { useFormContext, useForm } from 'react-hook-form';
|
|
6
6
|
import '../Button-es.js';
|
|
7
7
|
import '@jobber/design';
|
|
8
|
+
import '@jobber/hooks';
|
|
8
9
|
import 'framer-motion';
|
|
9
10
|
import '../Icon-es.js';
|
|
10
11
|
import '../Text-es.js';
|
|
@@ -17,7 +17,7 @@ export declare const InputText: React.ForwardRefExoticComponent<({
|
|
|
17
17
|
readonly placeholder?: string | undefined;
|
|
18
18
|
readonly size?: ("small" | "large") | undefined;
|
|
19
19
|
readonly value?: (string | number | Date) | undefined;
|
|
20
|
-
readonly clearable?: import("@jobber/hooks
|
|
20
|
+
readonly clearable?: import("@jobber/hooks").Clearable | undefined;
|
|
21
21
|
version?: 1 | undefined;
|
|
22
22
|
onFocus?: ((event?: React.FocusEvent) => void) | undefined;
|
|
23
23
|
onBlur?: ((event?: React.FocusEvent) => void) | undefined;
|
|
@@ -51,7 +51,7 @@ export declare const InputText: React.ForwardRefExoticComponent<({
|
|
|
51
51
|
readonly placeholder?: string | undefined;
|
|
52
52
|
readonly size?: ("small" | "large") | undefined;
|
|
53
53
|
readonly value?: (string | number | Date) | undefined;
|
|
54
|
-
readonly clearable?: import("@jobber/hooks
|
|
54
|
+
readonly clearable?: import("@jobber/hooks").Clearable | undefined;
|
|
55
55
|
version?: 1 | undefined;
|
|
56
56
|
onFocus?: ((event?: React.FocusEvent) => void) | undefined;
|
|
57
57
|
onBlur?: ((event?: React.FocusEvent) => void) | undefined;
|
package/dist/InputText/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
-
var
|
|
4
|
+
var jobberHooks = require('@jobber/hooks');
|
|
5
5
|
var FormField = require('../FormField-cjs.js');
|
|
6
6
|
require('classnames');
|
|
7
7
|
var tslib_es6 = require('../tslib.es6-cjs.js');
|
|
@@ -34,7 +34,7 @@ require('../_setToString-cjs.js');
|
|
|
34
34
|
*/
|
|
35
35
|
function useTextAreaResize({ rows, value, inputRef, wrapperRef, }) {
|
|
36
36
|
const rowRange = getRowRange(rows);
|
|
37
|
-
useSafeLayoutEffect
|
|
37
|
+
jobberHooks.useSafeLayoutEffect(() => {
|
|
38
38
|
if (inputRef &&
|
|
39
39
|
inputRef.current instanceof HTMLTextAreaElement &&
|
|
40
40
|
wrapperRef &&
|
|
@@ -45,7 +45,7 @@ function useTextAreaResize({ rows, value, inputRef, wrapperRef, }) {
|
|
|
45
45
|
// When the consumer passes a new controlled value, we need to recheck the size.
|
|
46
46
|
// The timeout ensures the DOM has a enough time to render the new text before
|
|
47
47
|
// we access the height.
|
|
48
|
-
useSafeLayoutEffect
|
|
48
|
+
jobberHooks.useSafeLayoutEffect(() => {
|
|
49
49
|
setTimeout(() => {
|
|
50
50
|
if (inputRef &&
|
|
51
51
|
inputRef.current instanceof HTMLTextAreaElement &&
|
package/dist/InputText/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React__default, { forwardRef, useRef, useImperativeHandle, useId } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { useSafeLayoutEffect } from '@jobber/hooks';
|
|
3
3
|
import { k as FormField, s as styles, j as useFormFieldWrapperStyles, b as useAtlantisFormFieldName, f as FormFieldWrapper, l as FormFieldPostFix, m as mergeRefs } from '../FormField-es.js';
|
|
4
4
|
import 'classnames';
|
|
5
5
|
import { _ as __rest } from '../tslib.es6-es.js';
|
|
@@ -32,7 +32,7 @@ import '../_setToString-es.js';
|
|
|
32
32
|
*/
|
|
33
33
|
function useTextAreaResize({ rows, value, inputRef, wrapperRef, }) {
|
|
34
34
|
const rowRange = getRowRange(rows);
|
|
35
|
-
|
|
35
|
+
useSafeLayoutEffect(() => {
|
|
36
36
|
if (inputRef &&
|
|
37
37
|
inputRef.current instanceof HTMLTextAreaElement &&
|
|
38
38
|
wrapperRef &&
|
|
@@ -43,7 +43,7 @@ function useTextAreaResize({ rows, value, inputRef, wrapperRef, }) {
|
|
|
43
43
|
// When the consumer passes a new controlled value, we need to recheck the size.
|
|
44
44
|
// The timeout ensures the DOM has a enough time to render the new text before
|
|
45
45
|
// we access the height.
|
|
46
|
-
|
|
46
|
+
useSafeLayoutEffect(() => {
|
|
47
47
|
setTimeout(() => {
|
|
48
48
|
if (inputRef &&
|
|
49
49
|
inputRef.current instanceof HTMLTextAreaElement &&
|
|
@@ -59,7 +59,7 @@ export declare function useInputTextFormField({ id, name, description, inline, h
|
|
|
59
59
|
className: string;
|
|
60
60
|
name: string;
|
|
61
61
|
disabled: boolean | undefined;
|
|
62
|
-
inputMode: "none" | "text" | "search" | "
|
|
62
|
+
inputMode: "none" | "text" | "search" | "email" | "decimal" | "tel" | "url" | "numeric" | undefined;
|
|
63
63
|
onChange: (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
64
64
|
onBlur: () => void;
|
|
65
65
|
onFocus: (event: FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
@@ -68,7 +68,6 @@ export declare function useInputTextFormField({ id, name, description, inline, h
|
|
|
68
68
|
autoComplete?: import("react").HTMLInputAutoCompleteAttribute | undefined;
|
|
69
69
|
capture?: boolean | "user" | "environment" | undefined;
|
|
70
70
|
checked?: boolean | undefined;
|
|
71
|
-
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
|
|
72
71
|
form?: string | undefined;
|
|
73
72
|
formAction?: string | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS] | undefined;
|
|
74
73
|
formEncType?: string | undefined;
|
|
@@ -97,10 +96,12 @@ export declare function useInputTextFormField({ id, name, description, inline, h
|
|
|
97
96
|
suppressContentEditableWarning?: boolean | undefined;
|
|
98
97
|
suppressHydrationWarning?: boolean | undefined;
|
|
99
98
|
accessKey?: string | undefined;
|
|
99
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {});
|
|
100
100
|
contentEditable?: (boolean | "false" | "true") | "inherit" | "plaintext-only" | undefined;
|
|
101
101
|
contextMenu?: string | undefined;
|
|
102
102
|
dir?: string | undefined;
|
|
103
103
|
draggable?: (boolean | "false" | "true") | undefined;
|
|
104
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
|
|
104
105
|
hidden?: boolean | undefined;
|
|
105
106
|
lang?: string | undefined;
|
|
106
107
|
nonce?: string | undefined;
|
|
@@ -123,7 +124,6 @@ export declare function useInputTextFormField({ id, name, description, inline, h
|
|
|
123
124
|
rev?: string | undefined;
|
|
124
125
|
typeof?: string | undefined;
|
|
125
126
|
vocab?: string | undefined;
|
|
126
|
-
autoCapitalize?: string | undefined;
|
|
127
127
|
autoCorrect?: string | undefined;
|
|
128
128
|
autoSave?: string | undefined;
|
|
129
129
|
color?: string | undefined;
|
|
@@ -136,6 +136,8 @@ export declare function useInputTextFormField({ id, name, description, inline, h
|
|
|
136
136
|
security?: string | undefined;
|
|
137
137
|
unselectable?: "on" | "off" | undefined;
|
|
138
138
|
is?: string | undefined;
|
|
139
|
+
exportparts?: string | undefined;
|
|
140
|
+
part?: string | undefined;
|
|
139
141
|
"aria-activedescendant"?: string | undefined;
|
|
140
142
|
"aria-atomic"?: (boolean | "false" | "true") | undefined;
|
|
141
143
|
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
|
|
@@ -206,7 +208,7 @@ export declare function useInputTextFormField({ id, name, description, inline, h
|
|
|
206
208
|
onFocusCapture?: import("react").FocusEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
|
|
207
209
|
onBlurCapture?: import("react").FocusEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
|
|
208
210
|
onChangeCapture?: import("react").FormEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
|
|
209
|
-
onBeforeInput?: import("react").
|
|
211
|
+
onBeforeInput?: import("react").InputEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
|
|
210
212
|
onBeforeInputCapture?: import("react").FormEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
|
|
211
213
|
onInput?: import("react").FormEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
|
|
212
214
|
onInputCapture?: import("react").FormEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
|
|
@@ -255,8 +257,6 @@ export declare function useInputTextFormField({ id, name, description, inline, h
|
|
|
255
257
|
onProgressCapture?: import("react").ReactEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
|
|
256
258
|
onRateChange?: import("react").ReactEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
|
|
257
259
|
onRateChangeCapture?: import("react").ReactEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
|
|
258
|
-
onResize?: import("react").ReactEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
|
|
259
|
-
onResizeCapture?: import("react").ReactEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
|
|
260
260
|
onSeeked?: import("react").ReactEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
|
|
261
261
|
onSeekedCapture?: import("react").ReactEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
|
|
262
262
|
onSeeking?: import("react").ReactEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
|
package/dist/InputTime/index.cjs
CHANGED
|
@@ -9,6 +9,7 @@ require('@jobber/design');
|
|
|
9
9
|
require('react-hook-form');
|
|
10
10
|
require('../Button-cjs.js');
|
|
11
11
|
var omit = require('../omit-cjs.js');
|
|
12
|
+
require('@jobber/hooks');
|
|
12
13
|
require('framer-motion');
|
|
13
14
|
require('../_commonjsHelpers-cjs.js');
|
|
14
15
|
require('../isObjectLike-cjs.js');
|
package/dist/InputTime/index.mjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React__default, { useState, useCallback, useEffect, useRef, useId } from 'react';
|
|
2
2
|
import { _ as __rest } from '../tslib.es6-es.js';
|
|
3
|
-
import {
|
|
3
|
+
import { d as debounce } from '../debounce-es.js';
|
|
4
4
|
import { j as useFormFieldWrapperStyles, f as FormFieldWrapper, k as FormField } from '../FormField-es.js';
|
|
5
5
|
import 'classnames';
|
|
6
6
|
import '@jobber/design';
|
|
7
7
|
import 'react-hook-form';
|
|
8
8
|
import '../Button-es.js';
|
|
9
9
|
import { o as omit } from '../omit-es.js';
|
|
10
|
+
import '@jobber/hooks';
|
|
10
11
|
import 'framer-motion';
|
|
11
12
|
import '../_commonjsHelpers-es.js';
|
|
12
13
|
import '../isObjectLike-es.js';
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var useScrollToActive = require('./useScrollToActive-cjs.js');
|
|
5
5
|
require('./isObjectLike-cjs.js');
|
|
6
|
+
require('@jobber/hooks');
|
|
6
7
|
require('@jobber/design');
|
|
7
8
|
var classnames = require('classnames');
|
|
8
9
|
var floatingUi_react = require('./floating-ui.react-cjs.js');
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React__default, { useEffect } from 'react';
|
|
2
2
|
import { a as useInternalChipDismissibleInput, d as useScrollToActive, b as useInView, c as useRepositionMenu, u as useInternalChipDismissible } from './useScrollToActive-es.js';
|
|
3
3
|
import './isObjectLike-es.js';
|
|
4
|
+
import '@jobber/hooks';
|
|
4
5
|
import '@jobber/design';
|
|
5
6
|
import classnames from 'classnames';
|
|
6
7
|
import { F as FloatingPortal } from './floating-ui.react-es.js';
|
package/dist/LightBox/index.cjs
CHANGED
|
@@ -4,13 +4,8 @@ var LightBox = require('../LightBox-cjs.js');
|
|
|
4
4
|
require('react');
|
|
5
5
|
require('framer-motion');
|
|
6
6
|
require('react-dom');
|
|
7
|
-
require('
|
|
8
|
-
require('../useOnKeyDown-cjs.js');
|
|
9
|
-
require('../useFocusTrap-cjs.js');
|
|
10
|
-
require('../useIsMounted-cjs.js');
|
|
11
|
-
require('../useSafeLayoutEffect-cjs.js');
|
|
7
|
+
require('@jobber/hooks');
|
|
12
8
|
require('classnames');
|
|
13
|
-
require('../useDebounce-cjs.js');
|
|
14
9
|
require('../ButtonDismiss-cjs.js');
|
|
15
10
|
require('../Button-cjs.js');
|
|
16
11
|
require('react-router-dom');
|
package/dist/LightBox/index.mjs
CHANGED
|
@@ -2,13 +2,8 @@ export { L as LightBox } from '../LightBox-es.js';
|
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'framer-motion';
|
|
4
4
|
import 'react-dom';
|
|
5
|
-
import '
|
|
6
|
-
import '../useOnKeyDown-es.js';
|
|
7
|
-
import '../useFocusTrap-es.js';
|
|
8
|
-
import '../useIsMounted-es.js';
|
|
9
|
-
import '../useSafeLayoutEffect-es.js';
|
|
5
|
+
import '@jobber/hooks';
|
|
10
6
|
import 'classnames';
|
|
11
|
-
import '../useDebounce-es.js';
|
|
12
7
|
import '../ButtonDismiss-es.js';
|
|
13
8
|
import '../Button-es.js';
|
|
14
9
|
import 'react-router-dom';
|
package/dist/LightBox-cjs.js
CHANGED
|
@@ -3,76 +3,14 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var framerMotion = require('framer-motion');
|
|
5
5
|
var ReactDOM = require('react-dom');
|
|
6
|
-
var
|
|
7
|
-
var useOnKeyDown = require('./useOnKeyDown-cjs.js');
|
|
8
|
-
var useFocusTrap = require('./useFocusTrap-cjs.js');
|
|
9
|
-
var useIsMounted = require('./useIsMounted-cjs.js');
|
|
6
|
+
var jobberHooks = require('@jobber/hooks');
|
|
10
7
|
var classnames = require('classnames');
|
|
11
|
-
var useDebounce = require('./useDebounce-cjs.js');
|
|
12
8
|
var ButtonDismiss = require('./ButtonDismiss-cjs.js');
|
|
13
9
|
var Text = require('./Text-cjs.js');
|
|
14
10
|
var Button = require('./Button-cjs.js');
|
|
15
11
|
var Heading = require('./Heading-cjs.js');
|
|
16
12
|
var AtlantisThemeContext = require('./AtlantisThemeContext-cjs.js');
|
|
17
13
|
|
|
18
|
-
var useBreakpoints = {};
|
|
19
|
-
|
|
20
|
-
var useMediaQuery = {};
|
|
21
|
-
|
|
22
|
-
(function (exports) {
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.mediaQueryStore = void 0;
|
|
25
|
-
exports.useMediaQuery = useMediaQuery;
|
|
26
|
-
const react_1 = React;
|
|
27
|
-
exports.mediaQueryStore = {
|
|
28
|
-
subscribe(onChange, query) {
|
|
29
|
-
const matchMedia = window.matchMedia(query);
|
|
30
|
-
matchMedia.addEventListener("change", onChange);
|
|
31
|
-
return () => {
|
|
32
|
-
matchMedia.removeEventListener("change", onChange);
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
|
-
getSnapshot(query) {
|
|
36
|
-
return () => window.matchMedia(query).matches;
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
function useMediaQuery(query) {
|
|
40
|
-
const subscribeMediaQuery = (0, react_1.useCallback)((onChange) => exports.mediaQueryStore.subscribe(onChange, query), [query]);
|
|
41
|
-
const matches = (0, react_1.useSyncExternalStore)(subscribeMediaQuery, exports.mediaQueryStore.getSnapshot(query), () => true);
|
|
42
|
-
return matches;
|
|
43
|
-
}
|
|
44
|
-
} (useMediaQuery));
|
|
45
|
-
|
|
46
|
-
(function (exports) {
|
|
47
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
-
exports.BREAKPOINT_SIZES = void 0;
|
|
49
|
-
exports.useBreakpoints = useBreakpoints;
|
|
50
|
-
const useMediaQuery_1 = useMediaQuery;
|
|
51
|
-
exports.BREAKPOINT_SIZES = { sm: 490, md: 768, lg: 1080, xl: 1440 };
|
|
52
|
-
/**
|
|
53
|
-
* Hook equivalent of CSS media queries with our
|
|
54
|
-
* [supported breakpoints](https://atlantis.getjobber.com/design/breakpoints).
|
|
55
|
-
*/
|
|
56
|
-
function useBreakpoints() {
|
|
57
|
-
const { sm, md, lg, xl } = exports.BREAKPOINT_SIZES;
|
|
58
|
-
const extraSmallOnly = (0, useMediaQuery_1.useMediaQuery)(`(max-width: ${sm - 1}px)`);
|
|
59
|
-
const smallAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${sm}px)`);
|
|
60
|
-
const mediumAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${md}px)`);
|
|
61
|
-
const largeAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${lg}px)`);
|
|
62
|
-
const extraLargeAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${xl}px)`);
|
|
63
|
-
return {
|
|
64
|
-
smallAndUp,
|
|
65
|
-
mediumAndUp,
|
|
66
|
-
largeAndUp,
|
|
67
|
-
extraLargeAndUp,
|
|
68
|
-
extraSmallOnly,
|
|
69
|
-
smallOnly: smallAndUp && !mediumAndUp,
|
|
70
|
-
mediumOnly: mediumAndUp && !largeAndUp,
|
|
71
|
-
largeOnly: largeAndUp && !extraLargeAndUp,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
} (useBreakpoints));
|
|
75
|
-
|
|
76
14
|
var styles = {"backgroundImage":"i9Tw1T65W-k-","next":"Q8amcRaTGf0-","prev":"W9FVb24yJrk-","buttonHidden":"nsN0TPWsBXI-","buttonVisible":"dkLYp7AD2jE-","lightboxWrapper":"_5p2iAj4JfoE-","toolbar":"rMK4cKdOxFw-","closeButton":"_0m6vb11DgiA-","slideNumber":"kCc68gGuTgg-","image":"yYFVVScosfQ-","imageArea":"UskuwLHR6fg-","captionWrapper":"OGjhge-r-U4-","title":"tZU2g-NYdIs-","blurOverlay":"GKIdLTmvcvQ-","thumbnailBar":"_3TfQLQEE3GQ-","thumbnailImage":"eBMzUOlcfQ4-","thumbnail":"eapm2zruLn8-","selected":"PeLn2u-QB0k-","spinning":"_8tDoqjgfLcw-"};
|
|
77
15
|
|
|
78
16
|
const swipeConfidenceThreshold = 10000;
|
|
@@ -106,21 +44,21 @@ function LightBox({ boxSizing = "content-box", open, images, imageIndex = 0, onR
|
|
|
106
44
|
const [currentImageIndex, setCurrentImageIndex] = React.useState(imageIndex);
|
|
107
45
|
const [direction, setDirection] = React.useState(0);
|
|
108
46
|
const [mouseIsStationary, setMouseIsStationary] = React.useState(true);
|
|
109
|
-
const lightboxRef = useFocusTrap
|
|
47
|
+
const lightboxRef = jobberHooks.useFocusTrap(open);
|
|
110
48
|
const selectedThumbnailRef = React.useRef(null);
|
|
111
|
-
const debouncedHandleNext = useDebounce
|
|
112
|
-
const debouncedHandlePrevious = useDebounce
|
|
113
|
-
const mounted = useIsMounted
|
|
49
|
+
const debouncedHandleNext = jobberHooks.useDebounce(handleMoveNext, BUTTON_DEBOUNCE_DELAY);
|
|
50
|
+
const debouncedHandlePrevious = jobberHooks.useDebounce(handleMovePrevious, BUTTON_DEBOUNCE_DELAY);
|
|
51
|
+
const mounted = jobberHooks.useIsMounted();
|
|
114
52
|
const prevOpen = React.useRef(open);
|
|
115
|
-
useRefocusOnActivator
|
|
116
|
-
const handleMouseMovement = useDebounce
|
|
53
|
+
jobberHooks.useRefocusOnActivator(open);
|
|
54
|
+
const handleMouseMovement = jobberHooks.useDebounce(() => {
|
|
117
55
|
setMouseIsStationary(true);
|
|
118
56
|
}, MOVEMENT_DEBOUNCE_DELAY);
|
|
119
|
-
useOnKeyDown
|
|
120
|
-
useOnKeyDown
|
|
57
|
+
jobberHooks.useOnKeyDown(handleRequestClose, "Escape");
|
|
58
|
+
jobberHooks.useOnKeyDown(debouncedHandlePrevious, {
|
|
121
59
|
key: "ArrowLeft",
|
|
122
60
|
});
|
|
123
|
-
useOnKeyDown
|
|
61
|
+
jobberHooks.useOnKeyDown(debouncedHandleNext, {
|
|
124
62
|
key: "ArrowRight",
|
|
125
63
|
});
|
|
126
64
|
React.useEffect(() => {
|
|
@@ -208,12 +146,12 @@ function LightBox({ boxSizing = "content-box", open, images, imageIndex = 0, onR
|
|
|
208
146
|
}
|
|
209
147
|
}
|
|
210
148
|
function PreviousButton({ onClick, hideButton }) {
|
|
211
|
-
const { mediumAndUp } =
|
|
149
|
+
const { mediumAndUp } = jobberHooks.useBreakpoints();
|
|
212
150
|
return (React.createElement("div", { className: `${styles.prev} ${hideButton ? styles.buttonHidden : styles.buttonVisible}` },
|
|
213
151
|
React.createElement(Button.Button, { size: mediumAndUp ? "large" : "small", variation: "subtle", type: "secondary", icon: "arrowLeft", ariaLabel: "Previous image", onClick: onClick })));
|
|
214
152
|
}
|
|
215
153
|
function NextButton({ onClick, hideButton }) {
|
|
216
|
-
const { mediumAndUp } =
|
|
154
|
+
const { mediumAndUp } = jobberHooks.useBreakpoints();
|
|
217
155
|
return (React.createElement("div", { className: `${styles.next} ${hideButton ? styles.buttonHidden : styles.buttonVisible}` },
|
|
218
156
|
React.createElement(Button.Button, { size: mediumAndUp ? "large" : "small", variation: "subtle", type: "secondary", icon: "arrowRight", ariaLabel: "Next image", onClick: onClick })));
|
|
219
157
|
}
|
package/dist/LightBox-es.js
CHANGED
|
@@ -1,76 +1,14 @@
|
|
|
1
1
|
import React__default, { useState, useRef, useEffect } from 'react';
|
|
2
2
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
3
3
|
import ReactDOM__default from 'react-dom';
|
|
4
|
-
import {
|
|
5
|
-
import { u as useOnKeyDown_2 } from './useOnKeyDown-es.js';
|
|
6
|
-
import { u as useFocusTrap_2 } from './useFocusTrap-es.js';
|
|
7
|
-
import { u as useIsMounted_2 } from './useIsMounted-es.js';
|
|
4
|
+
import { useFocusTrap, useDebounce, useIsMounted, useRefocusOnActivator, useOnKeyDown, useBreakpoints } from '@jobber/hooks';
|
|
8
5
|
import classnames from 'classnames';
|
|
9
|
-
import { u as useDebounce_2 } from './useDebounce-es.js';
|
|
10
6
|
import { B as ButtonDismiss } from './ButtonDismiss-es.js';
|
|
11
7
|
import { T as Text } from './Text-es.js';
|
|
12
8
|
import { B as Button } from './Button-es.js';
|
|
13
9
|
import { H as Heading } from './Heading-es.js';
|
|
14
10
|
import { A as AtlantisThemeContextProvider } from './AtlantisThemeContext-es.js';
|
|
15
11
|
|
|
16
|
-
var useBreakpoints = {};
|
|
17
|
-
|
|
18
|
-
var useMediaQuery = {};
|
|
19
|
-
|
|
20
|
-
(function (exports) {
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.mediaQueryStore = void 0;
|
|
23
|
-
exports.useMediaQuery = useMediaQuery;
|
|
24
|
-
const react_1 = React__default;
|
|
25
|
-
exports.mediaQueryStore = {
|
|
26
|
-
subscribe(onChange, query) {
|
|
27
|
-
const matchMedia = window.matchMedia(query);
|
|
28
|
-
matchMedia.addEventListener("change", onChange);
|
|
29
|
-
return () => {
|
|
30
|
-
matchMedia.removeEventListener("change", onChange);
|
|
31
|
-
};
|
|
32
|
-
},
|
|
33
|
-
getSnapshot(query) {
|
|
34
|
-
return () => window.matchMedia(query).matches;
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
function useMediaQuery(query) {
|
|
38
|
-
const subscribeMediaQuery = (0, react_1.useCallback)((onChange) => exports.mediaQueryStore.subscribe(onChange, query), [query]);
|
|
39
|
-
const matches = (0, react_1.useSyncExternalStore)(subscribeMediaQuery, exports.mediaQueryStore.getSnapshot(query), () => true);
|
|
40
|
-
return matches;
|
|
41
|
-
}
|
|
42
|
-
} (useMediaQuery));
|
|
43
|
-
|
|
44
|
-
(function (exports) {
|
|
45
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.BREAKPOINT_SIZES = void 0;
|
|
47
|
-
exports.useBreakpoints = useBreakpoints;
|
|
48
|
-
const useMediaQuery_1 = useMediaQuery;
|
|
49
|
-
exports.BREAKPOINT_SIZES = { sm: 490, md: 768, lg: 1080, xl: 1440 };
|
|
50
|
-
/**
|
|
51
|
-
* Hook equivalent of CSS media queries with our
|
|
52
|
-
* [supported breakpoints](https://atlantis.getjobber.com/design/breakpoints).
|
|
53
|
-
*/
|
|
54
|
-
function useBreakpoints() {
|
|
55
|
-
const { sm, md, lg, xl } = exports.BREAKPOINT_SIZES;
|
|
56
|
-
const extraSmallOnly = (0, useMediaQuery_1.useMediaQuery)(`(max-width: ${sm - 1}px)`);
|
|
57
|
-
const smallAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${sm}px)`);
|
|
58
|
-
const mediumAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${md}px)`);
|
|
59
|
-
const largeAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${lg}px)`);
|
|
60
|
-
const extraLargeAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${xl}px)`);
|
|
61
|
-
return {
|
|
62
|
-
smallAndUp,
|
|
63
|
-
mediumAndUp,
|
|
64
|
-
largeAndUp,
|
|
65
|
-
extraLargeAndUp,
|
|
66
|
-
extraSmallOnly,
|
|
67
|
-
smallOnly: smallAndUp && !mediumAndUp,
|
|
68
|
-
mediumOnly: mediumAndUp && !largeAndUp,
|
|
69
|
-
largeOnly: largeAndUp && !extraLargeAndUp,
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
} (useBreakpoints));
|
|
73
|
-
|
|
74
12
|
var styles = {"backgroundImage":"i9Tw1T65W-k-","next":"Q8amcRaTGf0-","prev":"W9FVb24yJrk-","buttonHidden":"nsN0TPWsBXI-","buttonVisible":"dkLYp7AD2jE-","lightboxWrapper":"_5p2iAj4JfoE-","toolbar":"rMK4cKdOxFw-","closeButton":"_0m6vb11DgiA-","slideNumber":"kCc68gGuTgg-","image":"yYFVVScosfQ-","imageArea":"UskuwLHR6fg-","captionWrapper":"OGjhge-r-U4-","title":"tZU2g-NYdIs-","blurOverlay":"GKIdLTmvcvQ-","thumbnailBar":"_3TfQLQEE3GQ-","thumbnailImage":"eBMzUOlcfQ4-","thumbnail":"eapm2zruLn8-","selected":"PeLn2u-QB0k-","spinning":"_8tDoqjgfLcw-"};
|
|
75
13
|
|
|
76
14
|
const swipeConfidenceThreshold = 10000;
|
|
@@ -104,21 +42,21 @@ function LightBox({ boxSizing = "content-box", open, images, imageIndex = 0, onR
|
|
|
104
42
|
const [currentImageIndex, setCurrentImageIndex] = useState(imageIndex);
|
|
105
43
|
const [direction, setDirection] = useState(0);
|
|
106
44
|
const [mouseIsStationary, setMouseIsStationary] = useState(true);
|
|
107
|
-
const lightboxRef =
|
|
45
|
+
const lightboxRef = useFocusTrap(open);
|
|
108
46
|
const selectedThumbnailRef = useRef(null);
|
|
109
|
-
const debouncedHandleNext =
|
|
110
|
-
const debouncedHandlePrevious =
|
|
111
|
-
const mounted =
|
|
47
|
+
const debouncedHandleNext = useDebounce(handleMoveNext, BUTTON_DEBOUNCE_DELAY);
|
|
48
|
+
const debouncedHandlePrevious = useDebounce(handleMovePrevious, BUTTON_DEBOUNCE_DELAY);
|
|
49
|
+
const mounted = useIsMounted();
|
|
112
50
|
const prevOpen = useRef(open);
|
|
113
|
-
|
|
114
|
-
const handleMouseMovement =
|
|
51
|
+
useRefocusOnActivator(open);
|
|
52
|
+
const handleMouseMovement = useDebounce(() => {
|
|
115
53
|
setMouseIsStationary(true);
|
|
116
54
|
}, MOVEMENT_DEBOUNCE_DELAY);
|
|
117
|
-
|
|
118
|
-
|
|
55
|
+
useOnKeyDown(handleRequestClose, "Escape");
|
|
56
|
+
useOnKeyDown(debouncedHandlePrevious, {
|
|
119
57
|
key: "ArrowLeft",
|
|
120
58
|
});
|
|
121
|
-
|
|
59
|
+
useOnKeyDown(debouncedHandleNext, {
|
|
122
60
|
key: "ArrowRight",
|
|
123
61
|
});
|
|
124
62
|
useEffect(() => {
|
|
@@ -206,12 +144,12 @@ function LightBox({ boxSizing = "content-box", open, images, imageIndex = 0, onR
|
|
|
206
144
|
}
|
|
207
145
|
}
|
|
208
146
|
function PreviousButton({ onClick, hideButton }) {
|
|
209
|
-
const { mediumAndUp } = useBreakpoints
|
|
147
|
+
const { mediumAndUp } = useBreakpoints();
|
|
210
148
|
return (React__default.createElement("div", { className: `${styles.prev} ${hideButton ? styles.buttonHidden : styles.buttonVisible}` },
|
|
211
149
|
React__default.createElement(Button, { size: mediumAndUp ? "large" : "small", variation: "subtle", type: "secondary", icon: "arrowLeft", ariaLabel: "Previous image", onClick: onClick })));
|
|
212
150
|
}
|
|
213
151
|
function NextButton({ onClick, hideButton }) {
|
|
214
|
-
const { mediumAndUp } = useBreakpoints
|
|
152
|
+
const { mediumAndUp } = useBreakpoints();
|
|
215
153
|
return (React__default.createElement("div", { className: `${styles.next} ${hideButton ? styles.buttonHidden : styles.buttonVisible}` },
|
|
216
154
|
React__default.createElement(Button, { size: mediumAndUp ? "large" : "small", variation: "subtle", type: "secondary", icon: "arrowRight", ariaLabel: "Next image", onClick: onClick })));
|
|
217
155
|
}
|
package/dist/List/index.cjs
CHANGED
package/dist/List/index.mjs
CHANGED
package/dist/Markdown/index.cjs
CHANGED
package/dist/Markdown/index.mjs
CHANGED