@jobber/components 8.13.1 → 8.14.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/FilterPicker.d.ts +1 -0
- package/{Combobox.js → FilterPicker.js} +3 -3
- package/dist/Checkbox/Checkbox.d.ts +1 -1
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.cjs +11 -11
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.mjs +11 -11
- package/dist/DataList/components/DataListFilters/index.cjs +11 -11
- package/dist/DataList/components/DataListFilters/index.mjs +11 -11
- package/dist/DataList/components/DataListHeader/index.cjs +0 -1
- package/dist/DataList/components/DataListHeader/index.mjs +0 -1
- package/dist/DataList/components/DataListSearch/index.cjs +1 -2
- package/dist/DataList/components/DataListSearch/index.mjs +1 -2
- package/dist/DataList/index.cjs +11 -12
- package/dist/DataList/index.mjs +11 -12
- package/dist/DataListHeader-cjs.js +22 -5
- package/dist/DataListHeader-es.js +22 -5
- package/dist/DataListSearch-cjs.js +19 -2
- package/dist/DataListSearch-es.js +19 -2
- package/dist/DataListSort-cjs.js +5 -5
- package/dist/DataListSort-es.js +5 -5
- package/dist/FilterPicker/FilterPicker.d.ts +11 -0
- package/dist/{Combobox/Combobox.types.d.ts → FilterPicker/FilterPicker.types.d.ts} +51 -51
- package/dist/FilterPicker/FilterPickerProvider.d.ts +18 -0
- package/dist/FilterPicker/components/FilterPickerAction/FilterPickerAction.d.ts +3 -0
- package/dist/FilterPicker/components/FilterPickerAction/index.cjs +12 -0
- package/dist/FilterPicker/components/FilterPickerAction/index.d.ts +1 -0
- package/dist/FilterPicker/components/FilterPickerAction/index.mjs +6 -0
- package/dist/FilterPicker/components/FilterPickerActivator/FilterPickerActivator.d.ts +3 -0
- package/dist/{Combobox/components/ComboboxActivator → FilterPicker/components/FilterPickerActivator}/index.cjs +3 -3
- package/dist/FilterPicker/components/FilterPickerActivator/index.d.ts +1 -0
- package/dist/{Combobox/components/ComboboxActivator → FilterPicker/components/FilterPickerActivator}/index.mjs +2 -2
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContent.d.ts +3 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentHeader/FilterPickerContentHeader.d.ts +3 -0
- package/dist/{Combobox/components/ComboboxContent/ComboboxContentHeader → FilterPicker/components/FilterPickerContent/FilterPickerContentHeader}/index.cjs +2 -2
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentHeader/index.d.ts +1 -0
- package/dist/{Combobox/components/ComboboxContent/ComboboxContentHeader → FilterPicker/components/FilterPickerContent/FilterPickerContentHeader}/index.mjs +1 -1
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentList/FilterPickerContentList.d.ts +3 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentList/FilterPickerContentList.module.css.d.ts +13 -0
- package/dist/{Combobox/components/ComboboxContent/ComboboxContentList → FilterPicker/components/FilterPickerContent/FilterPickerContentList}/index.cjs +5 -5
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentList/index.d.ts +1 -0
- package/dist/{Combobox/components/ComboboxContent/ComboboxContentList → FilterPicker/components/FilterPickerContent/FilterPickerContentList}/index.mjs +4 -4
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentSearch/FilterPickerContentSearch.d.ts +3 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentSearch/index.cjs +10 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentSearch/index.d.ts +1 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentSearch/index.mjs +4 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerLoadMore/FilterPickerLoadMore.d.ts +6 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerLoadMore/index.cjs +9 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerLoadMore/index.d.ts +1 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerLoadMore/index.mjs +3 -0
- package/dist/{Combobox/components/ComboboxContent → FilterPicker/components/FilterPickerContent}/index.cjs +8 -8
- package/dist/FilterPicker/components/FilterPickerContent/index.d.ts +1 -0
- package/dist/{Combobox/components/ComboboxContent → FilterPicker/components/FilterPickerContent}/index.mjs +7 -7
- package/dist/FilterPicker/components/FilterPickerOption/FilterPickerOption.d.ts +3 -0
- package/dist/{Combobox/components/ComboboxOption → FilterPicker/components/FilterPickerOption}/index.cjs +3 -3
- package/dist/FilterPicker/components/FilterPickerOption/index.d.ts +1 -0
- package/dist/{Combobox/components/ComboboxOption → FilterPicker/components/FilterPickerOption}/index.mjs +2 -2
- package/dist/FilterPicker/components/FilterPickerTrigger/FilterPickerTrigger.d.ts +3 -0
- package/dist/{Combobox/components/ComboboxTrigger → FilterPicker/components/FilterPickerTrigger}/index.cjs +3 -3
- package/dist/FilterPicker/components/FilterPickerTrigger/index.d.ts +1 -0
- package/dist/{Combobox/components/ComboboxTrigger → FilterPicker/components/FilterPickerTrigger}/index.mjs +2 -2
- package/dist/FilterPicker/constants.d.ts +1 -0
- package/dist/FilterPicker/hooks/useFilterPicker.d.ts +17 -0
- package/dist/FilterPicker/hooks/useFilterPickerAccessibility.d.ts +9 -0
- package/dist/FilterPicker/hooks/useFilterPickerActivatorAccessibility.d.ts +2 -0
- package/dist/FilterPicker/hooks/useFilterPickerContent.d.ts +9 -0
- package/dist/FilterPicker/hooks/useFilterPickerValidation.d.ts +12 -0
- package/dist/FilterPicker/hooks/useMakeFilterPickerHandlers.d.ts +8 -0
- package/dist/{Combobox → FilterPicker}/index.cjs +13 -13
- package/dist/FilterPicker/index.d.ts +3 -0
- package/dist/{Combobox → FilterPicker}/index.mjs +11 -11
- package/dist/{Combobox-cjs.js → FilterPicker-cjs.js} +25 -25
- package/dist/{Combobox-es.js → FilterPicker-es.js} +25 -25
- package/dist/{ComboboxAction-cjs.js → FilterPickerAction-cjs.js} +5 -5
- package/dist/{ComboboxAction-es.js → FilterPickerAction-es.js} +5 -5
- package/dist/{ComboboxActivator-cjs.js → FilterPickerActivator-cjs.js} +8 -8
- package/dist/{ComboboxActivator-es.js → FilterPickerActivator-es.js} +9 -9
- package/dist/{ComboboxContent-cjs.js → FilterPickerContent-cjs.js} +19 -19
- package/dist/{ComboboxContent-es.js → FilterPickerContent-es.js} +20 -20
- package/dist/{ComboboxContentHeader-cjs.js → FilterPickerContentHeader-cjs.js} +4 -4
- package/dist/{ComboboxContentHeader-es.js → FilterPickerContentHeader-es.js} +4 -4
- package/dist/{ComboboxContentList-cjs.js → FilterPickerContentList-cjs.js} +7 -7
- package/dist/{ComboboxContentList-es.js → FilterPickerContentList-es.js} +7 -7
- package/dist/{ComboboxContentSearch-cjs.js → FilterPickerContentSearch-cjs.js} +4 -4
- package/dist/{ComboboxContentSearch-es.js → FilterPickerContentSearch-es.js} +4 -4
- package/dist/FilterPickerLoadMore-cjs.js +16 -0
- package/dist/{ComboboxLoadMore-es.js → FilterPickerLoadMore-es.js} +4 -4
- package/dist/{ComboboxOption-cjs.js → FilterPickerOption-cjs.js} +5 -5
- package/dist/{ComboboxOption-es.js → FilterPickerOption-es.js} +5 -5
- package/dist/FilterPickerProvider-cjs.js +13 -0
- package/dist/FilterPickerProvider-es.js +10 -0
- package/dist/{ComboboxTrigger-cjs.js → FilterPickerTrigger-cjs.js} +4 -4
- package/dist/{ComboboxTrigger-es.js → FilterPickerTrigger-es.js} +4 -4
- package/dist/constants-cjs.js +2 -2
- package/dist/constants-es.js +2 -2
- package/dist/docs/Autocomplete/Autocomplete.md +1 -1
- package/dist/docs/Banner/Banner.md +2 -2
- package/dist/docs/Box/Box.md +2 -2
- package/dist/docs/Card/Card.md +1 -1
- package/dist/docs/Chip/Chip.md +4 -4
- package/dist/docs/DataList/DataList.md +16 -15
- package/dist/docs/{Combobox/Combobox.md → FilterPicker/FilterPicker.md} +91 -85
- package/dist/docs/Icon/Icon.md +1 -1
- package/dist/docs/Menu/Menu.md +2 -2
- package/dist/docs/MultiSelect/MultiSelect.md +1 -1
- package/dist/docs/Tabs/Tabs.md +2 -2
- package/dist/docs/index.md +1 -2
- package/dist/docs/usage-guidelines/usage-guidelines.md +5 -5
- package/dist/index.cjs +14 -16
- package/dist/index.d.mts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.mjs +12 -13
- package/dist/styles.css +53 -53
- package/dist/utils/meta/meta.json +5 -7
- package/package.json +6 -11
- package/rollup.config.mjs +2 -2
- package/AnimatedSwitcher.d.ts +0 -1
- package/AnimatedSwitcher.js +0 -17
- package/Combobox.d.ts +0 -1
- package/dist/AnimatedSwitcher/AnimatedSwitcher.d.ts +0 -32
- package/dist/AnimatedSwitcher/index.cjs +0 -11
- package/dist/AnimatedSwitcher/index.d.ts +0 -1
- package/dist/AnimatedSwitcher/index.mjs +0 -5
- package/dist/AnimatedSwitcher/transitions.d.ts +0 -8
- package/dist/AnimatedSwitcher-cjs.js +0 -95
- package/dist/AnimatedSwitcher-es.js +0 -93
- package/dist/Combobox/Combobox.d.ts +0 -11
- package/dist/Combobox/ComboboxProvider.d.ts +0 -18
- package/dist/Combobox/components/ComboboxAction/ComboboxAction.d.ts +0 -3
- package/dist/Combobox/components/ComboboxAction/index.cjs +0 -12
- package/dist/Combobox/components/ComboboxAction/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxAction/index.mjs +0 -6
- package/dist/Combobox/components/ComboboxActivator/ComboboxActivator.d.ts +0 -3
- package/dist/Combobox/components/ComboboxActivator/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxContent.d.ts +0 -3
- package/dist/Combobox/components/ComboboxContent/ComboboxContentHeader/ComboboxContentHeader.d.ts +0 -3
- package/dist/Combobox/components/ComboboxContent/ComboboxContentHeader/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxContentList/ComboboxContentList.d.ts +0 -3
- package/dist/Combobox/components/ComboboxContent/ComboboxContentList/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxContentSearch/ComboboxContentSearch.d.ts +0 -3
- package/dist/Combobox/components/ComboboxContent/ComboboxContentSearch/index.cjs +0 -10
- package/dist/Combobox/components/ComboboxContent/ComboboxContentSearch/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxContentSearch/index.mjs +0 -4
- package/dist/Combobox/components/ComboboxContent/ComboboxLoadMore/ComboboxLoadMore.d.ts +0 -6
- package/dist/Combobox/components/ComboboxContent/ComboboxLoadMore/index.cjs +0 -9
- package/dist/Combobox/components/ComboboxContent/ComboboxLoadMore/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxLoadMore/index.mjs +0 -3
- package/dist/Combobox/components/ComboboxContent/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxOption/ComboboxOption.d.ts +0 -3
- package/dist/Combobox/components/ComboboxOption/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxTrigger/ComboboxTrigger.d.ts +0 -3
- package/dist/Combobox/components/ComboboxTrigger/index.d.ts +0 -1
- package/dist/Combobox/constants.d.ts +0 -1
- package/dist/Combobox/hooks/useCombobox.d.ts +0 -17
- package/dist/Combobox/hooks/useComboboxAccessibility.d.ts +0 -9
- package/dist/Combobox/hooks/useComboboxActivatorAccessibility.d.ts +0 -2
- package/dist/Combobox/hooks/useComboboxContent.d.ts +0 -9
- package/dist/Combobox/hooks/useComboboxValidation.d.ts +0 -12
- package/dist/Combobox/hooks/useMakeComboboxHandlers.d.ts +0 -8
- package/dist/Combobox/index.d.ts +0 -3
- package/dist/ComboboxLoadMore-cjs.js +0 -16
- package/dist/ComboboxProvider-cjs.js +0 -13
- package/dist/ComboboxProvider-es.js +0 -10
- package/dist/docs/AnimatedSwitcher/AnimatedSwitcher.md +0 -34
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var React = require('react');
|
|
4
|
-
var framerMotion = require('framer-motion');
|
|
5
|
-
var Icon = require('./Icon-cjs.js');
|
|
6
|
-
|
|
7
|
-
const DURATION_SIMPLE = 0.1;
|
|
8
|
-
const DURATION_AVERAGE = 0.2;
|
|
9
|
-
const FADE = {
|
|
10
|
-
visible: { opacity: 1 },
|
|
11
|
-
hidden: { opacity: 0 },
|
|
12
|
-
};
|
|
13
|
-
const SLIDE_IN_UP = {
|
|
14
|
-
visible: { y: 0, opacity: 1 },
|
|
15
|
-
hidden: { y: "10%", opacity: 0 },
|
|
16
|
-
};
|
|
17
|
-
const SLIDE_IN_DOWN = {
|
|
18
|
-
visible: { y: 0, opacity: 1 },
|
|
19
|
-
hidden: { y: "-10%", opacity: 0 },
|
|
20
|
-
};
|
|
21
|
-
const SPIN_COUNTER_CLOCK_WISE = {
|
|
22
|
-
visible: {
|
|
23
|
-
rotate: 0,
|
|
24
|
-
scale: 1,
|
|
25
|
-
transition: { duration: DURATION_AVERAGE, ease: "easeOut" },
|
|
26
|
-
},
|
|
27
|
-
hidden: {
|
|
28
|
-
rotate: 180,
|
|
29
|
-
scale: 0.6,
|
|
30
|
-
transition: { duration: DURATION_AVERAGE, ease: "easeIn" },
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
const SPIN_CLOCK_WISE = {
|
|
34
|
-
visible: {
|
|
35
|
-
rotate: 0,
|
|
36
|
-
scale: 1,
|
|
37
|
-
transition: { duration: DURATION_AVERAGE, ease: "easeOut" },
|
|
38
|
-
},
|
|
39
|
-
hidden: {
|
|
40
|
-
rotate: -180,
|
|
41
|
-
scale: 0.6,
|
|
42
|
-
transition: { duration: DURATION_AVERAGE, ease: "easeIn" },
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
function AnimatedSwitcher({ initialChild, switched, switchTo, type = "slideFromBottom", }) {
|
|
47
|
-
const [ref, setRef] = React.useState(null);
|
|
48
|
-
const isSwitchingBetweenIcons = initialChild.type === Icon.Icon && switchTo.type === Icon.Icon;
|
|
49
|
-
const { key, transition, child, duration } = getChildData();
|
|
50
|
-
return (React.createElement(framerMotion.AnimatePresence, { mode: "wait", initial: false },
|
|
51
|
-
React.createElement(framerMotion.motion.div, { ref: setRef, key: key, variants: transition, initial: "hidden", animate: "visible", exit: "hidden", transition: { duration }, style: { display: getDisplayValue() } }, child)));
|
|
52
|
-
function getDisplayValue() {
|
|
53
|
-
if (ref === null || ref === void 0 ? void 0 : ref.firstElementChild) {
|
|
54
|
-
return window.getComputedStyle(ref.firstElementChild).display;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function getChildData() {
|
|
58
|
-
let data = {
|
|
59
|
-
key: `${initialChild.type.toString()}_1`,
|
|
60
|
-
child: initialChild,
|
|
61
|
-
};
|
|
62
|
-
if (switched) {
|
|
63
|
-
data = { key: `${switchTo.type.toString()}_2`, child: switchTo };
|
|
64
|
-
}
|
|
65
|
-
return Object.assign(Object.assign({}, data), { transition: getTransitionType(), duration: getTransitionDuration() });
|
|
66
|
-
}
|
|
67
|
-
function getTransitionType() {
|
|
68
|
-
if (isSwitchingBetweenIcons) {
|
|
69
|
-
if (switched)
|
|
70
|
-
return SPIN_COUNTER_CLOCK_WISE;
|
|
71
|
-
return SPIN_CLOCK_WISE;
|
|
72
|
-
}
|
|
73
|
-
else if (type === "fade") {
|
|
74
|
-
return FADE;
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
if (switched)
|
|
78
|
-
return SLIDE_IN_UP;
|
|
79
|
-
return SLIDE_IN_DOWN;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
function getTransitionDuration() {
|
|
83
|
-
switch (type) {
|
|
84
|
-
case "fade":
|
|
85
|
-
return DURATION_AVERAGE;
|
|
86
|
-
default:
|
|
87
|
-
return DURATION_SIMPLE;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
AnimatedSwitcher.Icon = function AnimatedSwitcherIcon({ switchToIcon, switched, initialIcon, }) {
|
|
92
|
-
return (React.createElement(AnimatedSwitcher, { switched: switched, initialChild: React.createElement(Icon.Icon, { name: initialIcon }), switchTo: React.createElement(Icon.Icon, { name: switchToIcon }) }));
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
exports.AnimatedSwitcher = AnimatedSwitcher;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import React__default, { useState } from 'react';
|
|
2
|
-
import { AnimatePresence, motion } from 'framer-motion';
|
|
3
|
-
import { I as Icon } from './Icon-es.js';
|
|
4
|
-
|
|
5
|
-
const DURATION_SIMPLE = 0.1;
|
|
6
|
-
const DURATION_AVERAGE = 0.2;
|
|
7
|
-
const FADE = {
|
|
8
|
-
visible: { opacity: 1 },
|
|
9
|
-
hidden: { opacity: 0 },
|
|
10
|
-
};
|
|
11
|
-
const SLIDE_IN_UP = {
|
|
12
|
-
visible: { y: 0, opacity: 1 },
|
|
13
|
-
hidden: { y: "10%", opacity: 0 },
|
|
14
|
-
};
|
|
15
|
-
const SLIDE_IN_DOWN = {
|
|
16
|
-
visible: { y: 0, opacity: 1 },
|
|
17
|
-
hidden: { y: "-10%", opacity: 0 },
|
|
18
|
-
};
|
|
19
|
-
const SPIN_COUNTER_CLOCK_WISE = {
|
|
20
|
-
visible: {
|
|
21
|
-
rotate: 0,
|
|
22
|
-
scale: 1,
|
|
23
|
-
transition: { duration: DURATION_AVERAGE, ease: "easeOut" },
|
|
24
|
-
},
|
|
25
|
-
hidden: {
|
|
26
|
-
rotate: 180,
|
|
27
|
-
scale: 0.6,
|
|
28
|
-
transition: { duration: DURATION_AVERAGE, ease: "easeIn" },
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
const SPIN_CLOCK_WISE = {
|
|
32
|
-
visible: {
|
|
33
|
-
rotate: 0,
|
|
34
|
-
scale: 1,
|
|
35
|
-
transition: { duration: DURATION_AVERAGE, ease: "easeOut" },
|
|
36
|
-
},
|
|
37
|
-
hidden: {
|
|
38
|
-
rotate: -180,
|
|
39
|
-
scale: 0.6,
|
|
40
|
-
transition: { duration: DURATION_AVERAGE, ease: "easeIn" },
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
function AnimatedSwitcher({ initialChild, switched, switchTo, type = "slideFromBottom", }) {
|
|
45
|
-
const [ref, setRef] = useState(null);
|
|
46
|
-
const isSwitchingBetweenIcons = initialChild.type === Icon && switchTo.type === Icon;
|
|
47
|
-
const { key, transition, child, duration } = getChildData();
|
|
48
|
-
return (React__default.createElement(AnimatePresence, { mode: "wait", initial: false },
|
|
49
|
-
React__default.createElement(motion.div, { ref: setRef, key: key, variants: transition, initial: "hidden", animate: "visible", exit: "hidden", transition: { duration }, style: { display: getDisplayValue() } }, child)));
|
|
50
|
-
function getDisplayValue() {
|
|
51
|
-
if (ref === null || ref === void 0 ? void 0 : ref.firstElementChild) {
|
|
52
|
-
return window.getComputedStyle(ref.firstElementChild).display;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function getChildData() {
|
|
56
|
-
let data = {
|
|
57
|
-
key: `${initialChild.type.toString()}_1`,
|
|
58
|
-
child: initialChild,
|
|
59
|
-
};
|
|
60
|
-
if (switched) {
|
|
61
|
-
data = { key: `${switchTo.type.toString()}_2`, child: switchTo };
|
|
62
|
-
}
|
|
63
|
-
return Object.assign(Object.assign({}, data), { transition: getTransitionType(), duration: getTransitionDuration() });
|
|
64
|
-
}
|
|
65
|
-
function getTransitionType() {
|
|
66
|
-
if (isSwitchingBetweenIcons) {
|
|
67
|
-
if (switched)
|
|
68
|
-
return SPIN_COUNTER_CLOCK_WISE;
|
|
69
|
-
return SPIN_CLOCK_WISE;
|
|
70
|
-
}
|
|
71
|
-
else if (type === "fade") {
|
|
72
|
-
return FADE;
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
if (switched)
|
|
76
|
-
return SLIDE_IN_UP;
|
|
77
|
-
return SLIDE_IN_DOWN;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
function getTransitionDuration() {
|
|
81
|
-
switch (type) {
|
|
82
|
-
case "fade":
|
|
83
|
-
return DURATION_AVERAGE;
|
|
84
|
-
default:
|
|
85
|
-
return DURATION_SIMPLE;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
AnimatedSwitcher.Icon = function AnimatedSwitcherIcon({ switchToIcon, switched, initialIcon, }) {
|
|
90
|
-
return (React__default.createElement(AnimatedSwitcher, { switched: switched, initialChild: React__default.createElement(Icon, { name: initialIcon }), switchTo: React__default.createElement(Icon, { name: switchToIcon }) }));
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
export { AnimatedSwitcher as A };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { ComboboxProps } from "./Combobox.types";
|
|
3
|
-
import { ComboboxAction } from "./components/ComboboxAction";
|
|
4
|
-
import { ComboboxOption as ComboboxOptionComponent } from "./components/ComboboxOption/ComboboxOption";
|
|
5
|
-
import { ComboboxActivator } from "./components/ComboboxActivator";
|
|
6
|
-
export declare function Combobox(props: ComboboxProps): React.JSX.Element;
|
|
7
|
-
export declare namespace Combobox {
|
|
8
|
-
var Activator: typeof ComboboxActivator;
|
|
9
|
-
var Action: typeof ComboboxAction;
|
|
10
|
-
var Option: typeof ComboboxOptionComponent;
|
|
11
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { RefObject } from "react";
|
|
3
|
-
import { type ComboboxOption } from "./Combobox.types";
|
|
4
|
-
export interface ComboboxProviderProps {
|
|
5
|
-
readonly children: React.ReactNode;
|
|
6
|
-
readonly selected: ComboboxOption[];
|
|
7
|
-
readonly selectionHandler: (option: ComboboxOption) => void;
|
|
8
|
-
readonly open: boolean;
|
|
9
|
-
readonly handleClose: () => void;
|
|
10
|
-
readonly handleOpen: () => void;
|
|
11
|
-
readonly shouldScroll: RefObject<boolean>;
|
|
12
|
-
readonly searchValue: string;
|
|
13
|
-
readonly label?: string;
|
|
14
|
-
readonly onClear?: () => void;
|
|
15
|
-
readonly onSelectAll?: (selection: ComboboxOption[]) => void;
|
|
16
|
-
}
|
|
17
|
-
export declare const ComboboxContext: React.Context<Omit<ComboboxProviderProps, "children">>;
|
|
18
|
-
export declare function ComboboxContextProvider({ children, ...props }: ComboboxProviderProps): React.JSX.Element;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var ComboboxAction = require('../../../ComboboxAction-cjs.js');
|
|
4
|
-
require('react');
|
|
5
|
-
require('../../../Typography-cjs.js');
|
|
6
|
-
require('classnames');
|
|
7
|
-
require('../../../ComboboxProvider-cjs.js');
|
|
8
|
-
require('../../../tslib.es6-cjs.js');
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
exports.ComboboxAction = ComboboxAction.ComboboxAction;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ComboboxAction } from "./ComboboxAction";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./ComboboxActivator";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ComboboxContentHeader } from "./ComboboxContentHeader";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ComboboxContentList } from "./ComboboxContentList";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var ComboboxContentSearch = require('../../../../ComboboxContentSearch-cjs.js');
|
|
4
|
-
require('react');
|
|
5
|
-
require('../../../../Icon-cjs.js');
|
|
6
|
-
require('@jobber/design');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
exports.ComboboxContentSearch = ComboboxContentSearch.ComboboxContentSearch;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ComboboxContentSearch } from "./ComboboxContentSearch";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ComboboxLoadMore } from "./ComboboxLoadMore";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ComboboxContent } from "./ComboboxContent";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./ComboboxOption";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ComboboxTrigger } from "./ComboboxTrigger";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const COMBOBOX_MENU_ID = "ATL-Combobox-Content";
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Dispatch, MutableRefObject } from "react";
|
|
2
|
-
import type React from "react";
|
|
3
|
-
import type { UseMakeComboboxHandlersReturn } from "./useMakeComboboxHandlers";
|
|
4
|
-
import { type ComboboxOption } from "../Combobox.types";
|
|
5
|
-
type UseComboboxReturn = {
|
|
6
|
-
wrapperRef: React.RefObject<HTMLDivElement | null>;
|
|
7
|
-
searchValue: string;
|
|
8
|
-
setSearchValue: Dispatch<React.SetStateAction<string>>;
|
|
9
|
-
open: boolean;
|
|
10
|
-
selectedOptions: ComboboxOption[];
|
|
11
|
-
selectedStateSetter: (selection: ComboboxOption[]) => void;
|
|
12
|
-
shouldScroll: MutableRefObject<boolean>;
|
|
13
|
-
internalFilteredOptions: ComboboxOption[];
|
|
14
|
-
handleSearchChange: (value: string) => void;
|
|
15
|
-
} & UseMakeComboboxHandlersReturn;
|
|
16
|
-
export declare function useCombobox(selected: ComboboxOption[], onSelect: (selection: ComboboxOption[]) => void, options: ComboboxOption[], onClose?: () => void, multiSelect?: boolean, onSearch?: (searchValue: string) => void, debounceTime?: number): UseComboboxReturn;
|
|
17
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { UseInteractionsReturn } from "@floating-ui/react";
|
|
2
|
-
import { type ComboboxOption } from "../Combobox.types";
|
|
3
|
-
export declare function useComboboxAccessibility(selectionCallback: (selection: ComboboxOption) => void, filteredOptions: ComboboxOption[], optionsListRef: React.RefObject<HTMLUListElement | null>, open: boolean, wrapperRef: React.RefObject<HTMLDivElement | null>): {
|
|
4
|
-
floatingRef: React.RefObject<HTMLDivElement | null>;
|
|
5
|
-
floatingStyles: React.CSSProperties;
|
|
6
|
-
floatingProps: ReturnType<UseInteractionsReturn["getFloatingProps"]>;
|
|
7
|
-
nodeId?: string;
|
|
8
|
-
parentNodeId: string | null;
|
|
9
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { RefObject } from "react";
|
|
2
|
-
import { type ComboboxOption } from "../Combobox.types";
|
|
3
|
-
interface useComboboxContent {
|
|
4
|
-
optionsListRef: RefObject<HTMLUListElement | null>;
|
|
5
|
-
onClear?: () => void;
|
|
6
|
-
onSelectAll?: (selection: ComboboxOption[]) => void;
|
|
7
|
-
}
|
|
8
|
-
export declare function useComboboxContent(open: boolean, selected: ComboboxOption[]): useComboboxContent;
|
|
9
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ReactElement } from "react";
|
|
2
|
-
import { type ComboboxActionProps, type ComboboxActivatorProps, type ComboboxOptionProps, type ComboboxProps } from "../Combobox.types";
|
|
3
|
-
export declare const COMBOBOX_TRIGGER_COUNT_ERROR_MESSAGE = "Combobox must have exactly one Trigger element";
|
|
4
|
-
export declare function useComboboxValidation(children?: ComboboxProps["children"]): {
|
|
5
|
-
triggerElement?: ReactElement<ComboboxActivatorProps>;
|
|
6
|
-
optionElements?: ReactElement<ComboboxOptionProps>[];
|
|
7
|
-
actionElements?: ReactElement<ComboboxActionProps>[];
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Return all instances child component that matches the `type` provided
|
|
11
|
-
*/
|
|
12
|
-
export declare function getCompoundComponents<T>(type: ReactElement<T>["type"], children?: ComboboxProps["children"]): ReactElement<T>[];
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type React from "react";
|
|
2
|
-
import { type ComboboxOption } from "../Combobox.types";
|
|
3
|
-
export interface UseMakeComboboxHandlersReturn {
|
|
4
|
-
handleClose: () => void;
|
|
5
|
-
handleSelection: (selection: ComboboxOption) => void;
|
|
6
|
-
handleOpen: () => void;
|
|
7
|
-
}
|
|
8
|
-
export declare function useMakeComboboxHandlers(setOpen: (open: boolean) => void, open: boolean, setSearchValue: (searchValue: string) => void, selectedOptions: ComboboxOption[], shouldScroll: React.RefObject<boolean>, selectedStateSetter: (selected: ComboboxOption[]) => void, multiSelect?: boolean, onClose?: () => void, onSearch?: (searchValue: string) => void): UseMakeComboboxHandlersReturn;
|
package/dist/Combobox/index.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var React = require('react');
|
|
4
|
-
var jobberHooks = require('@jobber/hooks');
|
|
5
|
-
|
|
6
|
-
var styles = {"trigger":"jPB--ZCYNNI-","spinning":"aW61BrnGmcw-"};
|
|
7
|
-
|
|
8
|
-
function ComboboxLoadMore({ onLoadMore }) {
|
|
9
|
-
const [inViewRef, isInView] = jobberHooks.useInView();
|
|
10
|
-
React.useEffect(() => {
|
|
11
|
-
isInView && onLoadMore();
|
|
12
|
-
}, [isInView]);
|
|
13
|
-
return (React.createElement("div", { "data-testid": "ATL-Combobox-Loadmore-Trigger", ref: inViewRef, className: styles.trigger }));
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
exports.ComboboxLoadMore = ComboboxLoadMore;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var tslib_es6 = require('./tslib.es6-cjs.js');
|
|
4
|
-
var React = require('react');
|
|
5
|
-
|
|
6
|
-
const ComboboxContext = React.createContext({});
|
|
7
|
-
function ComboboxContextProvider(_a) {
|
|
8
|
-
var { children } = _a, props = tslib_es6.__rest(_a, ["children"]);
|
|
9
|
-
return (React.createElement(ComboboxContext.Provider, { value: props }, children));
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
exports.ComboboxContext = ComboboxContext;
|
|
13
|
-
exports.ComboboxContextProvider = ComboboxContextProvider;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { _ as __rest } from './tslib.es6-es.js';
|
|
2
|
-
import React__default from 'react';
|
|
3
|
-
|
|
4
|
-
const ComboboxContext = React__default.createContext({});
|
|
5
|
-
function ComboboxContextProvider(_a) {
|
|
6
|
-
var { children } = _a, props = __rest(_a, ["children"]);
|
|
7
|
-
return (React__default.createElement(ComboboxContext.Provider, { value: props }, children));
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export { ComboboxContextProvider as C, ComboboxContext as a };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# AnimatedSwitcher
|
|
2
|
-
|
|
3
|
-
Smoothly switch between two components that aim to add delight when the user
|
|
4
|
-
interacts with them.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Configuration
|
|
8
|
-
|
|
9
|
-
Animating between 2 icons is done in a more opinionated way where it would spin
|
|
10
|
-
from 1 icon to another. The animation reverses when you want to go back to the
|
|
11
|
-
initial icon. See
|
|
12
|
-
[AnimatedSwitcher/Icon example](/storybook/web/?path=/story/components-utilities-animatedswitcher--icon).
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
## Props
|
|
16
|
-
|
|
17
|
-
### Web
|
|
18
|
-
|
|
19
|
-
#### AnimatedSwitcher
|
|
20
|
-
|
|
21
|
-
| Prop | Type | Required | Default | Description |
|
|
22
|
-
|------|------|----------|---------|-------------|
|
|
23
|
-
| `initialChild` | `ReactElement<unknown, string | JSXElementConstructor<any>>` | Yes | — | The component that shows up when the `switched` prop is `false` |
|
|
24
|
-
| `switched` | `boolean` | Yes | `false` | Determines when to switch the component to the `switchTo` prop. |
|
|
25
|
-
| `switchTo` | `ReactElement<unknown, string | JSXElementConstructor<any>>` | Yes | — | The component that shows up when the `switched` prop is `true` |
|
|
26
|
-
| `type` | `"fade" | "slideFromBottom"` | No | `slideFromBottom` | Change the transition between 2 elements. |
|
|
27
|
-
|
|
28
|
-
#### AnimatedSwitcher.Icon
|
|
29
|
-
|
|
30
|
-
| Prop | Type | Required | Default | Description |
|
|
31
|
-
|------|------|----------|---------|-------------|
|
|
32
|
-
| `initialIcon` | `IconNames` | Yes | — | |
|
|
33
|
-
| `switched` | `boolean` | Yes | `false` | Determines when to switch the component to the `switchTo` prop. |
|
|
34
|
-
| `switchToIcon` | `IconNames` | Yes | — | |
|