@jobber/components 4.79.0 → 4.79.1-JOB-85851.2
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/StatusIndicator.d.ts +1 -0
- package/StatusIndicator.js +17 -0
- package/dist/AnimatedPresence/index.js +5 -99
- package/dist/AnimatedPresence-20a02aaa.js +104 -0
- package/dist/Autocomplete/Menu.d.ts +2 -2
- package/dist/Autocomplete/index.js +16 -11
- package/dist/Banner/index.js +8 -7
- package/dist/Button/index.js +2 -2
- package/dist/{Button-b73a5e01.js → Button-6b922fc1.js} +1 -1
- package/dist/ButtonDismiss/ButtonDismiss.d.ts +1 -1
- package/dist/ButtonDismiss/index.js +3 -3
- package/dist/{ButtonDismiss-350af163.js → ButtonDismiss-a3ba1de2.js} +1 -1
- package/dist/Card/CardClickable.d.ts +1 -1
- package/dist/Card/index.js +7 -7
- package/dist/{Card-426a68a8.js → Card-74f078a4.js} +4 -4
- package/dist/Checkbox/index.js +3 -4
- package/dist/{Checkbox-99f6297f.js → Checkbox-e481a4b1.js} +2 -3
- package/dist/Chip/index.js +5 -3
- package/dist/{Chip-c91fd6c8.js → Chip-76f18555.js} +2 -2
- package/dist/Chips/index.js +9 -8
- package/dist/Combobox/Combobox.types.d.ts +4 -0
- package/dist/Combobox/components/ComboboxOption/ComboboxOption.d.ts +2 -1
- package/dist/Combobox/hooks/useMakeComboboxHandlers.d.ts +1 -1
- package/dist/Combobox/index.js +12 -8
- package/dist/{Combobox-d4b84edf.js → Combobox-6d864202.js} +25 -20
- package/dist/ConfirmationModal/index.js +11 -10
- package/dist/{ConfirmationModal-f1a049fb.js → ConfirmationModal-387aa1b5.js} +2 -2
- package/dist/DataDump/index.js +8 -8
- package/dist/DataList/DataList.const.d.ts +1 -0
- package/dist/DataList/DataList.types.d.ts +0 -1
- package/dist/DataList/components/DataListActionsMenu/DataListActionsMenu.d.ts +2 -2
- package/dist/DataList/components/DataListTotalCount/DataListTotalCount.d.ts +2 -2
- package/dist/DataList/index.js +40 -40
- package/dist/DataTable/BodyLoading.d.ts +1 -1
- package/dist/DataTable/Footer.d.ts +2 -2
- package/dist/DataTable/SortIcon.d.ts +1 -1
- package/dist/DataTable/index.js +7 -8
- package/dist/DatePicker/index.js +3 -3
- package/dist/{DatePicker-64c5ab1a.js → DatePicker-dd9173c7.js} +2 -2
- package/dist/DescriptionList/DescriptionList.d.ts +1 -1
- package/dist/DescriptionList/index.js +2 -2
- package/dist/Disclosure/index.js +1 -1
- package/dist/Drawer/DrawerGrid.d.ts +1 -1
- package/dist/Drawer/index.js +11 -11
- package/dist/Emphasis/Emphasis.d.ts +2 -2
- package/dist/Emphasis/index.js +2 -2
- package/dist/{Emphasis-bda56d3b.js → Emphasis-a77d8ee9.js} +1 -1
- package/dist/FeatureSwitch/index.js +9 -8
- package/dist/Flex/index.js +5 -33
- package/dist/Flex-d490c4db.js +38 -0
- package/dist/FormField/FormFieldAffix.d.ts +2 -2
- package/dist/FormField/index.js +5 -6
- package/dist/{FormField-b4e6c549.js → FormField-3ec1c85d.js} +5 -6
- package/dist/FormatFile/FormatFileDeleteButton.d.ts +2 -2
- package/dist/FormatFile/index.js +13 -12
- package/dist/{FormatFile-652edda8.js → FormatFile-5ba4cf69.js} +7 -7
- package/dist/Gallery/index.js +15 -13
- package/dist/Glimmer/index.js +1 -1
- package/dist/{Glimmer-7c317864.js → Glimmer-84dee1ed.js} +1 -1
- package/dist/Heading/index.js +4 -3
- package/dist/{Heading-1e8e4bd3.js → Heading-bae3c69e.js} +3 -3
- package/dist/InlineLabel/InlineLabel.d.ts +3 -3
- package/dist/InlineLabel/index.js +2 -2
- package/dist/{InlineLabel-a6557829.js → InlineLabel-4d463bd6.js} +1 -1
- package/dist/InputAvatar/index.js +5 -6
- package/dist/InputDate/index.js +6 -7
- package/dist/InputEmail/index.js +5 -6
- package/dist/InputFile/InputFile.d.ts +1 -1
- package/dist/InputFile/index.js +5 -6
- package/dist/{InputFile-c9eeb04b.js → InputFile-20b9074a.js} +7 -5
- package/dist/InputNumber/InputNumber.d.ts +1 -1
- package/dist/InputNumber/index.js +6 -7
- package/dist/{InputNumber-ceae3872.js → InputNumber-75ae72b9.js} +1 -1
- package/dist/InputPassword/InputPassword.d.ts +2 -2
- package/dist/InputPassword/index.js +5 -6
- package/dist/InputPhoneNumber/index.js +5 -6
- package/dist/InputText/index.js +7 -7
- package/dist/{InputText-6e356985.js → InputText-de22af8c.js} +3 -2
- package/dist/InputTime/index.js +5 -6
- package/dist/InputValidation/index.js +3 -3
- package/dist/{InputValidation-05e839fa.js → InputValidation-a92bb519.js} +1 -1
- package/dist/LightBox/LightBox.d.ts +2 -2
- package/dist/LightBox/index.js +5 -4
- package/dist/{LightBox-a89d8863.js → LightBox-7efe8932.js} +7 -3
- package/dist/List/index.js +7 -6
- package/dist/Markdown/index.js +7 -6
- package/dist/{Markdown-f7c55304.js → Markdown-b1b65457.js} +3 -3
- package/dist/Menu/Menu.d.ts +4 -4
- package/dist/Menu/index.js +4 -4
- package/dist/{Menu-81b12936.js → Menu-d6dd673e.js} +6 -6
- package/dist/Modal/Modal.d.ts +2 -2
- package/dist/Modal/index.js +7 -6
- package/dist/{Modal-a0627c92.js → Modal-5b866c72.js} +7 -5
- package/dist/MultiSelect/index.js +3 -4
- package/dist/{Option-8565da71.js → Option-c4b05656.js} +1 -1
- package/dist/Page/index.js +9 -9
- package/dist/Popover/index.js +8 -4
- package/dist/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/RadioGroup/index.js +3 -4
- package/dist/{RadioGroup-ca7a5978.js → RadioGroup-678f4932.js} +3 -4
- package/dist/RecurringSelect/CurrentRecurrenceComponent.d.ts +2 -2
- package/dist/RecurringSelect/components/DayOfMonthSelect.d.ts +2 -2
- package/dist/RecurringSelect/components/MonthlyDayOfWeekSelect.d.ts +2 -2
- package/dist/RecurringSelect/components/MonthlySelect.d.ts +2 -2
- package/dist/RecurringSelect/components/WeeklySelect.d.ts +2 -2
- package/dist/RecurringSelect/index.js +10 -11
- package/dist/Select/index.js +6 -7
- package/dist/StatusIndicator/StatusIndicator.d.ts +7 -0
- package/dist/StatusIndicator/StatusIndicator.type.d.ts +1 -0
- package/dist/StatusIndicator/index.d.ts +2 -0
- package/dist/StatusIndicator/index.js +11 -0
- package/dist/StatusIndicator-7b5258ea.js +18 -0
- package/dist/StatusLabel/StatusLabel.d.ts +3 -3
- package/dist/StatusLabel/index.js +8 -10
- package/dist/Switch/index.js +2 -2
- package/dist/{Switch-7d4aa7c3.js → Switch-eac89586.js} +1 -1
- package/dist/Table/Body.d.ts +1 -1
- package/dist/Table/Cells/Cell.d.ts +2 -2
- package/dist/Table/Cells/CellCurrency.d.ts +2 -2
- package/dist/Table/Cells/CellNumeric.d.ts +1 -1
- package/dist/Table/Footer.d.ts +1 -1
- package/dist/Table/Header.d.ts +1 -1
- package/dist/Table/Row.d.ts +1 -1
- package/dist/Table/Table.d.ts +1 -1
- package/dist/Tabs/index.js +1 -1
- package/dist/Text/Text.d.ts +1 -1
- package/dist/Text/index.js +2 -2
- package/dist/{Text-259af966.js → Text-fbeaaca6.js} +1 -1
- package/dist/Toast/index.js +2 -2
- package/dist/Tooltip/index.js +3 -1
- package/dist/{Tooltip-27771182.js → Tooltip-b9de6e57.js} +6 -3
- package/dist/Typography/Typography.d.ts +1 -1
- package/dist/Typography/css/TextColors.css.d.ts +1 -0
- package/dist/Typography/index.js +1 -1
- package/dist/{Typography-c45bf216.js → Typography-e2a23b7e.js} +2 -2
- package/dist/useAtlantisConfig-ed0bee66.js +16 -0
- package/dist/utils/useAtlantisConfig.d.ts +3 -0
- package/package.json +8 -12
- package/rollup.config.js +0 -1
- package/dist/getAtlantisConfig-0f3e8af2.js +0 -13
- package/dist/utils/getAtlantisConfig.d.ts +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dist/StatusIndicator";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true,
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var StatusIndicator = require("./dist/StatusIndicator");
|
|
8
|
+
|
|
9
|
+
Object.keys(StatusIndicator).forEach(function(key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
Object.defineProperty(exports, key, {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function get() {
|
|
14
|
+
return StatusIndicator[key];
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -2,105 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
var AnimatedPresence = require('../AnimatedPresence-20a02aaa.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('framer-motion');
|
|
8
|
+
require('@jobber/design');
|
|
8
9
|
|
|
9
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
10
|
|
|
11
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
const TIMING_BASE = toSeconds(design.tokens["timing-base"]);
|
|
15
|
-
const baseTransition = {
|
|
16
|
-
visible: { opacity: 1 },
|
|
17
|
-
hidden: { opacity: 0 },
|
|
18
|
-
};
|
|
19
|
-
const fade = {
|
|
20
|
-
visible: { opacity: 1 },
|
|
21
|
-
hidden: { opacity: 0 },
|
|
22
|
-
};
|
|
23
|
-
const popIn = {
|
|
24
|
-
visible: Object.assign({ scale: 1 }, baseTransition.visible),
|
|
25
|
-
hidden: Object.assign({ scale: 0.95 }, baseTransition.hidden),
|
|
26
|
-
};
|
|
27
|
-
const fromTop = {
|
|
28
|
-
visible: Object.assign({ y: 0 }, baseTransition.visible),
|
|
29
|
-
hidden: Object.assign({ y: -design.tokens["space-base"] }, baseTransition.hidden),
|
|
30
|
-
};
|
|
31
|
-
const fromBottom = {
|
|
32
|
-
visible: Object.assign({ y: 0 }, baseTransition.visible),
|
|
33
|
-
hidden: Object.assign({ y: design.tokens["space-base"] }, baseTransition.hidden),
|
|
34
|
-
};
|
|
35
|
-
const fromLeft = {
|
|
36
|
-
visible: Object.assign({ x: 0 }, baseTransition.visible),
|
|
37
|
-
hidden: Object.assign({ x: -design.tokens["space-base"] }, baseTransition.hidden),
|
|
38
|
-
};
|
|
39
|
-
const fromRight = {
|
|
40
|
-
visible: Object.assign({ x: 0 }, baseTransition.visible),
|
|
41
|
-
hidden: Object.assign({ x: design.tokens["space-base"] }, baseTransition.hidden),
|
|
42
|
-
};
|
|
43
|
-
const fromLeftToRight = {
|
|
44
|
-
initial: Object.assign({ x: -design.tokens["space-base"] }, baseTransition.hidden),
|
|
45
|
-
visible: Object.assign({ x: 0 }, baseTransition.visible),
|
|
46
|
-
hidden: Object.assign({ x: design.tokens["space-base"] }, baseTransition.hidden),
|
|
47
|
-
};
|
|
48
|
-
const fromRightToLeft = {
|
|
49
|
-
initial: Object.assign({ x: design.tokens["space-base"] }, baseTransition.hidden),
|
|
50
|
-
visible: Object.assign({ x: 0 }, baseTransition.visible),
|
|
51
|
-
hidden: Object.assign({ x: -design.tokens["space-base"] }, baseTransition.hidden),
|
|
52
|
-
};
|
|
53
|
-
function toSeconds(ms) {
|
|
54
|
-
return ms / 1000;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function usePreviousValue(value) {
|
|
58
|
-
const [previousValue, setPreviousValue] = React.useState(value);
|
|
59
|
-
React.useEffect(() => {
|
|
60
|
-
setPreviousValue(value);
|
|
61
|
-
}, [value]);
|
|
62
|
-
return [previousValue, setPreviousValue];
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const transitions = {
|
|
66
|
-
fromBottom,
|
|
67
|
-
fromTop,
|
|
68
|
-
fromLeft,
|
|
69
|
-
fromRight,
|
|
70
|
-
popIn,
|
|
71
|
-
fromLeftToRight,
|
|
72
|
-
fromRightToLeft,
|
|
73
|
-
fade,
|
|
74
|
-
};
|
|
75
|
-
function AnimatedPresence(props) {
|
|
76
|
-
const shouldReduceMotion = framerMotion.useReducedMotion();
|
|
77
|
-
if (shouldReduceMotion) {
|
|
78
|
-
return React__default["default"].createElement(React__default["default"].Fragment, null, props.children);
|
|
79
|
-
}
|
|
80
|
-
return React__default["default"].createElement(InternalAnimatedPresence, Object.assign({}, props));
|
|
81
|
-
}
|
|
82
|
-
function InternalAnimatedPresence({ transition = "fromTop", initial = false, children, }) {
|
|
83
|
-
const transitionVariation = transitions[transition];
|
|
84
|
-
const hasInitialTransition = "initial" in transitionVariation;
|
|
85
|
-
const childCount = React.Children.count(children);
|
|
86
|
-
// Set the initial value to 0 so it staggers the animation on mount when
|
|
87
|
-
// initial is true.
|
|
88
|
-
const [lastChildIndex, setLastChildIndex] = usePreviousValue(0);
|
|
89
|
-
// Whenever the children count changes, update the last index.
|
|
90
|
-
React.useEffect(() => {
|
|
91
|
-
setLastChildIndex(childCount - 1);
|
|
92
|
-
}, [childCount]);
|
|
93
|
-
return (React__default["default"].createElement(framerMotion.AnimatePresence, { initial: initial, mode: "popLayout" }, React.Children.map(children, (child, i) => child && (React__default["default"].createElement(framerMotion.motion.div, { layout: true, variants: transitionVariation, initial: hasInitialTransition ? "initial" : "hidden", animate: "visible", exit: "hidden", transition: {
|
|
94
|
-
duration: TIMING_BASE,
|
|
95
|
-
delay: generateDelayTime(i),
|
|
96
|
-
} }, child)))));
|
|
97
|
-
function generateDelayTime(index) {
|
|
98
|
-
// Don't add a delay if it's already rendered.
|
|
99
|
-
if (lastChildIndex > index)
|
|
100
|
-
return 0;
|
|
101
|
-
// Stagger the animation starting after the previous last child index.
|
|
102
|
-
return (index - lastChildIndex) * TIMING_QUICK;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
exports.AnimatedPresence = AnimatedPresence;
|
|
12
|
+
exports.AnimatedPresence = AnimatedPresence.AnimatedPresence;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var framerMotion = require('framer-motion');
|
|
5
|
+
var design = require('@jobber/design');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
10
|
+
|
|
11
|
+
const TIMING_QUICK = toSeconds(design.tokens["timing-quick"]);
|
|
12
|
+
const TIMING_BASE = toSeconds(design.tokens["timing-base"]);
|
|
13
|
+
const baseTransition = {
|
|
14
|
+
visible: { opacity: 1 },
|
|
15
|
+
hidden: { opacity: 0 },
|
|
16
|
+
};
|
|
17
|
+
const fade = {
|
|
18
|
+
visible: { opacity: 1 },
|
|
19
|
+
hidden: { opacity: 0 },
|
|
20
|
+
};
|
|
21
|
+
const popIn = {
|
|
22
|
+
visible: Object.assign({ scale: 1 }, baseTransition.visible),
|
|
23
|
+
hidden: Object.assign({ scale: 0.95 }, baseTransition.hidden),
|
|
24
|
+
};
|
|
25
|
+
const fromTop = {
|
|
26
|
+
visible: Object.assign({ y: 0 }, baseTransition.visible),
|
|
27
|
+
hidden: Object.assign({ y: -design.tokens["space-base"] }, baseTransition.hidden),
|
|
28
|
+
};
|
|
29
|
+
const fromBottom = {
|
|
30
|
+
visible: Object.assign({ y: 0 }, baseTransition.visible),
|
|
31
|
+
hidden: Object.assign({ y: design.tokens["space-base"] }, baseTransition.hidden),
|
|
32
|
+
};
|
|
33
|
+
const fromLeft = {
|
|
34
|
+
visible: Object.assign({ x: 0 }, baseTransition.visible),
|
|
35
|
+
hidden: Object.assign({ x: -design.tokens["space-base"] }, baseTransition.hidden),
|
|
36
|
+
};
|
|
37
|
+
const fromRight = {
|
|
38
|
+
visible: Object.assign({ x: 0 }, baseTransition.visible),
|
|
39
|
+
hidden: Object.assign({ x: design.tokens["space-base"] }, baseTransition.hidden),
|
|
40
|
+
};
|
|
41
|
+
const fromLeftToRight = {
|
|
42
|
+
initial: Object.assign({ x: -design.tokens["space-base"] }, baseTransition.hidden),
|
|
43
|
+
visible: Object.assign({ x: 0 }, baseTransition.visible),
|
|
44
|
+
hidden: Object.assign({ x: design.tokens["space-base"] }, baseTransition.hidden),
|
|
45
|
+
};
|
|
46
|
+
const fromRightToLeft = {
|
|
47
|
+
initial: Object.assign({ x: design.tokens["space-base"] }, baseTransition.hidden),
|
|
48
|
+
visible: Object.assign({ x: 0 }, baseTransition.visible),
|
|
49
|
+
hidden: Object.assign({ x: -design.tokens["space-base"] }, baseTransition.hidden),
|
|
50
|
+
};
|
|
51
|
+
function toSeconds(ms) {
|
|
52
|
+
return ms / 1000;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function usePreviousValue(value) {
|
|
56
|
+
const [previousValue, setPreviousValue] = React.useState(value);
|
|
57
|
+
React.useEffect(() => {
|
|
58
|
+
setPreviousValue(value);
|
|
59
|
+
}, [value]);
|
|
60
|
+
return [previousValue, setPreviousValue];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const transitions = {
|
|
64
|
+
fromBottom,
|
|
65
|
+
fromTop,
|
|
66
|
+
fromLeft,
|
|
67
|
+
fromRight,
|
|
68
|
+
popIn,
|
|
69
|
+
fromLeftToRight,
|
|
70
|
+
fromRightToLeft,
|
|
71
|
+
fade,
|
|
72
|
+
};
|
|
73
|
+
function AnimatedPresence(props) {
|
|
74
|
+
const shouldReduceMotion = framerMotion.useReducedMotion();
|
|
75
|
+
if (shouldReduceMotion) {
|
|
76
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null, props.children);
|
|
77
|
+
}
|
|
78
|
+
return React__default["default"].createElement(InternalAnimatedPresence, Object.assign({}, props));
|
|
79
|
+
}
|
|
80
|
+
function InternalAnimatedPresence({ transition = "fromTop", initial = false, children, }) {
|
|
81
|
+
const transitionVariation = transitions[transition];
|
|
82
|
+
const hasInitialTransition = "initial" in transitionVariation;
|
|
83
|
+
const childCount = React.Children.count(children);
|
|
84
|
+
// Set the initial value to 0 so it staggers the animation on mount when
|
|
85
|
+
// initial is true.
|
|
86
|
+
const [lastChildIndex, setLastChildIndex] = usePreviousValue(0);
|
|
87
|
+
// Whenever the children count changes, update the last index.
|
|
88
|
+
React.useEffect(() => {
|
|
89
|
+
setLastChildIndex(childCount - 1);
|
|
90
|
+
}, [childCount]);
|
|
91
|
+
return (React__default["default"].createElement(framerMotion.AnimatePresence, { initial: initial, mode: "popLayout" }, React.Children.map(children, (child, i) => child && (React__default["default"].createElement(framerMotion.motion.div, { layout: true, variants: transitionVariation, initial: hasInitialTransition ? "initial" : "hidden", animate: "visible", exit: "hidden", transition: {
|
|
92
|
+
duration: TIMING_BASE,
|
|
93
|
+
delay: generateDelayTime(i),
|
|
94
|
+
} }, child)))));
|
|
95
|
+
function generateDelayTime(index) {
|
|
96
|
+
// Don't add a delay if it's already rendered.
|
|
97
|
+
if (lastChildIndex > index)
|
|
98
|
+
return 0;
|
|
99
|
+
// Stagger the animation starting after the previous last child index.
|
|
100
|
+
return (index - lastChildIndex) * TIMING_QUICK;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
exports.AnimatedPresence = AnimatedPresence;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from "react";
|
|
2
2
|
import { Option } from "./Option";
|
|
3
3
|
interface MenuProps {
|
|
4
4
|
readonly visible: boolean;
|
|
@@ -10,5 +10,5 @@ interface MenuProps {
|
|
|
10
10
|
readonly attachTo: RefObject<Element | null>;
|
|
11
11
|
onOptionSelect(chosenOption: Option): void;
|
|
12
12
|
}
|
|
13
|
-
export declare function Menu({ visible, options, selectedOption, onOptionSelect, attachTo, }: MenuProps):
|
|
13
|
+
export declare function Menu({ visible, options, selectedOption, onOptionSelect, attachTo, }: MenuProps): JSX.Element;
|
|
14
14
|
export {};
|
|
@@ -10,20 +10,21 @@ var classnames = require('classnames');
|
|
|
10
10
|
var ReactDOM = require('react-dom');
|
|
11
11
|
var reactPopper = require('react-popper');
|
|
12
12
|
var useOnKeyDown = require('@jobber/hooks/useOnKeyDown');
|
|
13
|
-
var
|
|
13
|
+
var useSafeLayoutEffect = require('@jobber/hooks/useSafeLayoutEffect');
|
|
14
|
+
var useIsMounted = require('@jobber/hooks/useIsMounted');
|
|
15
|
+
var Text = require('../Text-fbeaaca6.js');
|
|
14
16
|
var Icon = require('../Icon-405a216c.js');
|
|
15
|
-
var Heading = require('../Heading-
|
|
16
|
-
var InputText = require('../InputText-
|
|
17
|
-
require('../Typography-
|
|
17
|
+
var Heading = require('../Heading-bae3c69e.js');
|
|
18
|
+
var InputText = require('../InputText-de22af8c.js');
|
|
19
|
+
require('../Typography-e2a23b7e.js');
|
|
18
20
|
require('@jobber/design');
|
|
19
|
-
require('../
|
|
20
|
-
require('../FormField-
|
|
21
|
-
require('uuid');
|
|
21
|
+
require('../useAtlantisConfig-ed0bee66.js');
|
|
22
|
+
require('../FormField-3ec1c85d.js');
|
|
22
23
|
require('react-hook-form');
|
|
23
24
|
require('@jobber/hooks/useShowClear');
|
|
24
|
-
require('../Button-
|
|
25
|
+
require('../Button-6b922fc1.js');
|
|
25
26
|
require('react-router-dom');
|
|
26
|
-
require('../InputValidation-
|
|
27
|
+
require('../InputValidation-a92bb519.js');
|
|
27
28
|
require('framer-motion');
|
|
28
29
|
require('../Spinner-9d8fc7ff.js');
|
|
29
30
|
|
|
@@ -42,6 +43,9 @@ var IndexChange;
|
|
|
42
43
|
IndexChange[IndexChange["Previous"] = -1] = "Previous";
|
|
43
44
|
IndexChange[IndexChange["Next"] = 1] = "Next";
|
|
44
45
|
})(IndexChange || (IndexChange = {}));
|
|
46
|
+
// Adding useIsMounted is what tipped this to 13 statements.
|
|
47
|
+
// Any additions beyond useIsMounted should probably see this component refactored a bit
|
|
48
|
+
// eslint-disable-next-line max-statements
|
|
45
49
|
function Menu({ visible, options, selectedOption, onOptionSelect, attachTo, }) {
|
|
46
50
|
const [highlightedIndex, setHighlightedIndex] = React.useState(0);
|
|
47
51
|
const { menuRef, setMenuRef, styles: popperStyles, attributes, targetWidth, } = useRepositionMenu(attachTo, visible);
|
|
@@ -51,6 +55,7 @@ function Menu({ visible, options, selectedOption, onOptionSelect, attachTo, }) {
|
|
|
51
55
|
const initialHighlight = options.some(detectGroups) ? 1 : 0;
|
|
52
56
|
setupKeyListeners();
|
|
53
57
|
React.useEffect(() => setHighlightedIndex(initialHighlight), [options]);
|
|
58
|
+
const mounted = useIsMounted.useIsMounted();
|
|
54
59
|
const menu = (React__default["default"].createElement("div", Object.assign({ className: classnames__default["default"](styles.options, { [styles.visible]: visible }), ref: setMenuRef, style: Object.assign(Object.assign({}, popperStyles.popper), { width: targetWidth }) }, attributes.popper), options.map((option, index) => {
|
|
55
60
|
const optionClass = classnames__default["default"](styles.option, {
|
|
56
61
|
[styles.active]: index === highlightedIndex,
|
|
@@ -69,7 +74,7 @@ function Menu({ visible, options, selectedOption, onOptionSelect, attachTo, }) {
|
|
|
69
74
|
option.details !== undefined && (React__default["default"].createElement("div", { className: styles.details },
|
|
70
75
|
React__default["default"].createElement(Text.Text, null, option.details))))));
|
|
71
76
|
})));
|
|
72
|
-
return ReactDOM.createPortal(menu, document.body);
|
|
77
|
+
return mounted.current ? ReactDOM.createPortal(menu, document.body) : menu;
|
|
73
78
|
function setupKeyListeners() {
|
|
74
79
|
React.useEffect(() => {
|
|
75
80
|
var _a, _b;
|
|
@@ -127,7 +132,7 @@ function useRepositionMenu(attachTo, visible = false) {
|
|
|
127
132
|
{ name: "flip", options: { fallbackPlacements: ["top"] } },
|
|
128
133
|
],
|
|
129
134
|
});
|
|
130
|
-
|
|
135
|
+
useSafeLayoutEffect.useSafeLayoutEffect(() => {
|
|
131
136
|
var _a;
|
|
132
137
|
(_a = popper === null || popper === void 0 ? void 0 : popper.update) === null || _a === void 0 ? void 0 : _a.call(popper);
|
|
133
138
|
}, [visible]);
|
package/dist/Banner/index.js
CHANGED
|
@@ -6,12 +6,13 @@ var React = require('react');
|
|
|
6
6
|
var classnames = require('classnames');
|
|
7
7
|
var jobberHooks = require('@jobber/hooks/useResizeObserver');
|
|
8
8
|
var styleInject_es = require('../style-inject.es-9d2f5f4e.js');
|
|
9
|
-
var
|
|
9
|
+
var useAtlantisConfig = require('../useAtlantisConfig-ed0bee66.js');
|
|
10
10
|
var Icon = require('../Icon-405a216c.js');
|
|
11
|
-
var Text = require('../Text-
|
|
12
|
-
var Button = require('../Button-
|
|
11
|
+
var Text = require('../Text-fbeaaca6.js');
|
|
12
|
+
var Button = require('../Button-6b922fc1.js');
|
|
13
|
+
require('@jobber/hooks/useSafeLayoutEffect');
|
|
13
14
|
require('@jobber/design');
|
|
14
|
-
require('../Typography-
|
|
15
|
+
require('../Typography-e2a23b7e.js');
|
|
15
16
|
require('react-router-dom');
|
|
16
17
|
|
|
17
18
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -32,7 +33,7 @@ var iconStyles = {"success":"_5-B0X5vn0eA-","error":"r3hqur-vxwI-","warning":"-c
|
|
|
32
33
|
styleInject_es.styleInject(css_248z);
|
|
33
34
|
|
|
34
35
|
function BannerIcon({ icon, type }) {
|
|
35
|
-
const { JOBBER_RETHEME } =
|
|
36
|
+
const { JOBBER_RETHEME } = useAtlantisConfig.useAtlantisConfig();
|
|
36
37
|
if (JOBBER_RETHEME) {
|
|
37
38
|
return (React__default["default"].createElement("span", { className: classnames__default["default"](styles.iconWrapper, iconStyles[type]) },
|
|
38
39
|
React__default["default"].createElement(Icon.Icon, { name: icon, color: "white", size: "small" })));
|
|
@@ -41,7 +42,7 @@ function BannerIcon({ icon, type }) {
|
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
function Banner({ children, type, primaryAction, dismissible = true, icon, onDismiss, }) {
|
|
44
|
-
const { JOBBER_RETHEME } =
|
|
45
|
+
const { JOBBER_RETHEME } = useAtlantisConfig.useAtlantisConfig();
|
|
45
46
|
const [showBanner, setShowBanner] = React.useState(true);
|
|
46
47
|
const bannerIcon = icon || getBannerIcon(type);
|
|
47
48
|
const bannerWidths = {
|
|
@@ -84,7 +85,7 @@ function Banner({ children, type, primaryAction, dismissible = true, icon, onDis
|
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
function getBannerIcon(type) {
|
|
87
|
-
const { JOBBER_RETHEME } =
|
|
88
|
+
const { JOBBER_RETHEME } = useAtlantisConfig.useAtlantisConfig();
|
|
88
89
|
if (!JOBBER_RETHEME)
|
|
89
90
|
return;
|
|
90
91
|
switch (type) {
|
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-6b922fc1.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-e2a23b7e.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-e2a23b7e.js');
|
|
9
9
|
|
|
10
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
11
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
interface ButtonDismissProps {
|
|
3
3
|
onClick?(event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>): void;
|
|
4
|
-
ariaLabel: string;
|
|
4
|
+
readonly ariaLabel: string;
|
|
5
5
|
}
|
|
6
6
|
export declare function ButtonDismiss({ onClick, ariaLabel }: ButtonDismissProps): JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -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-a3ba1de2.js');
|
|
6
6
|
require('react');
|
|
7
|
-
require('../Button-
|
|
7
|
+
require('../Button-6b922fc1.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-e2a23b7e.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
package/dist/Card/index.js
CHANGED
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var Card = require('../Card-
|
|
5
|
+
var Card = require('../Card-74f078a4.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('../
|
|
12
|
-
require('
|
|
9
|
+
require('../Heading-bae3c69e.js');
|
|
10
|
+
require('../Typography-e2a23b7e.js');
|
|
11
|
+
require('../useAtlantisConfig-ed0bee66.js');
|
|
12
|
+
require('@jobber/hooks/useSafeLayoutEffect');
|
|
13
|
+
require('../Button-6b922fc1.js');
|
|
13
14
|
require('react-router-dom');
|
|
14
15
|
require('../Icon-405a216c.js');
|
|
15
16
|
require('@jobber/design');
|
|
16
|
-
require('../Menu-
|
|
17
|
-
require('uuid');
|
|
17
|
+
require('../Menu-d6dd673e.js');
|
|
18
18
|
require('framer-motion');
|
|
19
19
|
require('@jobber/hooks/useOnKeyDown');
|
|
20
20
|
require('@jobber/hooks/useRefocusOnActivator');
|
|
@@ -3,16 +3,16 @@
|
|
|
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-bae3c69e.js');
|
|
7
|
+
var Button = require('./Button-6b922fc1.js');
|
|
8
|
+
var Menu = require('./Menu-d6dd673e.js');
|
|
9
9
|
|
|
10
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
11
|
|
|
12
12
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
13
|
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
14
14
|
|
|
15
|
-
var css_248z$1 = ":root {\n --card--accent-color: var(--color-grey);\n --card--base-padding: var(--space-base);\n --card--border: var(--border-base) solid var(--color-border);\n --card--header-background: var(--color-surface--background);\n}\n\n._2wxPdv7kELk- {\n display: block;\n width: 100%;\n border: calc(16px / 16) solid rgb(217, 223, 225);\n border: var(--card--border);\n border-radius: calc(16px / 8);\n border-radius: var(--radius-base);\n outline-color: rgb(147, 161, 169);\n outline-color: var(--color-focus);\n background-color: rgba(255, 255, 255, 1);\n background-color: var(--color-surface);\n}\n\n._2wxPdv7kELk-:active {\n outline: 0;\n}\n\n:root .jobber-retheme ._2wxPdv7kELk-:not(.tRfpysqqk8s-) {\n --card--header-background: transparent;\n}\n\n/* Adjust `Content` components public padding to match the cards */\n\n._2wxPdv7kELk- > * {\n --public-content--padding: var(--card--base-padding);\n}\n\n/* Remove the nested `Content` components public padding */\n\n._2wxPdv7kELk- > * > * {\n --public-content--padding: 0;\n}\n\n._5LfUFF9DYsk- {\n border-top-width: 0;\n}\n\n.
|
|
15
|
+
var css_248z$1 = ":root {\n --card--accent-color: var(--color-grey);\n --card--base-padding: var(--space-base);\n --card--border: var(--border-base) solid var(--color-border);\n --card--header-background: var(--color-surface--background);\n}\n\n._2wxPdv7kELk- {\n display: block;\n width: 100%;\n border: calc(16px / 16) solid rgb(217, 223, 225);\n border: var(--card--border);\n border-radius: calc(16px / 8);\n border-radius: var(--radius-base);\n outline-color: rgb(147, 161, 169);\n outline-color: var(--color-focus);\n background-color: rgba(255, 255, 255, 1);\n background-color: var(--color-surface);\n}\n\n._2wxPdv7kELk-:active {\n outline: 0;\n}\n\n:root .jobber-retheme ._2wxPdv7kELk-:not(.tRfpysqqk8s-) {\n --card--header-background: transparent;\n}\n\n/* Adjust `Content` components public padding to match the cards */\n\n._2wxPdv7kELk- > * {\n --public-content--padding: var(--card--base-padding);\n}\n\n/* Remove the nested `Content` components public padding */\n\n._2wxPdv7kELk- > * > * {\n --public-content--padding: 0;\n}\n\n._5LfUFF9DYsk- {\n border-top-width: 0;\n}\n\n._5LfUFF9DYsk-::before {\n content: \" \";\n display: block;\n margin: 0 calc(-1 * (16px / 16));\n margin: 0 calc(-1 * calc(16px / 16));\n margin: 0 calc(-1 * var(--border-base));\n border-top: 0.375rem solid rgb(181, 181, 181);\n border-top: 0.375rem solid var(--card--accent-color);\n border-radius: calc(16px / 8) calc(16px / 8) 0 0;\n border-radius: var(--radius-base) var(--radius-base) 0 0;\n}\n\n.tRfpysqqk8s- {\n --card--border: none;\n\n box-shadow: 0px calc(16px / 16) calc(16px / 4) 0px\n rgba(0, 0, 0, 0.1),\n 0px calc(16px / 4) 12px 0px rgba(0, 0, 0, 0.05);\n\n box-shadow: var(--shadow-base);\n color: inherit;\n text-decoration: inherit;\n cursor: pointer;\n transition: all 100ms linear;\n transition: all var(--timing-quick) linear;\n}\n\n.tRfpysqqk8s-:hover,\n.tRfpysqqk8s-:focus {\n background-color: rgb(244, 246, 250);\n background-color: var(--color-surface--hover);\n}\n\n.fAPeD1InvAI- {\n display: -ms-flexbox;\n display: flex;\n padding: calc(16px * 1);\n padding: var(--card--base-padding);\n background-color: rgb(238, 240, 242);\n background-color: var(--card--header-background);\n -ms-flex-pack: justify;\n justify-content: space-between;\n -ms-flex-align: start;\n align-items: flex-start;\n gap: calc(16px / 2);\n gap: var(--space-small);\n}\n\n.jobber-retheme .fAPeD1InvAI- {\n padding-bottom: 0;\n}\n\n.jobber-retheme .fAPeD1InvAI- h3 {\n font-family: \"Inter\", Helvetica, Arial, sans-serif;\n font-family: var(--typography--fontFamily-normal);\n font-size: calc((16px * 1) * 1.5);\n font-size: calc(calc(16px * 1) * 1.5);\n font-size: var(--typography--fontSize-largest);\n}\n";
|
|
16
16
|
var styles = {"card":"_2wxPdv7kELk-","clickable":"tRfpysqqk8s-","accent":"_5LfUFF9DYsk-","header":"fAPeD1InvAI-"};
|
|
17
17
|
styleInject_es.styleInject(css_248z$1);
|
|
18
18
|
|
package/dist/Checkbox/index.js
CHANGED
|
@@ -2,17 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var Checkbox = require('../Checkbox-
|
|
5
|
+
var Checkbox = require('../Checkbox-e481a4b1.js');
|
|
6
6
|
require('../tslib.es6-754e2961.js');
|
|
7
7
|
require('react');
|
|
8
|
-
require('uuid');
|
|
9
8
|
require('classnames');
|
|
10
9
|
require('react-hook-form');
|
|
11
10
|
require('../style-inject.es-9d2f5f4e.js');
|
|
12
11
|
require('../Icon-405a216c.js');
|
|
13
12
|
require('@jobber/design');
|
|
14
|
-
require('../Text-
|
|
15
|
-
require('../Typography-
|
|
13
|
+
require('../Text-fbeaaca6.js');
|
|
14
|
+
require('../Typography-e2a23b7e.js');
|
|
16
15
|
|
|
17
16
|
|
|
18
17
|
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
var tslib_es6 = require('./tslib.es6-754e2961.js');
|
|
4
4
|
var React = require('react');
|
|
5
|
-
var uuid = require('uuid');
|
|
6
5
|
var classnames = require('classnames');
|
|
7
6
|
var reactHookForm = require('react-hook-form');
|
|
8
7
|
var styleInject_es = require('./style-inject.es-9d2f5f4e.js');
|
|
9
8
|
var Icon = require('./Icon-405a216c.js');
|
|
10
|
-
var Text = require('./Text-
|
|
9
|
+
var Text = require('./Text-fbeaaca6.js');
|
|
11
10
|
|
|
12
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
12
|
|
|
@@ -23,7 +22,7 @@ function Checkbox({ checked, defaultChecked, disabled, label, name, value, indet
|
|
|
23
22
|
? reactHookForm.useFormContext()
|
|
24
23
|
: // If there isn't a Form Context being provided, get a form for this field.
|
|
25
24
|
reactHookForm.useForm({ mode: "onTouched" });
|
|
26
|
-
const [identifier] = React.useState(
|
|
25
|
+
const [identifier] = React.useState(React.useId());
|
|
27
26
|
/**
|
|
28
27
|
* Generate a name if one is not supplied, this is the name
|
|
29
28
|
* that will be used for react-hook-form and not neccessarily
|
package/dist/Chip/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var Chip = require('../Chip-
|
|
5
|
+
var Chip = require('../Chip-76f18555.js');
|
|
6
6
|
var tslib_es6 = require('../tslib.es6-754e2961.js');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var Icon = require('../Icon-405a216c.js');
|
|
@@ -11,10 +11,12 @@ require('@jobber/hooks/useInView');
|
|
|
11
11
|
require('../style-inject.es-9d2f5f4e.js');
|
|
12
12
|
require('../Avatar-76a799fa.js');
|
|
13
13
|
require('color');
|
|
14
|
-
require('../Typography-
|
|
15
|
-
require('../Tooltip-
|
|
14
|
+
require('../Typography-e2a23b7e.js');
|
|
15
|
+
require('../Tooltip-b9de6e57.js');
|
|
16
16
|
require('react-dom');
|
|
17
17
|
require('framer-motion');
|
|
18
|
+
require('@jobber/hooks/useSafeLayoutEffect');
|
|
19
|
+
require('@jobber/hooks/useIsMounted');
|
|
18
20
|
require('react-popper');
|
|
19
21
|
require('@jobber/design');
|
|
20
22
|
|
|
@@ -6,8 +6,8 @@ var useInView = require('@jobber/hooks/useInView');
|
|
|
6
6
|
var styleInject_es = require('./style-inject.es-9d2f5f4e.js');
|
|
7
7
|
var Avatar = require('./Avatar-76a799fa.js');
|
|
8
8
|
var Icon = require('./Icon-405a216c.js');
|
|
9
|
-
var Typography = require('./Typography-
|
|
10
|
-
var Tooltip = require('./Tooltip-
|
|
9
|
+
var Typography = require('./Typography-e2a23b7e.js');
|
|
10
|
+
var Tooltip = require('./Tooltip-b9de6e57.js');
|
|
11
11
|
|
|
12
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
13
|
|
package/dist/Chips/index.js
CHANGED
|
@@ -8,20 +8,21 @@ var styleInject_es = require('../style-inject.es-9d2f5f4e.js');
|
|
|
8
8
|
var useAssert = require('@jobber/hooks/useAssert');
|
|
9
9
|
var Icon = require('../Icon-405a216c.js');
|
|
10
10
|
var Avatar = require('../Avatar-76a799fa.js');
|
|
11
|
-
var Typography = require('../Typography-
|
|
12
|
-
var Tooltip = require('../Tooltip-
|
|
13
|
-
var uuid = require('uuid');
|
|
11
|
+
var Typography = require('../Typography-e2a23b7e.js');
|
|
12
|
+
var Tooltip = require('../Tooltip-b9de6e57.js');
|
|
14
13
|
var sortBy = require('lodash/sortBy');
|
|
15
14
|
var useLiveAnnounce = require('@jobber/hooks/useLiveAnnounce');
|
|
16
15
|
var debounce = require('lodash/debounce');
|
|
16
|
+
require('@jobber/design');
|
|
17
17
|
var reactPopper = require('react-popper');
|
|
18
|
-
var Text = require('../Text-
|
|
19
|
-
var Button = require('../Button-
|
|
18
|
+
var Text = require('../Text-fbeaaca6.js');
|
|
19
|
+
var Button = require('../Button-6b922fc1.js');
|
|
20
20
|
var Spinner = require('../Spinner-9d8fc7ff.js');
|
|
21
|
-
require('@jobber/design');
|
|
22
21
|
require('color');
|
|
23
22
|
require('react-dom');
|
|
24
23
|
require('framer-motion');
|
|
24
|
+
require('@jobber/hooks/useSafeLayoutEffect');
|
|
25
|
+
require('@jobber/hooks/useIsMounted');
|
|
25
26
|
require('react-router-dom');
|
|
26
27
|
|
|
27
28
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -129,7 +130,7 @@ function ChipDismissible({ label, disabled, invalid, prefix, onClick, onRequestR
|
|
|
129
130
|
return (React__default["default"].createElement(InternalChip, { label: label, disabled: disabled, invalid: invalid, prefix: prefix, onClick: onClick, suffix: React__default["default"].createElement(InternalChipButton, { icon: "remove", label: label, invalid: invalid, disabled: disabled, onClick: onRequestRemove }) }));
|
|
130
131
|
}
|
|
131
132
|
|
|
132
|
-
function InternalChipSingleSelect({ children, selected, name =
|
|
133
|
+
function InternalChipSingleSelect({ children, selected, name = React.useId(), onChange, onClick, }) {
|
|
133
134
|
return (React__default["default"].createElement("div", { className: styles$1.wrapper, "data-testid": "singleselect-chips" }, React__default["default"].Children.map(children, child => {
|
|
134
135
|
const isSelected = child.props.value === selected;
|
|
135
136
|
return (React__default["default"].createElement("label", null,
|
|
@@ -269,9 +270,9 @@ function useInternalChipDismissible({ children, selected, onChange, onClick, onC
|
|
|
269
270
|
availableChipOptions });
|
|
270
271
|
}
|
|
271
272
|
|
|
272
|
-
const menuId = uuid.v1();
|
|
273
273
|
// eslint-disable-next-line max-statements
|
|
274
274
|
function useInternalChipDismissibleInput({ options, isLoadingMore = false, onCustomOptionSelect, onOptionSelect, onSearch, }) {
|
|
275
|
+
const menuId = React.useId();
|
|
275
276
|
const [allOptions, setAllOptions] = React.useState([]);
|
|
276
277
|
const [searchValue, setSearchValue] = React.useState("");
|
|
277
278
|
const [menuOpen, setMenuOpen] = React.useState(false);
|
|
@@ -62,6 +62,10 @@ export interface ComboboxOption {
|
|
|
62
62
|
* The value to be visually displayed in the Combobox options list.
|
|
63
63
|
*/
|
|
64
64
|
label: string;
|
|
65
|
+
/**
|
|
66
|
+
* An optional component to be displayed before the label.
|
|
67
|
+
*/
|
|
68
|
+
prefix?: React.ReactElement;
|
|
65
69
|
}
|
|
66
70
|
export interface ComboboxContentProps {
|
|
67
71
|
/**
|