@sanity/ui 3.1.1-canary.0 → 3.1.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/dist/index.js +7 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +52 -38
- package/src/core/components/autocomplete/autocomplete.tsx +1 -4
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,
|
|
6
|
+
import { useState, useRef, useEffect, useImperativeHandle, Component, forwardRef, useReducer, cloneElement, Children, isValidElement, Fragment, useContext, useSyncExternalStore, startTransition, 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(180);
|
|
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,19 +530,14 @@ 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]
|
|
536
|
-
startTransition(() => setInputElement(node));
|
|
537
|
-
}, $[152] = t42) : t42 = $[152];
|
|
538
|
-
const t43 = suffix || openButtonNode;
|
|
533
|
+
const results = t40, t41 = loading && AnimatedSpinnerIcon, t42 = suffix || openButtonNode;
|
|
534
|
+
let t43;
|
|
535
|
+
$[152] !== activeItemId || $[153] !== border || $[154] !== clearButton || $[155] !== customValidity || $[156] !== disabled || $[157] !== expanded || $[158] !== fontSize || $[159] !== handleClearButtonClick || $[160] !== handleInputChange || $[161] !== handleInputFocus || $[162] !== icon || $[163] !== id || $[164] !== inputValue || $[165] !== listBoxId || $[166] !== padding || $[167] !== prefix || $[168] !== radius || $[169] !== readOnly || $[170] !== restProps || $[171] !== t41 || $[172] !== t42 ? (t43 = /* @__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: setInputElement, role: "combobox", spellCheck: !1, suffix: t42, value: inputValue }), $[152] = activeItemId, $[153] = border, $[154] = clearButton, $[155] = customValidity, $[156] = disabled, $[157] = expanded, $[158] = fontSize, $[159] = handleClearButtonClick, $[160] = handleInputChange, $[161] = handleInputFocus, $[162] = icon, $[163] = id, $[164] = inputValue, $[165] = listBoxId, $[166] = padding, $[167] = prefix, $[168] = radius, $[169] = readOnly, $[170] = restProps, $[171] = t41, $[172] = t42, $[173] = t43) : t43 = $[173];
|
|
539
536
|
let t44;
|
|
540
|
-
|
|
541
|
-
|
|
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,
|
|
537
|
+
return $[174] !== handleRootBlur || $[175] !== handleRootFocus || $[176] !== handleRootKeyDown || $[177] !== results || $[178] !== t43 ? (t44 = /* @__PURE__ */ jsxs(StyledAutocomplete, { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
|
|
538
|
+
t43,
|
|
544
539
|
results
|
|
545
|
-
] }), $[
|
|
540
|
+
] }), $[174] = handleRootBlur, $[175] = handleRootFocus, $[176] = handleRootKeyDown, $[177] = results, $[178] = t43, $[179] = t44) : t44 = $[179], t44;
|
|
546
541
|
});
|
|
547
542
|
function RenderPopover({
|
|
548
543
|
renderPopover,
|