@sanity/ui 3.0.0-static.6 → 3.0.0-static.8
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/_chunks-cjs/_visual-editing.js +53 -53
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +54 -54
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/css.d.mts +207 -185
- package/dist/css.d.ts +207 -185
- package/dist/css.js +617 -547
- package/dist/css.js.map +1 -1
- package/dist/css.mjs +617 -547
- package/dist/css.mjs.map +1 -1
- package/dist/index.js +3 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -13
- package/dist/index.mjs.map +1 -1
- package/dist/sanity-theme.css +1 -1
- package/dist/system.css +1334 -914
- package/dist/theme.d.mts +84 -76
- package/dist/theme.d.ts +84 -76
- package/dist/theme.js +148 -124
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +148 -124
- package/dist/theme.mjs.map +1 -1
- package/package.json +1 -1
- package/src/css/aspects/index.ts +1 -0
- package/src/css/aspects/minWidth/index.ts +2 -0
- package/src/css/aspects/minWidth/minWidth.style.ts +13 -0
- package/src/css/aspects/minWidth/minWidth.ts +6 -0
- package/src/css/aspects/minWidth/types.ts +7 -0
- package/src/css/compile/compileRule.ts +1 -0
- package/src/css/compile/compileStyle.ts +1 -1
- package/src/css/compile/compileTheme_v3.ts +46 -37
- package/src/css/primitives/badge/badge.style.ts +1 -1
- package/src/css/primitives/box/box.style.ts +1 -1
- package/src/css/primitives/box/box.ts +2 -3
- package/src/css/primitives/box/types.ts +2 -0
- package/src/css/primitives/button/button.style.ts +20 -0
- package/src/css/primitives/card/card.style.ts +116 -44
- package/src/css/primitives/card/types.ts +0 -1
- package/src/css/primitives/kbd/kbd.style.ts +1 -1
- package/src/css/primitives/popover/popover.ts +4 -0
- package/src/css/primitives/switch/switch.style.ts +8 -83
- package/src/css/primitives/text/text.style.ts +11 -3
- package/src/css/system.style.ts +2 -0
- package/src/css/types.ts +200 -188
- package/src/css/varNames.ts +86 -76
- package/src/css/vars.ts +85 -76
- package/src/theme/v3/color/buildColor_v3.ts +43 -38
- package/src/theme/v3/color/card.ts +43 -38
- package/src/theme/v3/color/color.ts +42 -38
- package/src/theme/v3/defaults.ts +63 -47
- package/src/theme/v3/resolveTokens.ts +43 -38
- package/src/theme/versioning/themeColor_v3_v2.ts +1 -1
- package/src/ui/components/autocomplete/__workshop__/async.tsx +0 -1
- package/src/ui/components/autocomplete/autocomplete.tsx +2 -11
- package/src/ui/primitives/box/box.tsx +4 -3
- package/src/ui/primitives/card/card.tsx +2 -6
- package/src/ui/primitives/kbd/kbd.tsx +2 -2
- package/src/ui/primitives/popover/popoverCard.tsx +45 -39
- package/src/css/primitives/card/rules.ts +0 -473
package/dist/index.js
CHANGED
|
@@ -201,7 +201,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
201
201
|
customValidity,
|
|
202
202
|
disabled,
|
|
203
203
|
filterOption: filterOptionProp,
|
|
204
|
-
fontSize =
|
|
204
|
+
fontSize = 2,
|
|
205
205
|
icon,
|
|
206
206
|
id,
|
|
207
207
|
listBox = _visualEditing.EMPTY_RECORD,
|
|
@@ -240,16 +240,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
240
240
|
value
|
|
241
241
|
} = state, defaultRenderOption = react.useCallback(({
|
|
242
242
|
value: value_0
|
|
243
|
-
}) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
244
|
-
_visualEditing.Card,
|
|
245
|
-
{
|
|
246
|
-
as: "button",
|
|
247
|
-
padding: paddingProp,
|
|
248
|
-
radius: 2,
|
|
249
|
-
selectable: !0,
|
|
250
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { size: fontSize, textOverflow: "ellipsis", children: value_0 })
|
|
251
|
-
}
|
|
252
|
-
), [fontSize, paddingProp]), renderOption = typeof renderOptionProp == "function" ? renderOptionProp : defaultRenderOption, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = react.useRef(null), resultsPopoverElementRef = react.useRef(null), inputElementRef = react.useRef(null), listBoxElementRef = react.useRef(null), listFocusedRef = react.useRef(!1), valueRef = react.useRef(value), valuePropRef = react.useRef(valueProp), popoverMouseWithinRef = react.useRef(!1);
|
|
243
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Card, { as: "button", padding: paddingProp, radius: 2, tone: "inherit", children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { size: fontSize, textOverflow: "ellipsis", children: value_0 }) }), [fontSize, paddingProp]), renderOption = typeof renderOptionProp == "function" ? renderOptionProp : defaultRenderOption, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = react.useRef(null), resultsPopoverElementRef = react.useRef(null), inputElementRef = react.useRef(null), listBoxElementRef = react.useRef(null), listFocusedRef = react.useRef(!1), valueRef = react.useRef(value), valuePropRef = react.useRef(valueProp), popoverMouseWithinRef = react.useRef(!1);
|
|
253
244
|
react.useImperativeHandle(forwardedRef, () => inputElementRef.current);
|
|
254
245
|
const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : _visualEditing.EMPTY_ARRAY, padding = _visualEditing.useArrayProp(paddingProp), currentOption = react.useMemo(() => value !== null ? options.find((o) => o.value === value) : void 0, [options, value]), filteredOptions = react.useMemo(() => options.filter((option) => query ? filterOption(query, option) : !0), [filterOption, options, query]), filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null, handleRootBlur = react.useCallback((event) => {
|
|
255
246
|
setTimeout(() => {
|
|
@@ -384,7 +375,6 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
384
375
|
return /* @__PURE__ */ jsxRuntime.jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: react.cloneElement(renderOption(option_0), {
|
|
385
376
|
disabled: loading,
|
|
386
377
|
selected: active,
|
|
387
|
-
selectable: !0,
|
|
388
378
|
tabIndex: listFocused && active ? 0 : -1
|
|
389
379
|
}) }, option_0.value);
|
|
390
380
|
}) }) }), [activeValue, currentOption, filteredOptions, handleOptionSelect, handleListBoxKeyDown, id, listBox, listBoxId, listFocused, loading, renderOption]), results = react.useMemo(() => renderPopover ? renderPopover({
|
|
@@ -393,7 +383,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
393
383
|
inputElement: inputElementRef.current,
|
|
394
384
|
onMouseEnter: handlePopoverMouseEnter,
|
|
395
385
|
onMouseLeave: handlePopoverMouseLeave
|
|
396
|
-
}, resultsPopoverElementRef) : filteredOptionsLen === 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.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: 3, ref: resultsPopoverElementRef, referenceElement: inputElementRef.current, ...popover }), [content2, expanded, filteredOptionsLen, handlePopoverMouseEnter, handlePopoverMouseLeave, popover,
|
|
386
|
+
}, resultsPopoverElementRef) : filteredOptionsLen === 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.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: 3, ref: resultsPopoverElementRef, referenceElement: inputElementRef.current, ...popover }), [content2, expanded, filteredOptionsLen, handlePopoverMouseEnter, handlePopoverMouseLeave, popover, renderPopover]);
|
|
397
387
|
return (
|
|
398
388
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
399
389
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
|