@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
|
@@ -3,12 +3,7 @@
|
|
|
3
3
|
var Disclosure = require('../Disclosure-cjs.js');
|
|
4
4
|
require('react');
|
|
5
5
|
require('classnames');
|
|
6
|
-
require('
|
|
7
|
-
require('../_commonjsHelpers-cjs.js');
|
|
8
|
-
require('../throttle-cjs.js');
|
|
9
|
-
require('../debounce-cjs.js');
|
|
10
|
-
require('../isObjectLike-cjs.js');
|
|
11
|
-
require('../isSymbol-cjs.js');
|
|
6
|
+
require('@jobber/hooks');
|
|
12
7
|
require('../Icon-cjs.js');
|
|
13
8
|
require('@jobber/design');
|
|
14
9
|
require('../Typography-cjs.js');
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
export { D as Disclosure } from '../Disclosure-es.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
|
-
import '
|
|
5
|
-
import '../_commonjsHelpers-es.js';
|
|
6
|
-
import '../throttle-es.js';
|
|
7
|
-
import '../debounce-es.js';
|
|
8
|
-
import '../isObjectLike-es.js';
|
|
9
|
-
import '../isSymbol-es.js';
|
|
4
|
+
import '@jobber/hooks';
|
|
10
5
|
import '../Icon-es.js';
|
|
11
6
|
import '@jobber/design';
|
|
12
7
|
import '../Typography-es.js';
|
package/dist/Disclosure-cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var classnames = require('classnames');
|
|
5
|
-
var
|
|
5
|
+
var jobberHooks = require('@jobber/hooks');
|
|
6
6
|
var Icon = require('./Icon-cjs.js');
|
|
7
7
|
var Typography = require('./Typography-cjs.js');
|
|
8
8
|
|
|
@@ -12,8 +12,8 @@ function Disclosure({ children, title, defaultOpen = false, onToggle, open, UNSA
|
|
|
12
12
|
var _a, _b, _c, _d;
|
|
13
13
|
const [internalOpen, setInternalOpen] = React.useState(defaultOpen || open || false);
|
|
14
14
|
const isOpen = open !== undefined ? open : internalOpen;
|
|
15
|
-
const [titleRef, { exactWidth }] =
|
|
16
|
-
const isBelowBreakpoint = exactWidth && exactWidth <
|
|
15
|
+
const [titleRef, { exactWidth }] = jobberHooks.useResizeObserver();
|
|
16
|
+
const isBelowBreakpoint = exactWidth && exactWidth < jobberHooks.Breakpoints.small;
|
|
17
17
|
const isTitleString = typeof title === "string";
|
|
18
18
|
const containerClassNames = classnames(styles.details, UNSAFE_className.container);
|
|
19
19
|
const summaryClassNames = classnames(styles.summary, UNSAFE_className.summary);
|
package/dist/Disclosure-es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default, { useState } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
|
-
import {
|
|
3
|
+
import { useResizeObserver, Breakpoints } from '@jobber/hooks';
|
|
4
4
|
import { I as Icon } from './Icon-es.js';
|
|
5
5
|
import { T as Typography } from './Typography-es.js';
|
|
6
6
|
|
|
@@ -10,8 +10,8 @@ function Disclosure({ children, title, defaultOpen = false, onToggle, open, UNSA
|
|
|
10
10
|
var _a, _b, _c, _d;
|
|
11
11
|
const [internalOpen, setInternalOpen] = useState(defaultOpen || open || false);
|
|
12
12
|
const isOpen = open !== undefined ? open : internalOpen;
|
|
13
|
-
const [titleRef, { exactWidth }] = useResizeObserver
|
|
14
|
-
const isBelowBreakpoint = exactWidth && exactWidth <
|
|
13
|
+
const [titleRef, { exactWidth }] = useResizeObserver();
|
|
14
|
+
const isBelowBreakpoint = exactWidth && exactWidth < Breakpoints.small;
|
|
15
15
|
const isTitleString = typeof title === "string";
|
|
16
16
|
const containerClassNames = classnames(styles.details, UNSAFE_className.container);
|
|
17
17
|
const summaryClassNames = classnames(styles.summary, UNSAFE_className.summary);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PropsWithChildren, ReactNode } from "react";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import type { Clearable } from "@jobber/hooks
|
|
3
|
+
import type { Clearable } from "@jobber/hooks";
|
|
4
4
|
import type { FormFieldProps } from "./FormFieldTypes";
|
|
5
5
|
export interface FormFieldWrapperProps extends FormFieldProps {
|
|
6
6
|
readonly error: string;
|
|
@@ -9,6 +9,7 @@ export declare function useAtlantisReactHookForm({ actionsRef, name, defaultValu
|
|
|
9
9
|
inputRefs: import("react").RefCallback<any>;
|
|
10
10
|
useControllerField: {
|
|
11
11
|
value: any;
|
|
12
|
+
disabled?: boolean;
|
|
12
13
|
name: string;
|
|
13
14
|
};
|
|
14
15
|
setValue: import("react-hook-form").UseFormSetValue<import("react-hook-form").FieldValues>;
|
package/dist/FormField/index.cjs
CHANGED
package/dist/FormField/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { A as AffixIcon, i as AffixLabel, k as FormField, F as FormFieldInputHorizontalWrapper, d as FormFieldInputWrapperStyles, e as FormFieldLabel, f as FormFieldWrapper, g as FormFieldWrapperMain, h as FormFieldWrapperToolbar, u as useAtlantisFormField, a as useAtlantisFormFieldActions, b as useAtlantisFormFieldName, c as useAtlantisReactHookForm, j as useFormFieldWrapperStyles } from '../FormField-es.js';
|
|
2
2
|
import 'react';
|
|
3
|
+
import '@jobber/hooks';
|
|
3
4
|
import 'framer-motion';
|
|
4
5
|
import '@jobber/design';
|
|
5
6
|
import 'classnames';
|
package/dist/FormField-cjs.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
+
var jobberHooks = require('@jobber/hooks');
|
|
4
5
|
var framerMotion = require('framer-motion');
|
|
5
6
|
var design = require('@jobber/design');
|
|
6
7
|
var classnames = require('classnames');
|
|
@@ -13,26 +14,6 @@ var Spinner = require('./Spinner-cjs.js');
|
|
|
13
14
|
var tslib_es6 = require('./tslib.es6-cjs.js');
|
|
14
15
|
var reactHookForm = require('react-hook-form');
|
|
15
16
|
|
|
16
|
-
var useShowClear$1 = {};
|
|
17
|
-
|
|
18
|
-
Object.defineProperty(useShowClear$1, "__esModule", { value: true });
|
|
19
|
-
var useShowClear_2 = useShowClear$1.useShowClear = useShowClear;
|
|
20
|
-
function useShowClear({ clearable, multiline, focused, hasValue, readonly, disabled = false, }) {
|
|
21
|
-
if (multiline && clearable !== "never") {
|
|
22
|
-
throw new Error("Multiline inputs can not be clearable");
|
|
23
|
-
}
|
|
24
|
-
// Do not show if there is no value
|
|
25
|
-
if (!hasValue || clearable === "never" || disabled || readonly) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
switch (clearable) {
|
|
29
|
-
case "while-editing":
|
|
30
|
-
return focused;
|
|
31
|
-
case "always":
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
17
|
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
18
|
|
|
38
19
|
/**
|
|
@@ -188,7 +169,7 @@ function FormFieldWrapper({ align, description, descriptionIdentifier, placehold
|
|
|
188
169
|
showMiniLabel,
|
|
189
170
|
});
|
|
190
171
|
const { focused } = useFormFieldFocus.useFormFieldFocus({ wrapperRef });
|
|
191
|
-
const showClear =
|
|
172
|
+
const showClear = jobberHooks.useShowClear({
|
|
192
173
|
clearable,
|
|
193
174
|
multiline: type === "textarea",
|
|
194
175
|
focused,
|
package/dist/FormField-es.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React__default, { useState, useEffect, useRef, useImperativeHandle, useId } from 'react';
|
|
2
|
+
import { useShowClear } from '@jobber/hooks';
|
|
2
3
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
3
4
|
import { tokens } from '@jobber/design';
|
|
4
5
|
import classnames from 'classnames';
|
|
@@ -11,26 +12,6 @@ import { S as Spinner } from './Spinner-es.js';
|
|
|
11
12
|
import { _ as __rest } from './tslib.es6-es.js';
|
|
12
13
|
import { useFormContext, useForm, useController } from 'react-hook-form';
|
|
13
14
|
|
|
14
|
-
var useShowClear$1 = {};
|
|
15
|
-
|
|
16
|
-
Object.defineProperty(useShowClear$1, "__esModule", { value: true });
|
|
17
|
-
var useShowClear_2 = useShowClear$1.useShowClear = useShowClear;
|
|
18
|
-
function useShowClear({ clearable, multiline, focused, hasValue, readonly, disabled = false, }) {
|
|
19
|
-
if (multiline && clearable !== "never") {
|
|
20
|
-
throw new Error("Multiline inputs can not be clearable");
|
|
21
|
-
}
|
|
22
|
-
// Do not show if there is no value
|
|
23
|
-
if (!hasValue || clearable === "never" || disabled || readonly) {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
switch (clearable) {
|
|
27
|
-
case "while-editing":
|
|
28
|
-
return focused;
|
|
29
|
-
case "always":
|
|
30
|
-
return true;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
15
|
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
16
|
|
|
36
17
|
/**
|
|
@@ -186,7 +167,7 @@ function FormFieldWrapper({ align, description, descriptionIdentifier, placehold
|
|
|
186
167
|
showMiniLabel,
|
|
187
168
|
});
|
|
188
169
|
const { focused } = useFormFieldFocus({ wrapperRef });
|
|
189
|
-
const showClear =
|
|
170
|
+
const showClear = useShowClear({
|
|
190
171
|
clearable,
|
|
191
172
|
multiline: type === "textarea",
|
|
192
173
|
focused,
|
|
@@ -16,17 +16,16 @@ require('../ProgressBar-cjs.js');
|
|
|
16
16
|
require('../Button-cjs.js');
|
|
17
17
|
require('react-router-dom');
|
|
18
18
|
require('../ConfirmationModal-cjs.js');
|
|
19
|
-
require('
|
|
19
|
+
require('@jobber/hooks');
|
|
20
20
|
require('../Modal/index.cjs');
|
|
21
21
|
require('react-dom');
|
|
22
22
|
require('framer-motion');
|
|
23
|
-
require('../useRefocusOnActivator-cjs.js');
|
|
24
|
-
require('../useFocusTrap-cjs.js');
|
|
25
23
|
require('../Heading-cjs.js');
|
|
26
24
|
require('../ButtonDismiss-cjs.js');
|
|
27
25
|
require('../noop-cjs.js');
|
|
28
26
|
require('../_commonjsHelpers-cjs.js');
|
|
29
27
|
require('../floating-ui.react-cjs.js');
|
|
28
|
+
require('react/jsx-runtime');
|
|
30
29
|
require('../identity-cjs.js');
|
|
31
30
|
require('../isTypedArray-cjs.js');
|
|
32
31
|
require('../isObjectLike-cjs.js');
|
|
@@ -39,7 +38,6 @@ require('../_isIterateeCall-cjs.js');
|
|
|
39
38
|
require('../_setToString-cjs.js');
|
|
40
39
|
require('../Markdown-cjs.js');
|
|
41
40
|
require('../Emphasis-cjs.js');
|
|
42
|
-
require('../index-cjs.js');
|
|
43
41
|
|
|
44
42
|
|
|
45
43
|
|
|
@@ -14,17 +14,16 @@ import '../ProgressBar-es.js';
|
|
|
14
14
|
import '../Button-es.js';
|
|
15
15
|
import 'react-router-dom';
|
|
16
16
|
import '../ConfirmationModal-es.js';
|
|
17
|
-
import '
|
|
17
|
+
import '@jobber/hooks';
|
|
18
18
|
import '../Modal/index.mjs';
|
|
19
19
|
import 'react-dom';
|
|
20
20
|
import 'framer-motion';
|
|
21
|
-
import '../useRefocusOnActivator-es.js';
|
|
22
|
-
import '../useFocusTrap-es.js';
|
|
23
21
|
import '../Heading-es.js';
|
|
24
22
|
import '../ButtonDismiss-es.js';
|
|
25
23
|
import '../noop-es.js';
|
|
26
24
|
import '../_commonjsHelpers-es.js';
|
|
27
25
|
import '../floating-ui.react-es.js';
|
|
26
|
+
import 'react/jsx-runtime';
|
|
28
27
|
import '../identity-es.js';
|
|
29
28
|
import '../isTypedArray-es.js';
|
|
30
29
|
import '../isObjectLike-es.js';
|
|
@@ -37,4 +36,3 @@ import '../_isIterateeCall-es.js';
|
|
|
37
36
|
import '../_setToString-es.js';
|
|
38
37
|
import '../Markdown-es.js';
|
|
39
38
|
import '../Emphasis-es.js';
|
|
40
|
-
import '../index-es.js';
|
package/dist/Gallery/index.cjs
CHANGED
|
@@ -7,12 +7,7 @@ require('classnames');
|
|
|
7
7
|
require('../LightBox-cjs.js');
|
|
8
8
|
require('framer-motion');
|
|
9
9
|
require('react-dom');
|
|
10
|
-
require('
|
|
11
|
-
require('../useOnKeyDown-cjs.js');
|
|
12
|
-
require('../useFocusTrap-cjs.js');
|
|
13
|
-
require('../useIsMounted-cjs.js');
|
|
14
|
-
require('../useSafeLayoutEffect-cjs.js');
|
|
15
|
-
require('../useDebounce-cjs.js');
|
|
10
|
+
require('@jobber/hooks');
|
|
16
11
|
require('../ButtonDismiss-cjs.js');
|
|
17
12
|
require('../Button-cjs.js');
|
|
18
13
|
require('react-router-dom');
|
|
@@ -41,10 +36,10 @@ require('../ConfirmationModal-cjs.js');
|
|
|
41
36
|
require('../Modal/index.cjs');
|
|
42
37
|
require('../noop-cjs.js');
|
|
43
38
|
require('../floating-ui.react-cjs.js');
|
|
39
|
+
require('react/jsx-runtime');
|
|
44
40
|
require('../AtlantisPortalContent-cjs.js');
|
|
45
41
|
require('../Markdown-cjs.js');
|
|
46
42
|
require('../Emphasis-cjs.js');
|
|
47
|
-
require('../index-cjs.js');
|
|
48
43
|
|
|
49
44
|
|
|
50
45
|
|
package/dist/Gallery/index.mjs
CHANGED
|
@@ -5,12 +5,7 @@ import 'classnames';
|
|
|
5
5
|
import '../LightBox-es.js';
|
|
6
6
|
import 'framer-motion';
|
|
7
7
|
import 'react-dom';
|
|
8
|
-
import '
|
|
9
|
-
import '../useOnKeyDown-es.js';
|
|
10
|
-
import '../useFocusTrap-es.js';
|
|
11
|
-
import '../useIsMounted-es.js';
|
|
12
|
-
import '../useSafeLayoutEffect-es.js';
|
|
13
|
-
import '../useDebounce-es.js';
|
|
8
|
+
import '@jobber/hooks';
|
|
14
9
|
import '../ButtonDismiss-es.js';
|
|
15
10
|
import '../Button-es.js';
|
|
16
11
|
import 'react-router-dom';
|
|
@@ -39,7 +34,7 @@ import '../ConfirmationModal-es.js';
|
|
|
39
34
|
import '../Modal/index.mjs';
|
|
40
35
|
import '../noop-es.js';
|
|
41
36
|
import '../floating-ui.react-es.js';
|
|
37
|
+
import 'react/jsx-runtime';
|
|
42
38
|
import '../AtlantisPortalContent-es.js';
|
|
43
39
|
import '../Markdown-es.js';
|
|
44
40
|
import '../Emphasis-es.js';
|
|
45
|
-
import '../index-es.js';
|
|
@@ -3,6 +3,12 @@ import React from "react";
|
|
|
3
3
|
import type { TypographyOptions, TypographyProps } from "../Typography";
|
|
4
4
|
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
5
|
export interface HeadingProps {
|
|
6
|
+
/**
|
|
7
|
+
* Adds a unique identifier to the heading.
|
|
8
|
+
* Useful when the heading needs to be referenced by another element.
|
|
9
|
+
* Not intended for styling.
|
|
10
|
+
*/
|
|
11
|
+
readonly id?: string;
|
|
6
12
|
/**
|
|
7
13
|
* @default 5
|
|
8
14
|
*/
|
|
@@ -31,5 +37,5 @@ export interface HeadingProps {
|
|
|
31
37
|
readonly UNSAFE_style?: TypographyProps["UNSAFE_style"];
|
|
32
38
|
}
|
|
33
39
|
export type LevelMap = Record<HeadingLevel, TypographyOptions>;
|
|
34
|
-
export declare function Heading({ level, children, element, maxLines, UNSAFE_className, UNSAFE_style, }: HeadingProps): React.JSX.Element;
|
|
40
|
+
export declare function Heading({ id, level, children, element, maxLines, UNSAFE_className, UNSAFE_style, }: HeadingProps): React.JSX.Element;
|
|
35
41
|
export {};
|
package/dist/Heading-cjs.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var Typography = require('./Typography-cjs.js');
|
|
5
5
|
|
|
6
|
-
function Heading({ level = 5, children, element, maxLines = "unlimited", UNSAFE_className, UNSAFE_style, }) {
|
|
6
|
+
function Heading({ id, level = 5, children, element, maxLines = "unlimited", UNSAFE_className, UNSAFE_style, }) {
|
|
7
7
|
const levelMap = {
|
|
8
8
|
1: {
|
|
9
9
|
element: "h1",
|
|
@@ -51,7 +51,7 @@ function Heading({ level = 5, children, element, maxLines = "unlimited", UNSAFE_
|
|
|
51
51
|
larger: 16,
|
|
52
52
|
unlimited: undefined,
|
|
53
53
|
};
|
|
54
|
-
return (React.createElement(Typography.Typography, Object.assign({}, levelMap[level], { element: element || levelMap[level].element, numberOfLines: maxLineToNumber[maxLines], UNSAFE_className: UNSAFE_className, UNSAFE_style: UNSAFE_style }), children));
|
|
54
|
+
return (React.createElement(Typography.Typography, Object.assign({ id: id }, levelMap[level], { element: element || levelMap[level].element, numberOfLines: maxLineToNumber[maxLines], UNSAFE_className: UNSAFE_className, UNSAFE_style: UNSAFE_style }), children));
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
exports.Heading = Heading;
|
package/dist/Heading-es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import { T as Typography } from './Typography-es.js';
|
|
3
3
|
|
|
4
|
-
function Heading({ level = 5, children, element, maxLines = "unlimited", UNSAFE_className, UNSAFE_style, }) {
|
|
4
|
+
function Heading({ id, level = 5, children, element, maxLines = "unlimited", UNSAFE_className, UNSAFE_style, }) {
|
|
5
5
|
const levelMap = {
|
|
6
6
|
1: {
|
|
7
7
|
element: "h1",
|
|
@@ -49,7 +49,7 @@ function Heading({ level = 5, children, element, maxLines = "unlimited", UNSAFE_
|
|
|
49
49
|
larger: 16,
|
|
50
50
|
unlimited: undefined,
|
|
51
51
|
};
|
|
52
|
-
return (React__default.createElement(Typography, Object.assign({}, levelMap[level], { element: element || levelMap[level].element, numberOfLines: maxLineToNumber[maxLines], UNSAFE_className: UNSAFE_className, UNSAFE_style: UNSAFE_style }), children));
|
|
52
|
+
return (React__default.createElement(Typography, Object.assign({ id: id }, levelMap[level], { element: element || levelMap[level].element, numberOfLines: maxLineToNumber[maxLines], UNSAFE_className: UNSAFE_className, UNSAFE_style: UNSAFE_style }), children));
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
export { Heading as H };
|
package/dist/InlineLabel-cjs.js
CHANGED
|
@@ -4,11 +4,12 @@ var React = require('react');
|
|
|
4
4
|
var classnames = require('classnames');
|
|
5
5
|
var Typography = require('./Typography-cjs.js');
|
|
6
6
|
|
|
7
|
-
var styles = {"inlineLabel":"M01SZy5EYFg-","base":"_0L5DuoQQ0N0-","large":"QKOUUH9-Fho-","larger":"GdJFaAMVrfU-","greyBlue":"_1KuDugNaT-o-","red":"bHju-S5Uytc-","orange":"hk1-OlPzFpM-","green":"ekQbbiBSxKk-","success":"YBvJuPW-YEI-","blue":"_5X5w6s0pPdw-","inactive":"lju-nyF9vX0-","navy":"nMlCD9k-Meg-","task":"HVMpHULM2PU-","yellow":"hOJmavXturw-","warning":"kfXKagw-wdE-","lime":"ZrdNg5b18oY-","purple":"df-Q7pKd2iI-","invoice":"WE3Qy5JUsN4-","pink":"-Wiy2k-i7tQ-","quote":"NoDP1qZvkds-","teal":"gc8t5abqWH4-","yellowGreen":"SeLhnnpqK70-","job":"L9FK1YwwCB8-","blueDark":"PZdC-xYFPok-","lightBlue":"_3JD9CXbxRQ8-","informative":"R-kgbH6qPZU-","indigo":"_6juDApQlcS0-","request":"MGcsvmjHlow-","spinning":"dre73387JG8-"};
|
|
7
|
+
var styles = {"inlineLabel":"M01SZy5EYFg-","small":"_8nqeeAapUQU-","base":"_0L5DuoQQ0N0-","large":"QKOUUH9-Fho-","larger":"GdJFaAMVrfU-","greyBlue":"_1KuDugNaT-o-","red":"bHju-S5Uytc-","orange":"hk1-OlPzFpM-","green":"ekQbbiBSxKk-","success":"YBvJuPW-YEI-","blue":"_5X5w6s0pPdw-","inactive":"lju-nyF9vX0-","navy":"nMlCD9k-Meg-","task":"HVMpHULM2PU-","yellow":"hOJmavXturw-","warning":"kfXKagw-wdE-","lime":"ZrdNg5b18oY-","purple":"df-Q7pKd2iI-","invoice":"WE3Qy5JUsN4-","pink":"-Wiy2k-i7tQ-","quote":"NoDP1qZvkds-","teal":"gc8t5abqWH4-","yellowGreen":"SeLhnnpqK70-","job":"L9FK1YwwCB8-","blueDark":"PZdC-xYFPok-","lightBlue":"_3JD9CXbxRQ8-","informative":"R-kgbH6qPZU-","indigo":"_6juDApQlcS0-","request":"MGcsvmjHlow-","spinning":"dre73387JG8-"};
|
|
8
8
|
|
|
9
9
|
function InlineLabel({ size = "base", color = "greyBlue", children, }) {
|
|
10
10
|
const className = classnames(styles.inlineLabel, styles[size], styles[color]);
|
|
11
11
|
const sizeMapper = {
|
|
12
|
+
small: "smaller",
|
|
12
13
|
base: "small",
|
|
13
14
|
large: "large",
|
|
14
15
|
larger: "large",
|
package/dist/InlineLabel-es.js
CHANGED
|
@@ -2,11 +2,12 @@ import React__default from 'react';
|
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import { T as Typography } from './Typography-es.js';
|
|
4
4
|
|
|
5
|
-
var styles = {"inlineLabel":"M01SZy5EYFg-","base":"_0L5DuoQQ0N0-","large":"QKOUUH9-Fho-","larger":"GdJFaAMVrfU-","greyBlue":"_1KuDugNaT-o-","red":"bHju-S5Uytc-","orange":"hk1-OlPzFpM-","green":"ekQbbiBSxKk-","success":"YBvJuPW-YEI-","blue":"_5X5w6s0pPdw-","inactive":"lju-nyF9vX0-","navy":"nMlCD9k-Meg-","task":"HVMpHULM2PU-","yellow":"hOJmavXturw-","warning":"kfXKagw-wdE-","lime":"ZrdNg5b18oY-","purple":"df-Q7pKd2iI-","invoice":"WE3Qy5JUsN4-","pink":"-Wiy2k-i7tQ-","quote":"NoDP1qZvkds-","teal":"gc8t5abqWH4-","yellowGreen":"SeLhnnpqK70-","job":"L9FK1YwwCB8-","blueDark":"PZdC-xYFPok-","lightBlue":"_3JD9CXbxRQ8-","informative":"R-kgbH6qPZU-","indigo":"_6juDApQlcS0-","request":"MGcsvmjHlow-","spinning":"dre73387JG8-"};
|
|
5
|
+
var styles = {"inlineLabel":"M01SZy5EYFg-","small":"_8nqeeAapUQU-","base":"_0L5DuoQQ0N0-","large":"QKOUUH9-Fho-","larger":"GdJFaAMVrfU-","greyBlue":"_1KuDugNaT-o-","red":"bHju-S5Uytc-","orange":"hk1-OlPzFpM-","green":"ekQbbiBSxKk-","success":"YBvJuPW-YEI-","blue":"_5X5w6s0pPdw-","inactive":"lju-nyF9vX0-","navy":"nMlCD9k-Meg-","task":"HVMpHULM2PU-","yellow":"hOJmavXturw-","warning":"kfXKagw-wdE-","lime":"ZrdNg5b18oY-","purple":"df-Q7pKd2iI-","invoice":"WE3Qy5JUsN4-","pink":"-Wiy2k-i7tQ-","quote":"NoDP1qZvkds-","teal":"gc8t5abqWH4-","yellowGreen":"SeLhnnpqK70-","job":"L9FK1YwwCB8-","blueDark":"PZdC-xYFPok-","lightBlue":"_3JD9CXbxRQ8-","informative":"R-kgbH6qPZU-","indigo":"_6juDApQlcS0-","request":"MGcsvmjHlow-","spinning":"dre73387JG8-"};
|
|
6
6
|
|
|
7
7
|
function InlineLabel({ size = "base", color = "greyBlue", children, }) {
|
|
8
8
|
const className = classnames(styles.inlineLabel, styles[size], styles[color]);
|
|
9
9
|
const sizeMapper = {
|
|
10
|
+
small: "smaller",
|
|
10
11
|
base: "small",
|
|
11
12
|
large: "large",
|
|
12
13
|
larger: "large",
|
|
@@ -53,16 +53,4 @@ export interface InputDateProps extends Omit<CommonFormFieldProps, "clearable">,
|
|
|
53
53
|
* Text to display instead of a date value
|
|
54
54
|
*/
|
|
55
55
|
readonly emptyValueLabel?: string;
|
|
56
|
-
/**
|
|
57
|
-
* Experimental:
|
|
58
|
-
* Whether to replace empty/invalid values with the original value on blur.
|
|
59
|
-
*
|
|
60
|
-
* This solves an immediate UX problem and is likely to change in the future.
|
|
61
|
-
* It prevents the input from retaining empty/invalid values when the user tabs
|
|
62
|
-
* into it, clears the value, and tabs away. In this scenario, the original
|
|
63
|
-
* value will be restored.
|
|
64
|
-
*
|
|
65
|
-
* @default false
|
|
66
|
-
*/
|
|
67
|
-
readonly restoreLastValueOnBlur?: boolean;
|
|
68
56
|
}
|
package/dist/InputDate/index.cjs
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var omit = require('../omit-cjs.js');
|
|
5
|
-
var DatePicker = require('../DatePicker-cjs.js');
|
|
6
5
|
var FormField = require('../FormField-cjs.js');
|
|
7
6
|
require('classnames');
|
|
8
7
|
require('../tslib.es6-cjs.js');
|
|
9
8
|
require('react-hook-form');
|
|
9
|
+
require('@jobber/hooks');
|
|
10
10
|
require('framer-motion');
|
|
11
11
|
require('@jobber/design');
|
|
12
12
|
require('../Button-cjs.js');
|
|
13
|
+
var DatePicker = require('../DatePicker-cjs.js');
|
|
13
14
|
var InputText_index = require('../InputText/index.cjs');
|
|
14
15
|
require('../_commonjsHelpers-cjs.js');
|
|
15
16
|
require('../_baseGet-cjs.js');
|
|
@@ -22,23 +23,23 @@ require('../keysIn-cjs.js');
|
|
|
22
23
|
require('../_baseAssignValue-cjs.js');
|
|
23
24
|
require('../_baseFlatten-cjs.js');
|
|
24
25
|
require('../_setToString-cjs.js');
|
|
25
|
-
require('../index-cjs.js');
|
|
26
|
-
require('react-dom');
|
|
27
|
-
require('../useRefocusOnActivator-cjs.js');
|
|
28
|
-
require('../Typography-cjs.js');
|
|
29
|
-
require('../AtlantisContext-cjs.js');
|
|
30
26
|
require('../Icon-cjs.js');
|
|
31
27
|
require('../Text-cjs.js');
|
|
28
|
+
require('../Typography-cjs.js');
|
|
32
29
|
require('../useFormFieldFocus-cjs.js');
|
|
33
30
|
require('../InputValidation-cjs.js');
|
|
34
31
|
require('../Spinner-cjs.js');
|
|
35
32
|
require('react-router-dom');
|
|
36
|
-
require('../
|
|
33
|
+
require('../clsx-cjs.js');
|
|
34
|
+
require('../floating-ui.react-cjs.js');
|
|
35
|
+
require('react/jsx-runtime');
|
|
36
|
+
require('react-dom');
|
|
37
|
+
require('../AtlantisContext-cjs.js');
|
|
37
38
|
|
|
38
39
|
function InputDate$1(inputProps) {
|
|
39
40
|
const formFieldActionsRef = React.useRef(null);
|
|
40
41
|
return (React.createElement(DatePicker.DatePicker, { selected: inputProps.value, onChange: inputProps.onChange, disabled: inputProps.disabled, readonly: inputProps.readonly, fullWidth: !inputProps.inline, minDate: inputProps.minDate, maxDate: inputProps.maxDate, smartAutofocus: false, activator: activatorProps => {
|
|
41
|
-
const { onChange, onClick, value
|
|
42
|
+
const { onChange, onClick, value } = activatorProps;
|
|
42
43
|
const newActivatorProps = omit.omit(activatorProps, ["activator"]);
|
|
43
44
|
const [isFocused, setIsFocused] = React.useState(false);
|
|
44
45
|
const suffix = inputProps.showIcon !== false
|
|
@@ -61,31 +62,9 @@ function InputDate$1(inputProps) {
|
|
|
61
62
|
React.createElement(FormField.FormField, Object.assign({}, newActivatorProps, inputProps, { value: showEmptyValueLabel ? inputProps.emptyValueLabel || "" : value, placeholder: inputProps.placeholder, onChange: (_, event) => {
|
|
62
63
|
onChange && onChange(event);
|
|
63
64
|
}, onBlur: () => {
|
|
64
|
-
var _a;
|
|
65
65
|
inputProps.onBlur && inputProps.onBlur();
|
|
66
66
|
activatorProps.onBlur && activatorProps.onBlur();
|
|
67
67
|
setIsFocused(false);
|
|
68
|
-
/**
|
|
69
|
-
* This is an experimental workaround to solve a specific UX problem we have under certain conditions.
|
|
70
|
-
* When you click to focus InputDate, ReactDatePicker becomes visible. If you delete the current date and blur
|
|
71
|
-
* the input field by clicking away, ReactDatePicker will automatically set the date to whatever date was
|
|
72
|
-
* currently selected.
|
|
73
|
-
*
|
|
74
|
-
* The above works great and is the expected user experience. ReactDatePicker fills in the empty value for us.
|
|
75
|
-
*
|
|
76
|
-
* However, there's a specific scenario where ReactDatePicker isn't visible: when you tab into the input date.
|
|
77
|
-
* When you tab into it, clear the value, and tab away to blur, ReactDatePicker doesn't automatically fill in
|
|
78
|
-
* the empty value because it wasn't visible/active.
|
|
79
|
-
*
|
|
80
|
-
* To solve this, we need to handle the blur event here and check if the value is empty or invalid. If it is,
|
|
81
|
-
* we have to call onChange with the original input value which informs ReactDatePicker that is the current value.
|
|
82
|
-
*/
|
|
83
|
-
if (inputProps.restoreLastValueOnBlur) {
|
|
84
|
-
if ((!value || !DatePicker.isValid(value)) && inputProps.value) {
|
|
85
|
-
// @ts-expect-error -- ReactDatePicker types don't include setSelected
|
|
86
|
-
(_a = pickerRef.current) === null || _a === void 0 ? void 0 : _a.setSelected(inputProps.value);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
68
|
}, onFocus: () => {
|
|
90
69
|
inputProps.onFocus && inputProps.onFocus();
|
|
91
70
|
activatorProps.onFocus && activatorProps.onFocus();
|
package/dist/InputDate/index.mjs
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React__default, { useRef, useState, useEffect, forwardRef } from 'react';
|
|
2
2
|
import { o as omit } from '../omit-es.js';
|
|
3
|
-
import { D as DatePicker, i as isValid } from '../DatePicker-es.js';
|
|
4
3
|
import { k as FormField } from '../FormField-es.js';
|
|
5
4
|
import 'classnames';
|
|
6
5
|
import '../tslib.es6-es.js';
|
|
7
6
|
import 'react-hook-form';
|
|
7
|
+
import '@jobber/hooks';
|
|
8
8
|
import 'framer-motion';
|
|
9
9
|
import '@jobber/design';
|
|
10
10
|
import '../Button-es.js';
|
|
11
|
+
import { D as DatePicker } from '../DatePicker-es.js';
|
|
11
12
|
import { InputText } from '../InputText/index.mjs';
|
|
12
13
|
import '../_commonjsHelpers-es.js';
|
|
13
14
|
import '../_baseGet-es.js';
|
|
@@ -20,23 +21,23 @@ import '../keysIn-es.js';
|
|
|
20
21
|
import '../_baseAssignValue-es.js';
|
|
21
22
|
import '../_baseFlatten-es.js';
|
|
22
23
|
import '../_setToString-es.js';
|
|
23
|
-
import '../index-es.js';
|
|
24
|
-
import 'react-dom';
|
|
25
|
-
import '../useRefocusOnActivator-es.js';
|
|
26
|
-
import '../Typography-es.js';
|
|
27
|
-
import '../AtlantisContext-es.js';
|
|
28
24
|
import '../Icon-es.js';
|
|
29
25
|
import '../Text-es.js';
|
|
26
|
+
import '../Typography-es.js';
|
|
30
27
|
import '../useFormFieldFocus-es.js';
|
|
31
28
|
import '../InputValidation-es.js';
|
|
32
29
|
import '../Spinner-es.js';
|
|
33
30
|
import 'react-router-dom';
|
|
34
|
-
import '../
|
|
31
|
+
import '../clsx-es.js';
|
|
32
|
+
import '../floating-ui.react-es.js';
|
|
33
|
+
import 'react/jsx-runtime';
|
|
34
|
+
import 'react-dom';
|
|
35
|
+
import '../AtlantisContext-es.js';
|
|
35
36
|
|
|
36
37
|
function InputDate$1(inputProps) {
|
|
37
38
|
const formFieldActionsRef = useRef(null);
|
|
38
39
|
return (React__default.createElement(DatePicker, { selected: inputProps.value, onChange: inputProps.onChange, disabled: inputProps.disabled, readonly: inputProps.readonly, fullWidth: !inputProps.inline, minDate: inputProps.minDate, maxDate: inputProps.maxDate, smartAutofocus: false, activator: activatorProps => {
|
|
39
|
-
const { onChange, onClick, value
|
|
40
|
+
const { onChange, onClick, value } = activatorProps;
|
|
40
41
|
const newActivatorProps = omit(activatorProps, ["activator"]);
|
|
41
42
|
const [isFocused, setIsFocused] = useState(false);
|
|
42
43
|
const suffix = inputProps.showIcon !== false
|
|
@@ -59,31 +60,9 @@ function InputDate$1(inputProps) {
|
|
|
59
60
|
React__default.createElement(FormField, Object.assign({}, newActivatorProps, inputProps, { value: showEmptyValueLabel ? inputProps.emptyValueLabel || "" : value, placeholder: inputProps.placeholder, onChange: (_, event) => {
|
|
60
61
|
onChange && onChange(event);
|
|
61
62
|
}, onBlur: () => {
|
|
62
|
-
var _a;
|
|
63
63
|
inputProps.onBlur && inputProps.onBlur();
|
|
64
64
|
activatorProps.onBlur && activatorProps.onBlur();
|
|
65
65
|
setIsFocused(false);
|
|
66
|
-
/**
|
|
67
|
-
* This is an experimental workaround to solve a specific UX problem we have under certain conditions.
|
|
68
|
-
* When you click to focus InputDate, ReactDatePicker becomes visible. If you delete the current date and blur
|
|
69
|
-
* the input field by clicking away, ReactDatePicker will automatically set the date to whatever date was
|
|
70
|
-
* currently selected.
|
|
71
|
-
*
|
|
72
|
-
* The above works great and is the expected user experience. ReactDatePicker fills in the empty value for us.
|
|
73
|
-
*
|
|
74
|
-
* However, there's a specific scenario where ReactDatePicker isn't visible: when you tab into the input date.
|
|
75
|
-
* When you tab into it, clear the value, and tab away to blur, ReactDatePicker doesn't automatically fill in
|
|
76
|
-
* the empty value because it wasn't visible/active.
|
|
77
|
-
*
|
|
78
|
-
* To solve this, we need to handle the blur event here and check if the value is empty or invalid. If it is,
|
|
79
|
-
* we have to call onChange with the original input value which informs ReactDatePicker that is the current value.
|
|
80
|
-
*/
|
|
81
|
-
if (inputProps.restoreLastValueOnBlur) {
|
|
82
|
-
if ((!value || !isValid(value)) && inputProps.value) {
|
|
83
|
-
// @ts-expect-error -- ReactDatePicker types don't include setSelected
|
|
84
|
-
(_a = pickerRef.current) === null || _a === void 0 ? void 0 : _a.setSelected(inputProps.value);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
66
|
}, onFocus: () => {
|
|
88
67
|
inputProps.onFocus && inputProps.onFocus();
|
|
89
68
|
activatorProps.onFocus && activatorProps.onFocus();
|
|
@@ -5,6 +5,7 @@ var FormField = require('../FormField-cjs.js');
|
|
|
5
5
|
require('classnames');
|
|
6
6
|
var tslib_es6 = require('../tslib.es6-cjs.js');
|
|
7
7
|
require('react-hook-form');
|
|
8
|
+
require('@jobber/hooks');
|
|
8
9
|
require('framer-motion');
|
|
9
10
|
require('@jobber/design');
|
|
10
11
|
require('../Button-cjs.js');
|
|
@@ -3,6 +3,7 @@ import { k as FormField, j as useFormFieldWrapperStyles, b as useAtlantisFormFie
|
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import { _ as __rest } from '../tslib.es6-es.js';
|
|
5
5
|
import 'react-hook-form';
|
|
6
|
+
import '@jobber/hooks';
|
|
6
7
|
import 'framer-motion';
|
|
7
8
|
import '@jobber/design';
|
|
8
9
|
import '../Button-es.js';
|