@sanity/ui 3.1.0 → 3.1.1-canary.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.js +12 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +27 -41
- package/src/core/components/autocomplete/autocomplete.tsx +4 -1
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { Arrow, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvid
|
|
|
3
3
|
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
4
4
|
import { c } from "react-compiler-runtime";
|
|
5
5
|
import { SpinnerIcon, ChevronDownIcon, CloseIcon, ToggleArrowRightIcon } from "@sanity/icons";
|
|
6
|
-
import { useState, useRef, useEffect, useImperativeHandle, Component, forwardRef, useReducer, cloneElement, Children, isValidElement, Fragment, useContext, useSyncExternalStore,
|
|
6
|
+
import { useState, useRef, useEffect, useImperativeHandle, Component, forwardRef, useReducer, cloneElement, startTransition, Children, isValidElement, Fragment, useContext, useSyncExternalStore, useId } from "react";
|
|
7
7
|
import { styled, keyframes, css } from "styled-components";
|
|
8
8
|
import { getTheme_v2 } from "@sanity/ui/theme";
|
|
9
9
|
import { motion, AnimatePresence } from "framer-motion";
|
|
@@ -220,7 +220,7 @@ function autocompleteReducer(state, msg) {
|
|
|
220
220
|
} : state;
|
|
221
221
|
}
|
|
222
222
|
const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "Home", "End", "PageUp", "PageDown", "Meta", "Tab", "CapsLock"], AUTOCOMPLETE_POPOVER_PLACEMENT = "bottom-start", AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ["bottom-start", "top-start"], DEFAULT_RENDER_VALUE = (value, option) => option ? option.value : value, DEFAULT_FILTER_OPTION = (query, option) => option.value.toLowerCase().indexOf(query.toLowerCase()) > -1, InnerAutocomplete = forwardRef(function(props, forwardedRef) {
|
|
223
|
-
const $ = c(
|
|
223
|
+
const $ = c(181);
|
|
224
224
|
let customValidity, disabled, filterOptionProp, icon, id, loading, onBlur, onChange, onFocus, onQueryChange, onSelect, openButton, openOnFocus, optionsProp, prefix, readOnly, relatedElements, renderOptionProp, renderPopover, restProps, suffix, t0, t1, t2, t3, t4, t5, t6, valueProp;
|
|
225
225
|
$[0] !== props ? ({
|
|
226
226
|
border: t0,
|
|
@@ -530,14 +530,19 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
530
530
|
let t412;
|
|
531
531
|
$[144] !== content2 || $[145] !== expanded || $[146] !== handlePopoverMouseEnter || $[147] !== handlePopoverMouseLeave || $[148] !== inputElement || $[149] !== popover || $[150] !== radius ? (t412 = /* @__PURE__ */ jsx(Popover, { arrow: !1, constrainSize: !0, content: content2, fallbackPlacements: AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS, matchReferenceWidth: !0, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, open: expanded, overflow: "auto", placement: AUTOCOMPLETE_POPOVER_PLACEMENT, portal: !0, radius, ref: resultsPopoverElementRef, referenceElement: inputElement, ...popover }), $[144] = content2, $[145] = expanded, $[146] = handlePopoverMouseEnter, $[147] = handlePopoverMouseLeave, $[148] = inputElement, $[149] = popover, $[150] = radius, $[151] = t412) : t412 = $[151], t40 = t412;
|
|
532
532
|
}
|
|
533
|
-
const results = t40, t41 = loading && AnimatedSpinnerIcon
|
|
534
|
-
let
|
|
535
|
-
$[152]
|
|
533
|
+
const results = t40, t41 = loading && AnimatedSpinnerIcon;
|
|
534
|
+
let t42;
|
|
535
|
+
$[152] === Symbol.for("react.memo_cache_sentinel") ? (t42 = (node) => {
|
|
536
|
+
startTransition(() => setInputElement(node));
|
|
537
|
+
}, $[152] = t42) : t42 = $[152];
|
|
538
|
+
const t43 = suffix || openButtonNode;
|
|
536
539
|
let t44;
|
|
537
|
-
|
|
538
|
-
|
|
540
|
+
$[153] !== activeItemId || $[154] !== border || $[155] !== clearButton || $[156] !== customValidity || $[157] !== disabled || $[158] !== expanded || $[159] !== fontSize || $[160] !== handleClearButtonClick || $[161] !== handleInputChange || $[162] !== handleInputFocus || $[163] !== icon || $[164] !== id || $[165] !== inputValue || $[166] !== listBoxId || $[167] !== padding || $[168] !== prefix || $[169] !== radius || $[170] !== readOnly || $[171] !== restProps || $[172] !== t41 || $[173] !== t43 ? (t44 = /* @__PURE__ */ jsx(TextInput, { ...restProps, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", border, clearButton, customValidity, disabled, fontSize, icon, iconRight: t41, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: t42, role: "combobox", spellCheck: !1, suffix: t43, value: inputValue }), $[153] = activeItemId, $[154] = border, $[155] = clearButton, $[156] = customValidity, $[157] = disabled, $[158] = expanded, $[159] = fontSize, $[160] = handleClearButtonClick, $[161] = handleInputChange, $[162] = handleInputFocus, $[163] = icon, $[164] = id, $[165] = inputValue, $[166] = listBoxId, $[167] = padding, $[168] = prefix, $[169] = radius, $[170] = readOnly, $[171] = restProps, $[172] = t41, $[173] = t43, $[174] = t44) : t44 = $[174];
|
|
541
|
+
let t45;
|
|
542
|
+
return $[175] !== handleRootBlur || $[176] !== handleRootFocus || $[177] !== handleRootKeyDown || $[178] !== results || $[179] !== t44 ? (t45 = /* @__PURE__ */ jsxs(StyledAutocomplete, { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
|
|
543
|
+
t44,
|
|
539
544
|
results
|
|
540
|
-
] }), $[
|
|
545
|
+
] }), $[175] = handleRootBlur, $[176] = handleRootFocus, $[177] = handleRootKeyDown, $[178] = results, $[179] = t44, $[180] = t45) : t45 = $[180], t45;
|
|
541
546
|
});
|
|
542
547
|
function RenderPopover({
|
|
543
548
|
renderPopover,
|