@jobber/components 6.103.4-uncontroll-3a6b89f.8 → 6.103.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Autocomplete/Autocomplete.types.d.ts +13 -19
- package/dist/Autocomplete/index.cjs +10 -51
- package/dist/Autocomplete/index.mjs +10 -51
- package/dist/Autocomplete/tests/Autocomplete.setup.d.ts +0 -17
- package/dist/Autocomplete/useAutocomplete.d.ts +0 -1
- package/dist/Card-cjs.js +1 -1
- package/dist/Card-es.js +1 -1
- package/dist/Chip/Chip.d.ts +1 -2
- package/dist/Chip/hooks/useChildComponent.d.ts +4 -3
- package/dist/Chip/index.cjs +1 -1
- package/dist/Chip-cjs.js +5 -4
- package/dist/Chip-es.js +5 -4
- package/dist/ChipDismissible-cjs.js +4 -4
- package/dist/ChipDismissible-es.js +5 -5
- package/dist/Chips/InternalChipDismissible/hooks/useInView.d.ts +1 -1
- package/dist/Chips/InternalChipDismissible/hooks/useInternalChipDismissibleInput.d.ts +1 -1
- package/dist/Chips/InternalChipDismissible/hooks/useScrollToActive.d.ts +1 -1
- package/dist/Combobox/Combobox.d.ts +2 -1
- package/dist/Combobox/Combobox.types.d.ts +2 -2
- package/dist/Combobox/ComboboxProvider.d.ts +1 -1
- package/dist/Combobox/components/ComboboxActivator/ComboboxActivator.d.ts +1 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxContent.d.ts +2 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxContentHeader/ComboboxContentHeader.d.ts +2 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxContentList/ComboboxContentList.d.ts +2 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxContentSearch/ComboboxContentSearch.d.ts +2 -1
- package/dist/Combobox/hooks/useCombobox.d.ts +1 -1
- package/dist/Combobox/hooks/useComboboxAccessibility.d.ts +2 -2
- package/dist/Combobox/hooks/useComboboxContent.d.ts +1 -1
- package/dist/ComboboxActivator-cjs.js +2 -2
- package/dist/ComboboxActivator-es.js +3 -3
- package/dist/ComboboxTrigger-cjs.js +1 -1
- package/dist/ComboboxTrigger-es.js +2 -2
- package/dist/DataList/DataList.types.d.ts +2 -2
- package/dist/DataList/DataList.utils.d.ts +1 -1
- package/dist/DataList/components/DataListHeaderTile/components/DataListSortingOptions.d.ts +2 -2
- package/dist/DataList/components/DataListItem/DataListItemInternal.d.ts +2 -1
- package/dist/DataList.utils-cjs.js +2 -0
- package/dist/DataList.utils-es.js +2 -0
- package/dist/DataListActions-cjs.js +10 -3
- package/dist/DataListActions-es.js +10 -3
- package/dist/DataListItem-cjs.js +2 -0
- package/dist/DataListItem-es.js +2 -0
- package/dist/DataListSort-cjs.js +1 -1
- package/dist/DataListSort-es.js +2 -2
- package/dist/DataTable/SortIcon.d.ts +2 -1
- package/dist/DataTable/components/DataTableSortableHeader.d.ts +1 -1
- package/dist/DatePicker/useFocusOnSelectedDate.d.ts +1 -2
- package/dist/DatePicker-cjs.js +1 -1
- package/dist/DatePicker-es.js +1 -1
- package/dist/FormField/FormFieldAffix.d.ts +1 -1
- package/dist/FormField/FormFieldTypes.d.ts +3 -3
- package/dist/FormField/hooks/useFormFieldFocus.d.ts +1 -1
- package/dist/FormField/hooks/useFormFieldWrapperStyles.d.ts +2 -2
- package/dist/FormField-cjs.js +2 -2
- package/dist/FormField-es.js +2 -2
- package/dist/InputGroup-cjs.js +1 -0
- package/dist/InputGroup-es.js +1 -0
- package/dist/InputText/InputText.d.ts +2 -2
- package/dist/InputText/useInputTextActions.d.ts +1 -1
- package/dist/InputText/useInputTextFormField.d.ts +15 -1
- package/dist/InputText/useTextAreaResize.d.ts +2 -2
- package/dist/InternalChipDismissible-cjs.js +3 -3
- package/dist/InternalChipDismissible-es.js +4 -4
- package/dist/Menu-cjs.js +2 -0
- package/dist/Menu-es.js +2 -0
- package/dist/MultiSelect-cjs.js +13 -7
- package/dist/MultiSelect-es.js +13 -7
- package/dist/RadioGroup-cjs.js +7 -1
- package/dist/RadioGroup-es.js +7 -1
- package/dist/StatusLabel/StatusLabel.d.ts +2 -1
- package/dist/Tabs/hooks/useTabsOverflow.d.ts +2 -2
- package/dist/Tabs-cjs.js +4 -2
- package/dist/Tabs-es.js +4 -2
- package/dist/Tooltip/useTooltipPositioning.d.ts +1 -1
- package/dist/helpers-cjs.js +1 -0
- package/dist/helpers-es.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/showToast-cjs.js +2 -2
- package/dist/showToast-es.js +2 -2
- package/dist/useChildComponent-cjs.js +1 -1
- package/dist/useChildComponent-es.js +1 -1
- package/package.json +2 -2
package/dist/MultiSelect-es.js
CHANGED
|
@@ -10,7 +10,7 @@ var styles = {"dropDownMenuContainer":"zossMHCpMPU-","option":"poS49c-LqiU-","ac
|
|
|
10
10
|
|
|
11
11
|
function DropDownMenu({ options, setOptions }) {
|
|
12
12
|
const [highlightedIndex, setHighlightedIndex] = useState(0);
|
|
13
|
-
const menuDiv = useRef();
|
|
13
|
+
const menuDiv = useRef(null);
|
|
14
14
|
const handleOptionClick = useCallback((clickedOption) => {
|
|
15
15
|
setOptions(current => current.map(option => {
|
|
16
16
|
if (option.label == clickedOption.label) {
|
|
@@ -85,13 +85,17 @@ function DropDownMenu({ options, setOptions }) {
|
|
|
85
85
|
event.preventDefault();
|
|
86
86
|
const newIndex = Math.max(0, highlightedIndex - 1);
|
|
87
87
|
handleOptionFocus(newIndex);
|
|
88
|
-
|
|
88
|
+
if (menuDiv.current) {
|
|
89
|
+
scrollMenuIfItemNotInView(menuDiv.current, "up");
|
|
90
|
+
}
|
|
89
91
|
}
|
|
90
92
|
function handlePressDown(event) {
|
|
91
93
|
event.preventDefault();
|
|
92
94
|
const newIndex = Math.min(options.length - 1, highlightedIndex + 1);
|
|
93
95
|
handleOptionFocus(newIndex);
|
|
94
|
-
|
|
96
|
+
if (menuDiv.current) {
|
|
97
|
+
scrollMenuIfItemNotInView(menuDiv.current, "down");
|
|
98
|
+
}
|
|
95
99
|
}
|
|
96
100
|
}
|
|
97
101
|
|
|
@@ -99,15 +103,16 @@ function MultiSelect({ defaultLabel, allSelectedLabel, options, onOptionsChange,
|
|
|
99
103
|
const [label, setLabel] = useState(defaultLabel);
|
|
100
104
|
const [menuVisible, setMenuVisible] = useState(false);
|
|
101
105
|
const [focused, setFocused] = useState(false);
|
|
102
|
-
const multiSelectContainer = useRef();
|
|
103
|
-
const multiSelectRef = useRef();
|
|
106
|
+
const multiSelectContainer = useRef(null);
|
|
107
|
+
const multiSelectRef = useRef(null);
|
|
104
108
|
const multiSelectClass = classnames(styles$1.multiSelect, {
|
|
105
109
|
[styles$1.active]: menuVisible,
|
|
106
110
|
[styles$1.large]: size === "large",
|
|
107
111
|
[styles$1.small]: size === "small",
|
|
108
112
|
});
|
|
109
113
|
function handleMenuVisibility() {
|
|
110
|
-
|
|
114
|
+
var _a;
|
|
115
|
+
(_a = multiSelectRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
111
116
|
setMenuVisible(!menuVisible);
|
|
112
117
|
}
|
|
113
118
|
const handleClickOutside = (e) => {
|
|
@@ -117,6 +122,7 @@ function MultiSelect({ defaultLabel, allSelectedLabel, options, onOptionsChange,
|
|
|
117
122
|
}
|
|
118
123
|
};
|
|
119
124
|
function handleKeydown(event) {
|
|
125
|
+
var _a;
|
|
120
126
|
const { key, metaKey, ctrlKey } = event;
|
|
121
127
|
if (metaKey || ctrlKey)
|
|
122
128
|
return;
|
|
@@ -129,7 +135,7 @@ function MultiSelect({ defaultLabel, allSelectedLabel, options, onOptionsChange,
|
|
|
129
135
|
break;
|
|
130
136
|
}
|
|
131
137
|
case "Escape": {
|
|
132
|
-
multiSelectRef.current.focus();
|
|
138
|
+
(_a = multiSelectRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
133
139
|
setMenuVisible(false);
|
|
134
140
|
break;
|
|
135
141
|
}
|
package/dist/RadioGroup-cjs.js
CHANGED
|
@@ -31,7 +31,13 @@ function RadioGroup({ children, value, ariaLabel, onChange, name = React.useId()
|
|
|
31
31
|
const className = classnames(styles.radioGroup, {
|
|
32
32
|
[styles.directionHorizontal]: direction === "horizontal",
|
|
33
33
|
});
|
|
34
|
-
return (React.createElement("div", { role: "radiogroup", "aria-label": ariaLabel, className: className }, React.Children.map(children, option => (
|
|
34
|
+
return (React.createElement("div", { role: "radiogroup", "aria-label": ariaLabel, className: className }, React.Children.map(children, option => (
|
|
35
|
+
// @ts-expect-error - TODO: it thinks value is missing, but it's probably coming from option.props
|
|
36
|
+
React.createElement(InternalRadioOption
|
|
37
|
+
// @ts-expect-error - TODO: fix option.props type is unknown
|
|
38
|
+
, Object.assign({
|
|
39
|
+
// @ts-expect-error - TODO: fix option.props type is unknown
|
|
40
|
+
checked: value === option.props.value, name: name, onChange: handleChange }, option.props), option.props.children)))));
|
|
35
41
|
function handleChange(newValue) {
|
|
36
42
|
if (newValue !== value) {
|
|
37
43
|
onChange(newValue);
|
package/dist/RadioGroup-es.js
CHANGED
|
@@ -29,7 +29,13 @@ function RadioGroup({ children, value, ariaLabel, onChange, name = useId(), dire
|
|
|
29
29
|
const className = classnames(styles.radioGroup, {
|
|
30
30
|
[styles.directionHorizontal]: direction === "horizontal",
|
|
31
31
|
});
|
|
32
|
-
return (React__default.createElement("div", { role: "radiogroup", "aria-label": ariaLabel, className: className }, React__default.Children.map(children, option => (
|
|
32
|
+
return (React__default.createElement("div", { role: "radiogroup", "aria-label": ariaLabel, className: className }, React__default.Children.map(children, option => (
|
|
33
|
+
// @ts-expect-error - TODO: it thinks value is missing, but it's probably coming from option.props
|
|
34
|
+
React__default.createElement(InternalRadioOption
|
|
35
|
+
// @ts-expect-error - TODO: fix option.props type is unknown
|
|
36
|
+
, Object.assign({
|
|
37
|
+
// @ts-expect-error - TODO: fix option.props type is unknown
|
|
38
|
+
checked: value === option.props.value, name: name, onChange: handleChange }, option.props), option.props.children)))));
|
|
33
39
|
function handleChange(newValue) {
|
|
34
40
|
if (newValue !== value) {
|
|
35
41
|
onChange(newValue);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { StatusIndicatorType } from "../StatusIndicator/StatusIndicator.type";
|
|
2
3
|
export interface StatusLabelType {
|
|
3
4
|
readonly statusLabel: string;
|
|
@@ -21,5 +22,5 @@ interface StatusLabelProps {
|
|
|
21
22
|
*/
|
|
22
23
|
readonly status: StatusIndicatorType;
|
|
23
24
|
}
|
|
24
|
-
export declare function StatusLabel({ label, alignment, status, }: StatusLabelProps): JSX.Element;
|
|
25
|
+
export declare function StatusLabel({ label, alignment, status, }: StatusLabelProps): React.JSX.Element;
|
|
25
26
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
2
|
interface UseTabsOverflow {
|
|
3
3
|
overflowRight: boolean;
|
|
4
4
|
overflowLeft: boolean;
|
|
5
|
-
tabRow:
|
|
5
|
+
tabRow: RefObject<HTMLUListElement | null>;
|
|
6
6
|
}
|
|
7
7
|
export declare function useTabsOverflow(): UseTabsOverflow;
|
|
8
8
|
export {};
|
package/dist/Tabs-cjs.js
CHANGED
|
@@ -84,7 +84,7 @@ var throttle$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(throttle_
|
|
|
84
84
|
function useTabsOverflow() {
|
|
85
85
|
const [overflowRight, setOverflowRight] = React.useState(false);
|
|
86
86
|
const [overflowLeft, setOverflowLeft] = React.useState(false);
|
|
87
|
-
const tabRow = React.useRef();
|
|
87
|
+
const tabRow = React.useRef(null);
|
|
88
88
|
const handleOverflowing = () => {
|
|
89
89
|
if (tabRow.current) {
|
|
90
90
|
const scrollWidth = tabRow.current.scrollWidth;
|
|
@@ -187,7 +187,9 @@ function Tabs({ children, defaultTab = 0, activeTab: controlledActiveTab, onTabC
|
|
|
187
187
|
if (!isChildTab(child)) {
|
|
188
188
|
return child;
|
|
189
189
|
}
|
|
190
|
-
const index = tabChildren.findIndex(
|
|
190
|
+
const index = tabChildren.findIndex(
|
|
191
|
+
// @ts-expect-error - TODO: fix tab.props type is unknown
|
|
192
|
+
tab => tab.props.label === child.props.label);
|
|
191
193
|
return (React.createElement(InternalTab, { label: child.props.label, selected: activeTab === index, activateTab: activateTab(index), onClick: child.props.onClick, ref: el => {
|
|
192
194
|
if (el) {
|
|
193
195
|
tabRefs.current.set(index, el);
|
package/dist/Tabs-es.js
CHANGED
|
@@ -82,7 +82,7 @@ var throttle$1 = /*@__PURE__*/getDefaultExportFromCjs(throttle_1);
|
|
|
82
82
|
function useTabsOverflow() {
|
|
83
83
|
const [overflowRight, setOverflowRight] = useState(false);
|
|
84
84
|
const [overflowLeft, setOverflowLeft] = useState(false);
|
|
85
|
-
const tabRow = useRef();
|
|
85
|
+
const tabRow = useRef(null);
|
|
86
86
|
const handleOverflowing = () => {
|
|
87
87
|
if (tabRow.current) {
|
|
88
88
|
const scrollWidth = tabRow.current.scrollWidth;
|
|
@@ -185,7 +185,9 @@ function Tabs({ children, defaultTab = 0, activeTab: controlledActiveTab, onTabC
|
|
|
185
185
|
if (!isChildTab(child)) {
|
|
186
186
|
return child;
|
|
187
187
|
}
|
|
188
|
-
const index = tabChildren.findIndex(
|
|
188
|
+
const index = tabChildren.findIndex(
|
|
189
|
+
// @ts-expect-error - TODO: fix tab.props type is unknown
|
|
190
|
+
tab => tab.props.label === child.props.label);
|
|
189
191
|
return (React__default.createElement(InternalTab, { label: child.props.label, selected: activeTab === index, activateTab: activateTab(index), onClick: child.props.onClick, ref: el => {
|
|
190
192
|
if (el) {
|
|
191
193
|
tabRefs.current.set(index, el);
|
|
@@ -11,7 +11,7 @@ export declare function useTooltipPositioning({ preferredPlacement, }: ToolTipPo
|
|
|
11
11
|
}) | undefined;
|
|
12
12
|
};
|
|
13
13
|
placement: import("@floating-ui/utils").Placement;
|
|
14
|
-
shadowRef: import("react").RefObject<HTMLSpanElement>;
|
|
14
|
+
shadowRef: import("react").RefObject<HTMLSpanElement | null>;
|
|
15
15
|
setArrowRef: import("react").Dispatch<import("react").SetStateAction<HTMLDivElement | null | undefined>>;
|
|
16
16
|
setTooltipRef: ((node: HTMLElement | null) => void) & ((node: HTMLElement | null) => void);
|
|
17
17
|
};
|
package/dist/helpers-cjs.js
CHANGED
|
@@ -23,6 +23,7 @@ var jobberHooks__namespace = /*#__PURE__*/_interopNamespaceDefault(jobberHooks);
|
|
|
23
23
|
|
|
24
24
|
const mockContainerWidth = (exactWidth) => {
|
|
25
25
|
jest.spyOn(jobberHooks__namespace, "useResizeObserver").mockReturnValue([
|
|
26
|
+
// @ts-expect-error - TODO: fix this mock ref value
|
|
26
27
|
{ current: null },
|
|
27
28
|
{
|
|
28
29
|
width: 1200,
|
package/dist/helpers-es.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -219,7 +219,7 @@ exports.Cluster = Cluster.Cluster;
|
|
|
219
219
|
exports.Container = Container.Container;
|
|
220
220
|
exports.Cover = Cover.Cover;
|
|
221
221
|
exports.Checkbox = Checkbox_index.Checkbox;
|
|
222
|
-
exports.Chip = Chip.
|
|
222
|
+
exports.Chip = Chip.Chip;
|
|
223
223
|
exports.ChipDismissible = ChipDismissible.ChipDismissible;
|
|
224
224
|
exports.ChipSelectable = ChipDismissible.ChipSelectable;
|
|
225
225
|
exports.Icon = Icon.Icon;
|
package/dist/showToast-cjs.js
CHANGED
|
@@ -84,8 +84,8 @@ function showToast(props) {
|
|
|
84
84
|
}
|
|
85
85
|
const ToastContainer = React.forwardRef(ToastInternal);
|
|
86
86
|
function ToasterOven(props) {
|
|
87
|
-
const toastRef = React.useRef();
|
|
88
|
-
React.useEffect(() => toastRef.current.add(props));
|
|
87
|
+
const toastRef = React.useRef(null);
|
|
88
|
+
React.useEffect(() => { var _a; return (_a = toastRef.current) === null || _a === void 0 ? void 0 : _a.add(props); });
|
|
89
89
|
return React.createElement(ToastContainer, { ref: toastRef });
|
|
90
90
|
}
|
|
91
91
|
function ToastInternal(_, ref) {
|
package/dist/showToast-es.js
CHANGED
|
@@ -82,8 +82,8 @@ function showToast(props) {
|
|
|
82
82
|
}
|
|
83
83
|
const ToastContainer = forwardRef(ToastInternal);
|
|
84
84
|
function ToasterOven(props) {
|
|
85
|
-
const toastRef = useRef();
|
|
86
|
-
useEffect(() => toastRef.current.add(props));
|
|
85
|
+
const toastRef = useRef(null);
|
|
86
|
+
useEffect(() => { var _a; return (_a = toastRef.current) === null || _a === void 0 ? void 0 : _a.add(props); });
|
|
87
87
|
return React__default.createElement(ToastContainer, { ref: toastRef });
|
|
88
88
|
}
|
|
89
89
|
function ToastInternal(_, ref) {
|
|
@@ -5,7 +5,7 @@ var React = require('react');
|
|
|
5
5
|
/**
|
|
6
6
|
* Returns the first React Child that receives `true` from isCorrectComponent
|
|
7
7
|
* @param children React Children
|
|
8
|
-
* @param isCorrectComponent a function that accepts a
|
|
8
|
+
* @param isCorrectComponent a function that accepts a ReactElement and returns a boolean.
|
|
9
9
|
* @returns The first child component that returns true on isCorrectComponent
|
|
10
10
|
*/
|
|
11
11
|
function useChildComponent(children, isCorrectComponent) {
|
|
@@ -3,7 +3,7 @@ import React__default, { useMemo, isValidElement } from 'react';
|
|
|
3
3
|
/**
|
|
4
4
|
* Returns the first React Child that receives `true` from isCorrectComponent
|
|
5
5
|
* @param children React Children
|
|
6
|
-
* @param isCorrectComponent a function that accepts a
|
|
6
|
+
* @param isCorrectComponent a function that accepts a ReactElement and returns a boolean.
|
|
7
7
|
* @returns The first child component that returns true on isCorrectComponent
|
|
8
8
|
*/
|
|
9
9
|
function useChildComponent(children, isCorrectComponent) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "6.103.
|
|
3
|
+
"version": "6.103.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -538,5 +538,5 @@
|
|
|
538
538
|
"> 1%",
|
|
539
539
|
"IE 10"
|
|
540
540
|
],
|
|
541
|
-
"gitHead": "
|
|
541
|
+
"gitHead": "4b120bbb1789aa1b6b9a8eaf157be90d4ea15efc"
|
|
542
542
|
}
|