@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.
Files changed (60) hide show
  1. package/dist/_chunks-cjs/_visual-editing.js +53 -53
  2. package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
  3. package/dist/_chunks-es/_visual-editing.mjs +54 -54
  4. package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/css.d.mts +207 -185
  7. package/dist/css.d.ts +207 -185
  8. package/dist/css.js +617 -547
  9. package/dist/css.js.map +1 -1
  10. package/dist/css.mjs +617 -547
  11. package/dist/css.mjs.map +1 -1
  12. package/dist/index.js +3 -13
  13. package/dist/index.js.map +1 -1
  14. package/dist/index.mjs +3 -13
  15. package/dist/index.mjs.map +1 -1
  16. package/dist/sanity-theme.css +1 -1
  17. package/dist/system.css +1334 -914
  18. package/dist/theme.d.mts +84 -76
  19. package/dist/theme.d.ts +84 -76
  20. package/dist/theme.js +148 -124
  21. package/dist/theme.js.map +1 -1
  22. package/dist/theme.mjs +148 -124
  23. package/dist/theme.mjs.map +1 -1
  24. package/package.json +1 -1
  25. package/src/css/aspects/index.ts +1 -0
  26. package/src/css/aspects/minWidth/index.ts +2 -0
  27. package/src/css/aspects/minWidth/minWidth.style.ts +13 -0
  28. package/src/css/aspects/minWidth/minWidth.ts +6 -0
  29. package/src/css/aspects/minWidth/types.ts +7 -0
  30. package/src/css/compile/compileRule.ts +1 -0
  31. package/src/css/compile/compileStyle.ts +1 -1
  32. package/src/css/compile/compileTheme_v3.ts +46 -37
  33. package/src/css/primitives/badge/badge.style.ts +1 -1
  34. package/src/css/primitives/box/box.style.ts +1 -1
  35. package/src/css/primitives/box/box.ts +2 -3
  36. package/src/css/primitives/box/types.ts +2 -0
  37. package/src/css/primitives/button/button.style.ts +20 -0
  38. package/src/css/primitives/card/card.style.ts +116 -44
  39. package/src/css/primitives/card/types.ts +0 -1
  40. package/src/css/primitives/kbd/kbd.style.ts +1 -1
  41. package/src/css/primitives/popover/popover.ts +4 -0
  42. package/src/css/primitives/switch/switch.style.ts +8 -83
  43. package/src/css/primitives/text/text.style.ts +11 -3
  44. package/src/css/system.style.ts +2 -0
  45. package/src/css/types.ts +200 -188
  46. package/src/css/varNames.ts +86 -76
  47. package/src/css/vars.ts +85 -76
  48. package/src/theme/v3/color/buildColor_v3.ts +43 -38
  49. package/src/theme/v3/color/card.ts +43 -38
  50. package/src/theme/v3/color/color.ts +42 -38
  51. package/src/theme/v3/defaults.ts +63 -47
  52. package/src/theme/v3/resolveTokens.ts +43 -38
  53. package/src/theme/versioning/themeColor_v3_v2.ts +1 -1
  54. package/src/ui/components/autocomplete/__workshop__/async.tsx +0 -1
  55. package/src/ui/components/autocomplete/autocomplete.tsx +2 -11
  56. package/src/ui/primitives/box/box.tsx +4 -3
  57. package/src/ui/primitives/card/card.tsx +2 -6
  58. package/src/ui/primitives/kbd/kbd.tsx +2 -2
  59. package/src/ui/primitives/popover/popoverCard.tsx +45 -39
  60. package/src/css/primitives/card/rules.ts +0 -473
package/dist/index.mjs CHANGED
@@ -208,7 +208,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
208
208
  customValidity,
209
209
  disabled,
210
210
  filterOption: filterOptionProp,
211
- fontSize = 1,
211
+ fontSize = 2,
212
212
  icon,
213
213
  id,
214
214
  listBox = EMPTY_RECORD,
@@ -247,16 +247,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
247
247
  value
248
248
  } = state, defaultRenderOption = useCallback(({
249
249
  value: value_0
250
- }) => /* @__PURE__ */ jsx(
251
- Card,
252
- {
253
- as: "button",
254
- padding: paddingProp,
255
- radius: 2,
256
- selectable: !0,
257
- children: /* @__PURE__ */ jsx(Text, { size: fontSize, textOverflow: "ellipsis", children: value_0 })
258
- }
259
- ), [fontSize, paddingProp]), renderOption = typeof renderOptionProp == "function" ? renderOptionProp : defaultRenderOption, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = useRef(null), resultsPopoverElementRef = useRef(null), inputElementRef = useRef(null), listBoxElementRef = useRef(null), listFocusedRef = useRef(!1), valueRef = useRef(value), valuePropRef = useRef(valueProp), popoverMouseWithinRef = useRef(!1);
250
+ }) => /* @__PURE__ */ jsx(Card, { as: "button", padding: paddingProp, radius: 2, tone: "inherit", children: /* @__PURE__ */ jsx(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 = useRef(null), resultsPopoverElementRef = useRef(null), inputElementRef = useRef(null), listBoxElementRef = useRef(null), listFocusedRef = useRef(!1), valueRef = useRef(value), valuePropRef = useRef(valueProp), popoverMouseWithinRef = useRef(!1);
260
251
  useImperativeHandle(forwardedRef, () => inputElementRef.current);
261
252
  const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = useArrayProp(paddingProp), currentOption = useMemo(() => value !== null ? options.find((o) => o.value === value) : void 0, [options, value]), filteredOptions = 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 = useCallback((event) => {
262
253
  setTimeout(() => {
@@ -391,7 +382,6 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
391
382
  return /* @__PURE__ */ jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: cloneElement(renderOption(option_0), {
392
383
  disabled: loading,
393
384
  selected: active,
394
- selectable: !0,
395
385
  tabIndex: listFocused && active ? 0 : -1
396
386
  }) }, option_0.value);
397
387
  }) }) }), [activeValue, currentOption, filteredOptions, handleOptionSelect, handleListBoxKeyDown, id, listBox, listBoxId, listFocused, loading, renderOption]), results = useMemo(() => renderPopover ? renderPopover({
@@ -400,7 +390,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
400
390
  inputElement: inputElementRef.current,
401
391
  onMouseEnter: handlePopoverMouseEnter,
402
392
  onMouseLeave: handlePopoverMouseLeave
403
- }, resultsPopoverElementRef) : filteredOptionsLen === 0 ? null : /* @__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: 3, ref: resultsPopoverElementRef, referenceElement: inputElementRef.current, ...popover }), [content2, expanded, filteredOptionsLen, handlePopoverMouseEnter, handlePopoverMouseLeave, popover, radius, renderPopover]);
393
+ }, resultsPopoverElementRef) : filteredOptionsLen === 0 ? null : /* @__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: 3, ref: resultsPopoverElementRef, referenceElement: inputElementRef.current, ...popover }), [content2, expanded, filteredOptionsLen, handlePopoverMouseEnter, handlePopoverMouseLeave, popover, renderPopover]);
404
394
  return (
405
395
  // eslint-disable-next-line jsx-a11y/no-static-element-interactions
406
396
  /* @__PURE__ */ jsxs("div", { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [