@sanity/ui 3.0.0-static.10 → 3.0.0-static.11
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 +160 -207
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +161 -208
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_visual-editing.d.mts +1 -3
- package/dist/_visual-editing.d.ts +1 -3
- package/dist/cli.js +1 -1
- package/dist/css.d.mts +115 -2
- package/dist/css.d.ts +115 -2
- package/dist/css.js +539 -402
- package/dist/css.js.map +1 -1
- package/dist/css.mjs +541 -404
- package/dist/css.mjs.map +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +50 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +45 -12
- package/dist/index.mjs.map +1 -1
- package/dist/sanity-theme.css +1 -1
- package/dist/system.css +418 -182
- package/dist/theme.js +10 -11
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +10 -11
- package/dist/theme.mjs.map +1 -1
- package/package.json +1 -1
- package/src/css/_resp.ts +0 -1
- package/src/css/aspects/font/font.style.ts +7 -66
- package/src/css/aspects/shadow/shadow.style.ts +16 -41
- package/src/css/compile/compilePalette.ts +4 -3
- package/src/css/compile/compileSystem.ts +0 -3
- package/src/css/compile/compileTheme_v3.ts +233 -219
- package/src/css/components/skeleton/skeleton.style.ts +8 -4
- package/src/css/constants.ts +9 -0
- package/src/css/index.ts +1 -0
- package/src/css/primitives/_arrow/_arrow.style.ts +6 -8
- package/src/css/primitives/_arrow/_arrow.ts +4 -0
- package/src/css/primitives/_selectable/_selectable.style.ts +23 -23
- package/src/css/primitives/button/button.style.ts +48 -15
- package/src/css/primitives/card/card.style.ts +1 -1
- package/src/css/primitives/token/token.style.ts +37 -36
- package/src/css/responsiveRules.ts +12 -19
- package/src/css/types.ts +106 -3
- package/src/css/varNames.ts +101 -4
- package/src/css/vars.ts +52 -16
- package/src/theme/v3/buildTheme_v3.ts +1 -1
- package/src/theme/v3/{defaults.ts → defaultTokens.ts} +1 -2
- package/src/theme/v3/index.ts +1 -1
- package/src/theme/v3/resolveTokens.ts +9 -9
- package/src/ui/RootClassNames.tsx +41 -0
- package/src/ui/_compat/helpers.ts +72 -0
- package/src/ui/_compat/index.ts +2 -6
- package/src/ui/_compat/studioTheme.ts +7 -0
- package/src/ui/_compat/types.ts +0 -83
- package/src/ui/index.ts +1 -0
- package/src/ui/primitives/button/button.tsx +5 -6
- package/src/ui/primitives/popover/popover.tsx +25 -7
- package/src/ui/primitives/popover/popoverCard.tsx +46 -45
- package/src/ui/primitives/tooltip/tooltip.tsx +9 -2
- package/src/ui/primitives/tooltip/tooltipCard.tsx +1 -1
- package/src/ui/utils/arrow/arrow.tsx +3 -11
- package/src/ui/utils/elementQuery/elementQuery.tsx +10 -8
- package/src/ui/utils/virtualList/virtualList.tsx +37 -32
- package/src/css/components/breadcrumbs/rules.ts +0 -25
- package/src/css/components/dialog/rules.ts +0 -78
- package/src/css/components/skeleton/rules.ts +0 -113
- package/src/css/components/toast/rules.ts +0 -18
- package/src/css/components/tree/rules.ts +0 -168
- package/src/css/primitives/popover/rules.ts +0 -5
- package/src/css/primitives/spinner/rules.ts +0 -21
- package/src/css/primitives/token/rules.ts +0 -45
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { px, rem } from "@sanity/ui/css";
|
|
1
|
+
import { createColorTheme as createColorTheme$1, hexToRgb as hexToRgb$1, hslToRgb as hslToRgb$1, multiply as multiply$1, parseColor as parseColor$1, rgbToHex as rgbToHex$1, rgbToHsl as rgbToHsl$1, rgba as rgba$1, screen as screen$1, buildTheme_v3 } from "@sanity/ui/theme";
|
|
2
|
+
import { isHTMLElement, isHTMLAnchorElement, isHTMLInputElement, isHTMLButtonElement, isHTMLSelectElement, isHTMLTextAreaElement, EMPTY_ARRAY, useElementSize, Code, _isEnterToClickElement, Card, Text, useArrayProp, EMPTY_RECORD, Box, Button, Stack, Popover, TextInput, AnimatedSpinnerIcon, useClickOutsideEvent, Flex, createGlobalScopedContext, usePortal, useBoundaryElement, useLayer, useGlobalKeyDown, Container, usePrefersReducedMotion, Z_OFFSETS, Portal, Layer, containsOrEqualsElement, Grid, LayerProvider, isRecord, Selectable, useCard } from "./_chunks-es/_visual-editing.mjs";
|
|
3
|
+
import { Arrow, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvider, CardProvider, Checkbox, ConditionalWrapper, ElementQuery, Heading, Hotkeys, Inline, KBD, Label, Menu, MenuDivider, MenuGroup, MenuItem, PortalProvider, Radio, Select, Spinner, SrOnly, Switch, Tab, TabList, TextArea, ThemeColorProvider, ThemeProvider, Tooltip, TooltipDelayGroupContext, TooltipDelayGroupProvider, VirtualList, _ResizeObserver, _elementSizeObserver, _getArrayProp, _isScrollable, studioTheme, useCustomValidity, useMatchMedia, useMediaIndex, usePrefersDark, useRootTheme, useTheme, useTheme_v2, useTooltipDelayGroup } from "./_chunks-es/_visual-editing.mjs";
|
|
5
4
|
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
6
5
|
import { ChevronDownIcon, CloseIcon, ToggleArrowRightIcon } from "@sanity/icons";
|
|
7
6
|
import { useState, useRef, useEffect, useImperativeHandle, Component, forwardRef, useReducer, useCallback, useMemo, cloneElement, Children, isValidElement, Fragment, useContext, useSyncExternalStore, startTransition, memo, useId } from "react";
|
|
8
7
|
import { c } from "react-compiler-runtime";
|
|
8
|
+
import { composeClassNames, breadcrumbs, dialogContainer, dialogCardRoot, dialogLayout, dialogHeader, dialogContent, dialogFooter, dialog, skeleton, textSkeleton, labelSkeleton, headingSkeleton, codeSkeleton, toast, toastLoadingBar, toastLoadingBarMask, toastLoadingBarProgress, toastLayer, treeItem, scopeClassName, card, compilePalette, compileTheme, compileSystem } from "@sanity/ui/css";
|
|
9
|
+
import { px, rem } from "@sanity/ui/css";
|
|
9
10
|
import { motion, AnimatePresence } from "framer-motion";
|
|
10
|
-
|
|
11
|
+
const createColorTheme = createColorTheme$1, hexToRgb = hexToRgb$1, hslToRgb = hslToRgb$1, multiply = multiply$1, parseColor = parseColor$1, rgbToHex = rgbToHex$1, rgbToHsl = rgbToHsl$1, rgba = rgba$1, screen = screen$1;
|
|
11
12
|
function _responsive(media, values, callback) {
|
|
12
13
|
return (values?.map(callback) || []).map((statement, mediaIndex) => mediaIndex === 0 ? statement : {
|
|
13
14
|
[`@media screen and (min-width: ${media[mediaIndex - 1]}px)`]: statement
|
|
@@ -639,7 +640,7 @@ const MenuButton = forwardRef(function(props, forwardedRef) {
|
|
|
639
640
|
}, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8) : (t7 = $[10], t8 = $[11]), useEffect(t7, t8);
|
|
640
641
|
let t9;
|
|
641
642
|
$[12] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => {
|
|
642
|
-
setOpen(_temp$
|
|
643
|
+
setOpen(_temp$3), setShouldFocus(null);
|
|
643
644
|
}, $[12] = t9) : t9 = $[12];
|
|
644
645
|
const handleButtonClick = t9;
|
|
645
646
|
let t10;
|
|
@@ -749,7 +750,7 @@ const MenuButton = forwardRef(function(props, forwardedRef) {
|
|
|
749
750
|
return $[58] !== menu || $[59] !== open || $[60] !== popoverProps || $[61] !== t24 ? (t25 = /* @__PURE__ */ jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: t24 }), $[58] = menu, $[59] = open, $[60] = popoverProps, $[61] = t24, $[62] = t25) : t25 = $[62], t25;
|
|
750
751
|
});
|
|
751
752
|
MenuButton.displayName = "ForwardRef(MenuButton)";
|
|
752
|
-
function _temp$
|
|
753
|
+
function _temp$3(v) {
|
|
753
754
|
return !v;
|
|
754
755
|
}
|
|
755
756
|
const Skeleton = forwardRef(function(props, ref) {
|
|
@@ -992,12 +993,12 @@ const container = {
|
|
|
992
993
|
}
|
|
993
994
|
}, MotionCard = motion.create(Card), MotionFlex = motion.create(Flex), MotionText = motion.create(Text), MotionBox = motion.create(Box);
|
|
994
995
|
function useMounted() {
|
|
995
|
-
return useSyncExternalStore(subscribe, _temp$
|
|
996
|
+
return useSyncExternalStore(subscribe, _temp$2, _temp2$1);
|
|
996
997
|
}
|
|
997
|
-
function _temp2() {
|
|
998
|
+
function _temp2$1() {
|
|
998
999
|
return !1;
|
|
999
1000
|
}
|
|
1000
|
-
function _temp$
|
|
1001
|
+
function _temp$2() {
|
|
1001
1002
|
return !0;
|
|
1002
1003
|
}
|
|
1003
1004
|
const subscribe = () => () => {
|
|
@@ -1063,14 +1064,14 @@ function ToastProvider(props) {
|
|
|
1063
1064
|
}, $[1] = t3) : t3 = $[1], t2 = t3;
|
|
1064
1065
|
const value = t2;
|
|
1065
1066
|
let t4;
|
|
1066
|
-
$[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t4 = mounted && /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsx(ToastLayer, { padding, paddingX, paddingY, gap, children: /* @__PURE__ */ jsx(AnimatePresence, { initial: !1, mode: "popLayout", children: state.map(_temp) }) }) }), $[2] = gap, $[3] = mounted, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = state, $[8] = zOffset, $[9] = t4) : t4 = $[9];
|
|
1067
|
+
$[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t4 = mounted && /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsx(ToastLayer, { padding, paddingX, paddingY, gap, children: /* @__PURE__ */ jsx(AnimatePresence, { initial: !1, mode: "popLayout", children: state.map(_temp$1) }) }) }), $[2] = gap, $[3] = mounted, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = state, $[8] = zOffset, $[9] = t4) : t4 = $[9];
|
|
1067
1068
|
let t5;
|
|
1068
1069
|
return $[10] !== children || $[11] !== t4 ? (t5 = /* @__PURE__ */ jsxs(ToastContext.Provider, { value, children: [
|
|
1069
1070
|
children,
|
|
1070
1071
|
t4
|
|
1071
1072
|
] }), $[10] = children, $[11] = t4, $[12] = t5) : t5 = $[12], t5;
|
|
1072
1073
|
}
|
|
1073
|
-
function _temp(t0) {
|
|
1074
|
+
function _temp$1(t0) {
|
|
1074
1075
|
const {
|
|
1075
1076
|
dismiss: dismiss_0,
|
|
1076
1077
|
id: id_0,
|
|
@@ -1381,6 +1382,37 @@ const TreeGroup = memo(function(props) {
|
|
|
1381
1382
|
] });
|
|
1382
1383
|
});
|
|
1383
1384
|
TreeItem.displayName = "Memo(TreeItem)";
|
|
1385
|
+
function RootClassNames(props) {
|
|
1386
|
+
const $ = c(7), {
|
|
1387
|
+
element
|
|
1388
|
+
} = props, {
|
|
1389
|
+
scheme,
|
|
1390
|
+
tone
|
|
1391
|
+
} = useCard() ?? {};
|
|
1392
|
+
let t0;
|
|
1393
|
+
$[0] !== scheme || $[1] !== tone ? (t0 = () => {
|
|
1394
|
+
const els = document.querySelectorAll([scopeClassName("button"), scopeClassName("card"), scopeClassName("font")].map(_temp).join(", "));
|
|
1395
|
+
for (const el of els)
|
|
1396
|
+
el instanceof HTMLElement && (el.style.transition = "none");
|
|
1397
|
+
return _raf2(() => {
|
|
1398
|
+
document.documentElement.className = card({
|
|
1399
|
+
scheme,
|
|
1400
|
+
tone
|
|
1401
|
+
}) ?? "", _raf2(() => {
|
|
1402
|
+
for (const el_0 of els)
|
|
1403
|
+
el_0 instanceof HTMLElement && (el_0.style.transition = "");
|
|
1404
|
+
});
|
|
1405
|
+
}), _temp2;
|
|
1406
|
+
}, $[0] = scheme, $[1] = tone, $[2] = t0) : t0 = $[2];
|
|
1407
|
+
let t1;
|
|
1408
|
+
return $[3] !== element || $[4] !== scheme || $[5] !== tone ? (t1 = [element, scheme, tone], $[3] = element, $[4] = scheme, $[5] = tone, $[6] = t1) : t1 = $[6], useEffect(t0, t1), null;
|
|
1409
|
+
}
|
|
1410
|
+
function _temp2() {
|
|
1411
|
+
document.documentElement.className = "";
|
|
1412
|
+
}
|
|
1413
|
+
function _temp(n) {
|
|
1414
|
+
return `.${n}`;
|
|
1415
|
+
}
|
|
1384
1416
|
function StyleTags(props) {
|
|
1385
1417
|
const $ = c(10), {
|
|
1386
1418
|
theme: themeProp
|
|
@@ -1448,6 +1480,7 @@ export {
|
|
|
1448
1480
|
Portal,
|
|
1449
1481
|
PortalProvider,
|
|
1450
1482
|
Radio,
|
|
1483
|
+
RootClassNames,
|
|
1451
1484
|
Select,
|
|
1452
1485
|
Skeleton,
|
|
1453
1486
|
Spinner,
|