@sanity/ui 3.0.0-static.17 → 3.0.0-static.18
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.cjs +2 -2
- package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -1
- package/dist/_chunks-es/_visual-editing.js +3 -3
- package/dist/_chunks-es/_visual-editing.js.map +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/css.cjs +1 -0
- package/dist/css.cjs.map +1 -1
- package/dist/css.d.cts +7 -3
- package/dist/css.d.ts +7 -3
- package/dist/css.js +1 -0
- package/dist/css.js.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/package.json +1 -1
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +2 -18
- package/src/core/hooks/useMediaIndex/useMediaIndex.ts +9 -9
- package/src/css/constants.ts +1 -0
- package/src/css/types.ts +23 -18
|
@@ -3,7 +3,7 @@ import { c } from "react-compiler-runtime";
|
|
|
3
3
|
import { getScopedTheme, getTheme_v2 } from "@sanity/ui/theme";
|
|
4
4
|
import { createContext, useContext, useState, useEffect, useDebugValue, useSyncExternalStore, Children, isValidElement, cloneElement, useRef, useImperativeHandle, lazy, Suspense, useMemo, useCallback, useId, useLayoutEffect } from "react";
|
|
5
5
|
import { ThemeProvider as ThemeProvider$1, useTheme as useTheme$1 } from "styled-components";
|
|
6
|
-
import { composeClassNames, box, label, textOverflow, avatar, avatarArrow, avatarInitials, avatarImage, avatarCounter, avatarStack, text, badge, animatedSpinnerIcon, spinner, buttonLoadingBox, button, card, checkbox, checkboxInput, code, container, heading, kbd, _arrow, _arrowStrokeMask, _arrowStroke, _arrowShape,
|
|
6
|
+
import { BREAKPOINTS, composeClassNames, box, label, textOverflow, avatar, avatarArrow, avatarInitials, avatarImage, avatarCounter, avatarStack, text, badge, animatedSpinnerIcon, spinner, buttonLoadingBox, button, card, checkbox, checkboxInput, code, container, heading, kbd, _arrow, _arrowStrokeMask, _arrowStroke, _arrowShape, srOnly, vars, popoverCard, radio, select, _inputElement, selectPresentation, stack, _switch, _switchElement, _switchPresentation, _switchTrack, _switchThumb, textArea, _inputPresentation, textInput, tooltipCard, tooltip, menu, menuDivider, _selectable } from "@sanity/ui/css";
|
|
7
7
|
import { isValidElementType } from "react-is";
|
|
8
8
|
import { SpinnerIcon, CheckmarkIcon, RemoveIcon, ChevronDownIcon, CloseIcon, ChevronRightIcon } from "@sanity/icons";
|
|
9
9
|
import { detectOverflow, flip, offset, shift, arrow, hide, useFloating, autoUpdate } from "@floating-ui/react-dom";
|
|
@@ -293,9 +293,9 @@ function useMatchMedia(mediaQueryString, getServerSnapshot2) {
|
|
|
293
293
|
let t1;
|
|
294
294
|
return $[2] !== mediaQueryString ? (t1 = () => window.matchMedia(mediaQueryString).matches, $[2] = mediaQueryString, $[3] = t1) : t1 = $[3], useSyncExternalStore(t0, t1, getServerSnapshot2);
|
|
295
295
|
}
|
|
296
|
-
const media =
|
|
296
|
+
const media = Object.values(BREAKPOINTS);
|
|
297
297
|
function _getMediaQuery(media2, index) {
|
|
298
|
-
return index === 0 ? `screen and (max-width: ${media2[index] - 1}px)` : index === media2.length ? `screen and (min-width: ${media2[index
|
|
298
|
+
return index === 0 ? `screen and (max-width: ${media2[index + 1] - 1}px)` : index === media2.length ? `screen and (min-width: ${media2[index]}px)` : `screen and (min-width: ${media2[index]}px) and (max-width: ${media2[index + 1] - 1}px)`;
|
|
299
299
|
}
|
|
300
300
|
function _createMediaStore() {
|
|
301
301
|
const mediaLen = media.length;
|