@jobber/components 4.44.0 → 4.45.1-visual-upd.1
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/Chip.d.ts +1 -0
- package/Chip.js +17 -0
- package/Combobox.d.ts +1 -0
- package/Combobox.js +17 -0
- package/dist/Autocomplete/index.js +7 -7
- package/dist/Banner/index.js +3 -3
- package/dist/Button/index.js +2 -2
- package/dist/{Button-fd8413b2.js → Button-db6114a6.js} +1 -1
- package/dist/ButtonDismiss/index.js +3 -3
- package/dist/{ButtonDismiss-82680c7d.js → ButtonDismiss-1ccb84ec.js} +1 -1
- package/dist/Card/index.js +5 -5
- package/dist/{Card-cc2ffbaa.js → Card-116af709.js} +3 -3
- package/dist/Checkbox/index.js +3 -3
- package/dist/{Checkbox-3bccf65c.js → Checkbox-bc4bc968.js} +1 -1
- package/dist/Chip/Chip.d.ts +8 -0
- package/dist/Chip/components/ChipDismissible/ChipDismissible.d.ts +3 -0
- package/dist/Chip/components/ChipPrefix/Chip.Prefix.d.ts +2 -0
- package/dist/Chip/components/ChipSelectable/ChipSelectable.d.ts +3 -0
- package/dist/Chip/components/ChipSuffix/Chip.Suffix.d.ts +6 -0
- package/dist/Chip/hooks/index.d.ts +1 -0
- package/dist/Chip/hooks/useChildComponent.d.ts +8 -0
- package/dist/Chip/index.d.ts +3 -0
- package/dist/Chip/index.js +85 -0
- package/dist/{Chip-4916a642.js → Chip-b603ceaf.js} +5 -5
- package/dist/Chips/index.js +5 -5
- package/dist/Combobox/Combobox.d.ts +22 -0
- package/dist/Combobox/Combobox.types.d.ts +14 -0
- package/dist/Combobox/ComboboxProvider.d.ts +12 -0
- package/dist/Combobox/components/ComboboxAction/ComboboxAction.d.ts +12 -0
- package/dist/Combobox/components/ComboboxAction/index.d.ts +1 -0
- package/dist/Combobox/components/ComboboxContent/ComboboxContent.d.ts +44 -0
- package/dist/Combobox/components/ComboboxContent/ComboboxList.d.ts +15 -0
- package/dist/Combobox/components/ComboboxContent/ComboboxSearch.d.ts +7 -0
- package/dist/Combobox/components/ComboboxContent/index.d.ts +1 -0
- package/dist/Combobox/components/ComboboxTrigger/ComboboxTriggerButton/ComboboxTriggerButton.d.ts +3 -0
- package/dist/Combobox/components/ComboboxTrigger/ComboboxTriggerChip/ComboboxTriggerChip.d.ts +3 -0
- package/dist/Combobox/components/ComboboxTrigger/index.d.ts +2 -0
- package/dist/Combobox/hooks/useComboboxAccessibility.d.ts +13 -0
- package/dist/Combobox/hooks/useComboboxContent.d.ts +13 -0
- package/dist/Combobox/index.d.ts +3 -0
- package/dist/Combobox/index.js +329 -0
- package/dist/ConfirmationModal/index.js +9 -9
- package/dist/{ConfirmationModal-6b61ebf5.js → ConfirmationModal-285c3cbe.js} +2 -2
- package/dist/DataDump/index.js +6 -6
- package/dist/DataList/DataList.d.ts +1 -1
- package/dist/DataList/DataList.types.d.ts +29 -6
- package/dist/DataList/DataList.utils.d.ts +1 -1
- package/dist/DataList/components/DataListAction/DataListAction.d.ts +2 -3
- package/dist/DataList/components/DataListActions/DataListActions.d.ts +3 -0
- package/dist/DataList/components/DataListActions/index.d.ts +1 -0
- package/dist/DataList/components/DataListHeader/DataListHeader.d.ts +2 -0
- package/dist/DataList/components/DataListHeader/index.d.ts +1 -0
- package/dist/DataList/components/DataListItem/DataListItem.d.ts +2 -2
- package/dist/DataList/components/DataListItemActions/DataListItemActions.d.ts +1 -5
- package/dist/DataList/components/DataListItemActions/index.d.ts +0 -1
- package/dist/DataList/components/DataListItemActionsOverflow/DataListItemActionsOverflow.d.ts +7 -0
- package/dist/DataList/components/DataListItemActionsOverflow/index.d.ts +1 -0
- package/dist/DataList/components/DataListItems/DataListItems.d.ts +7 -0
- package/dist/DataList/components/DataListItems/index.d.ts +1 -0
- package/dist/DataList/components/DataListLayout/DataListLayout.d.ts +2 -2
- package/dist/DataList/components/DataListLoadingState/DataListLoadingState.d.ts +2 -9
- package/dist/DataList/components/DataListSearch/DataListSearch.d.ts +1 -1
- package/dist/DataList/context/DataListContext/DataListContext.d.ts +3 -3
- package/dist/DataList/hooks/useActiveLayout.d.ts +4 -0
- package/dist/DataList/index.js +396 -365
- package/dist/DataTable/index.js +6 -6
- package/dist/DatePicker/index.js +3 -3
- package/dist/{DatePicker-b31baae4.js → DatePicker-49213434.js} +2 -2
- package/dist/DescriptionList/index.js +1 -1
- package/dist/Disclosure/index.js +1 -1
- package/dist/Drawer/index.js +4 -4
- package/dist/Emphasis/index.js +2 -2
- package/dist/{Emphasis-76a10790.js → Emphasis-e10dde65.js} +1 -1
- package/dist/FeatureSwitch/index.js +7 -7
- package/dist/FormField/index.js +5 -5
- package/dist/{FormField-d6138b7f.js → FormField-fa9254dc.js} +3 -3
- package/dist/FormatFile/index.js +10 -10
- package/dist/{FormatFile-aa1898f9.js → FormatFile-6423c3b5.js} +4 -4
- package/dist/Gallery/index.js +11 -11
- package/dist/Heading/index.js +2 -2
- package/dist/{Heading-a1191b15.js → Heading-4cde9989.js} +1 -1
- package/dist/InlineLabel/index.js +2 -2
- package/dist/{InlineLabel-afd5fc6f.js → InlineLabel-a24706c4.js} +1 -1
- package/dist/InputAvatar/index.js +3 -3
- package/dist/InputDate/index.js +6 -6
- package/dist/InputEmail/index.js +5 -5
- package/dist/InputFile/index.js +3 -3
- package/dist/{InputFile-2a06c2c0.js → InputFile-25c3369b.js} +2 -2
- package/dist/InputNumber/index.js +6 -6
- package/dist/{InputNumber-07b03067.js → InputNumber-ea9fcee1.js} +1 -1
- package/dist/InputPassword/index.js +5 -5
- package/dist/InputPhoneNumber/index.js +5 -5
- package/dist/InputText/index.js +6 -6
- package/dist/{InputText-d1a52550.js → InputText-ab237501.js} +1 -1
- package/dist/InputTime/index.js +5 -5
- package/dist/InputValidation/index.js +3 -3
- package/dist/{InputValidation-b5a3d92c.js → InputValidation-377d6c62.js} +1 -1
- package/dist/LightBox/index.js +4 -4
- package/dist/{LightBox-437a1c8b.js → LightBox-93ef99b9.js} +2 -2
- package/dist/List/index.js +5 -5
- package/dist/Markdown/index.js +5 -5
- package/dist/{Markdown-f6748dcb.js → Markdown-d53b01bf.js} +3 -3
- package/dist/Menu/index.js +3 -3
- package/dist/{Menu-51f8712f.js → Menu-2e64307a.js} +2 -2
- package/dist/Modal/index.js +5 -5
- package/dist/{Modal-a9ab9565.js → Modal-c17cc105.js} +3 -3
- package/dist/MultiSelect/index.js +3 -3
- package/dist/{Option-b903e7ac.js → Option-07a24acd.js} +1 -1
- package/dist/Page/index.js +7 -7
- package/dist/Popover/index.js +4 -4
- package/dist/{Popover-bbfc6aa1.js → Popover-7c966790.js} +1 -1
- package/dist/RadioGroup/index.js +3 -3
- package/dist/{RadioGroup-8e76d20b.js → RadioGroup-9bdd8a59.js} +1 -1
- package/dist/RecurringSelect/index.js +8 -8
- package/dist/Select/index.js +6 -6
- package/dist/StatusLabel/index.js +2 -2
- package/dist/Switch/index.js +2 -2
- package/dist/{Switch-e75145cc.js → Switch-cc9b645c.js} +1 -1
- package/dist/Tabs/index.js +1 -1
- package/dist/Text/index.js +2 -2
- package/dist/{Text-e7ed0974.js → Text-54334431.js} +1 -1
- package/dist/Toast/index.js +2 -2
- package/dist/Tooltip/index.js +1 -3
- package/dist/{Tooltip-bf67fe6e.js → Tooltip-3f9048ce.js} +5 -6
- package/dist/Typography/index.js +1 -1
- package/dist/{Typography-fd6f932a.js → Typography-83915c54.js} +2 -2
- package/package.json +5 -5
- package/rollup.config.js +2 -5
- package/dist/DataList/components/DataListItemActions/DataListItemActionsOverflow.d.ts +0 -7
- package/dist/DataList/components/DataListLayoutInternal/DataListHeader.d.ts +0 -11
- package/dist/DataList/components/DataListLayoutInternal/DataListItems.d.ts +0 -10
- package/dist/DataList/components/DataListLayoutInternal/DataListLayoutInternal.d.ts +0 -10
- package/dist/DataList/components/DataListLayoutInternal/index.d.ts +0 -3
- package/dist/DataList/hooks/useLayoutMediaQueries.d.ts +0 -1
- /package/dist/DataList/components/{DataListLayoutInternal → DataListHeader}/DataListHeaderCheckbox.d.ts +0 -0
package/Chip.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dist/Chip";
|
package/Chip.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true,
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var Chip = require("./dist/Chip");
|
|
8
|
+
|
|
9
|
+
Object.keys(Chip).forEach(function(key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
Object.defineProperty(exports, key, {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function get() {
|
|
14
|
+
return Chip[key];
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
});
|
package/Combobox.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dist/Combobox";
|
package/Combobox.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true,
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var Combobox = require("./dist/Combobox");
|
|
8
|
+
|
|
9
|
+
Object.keys(Combobox).forEach(function(key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
Object.defineProperty(exports, key, {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function get() {
|
|
14
|
+
return Combobox[key];
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -10,18 +10,18 @@ var classnames = require('classnames');
|
|
|
10
10
|
var useEventListener = require('@use-it/event-listener');
|
|
11
11
|
var ReactDOM = require('react-dom');
|
|
12
12
|
var reactPopper = require('react-popper');
|
|
13
|
-
var Text = require('../Text-
|
|
13
|
+
var Text = require('../Text-54334431.js');
|
|
14
14
|
var Icon = require('../Icon-405a216c.js');
|
|
15
|
-
var Heading = require('../Heading-
|
|
16
|
-
var InputText = require('../InputText-
|
|
17
|
-
require('../Typography-
|
|
15
|
+
var Heading = require('../Heading-4cde9989.js');
|
|
16
|
+
var InputText = require('../InputText-ab237501.js');
|
|
17
|
+
require('../Typography-83915c54.js');
|
|
18
18
|
require('@jobber/design');
|
|
19
|
-
require('../FormField-
|
|
19
|
+
require('../FormField-fa9254dc.js');
|
|
20
20
|
require('uuid');
|
|
21
21
|
require('react-hook-form');
|
|
22
|
-
require('../Button-
|
|
22
|
+
require('../Button-db6114a6.js');
|
|
23
23
|
require('react-router-dom');
|
|
24
|
-
require('../InputValidation-
|
|
24
|
+
require('../InputValidation-377d6c62.js');
|
|
25
25
|
require('framer-motion');
|
|
26
26
|
require('../Spinner-9d8fc7ff.js');
|
|
27
27
|
|
package/dist/Banner/index.js
CHANGED
|
@@ -7,10 +7,10 @@ var classnames = require('classnames');
|
|
|
7
7
|
var jobberHooks = require('@jobber/hooks/useResizeObserver');
|
|
8
8
|
var styleInject_es = require('../style-inject.es-9d2f5f4e.js');
|
|
9
9
|
var Icon = require('../Icon-405a216c.js');
|
|
10
|
-
var Text = require('../Text-
|
|
11
|
-
var Button = require('../Button-
|
|
10
|
+
var Text = require('../Text-54334431.js');
|
|
11
|
+
var Button = require('../Button-db6114a6.js');
|
|
12
12
|
require('@jobber/design');
|
|
13
|
-
require('../Typography-
|
|
13
|
+
require('../Typography-83915c54.js');
|
|
14
14
|
require('react-router-dom');
|
|
15
15
|
|
|
16
16
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
package/dist/Button/index.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var Button = require('../Button-
|
|
5
|
+
var Button = require('../Button-db6114a6.js');
|
|
6
6
|
require('react');
|
|
7
7
|
require('classnames');
|
|
8
8
|
require('react-router-dom');
|
|
9
9
|
require('../style-inject.es-9d2f5f4e.js');
|
|
10
10
|
require('../Icon-405a216c.js');
|
|
11
11
|
require('@jobber/design');
|
|
12
|
-
require('../Typography-
|
|
12
|
+
require('../Typography-83915c54.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -5,7 +5,7 @@ var classnames = require('classnames');
|
|
|
5
5
|
var reactRouterDom = require('react-router-dom');
|
|
6
6
|
var styleInject_es = require('./style-inject.es-9d2f5f4e.js');
|
|
7
7
|
var Icon = require('./Icon-405a216c.js');
|
|
8
|
-
var Typography = require('./Typography-
|
|
8
|
+
var Typography = require('./Typography-83915c54.js');
|
|
9
9
|
|
|
10
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
11
|
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var ButtonDismiss = require('../ButtonDismiss-
|
|
5
|
+
var ButtonDismiss = require('../ButtonDismiss-1ccb84ec.js');
|
|
6
6
|
require('react');
|
|
7
|
-
require('../Button-
|
|
7
|
+
require('../Button-db6114a6.js');
|
|
8
8
|
require('classnames');
|
|
9
9
|
require('react-router-dom');
|
|
10
10
|
require('../style-inject.es-9d2f5f4e.js');
|
|
11
11
|
require('../Icon-405a216c.js');
|
|
12
12
|
require('@jobber/design');
|
|
13
|
-
require('../Typography-
|
|
13
|
+
require('../Typography-83915c54.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
package/dist/Card/index.js
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var Card = require('../Card-
|
|
5
|
+
var Card = require('../Card-116af709.js');
|
|
6
6
|
require('react');
|
|
7
7
|
require('classnames');
|
|
8
8
|
require('../style-inject.es-9d2f5f4e.js');
|
|
9
|
-
require('../Heading-
|
|
10
|
-
require('../Typography-
|
|
11
|
-
require('../Button-
|
|
9
|
+
require('../Heading-4cde9989.js');
|
|
10
|
+
require('../Typography-83915c54.js');
|
|
11
|
+
require('../Button-db6114a6.js');
|
|
12
12
|
require('react-router-dom');
|
|
13
13
|
require('../Icon-405a216c.js');
|
|
14
14
|
require('@jobber/design');
|
|
15
|
-
require('../Menu-
|
|
15
|
+
require('../Menu-2e64307a.js');
|
|
16
16
|
require('uuid');
|
|
17
17
|
require('framer-motion');
|
|
18
18
|
require('@jobber/hooks/useOnKeyDown');
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var classnames = require('classnames');
|
|
5
5
|
var styleInject_es = require('./style-inject.es-9d2f5f4e.js');
|
|
6
|
-
var Heading = require('./Heading-
|
|
7
|
-
var Button = require('./Button-
|
|
8
|
-
var Menu = require('./Menu-
|
|
6
|
+
var Heading = require('./Heading-4cde9989.js');
|
|
7
|
+
var Button = require('./Button-db6114a6.js');
|
|
8
|
+
var Menu = require('./Menu-2e64307a.js');
|
|
9
9
|
|
|
10
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
11
|
|
package/dist/Checkbox/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var Checkbox = require('../Checkbox-
|
|
5
|
+
var Checkbox = require('../Checkbox-bc4bc968.js');
|
|
6
6
|
require('../tslib.es6-5b8768b7.js');
|
|
7
7
|
require('react');
|
|
8
8
|
require('uuid');
|
|
@@ -11,8 +11,8 @@ require('react-hook-form');
|
|
|
11
11
|
require('../style-inject.es-9d2f5f4e.js');
|
|
12
12
|
require('../Icon-405a216c.js');
|
|
13
13
|
require('@jobber/design');
|
|
14
|
-
require('../Text-
|
|
15
|
-
require('../Typography-
|
|
14
|
+
require('../Text-54334431.js');
|
|
15
|
+
require('../Typography-83915c54.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -7,7 +7,7 @@ var classnames = require('classnames');
|
|
|
7
7
|
var reactHookForm = require('react-hook-form');
|
|
8
8
|
var styleInject_es = require('./style-inject.es-9d2f5f4e.js');
|
|
9
9
|
var Icon = require('./Icon-405a216c.js');
|
|
10
|
-
var Text = require('./Text-
|
|
10
|
+
var Text = require('./Text-54334431.js');
|
|
11
11
|
|
|
12
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
13
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChipPrefix } from "./components/ChipPrefix/Chip.Prefix";
|
|
2
|
+
import { ChipSuffix } from "./components/ChipSuffix/Chip.Suffix";
|
|
3
|
+
import { ChipProps } from "./Chip.types";
|
|
4
|
+
export declare const Chip: {
|
|
5
|
+
({ ariaLabel, disabled, heading, invalid, label, value, onClick, onKeyDown, children, role, tabIndex, variation, }: ChipProps): JSX.Element;
|
|
6
|
+
Prefix: typeof ChipPrefix;
|
|
7
|
+
Suffix: typeof ChipSuffix;
|
|
8
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
export declare function ChipSuffix({ children, className }: ChipSuffixProps): JSX.Element;
|
|
3
|
+
export interface ChipSuffixProps extends PropsWithChildren {
|
|
4
|
+
readonly className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const allowedSuffixIcons: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./useChildComponent";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the first React Child that receives `true` from isCorrectComponent
|
|
4
|
+
* @param children React Children
|
|
5
|
+
* @param isCorrectComponent a function that accepts a JSX Element and returns a boolean.
|
|
6
|
+
* @returns The first child component that returns true on isCorrectComponent
|
|
7
|
+
*/
|
|
8
|
+
export declare function useChildComponent(children: ReactNode | undefined, isCorrectComponent: (toCheck: JSX.Element) => boolean): JSX.Element | undefined;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var classnames = require('classnames');
|
|
7
|
+
var styleInject_es = require('../style-inject.es-9d2f5f4e.js');
|
|
8
|
+
var Avatar = require('../Avatar-1aa30ee1.js');
|
|
9
|
+
var Icon = require('../Icon-405a216c.js');
|
|
10
|
+
var Typography = require('../Typography-83915c54.js');
|
|
11
|
+
var tslib_es6 = require('../tslib.es6-5b8768b7.js');
|
|
12
|
+
require('color');
|
|
13
|
+
require('@jobber/design');
|
|
14
|
+
|
|
15
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
|
+
|
|
17
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
18
|
+
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
19
|
+
|
|
20
|
+
var css_248z = ".af7U8MvcbHE- {\n --chip-height: 40px;\n --chip-radius: 20px;\n --chip-disabled--bg: var(--color-grey--lighter);\n --chip-bar-color: var(--color-greyBlue--light);\n --chip-base-bg: var(--color-greyBlue--lightest);\n --chip-base--hover: var(--color-greyBlue--lighter);\n display: -ms-flexbox;\n display: flex;\n position: relative;\n height: 40px;\n height: var(--chip-height);\n padding: calc(16px / 2) 16px;\n padding: var(--space-small) var(--base-unit);\n border: calc(16px / 16) solid transparent;\n border: var(--border-base) solid transparent;\n border-radius: 20px;\n border-radius: var(--chip-radius);\n color: rgb(1, 41, 57);\n color: var(--color-heading);\n text-align: left;\n cursor: pointer;\n transition: all var(--ease-both) 100ms;\n transition: all var(--ease-both) var(--timing-quick);\n -ms-flex-align: center;\n align-items: center;\n}\n\n.af7U8MvcbHE-:focus {\n box-shadow: 0px 0px calc(16px / 4) calc(16px / 8)\n rgb(231, 213, 87);\n box-shadow: var(--shadow-focus);\n}\n\n.af7U8MvcbHE- .e905AYK4SCc- {\n margin-left: calc(-1 * (16px / 2));\n margin-left: calc(-1 * calc(16px / 2));\n margin-left: calc(-1 * var(--space-small));\n margin-right: calc(16px / 2);\n margin-right: var(--space-small);\n}\n\n.af7U8MvcbHE- .ySADfZ0FckM- {\n margin-left: calc(16px / 2);\n margin-left: var(--space-small);\n margin-right: calc(-1 * (16px / 2));\n margin-right: calc(-1 * calc(16px / 2));\n margin-right: calc(-1 * var(--space-small));\n}\n\n.af7U8MvcbHE- .e905AYK4SCc-,\n.af7U8MvcbHE- .ySADfZ0FckM- {\n display: -ms-flexbox;\n display: flex;\n width: calc(16px * 1.5);\n width: var(--space-large);\n height: calc(16px * 1.5);\n height: var(--space-large);\n -ms-flex-negative: 0;\n flex-shrink: 0;\n border-radius: 100%;\n border-radius: var(--radius-circle);\n background-color: rgba(255, 255, 255, 1);\n background-color: var(--color-surface);\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n.af7U8MvcbHE- .ySADfZ0FckM-:hover,\n.af7U8MvcbHE- .e905AYK4SCc-:hover {\n background-color: rgb(181, 181, 181);\n background-color: var(--color-disabled);\n}\n\n.af7U8MvcbHE- .e905AYK4SCc-.usdkmQ9Sxbk-,\n.af7U8MvcbHE- .ySADfZ0FckM-.usdkmQ9Sxbk- {\n display: none;\n}\n\n.af7U8MvcbHE- .dg1-Izy1eQA- {\n width: calc(16px / 16);\n width: var(--space-minuscule);\n height: 16px;\n height: var(--base-unit);\n margin: 0 calc(16px / 2);\n margin: 0 var(--space-small);\n background-color: var(--chip-bar-color);\n}\n\n.af7U8MvcbHE- .-lz0EYLTDgg- {\n border-radius: 100%;\n border-radius: var(--radius-circle);\n background-color: rgba(255, 255, 255, 1);\n background-color: var(--color-surface);\n}\n\n.wSI5L-5rODg- {\n border: calc(16px / 16) solid transparent;\n border: var(--border-base) solid transparent;\n color: rgb(1, 41, 57);\n color: var(--color-heading);\n background-color: var(--chip-base-bg);\n}\n\n.wSI5L-5rODg-:hover,\n.wSI5L-5rODg-:focus {\n background-color: var(--chip-base--hover);\n}\n\n.SmUxkzpIC84-,\n.SmUxkzpIC84-:hover,\n.SmUxkzpIC84-:focus,\n.Mux23dmZSuw-.SmUxkzpIC84-,\n.Mux23dmZSuw-.SmUxkzpIC84-:hover,\n.Mux23dmZSuw-.SmUxkzpIC84-:focus {\n border: calc(16px / 16) solid rgb(201, 66, 33);\n border: var(--border-base) solid var(--color-critical);\n background-color: rgb(255, 226, 219);\n background-color: var(--color-critical--surface);\n}\n\n.Mux23dmZSuw- {\n border: calc(16px / 16) solid rgb(225, 225, 225);\n border: var(--border-base) solid var(--color-disabled--secondary);\n background-color: rgba(255, 255, 255, 1);\n background-color: var(--color-surface);\n}\n\n.Mux23dmZSuw-:hover {\n border: calc(16px / 16) solid var(--chip-base-bg);\n border: var(--border-base) solid var(--chip-base-bg);\n background-color: var(--chip-base-bg);\n}\n\n.MbRItb9vKhc-,\n.MbRItb9vKhc-:hover,\n.MbRItb9vKhc-:focus {\n border: calc(16px / 16) solid var(--chip-disabled--bg);\n border: var(--border-base) solid var(--chip-disabled--bg);\n color: rgb(181, 181, 181);\n color: var(--color-disabled);\n background-color: var(--chip-disabled--bg);\n cursor: auto;\n}\n\n.MbRItb9vKhc- .dg1-Izy1eQA- {\n background-color: rgb(181, 181, 181);\n background-color: var(--color-disabled);\n}\n\n.af7U8MvcbHE-.MbRItb9vKhc- .ySADfZ0FckM- {\n background-color: rgb(181, 181, 181);\n background-color: var(--color-disabled);\n}\n";
|
|
21
|
+
var styles = {"chip":"af7U8MvcbHE-","prefix":"e905AYK4SCc-","suffix":"ySADfZ0FckM-","empty":"usdkmQ9Sxbk-","chipBar":"dg1-Izy1eQA-","selected":"-lz0EYLTDgg-","base":"wSI5L-5rODg-","invalid":"SmUxkzpIC84-","subtle":"Mux23dmZSuw-","disabled":"MbRItb9vKhc-"};
|
|
22
|
+
styleInject_es.styleInject(css_248z);
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Returns the first React Child that receives `true` from isCorrectComponent
|
|
26
|
+
* @param children React Children
|
|
27
|
+
* @param isCorrectComponent a function that accepts a JSX Element and returns a boolean.
|
|
28
|
+
* @returns The first child component that returns true on isCorrectComponent
|
|
29
|
+
*/
|
|
30
|
+
function useChildComponent(children, isCorrectComponent) {
|
|
31
|
+
return React.useMemo(() => {
|
|
32
|
+
return React__default["default"].Children.toArray(children).find(d => React.isValidElement(d) && isCorrectComponent(d));
|
|
33
|
+
}, [children]);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function ChipPrefix({ children }) {
|
|
37
|
+
const singleChild = useChildComponent(children, d => d.type === Avatar.Avatar || d.type === Icon.Icon);
|
|
38
|
+
return (React__default["default"].createElement("span", { className: classnames__default["default"](styles.prefix, !singleChild && styles.empty) }, singleChild));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function ChipSuffix({ children, className }) {
|
|
42
|
+
var _a;
|
|
43
|
+
let singleChild = useChildComponent(children, d => d.type === Icon.Icon);
|
|
44
|
+
if (!allowedSuffixIcons.includes((_a = singleChild === null || singleChild === void 0 ? void 0 : singleChild.props) === null || _a === void 0 ? void 0 : _a.name)) {
|
|
45
|
+
singleChild = undefined;
|
|
46
|
+
}
|
|
47
|
+
return (React__default["default"].createElement("span", { className: classnames__default["default"](styles.suffix, className, !singleChild && styles.empty) }, singleChild));
|
|
48
|
+
}
|
|
49
|
+
const allowedSuffixIcons = ["cross", "add", "checkmark"];
|
|
50
|
+
|
|
51
|
+
const Chip = ({ ariaLabel, disabled, heading, invalid, label, value, onClick, onKeyDown, children, role = "button", tabIndex = 0, variation = "base", }) => {
|
|
52
|
+
const classes = classnames__default["default"](styles.chip, {
|
|
53
|
+
[styles.invalid]: invalid,
|
|
54
|
+
[styles.base]: variation === "base",
|
|
55
|
+
[styles.subtle]: variation === "subtle",
|
|
56
|
+
[styles.disabled]: disabled,
|
|
57
|
+
});
|
|
58
|
+
const prefix = useChildComponent(children, d => d.type === Chip.Prefix);
|
|
59
|
+
const suffix = useChildComponent(children, d => d.type === Chip.Suffix);
|
|
60
|
+
return (React__default["default"].createElement("button", { className: classes, onClick: (ev) => onClick && onClick(value, ev), tabIndex: tabIndex, onKeyDown: onKeyDown, "aria-label": ariaLabel || label, disabled: disabled, role: role, type: "button" },
|
|
61
|
+
prefix,
|
|
62
|
+
React__default["default"].createElement(Typography.Typography, { size: "base", fontWeight: "medium" }, heading),
|
|
63
|
+
heading && React__default["default"].createElement("span", { className: styles.chipBar }),
|
|
64
|
+
React__default["default"].createElement(Typography.Typography, { size: "base" }, label),
|
|
65
|
+
suffix));
|
|
66
|
+
};
|
|
67
|
+
Chip.Prefix = ChipPrefix;
|
|
68
|
+
Chip.Suffix = ChipSuffix;
|
|
69
|
+
|
|
70
|
+
function ChipSelectable(_a) {
|
|
71
|
+
var { selected } = _a, rest = tslib_es6.__rest(_a, ["selected"]);
|
|
72
|
+
return (React__default["default"].createElement(Chip, Object.assign({}, rest),
|
|
73
|
+
React__default["default"].createElement(Chip.Suffix, { className: selected ? styles.selected : "" },
|
|
74
|
+
React__default["default"].createElement(Icon.Icon, { name: selected ? "checkmark" : "add", size: "small", color: selected ? "green" : "blue" }))));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function ChipDismissible(props) {
|
|
78
|
+
return (React__default["default"].createElement(Chip, Object.assign({}, props),
|
|
79
|
+
React__default["default"].createElement(Chip.Suffix, null,
|
|
80
|
+
React__default["default"].createElement(Icon.Icon, { name: "cross", size: "small", color: "blue" }))));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
exports.Chip = Chip;
|
|
84
|
+
exports.ChipDismissible = ChipDismissible;
|
|
85
|
+
exports.ChipSelectable = ChipSelectable;
|
|
@@ -7,14 +7,14 @@ var classnames = require('classnames');
|
|
|
7
7
|
var useAssert = require('@jobber/hooks/useAssert');
|
|
8
8
|
var Icon = require('./Icon-405a216c.js');
|
|
9
9
|
var Avatar = require('./Avatar-1aa30ee1.js');
|
|
10
|
-
var Typography = require('./Typography-
|
|
11
|
-
var Tooltip = require('./Tooltip-
|
|
10
|
+
var Typography = require('./Typography-83915c54.js');
|
|
11
|
+
var Tooltip = require('./Tooltip-3f9048ce.js');
|
|
12
12
|
var sortBy = require('lodash/sortBy');
|
|
13
13
|
var useLiveAnnounce = require('@jobber/hooks/useLiveAnnounce');
|
|
14
14
|
var debounce = require('lodash/debounce');
|
|
15
15
|
var reactPopper = require('react-popper');
|
|
16
|
-
var Text = require('./Text-
|
|
17
|
-
var Button = require('./Button-
|
|
16
|
+
var Text = require('./Text-54334431.js');
|
|
17
|
+
var Button = require('./Button-db6114a6.js');
|
|
18
18
|
var Spinner = require('./Spinner-9d8fc7ff.js');
|
|
19
19
|
|
|
20
20
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -472,7 +472,7 @@ function InternalChipDismissibleInput(props) {
|
|
|
472
472
|
React__default["default"].createElement("input", { ref: inputRef, className: styles.input, type: "text", role: "combobox", "aria-label": "Press up and down arrow to cycle through the options or type to narrow down the results", "aria-autocomplete": "list", "aria-owns": menuId, "aria-expanded": hasAvailableOptions, "aria-activedescendant": generateDescendantId(activeIndex), value: searchValue, onChange: handleSearchChange, onKeyDown: handleKeyDown, onBlur: debounce__default["default"](handleBlur, 200), onFocus: handleOpenMenu, autoFocus: true }),
|
|
473
473
|
(hasAvailableOptions || isLoadingMore) && (React__default["default"].createElement("div", Object.assign({ ref: setPositionedElementRef, className: styles.menu, style: popperStyles.popper }, attributes.popper),
|
|
474
474
|
React__default["default"].createElement("div", { ref: menuRef, role: "listbox", id: menuId, className: styles.menuList, "data-testid": "chip-menu" },
|
|
475
|
-
allOptions.map((option, i) => (React__default["default"].createElement("button", { key: option.value, role: "option", id: generateDescendantId(i), className: classnames__default["default"](styles.menuListOption, {
|
|
475
|
+
allOptions.map((option, i) => (React__default["default"].createElement("button", { key: option.value, role: "option", type: "button", id: generateDescendantId(i), className: classnames__default["default"](styles.menuListOption, {
|
|
476
476
|
[styles.activeOption]: activeIndex === i,
|
|
477
477
|
}), onClick: () => handleSelectOption(option), onMouseEnter: handleSetActiveOnMouseOver(i), onMouseDown: handleCancelBlur, onMouseUp: handleEnableBlur },
|
|
478
478
|
React__default["default"].createElement("span", { "aria-hidden": true }, option.prefix),
|
package/dist/Chips/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var Chip = require('../Chip-
|
|
6
|
+
var Chip = require('../Chip-b603ceaf.js');
|
|
7
7
|
require('uuid');
|
|
8
8
|
require('../style-inject.es-9d2f5f4e.js');
|
|
9
9
|
require('classnames');
|
|
@@ -12,16 +12,16 @@ require('../Icon-405a216c.js');
|
|
|
12
12
|
require('@jobber/design');
|
|
13
13
|
require('../Avatar-1aa30ee1.js');
|
|
14
14
|
require('color');
|
|
15
|
-
require('../Typography-
|
|
16
|
-
require('../Tooltip-
|
|
15
|
+
require('../Typography-83915c54.js');
|
|
16
|
+
require('../Tooltip-3f9048ce.js');
|
|
17
17
|
require('react-dom');
|
|
18
18
|
require('framer-motion');
|
|
19
19
|
require('react-popper');
|
|
20
|
-
require('../Text-e7ed0974.js');
|
|
21
20
|
require('lodash/sortBy');
|
|
22
21
|
require('@jobber/hooks/useLiveAnnounce');
|
|
23
22
|
require('lodash/debounce');
|
|
24
|
-
require('../
|
|
23
|
+
require('../Text-54334431.js');
|
|
24
|
+
require('../Button-db6114a6.js');
|
|
25
25
|
require('react-router-dom');
|
|
26
26
|
require('../Spinner-9d8fc7ff.js');
|
|
27
27
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { ComboboxContent } from "./components/ComboboxContent";
|
|
3
|
+
import { ComboboxAction } from "./components/ComboboxAction";
|
|
4
|
+
import { ComboboxTriggerButton, ComboboxTriggerChip } from "./components/ComboboxTrigger";
|
|
5
|
+
export interface ComboboxProps {
|
|
6
|
+
readonly children: ReactElement | ReactElement[];
|
|
7
|
+
/**
|
|
8
|
+
* When `true`, `Combobox` will allow for multiple selections
|
|
9
|
+
*
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
readonly multiSelect?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const COMBOBOX_TRIGGER_COUNT_ERROR_MESSAGE = "Combobox can only have one Trigger element";
|
|
15
|
+
export declare const COMBOBOX_REQUIRED_CHILDREN_ERROR_MESSAGE = "Combobox must have a Trigger and Combobox.Content element";
|
|
16
|
+
export declare const Combobox: {
|
|
17
|
+
(props: ComboboxProps): JSX.Element;
|
|
18
|
+
TriggerButton: typeof ComboboxTriggerButton;
|
|
19
|
+
TriggerChip: typeof ComboboxTriggerChip;
|
|
20
|
+
Content: typeof ComboboxContent;
|
|
21
|
+
Action: typeof ComboboxAction;
|
|
22
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ButtonProps } from "../Button";
|
|
2
|
+
export interface ComboboxTriggerProps {
|
|
3
|
+
/**
|
|
4
|
+
* The label text of the trigger.
|
|
5
|
+
*/
|
|
6
|
+
readonly label: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ComboboxTriggerButtonProps extends ComboboxTriggerProps, Pick<ButtonProps, "type" | "variation" | "icon" | "iconOnRight"> {
|
|
9
|
+
}
|
|
10
|
+
export type ComboboxTriggerChipProps = ComboboxTriggerProps;
|
|
11
|
+
export interface ComboboxOption {
|
|
12
|
+
id: string | number;
|
|
13
|
+
label: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { RefObject } from "react";
|
|
2
|
+
export declare const ComboboxContext: React.Context<{
|
|
3
|
+
multiselect: boolean;
|
|
4
|
+
open: boolean;
|
|
5
|
+
setOpen: (open: boolean) => void;
|
|
6
|
+
wrapperRef: RefObject<HTMLDivElement>;
|
|
7
|
+
}>;
|
|
8
|
+
export interface ComboboxProviderProps {
|
|
9
|
+
readonly children: React.ReactNode;
|
|
10
|
+
readonly multiselect?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function ComboboxContextProvider(props: ComboboxProviderProps): JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface ComboboxActionProps {
|
|
3
|
+
/**
|
|
4
|
+
* The function to call when the action is clicked.
|
|
5
|
+
*/
|
|
6
|
+
onClick(event: React.MouseEvent<HTMLButtonElement>): void;
|
|
7
|
+
/**
|
|
8
|
+
* The label text of the action.
|
|
9
|
+
*/
|
|
10
|
+
readonly label: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function ComboboxAction(props: ComboboxActionProps): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ComboboxAction, ComboboxActionProps } from "./ComboboxAction";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { XOR } from "ts-xor";
|
|
3
|
+
import { ComboboxOption } from "../../Combobox.types";
|
|
4
|
+
interface ComboboxCloseProps {
|
|
5
|
+
/**
|
|
6
|
+
* Callback function invoked upon the selection of an option. Provides the selected option(s) as an argument.
|
|
7
|
+
*/
|
|
8
|
+
readonly onSelect: (selection: ComboboxOption[]) => void;
|
|
9
|
+
}
|
|
10
|
+
interface ComoboboxSelectProps {
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* Callback function invoked upon the Combobox menu closing. Provides the selected option(s) as an argument.
|
|
14
|
+
*/
|
|
15
|
+
readonly onClose: (selection: ComboboxOption[]) => void;
|
|
16
|
+
}
|
|
17
|
+
interface ComboboxContentBaseProps {
|
|
18
|
+
/**
|
|
19
|
+
* List of selectable options to display.
|
|
20
|
+
*/
|
|
21
|
+
readonly options: ComboboxOption[];
|
|
22
|
+
/**
|
|
23
|
+
* Optional action button(s) to display at the bottom of the list.
|
|
24
|
+
*/
|
|
25
|
+
readonly children?: ReactElement | ReactElement[];
|
|
26
|
+
/**
|
|
27
|
+
* Placeholder text to display in the search input. Defaults to "Search".
|
|
28
|
+
*/
|
|
29
|
+
readonly searchPlaceholder?: string;
|
|
30
|
+
/**
|
|
31
|
+
* pre selected option
|
|
32
|
+
* @default ""
|
|
33
|
+
* @type string
|
|
34
|
+
*/
|
|
35
|
+
readonly selected: ComboboxOption[];
|
|
36
|
+
/**
|
|
37
|
+
* The encapsulating noun for the content of the combobox. Used
|
|
38
|
+
* in the empty state, and search placeholder. Should be pluralized.
|
|
39
|
+
*/
|
|
40
|
+
readonly subjectNoun?: string;
|
|
41
|
+
}
|
|
42
|
+
type ComboboxContentProps = ComboboxContentBaseProps & XOR<ComboboxCloseProps, ComoboboxSelectProps>;
|
|
43
|
+
export declare function ComboboxContent(props: ComboboxContentProps): JSX.Element;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { SetStateAction } from "react";
|
|
2
|
+
import { ComboboxOption } from "../../Combobox.types";
|
|
3
|
+
interface ComboboxListProps {
|
|
4
|
+
readonly options: ComboboxOption[];
|
|
5
|
+
readonly showEmptyState: boolean;
|
|
6
|
+
readonly selected: ComboboxOption[];
|
|
7
|
+
readonly optionsListRef: React.RefObject<HTMLUListElement>;
|
|
8
|
+
readonly setFirstSelectedElement: React.Dispatch<SetStateAction<HTMLElement | null>>;
|
|
9
|
+
readonly selectionHandler: (option: ComboboxOption) => void;
|
|
10
|
+
readonly searchValue: string;
|
|
11
|
+
readonly multiselect: boolean;
|
|
12
|
+
readonly subjectNoun?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function ComboboxList(props: ComboboxListProps): JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ComboboxContent } from "./ComboboxContent";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComboboxOption } from "../Combobox.types";
|
|
3
|
+
export declare function useComboboxAccessibility(selectionCallback: (selection: ComboboxOption) => void, filteredOptions: ComboboxOption[], optionsListRef: React.RefObject<HTMLUListElement>, open: boolean, setOpen: (open: boolean) => void, wrapperRef: React.RefObject<HTMLDivElement>): {
|
|
4
|
+
popperRef: React.RefObject<HTMLDivElement>;
|
|
5
|
+
popperStyles: {
|
|
6
|
+
[key: string]: React.CSSProperties;
|
|
7
|
+
};
|
|
8
|
+
attributes: {
|
|
9
|
+
[key: string]: {
|
|
10
|
+
[key: string]: string;
|
|
11
|
+
} | undefined;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComboboxOption } from "../Combobox.types";
|
|
3
|
+
interface useComboboxContent {
|
|
4
|
+
searchValue: string;
|
|
5
|
+
setSearchValue: React.Dispatch<React.SetStateAction<string>>;
|
|
6
|
+
setFirstSelectedElement: React.Dispatch<React.SetStateAction<HTMLElement | null>>;
|
|
7
|
+
filteredOptions: ComboboxOption[];
|
|
8
|
+
optionsListRef: React.RefObject<HTMLUListElement>;
|
|
9
|
+
selectedOptions: ComboboxOption[];
|
|
10
|
+
setInternalSelected: (selected: ComboboxOption[]) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function useComboboxContent(options: ComboboxOption[], open: boolean, selected: ComboboxOption[], onClose: ((selection: ComboboxOption[]) => void) | undefined): useComboboxContent;
|
|
13
|
+
export {};
|