@sanity/ui 2.4.0 → 2.6.0
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/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.esm.js +13 -8
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +13 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/core/components/autocomplete/autocomplete.tsx +14 -6
- package/src/core/primitives/textArea/textArea.tsx +6 -0
package/dist/index.mjs
CHANGED
|
@@ -3986,6 +3986,7 @@ const Root$d = styled.span(switchBaseStyles), Input$2 = styled.input(switchInput
|
|
|
3986
3986
|
padding = 3,
|
|
3987
3987
|
radius = 2,
|
|
3988
3988
|
weight,
|
|
3989
|
+
__unstable_disableFocusRing,
|
|
3989
3990
|
...restProps
|
|
3990
3991
|
} = props, ref = useRef(null), rootTheme = useRootTheme();
|
|
3991
3992
|
return useImperativeHandle(
|
|
@@ -4013,6 +4014,7 @@ const Root$d = styled.span(switchBaseStyles), Input$2 = styled.input(switchInput
|
|
|
4013
4014
|
Presentation$1,
|
|
4014
4015
|
{
|
|
4015
4016
|
$radius: useArrayProp(radius),
|
|
4017
|
+
$unstableDisableFocusRing: __unstable_disableFocusRing,
|
|
4016
4018
|
$scheme: rootTheme.scheme,
|
|
4017
4019
|
$tone: rootTheme.tone,
|
|
4018
4020
|
"data-border": border2 ? "" : void 0,
|
|
@@ -4620,6 +4622,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
|
4620
4622
|
onQueryChange,
|
|
4621
4623
|
onSelect,
|
|
4622
4624
|
openButton,
|
|
4625
|
+
openOnFocus,
|
|
4623
4626
|
options: optionsProp,
|
|
4624
4627
|
padding: paddingProp = 3,
|
|
4625
4628
|
popover = EMPTY_RECORD,
|
|
@@ -4715,11 +4718,16 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
|
4715
4718
|
dispatch({ type: "input/change", query: nextQuery }), onQueryChange && onQueryChange(nextQuery);
|
|
4716
4719
|
},
|
|
4717
4720
|
[onQueryChange]
|
|
4718
|
-
),
|
|
4721
|
+
), dispatchOpen = useCallback(() => {
|
|
4722
|
+
dispatch({
|
|
4723
|
+
type: "root/open",
|
|
4724
|
+
query: value ? renderValue(value, currentOption) : ""
|
|
4725
|
+
});
|
|
4726
|
+
}, [currentOption, renderValue, value]), handleInputFocus = useCallback(
|
|
4719
4727
|
(event) => {
|
|
4720
|
-
focused || (dispatch({ type: "input/focus" }), onFocus && onFocus(event));
|
|
4728
|
+
focused || (dispatch({ type: "input/focus" }), onFocus && onFocus(event), openOnFocus && dispatchOpen());
|
|
4721
4729
|
},
|
|
4722
|
-
[focused, onFocus]
|
|
4730
|
+
[focused, onFocus, openOnFocus, dispatchOpen]
|
|
4723
4731
|
), handlePopoverMouseEnter = useCallback(() => {
|
|
4724
4732
|
popoverMouseWithinRef.current = !0;
|
|
4725
4733
|
}, []), handlePopoverMouseLeave = useCallback(() => {
|
|
@@ -4765,15 +4773,12 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
|
4765
4773
|
[openButton]
|
|
4766
4774
|
), handleOpenClick = useCallback(
|
|
4767
4775
|
(event) => {
|
|
4768
|
-
|
|
4769
|
-
type: "root/open",
|
|
4770
|
-
query: value ? renderValue(value, currentOption) : ""
|
|
4771
|
-
}), openButtonProps.onClick && openButtonProps.onClick(event), _raf(() => {
|
|
4776
|
+
dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event), _raf(() => {
|
|
4772
4777
|
var _a;
|
|
4773
4778
|
return (_a = inputElementRef.current) == null ? void 0 : _a.focus();
|
|
4774
4779
|
});
|
|
4775
4780
|
},
|
|
4776
|
-
[
|
|
4781
|
+
[openButtonProps, dispatchOpen]
|
|
4777
4782
|
), openButtonNode = useMemo(
|
|
4778
4783
|
() => !disabled && !readOnly && openButton ? /* @__PURE__ */ jsx(Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsx(
|
|
4779
4784
|
Button,
|