@sanity/ui 2.0.12 → 2.0.13-alpha.2
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/getScopedTheme.js +547 -0
- package/dist/_chunks-cjs/getScopedTheme.js.map +1 -0
- package/dist/_chunks-es/getScopedTheme.mjs +548 -0
- package/dist/_chunks-es/getScopedTheme.mjs.map +1 -0
- package/dist/_legacy/getScopedTheme.esm.js +548 -0
- package/dist/_legacy/getScopedTheme.esm.js.map +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +74 -74
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +202 -202
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +74 -74
- package/dist/index.mjs.map +1 -1
- package/dist/theme.d.mts +1 -1
- package/dist/theme.d.ts +1 -1
- package/dist/theme.esm.js +51 -587
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +22 -560
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +51 -587
- package/dist/theme.mjs.map +1 -1
- package/package.json +1 -1
- package/src/core/components/autocomplete/autocomplete.styles.tsx +1 -1
- package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +1 -1
- package/src/core/components/dialog/__workshop__/panes.tsx +1 -1
- package/src/core/components/dialog/dialog.tsx +1 -1
- package/src/core/components/dialog/styles.ts +3 -3
- package/src/core/components/hotkeys/hotkeys.tsx +1 -1
- package/src/core/components/menu/menu.tsx +1 -1
- package/src/core/components/menu/menuDivider.ts +1 -1
- package/src/core/components/skeleton/skeleton.tsx +1 -1
- package/src/core/components/skeleton/textSkeleton.tsx +3 -3
- package/src/core/components/tab/tab.tsx +1 -1
- package/src/core/components/tab/tabList.tsx +1 -1
- package/src/core/components/toast/toast.tsx +1 -1
- package/src/core/components/toast/toastProvider.tsx +1 -1
- package/src/core/components/tree/style.ts +2 -3
- package/src/core/components/tree/treeItem.tsx +1 -1
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +1 -1
- package/src/core/primitives/_selectable/selectable.tsx +1 -1
- package/src/core/primitives/_selectable/style.ts +1 -2
- package/src/core/primitives/avatar/avatar.tsx +1 -1
- package/src/core/primitives/avatar/avatarCounter.tsx +3 -4
- package/src/core/primitives/avatar/avatarStack.tsx +2 -3
- package/src/core/primitives/avatar/styles.ts +3 -3
- package/src/core/primitives/badge/badge.tsx +1 -1
- package/src/core/primitives/box/box.tsx +1 -1
- package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +1 -1
- package/src/core/primitives/button/__workshop__/styled1.tsx +1 -1
- package/src/core/primitives/button/__workshop__/styled2.tsx +1 -1
- package/src/core/primitives/button/button.tsx +1 -1
- package/src/core/primitives/button/styles.ts +3 -3
- package/src/core/primitives/card/__workshop__/selected.tsx +3 -3
- package/src/core/primitives/card/__workshop__/styled.tsx +1 -1
- package/src/core/primitives/card/card.tsx +1 -1
- package/src/core/primitives/card/styles.ts +2 -3
- package/src/core/primitives/checkbox/checkbox.tsx +1 -1
- package/src/core/primitives/checkbox/styles.ts +1 -2
- package/src/core/primitives/code/code.tsx +1 -1
- package/src/core/primitives/code/styles.ts +1 -4
- package/src/core/primitives/container/container.tsx +1 -1
- package/src/core/primitives/container/styles.ts +2 -2
- package/src/core/primitives/flex/__workshop__/example.tsx +1 -1
- package/src/core/primitives/flex/flex.tsx +1 -1
- package/src/core/primitives/grid/grid.tsx +1 -1
- package/src/core/primitives/heading/heading.tsx +1 -1
- package/src/core/primitives/heading/styles.ts +1 -2
- package/src/core/primitives/inline/inline.tsx +1 -1
- package/src/core/primitives/inline/styles.ts +2 -2
- package/src/core/primitives/kbd/kbd.tsx +1 -1
- package/src/core/primitives/label/label.tsx +1 -1
- package/src/core/primitives/label/styles.ts +1 -2
- package/src/core/primitives/popover/popoverCard.tsx +1 -1
- package/src/core/primitives/radio/radio.tsx +1 -1
- package/src/core/primitives/radio/styles.ts +1 -2
- package/src/core/primitives/select/select.tsx +1 -1
- package/src/core/primitives/select/styles.ts +5 -5
- package/src/core/primitives/spinner/spinner.tsx +1 -1
- package/src/core/primitives/stack/stack.tsx +1 -1
- package/src/core/primitives/stack/styles.ts +2 -2
- package/src/core/primitives/switch/styles.ts +3 -4
- package/src/core/primitives/switch/switch.tsx +1 -1
- package/src/core/primitives/text/__workshop__/colored.tsx +3 -3
- package/src/core/primitives/text/styles.ts +1 -2
- package/src/core/primitives/text/text.tsx +1 -1
- package/src/core/primitives/textArea/textArea.tsx +1 -1
- package/src/core/primitives/textInput/textInput.tsx +1 -1
- package/src/core/primitives/tooltip/tooltip.tsx +1 -1
- package/src/core/primitives/tooltip/tooltipCard.tsx +1 -1
- package/src/core/styles/border/borderStyle.ts +6 -6
- package/src/core/styles/box/boxStyle.ts +5 -5
- package/src/core/styles/flex/flexItemStyle.ts +2 -2
- package/src/core/styles/flex/flexStyle.ts +6 -6
- package/src/core/styles/font/responsiveFont.ts +2 -2
- package/src/core/styles/font/textAlignStyle.ts +2 -2
- package/src/core/styles/grid/gridItemStyle.ts +7 -7
- package/src/core/styles/grid/gridStyle.ts +9 -9
- package/src/core/styles/helpers.ts +2 -2
- package/src/core/styles/input/responsiveInputPaddingStyle.ts +2 -2
- package/src/core/styles/input/textInputStyle.ts +4 -4
- package/src/core/styles/margin/marginsStyle.test.ts +1 -1
- package/src/core/styles/padding/paddingStyle.test.ts +1 -1
- package/src/core/styles/radius/radiusStyle.ts +2 -2
- package/src/core/styles/shadow/shadowStyle.ts +2 -2
- package/src/core/theme/__workshop__/build/Root.tsx +1 -2
- package/src/core/theme/theme.test.tsx +1 -1
- package/src/core/theme/themeProvider.tsx +6 -7
- package/src/core/theme/useTheme.ts +2 -1
- package/src/core/utils/arrow/arrow.tsx +1 -1
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +1 -1
- package/src/core/utils/layer/layer.tsx +1 -1
- package/src/core/utils/srOnly/srOnly.tsx +1 -1
- package/src/core/utils/virtualList/virtualList.tsx +1 -1
- package/src/theme/system/theme.ts +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { buildTheme, 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
|
|
1
|
+
import { buildTheme, 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 } from "@sanity/ui/theme";
|
|
2
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo, useState, useRef, useEffect, createContext, useContext, useSyncExternalStore, useLayoutEffect, forwardRef, useId, useCallback, cloneElement, isValidElement, createElement, Component, memo, useReducer, Children, Fragment as Fragment$1, startTransition } from "react";
|
|
4
4
|
import ReactIs, { isElement as isElement$1, isFragment, isValidElementType } from "react-is";
|
|
5
|
-
import { ThemeProvider as ThemeProvider$1, useTheme as useTheme$1, css,
|
|
5
|
+
import styled, { ThemeProvider as ThemeProvider$1, useTheme as useTheme$1, css, keyframes } from "styled-components";
|
|
6
|
+
import "@sanity/color";
|
|
7
|
+
import { g as getScopedTheme, a as getTheme_v2 } from "./_legacy/getScopedTheme.esm.js";
|
|
6
8
|
import { SpinnerIcon, CheckmarkIcon, RemoveIcon, ChevronDownIcon, CloseIcon, ChevronRightIcon, ToggleArrowRightIcon } from "@sanity/icons";
|
|
7
9
|
import Refractor from "react-refractor";
|
|
8
10
|
import { detectOverflow, flip, offset, shift, arrow, hide, useFloating, autoUpdate } from "@floating-ui/react-dom";
|
|
@@ -45,7 +47,7 @@ function _getResponsiveSpace(theme, props, spaceIndexes = EMPTY_ARRAY) {
|
|
|
45
47
|
throw new Error("the property must be array of numbers");
|
|
46
48
|
if (spaceIndexes.length === 0)
|
|
47
49
|
return null;
|
|
48
|
-
const { media, space } =
|
|
50
|
+
const { media, space } = theme.sanity.v2;
|
|
49
51
|
return _responsive(
|
|
50
52
|
media,
|
|
51
53
|
spaceIndexes,
|
|
@@ -53,7 +55,7 @@ function _getResponsiveSpace(theme, props, spaceIndexes = EMPTY_ARRAY) {
|
|
|
53
55
|
);
|
|
54
56
|
}
|
|
55
57
|
function responsiveFont(fontKey, props) {
|
|
56
|
-
const { $size, $weight } = props, { font, media } =
|
|
58
|
+
const { $size, $weight } = props, { font, media } = props.theme.sanity.v2, { family, sizes, weights } = font[fontKey], fontWeight = $weight && weights[$weight] || weights.regular, defaultSize = sizes[2], base = {
|
|
57
59
|
position: "relative",
|
|
58
60
|
fontFamily: family,
|
|
59
61
|
fontWeight,
|
|
@@ -114,7 +116,7 @@ function responsiveLabelFont(props) {
|
|
|
114
116
|
return responsiveFont("label", props);
|
|
115
117
|
}
|
|
116
118
|
function responsiveTextAlignStyle(props) {
|
|
117
|
-
const { media } =
|
|
119
|
+
const { media } = props.theme.sanity.v2;
|
|
118
120
|
return _responsive(media, props.$align, (textAlign) => ({ textAlign }));
|
|
119
121
|
}
|
|
120
122
|
function responsiveTextFont(props) {
|
|
@@ -532,7 +534,7 @@ function ThemeProvider(props) {
|
|
|
532
534
|
scheme,
|
|
533
535
|
tone
|
|
534
536
|
} : null, [rootTheme, scheme, tone]), theme = useMemo(() => rootTheme ? getScopedTheme(rootTheme, scheme, tone) : null, [scheme, rootTheme, tone]);
|
|
535
|
-
return theme ? /* @__PURE__ */ jsx(ThemeContext.Provider, { value: themeContext, children: /* @__PURE__ */ jsx(ThemeProvider$1, { theme, children }) }) : /* @__PURE__ */ jsx("pre", { children: 'ThemeProvider: no "theme" property provided' });
|
|
537
|
+
return theme ? theme.sanity.v2 ? /* @__PURE__ */ jsx(ThemeContext.Provider, { value: themeContext, children: /* @__PURE__ */ jsx(ThemeProvider$1, { theme, children }) }) : /* @__PURE__ */ jsx("pre", { children: 'ThemeProvider: no "theme.sanity.v2" property in theme' }) : /* @__PURE__ */ jsx("pre", { children: 'ThemeProvider: no "theme" property provided' });
|
|
536
538
|
}
|
|
537
539
|
function useRootTheme() {
|
|
538
540
|
const value = useContext(ThemeContext);
|
|
@@ -645,7 +647,7 @@ function responsiveBorderStyle() {
|
|
|
645
647
|
}
|
|
646
648
|
function border(props) {
|
|
647
649
|
var _a, _b;
|
|
648
|
-
const { card, media } =
|
|
650
|
+
const { card, media } = props.theme.sanity.v2, borderStyle = `${(_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1}px solid var(--card-border-color)`;
|
|
649
651
|
return _responsive(
|
|
650
652
|
media,
|
|
651
653
|
props.$border,
|
|
@@ -654,7 +656,7 @@ function border(props) {
|
|
|
654
656
|
}
|
|
655
657
|
function borderTop(props) {
|
|
656
658
|
var _a, _b;
|
|
657
|
-
const { card, media } =
|
|
659
|
+
const { card, media } = props.theme.sanity.v2, borderStyle = `${(_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1}px solid var(--card-border-color)`;
|
|
658
660
|
return _responsive(
|
|
659
661
|
media,
|
|
660
662
|
props.$borderTop,
|
|
@@ -663,7 +665,7 @@ function borderTop(props) {
|
|
|
663
665
|
}
|
|
664
666
|
function borderRight(props) {
|
|
665
667
|
var _a, _b;
|
|
666
|
-
const { card, media } =
|
|
668
|
+
const { card, media } = props.theme.sanity.v2, borderStyle = `${(_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1}px solid var(--card-border-color)`;
|
|
667
669
|
return _responsive(
|
|
668
670
|
media,
|
|
669
671
|
props.$borderRight,
|
|
@@ -672,7 +674,7 @@ function borderRight(props) {
|
|
|
672
674
|
}
|
|
673
675
|
function borderBottom(props) {
|
|
674
676
|
var _a, _b;
|
|
675
|
-
const { card, media } =
|
|
677
|
+
const { card, media } = props.theme.sanity.v2, borderStyle = `${(_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1}px solid var(--card-border-color)`;
|
|
676
678
|
return _responsive(
|
|
677
679
|
media,
|
|
678
680
|
props.$borderBottom,
|
|
@@ -681,7 +683,7 @@ function borderBottom(props) {
|
|
|
681
683
|
}
|
|
682
684
|
function borderLeft(props) {
|
|
683
685
|
var _a, _b;
|
|
684
|
-
const { card, media } =
|
|
686
|
+
const { card, media } = props.theme.sanity.v2, borderStyle = `${(_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1}px solid var(--card-border-color)`;
|
|
685
687
|
return _responsive(
|
|
686
688
|
media,
|
|
687
689
|
props.$borderLeft,
|
|
@@ -711,25 +713,25 @@ function responsiveBoxStyle() {
|
|
|
711
713
|
];
|
|
712
714
|
}
|
|
713
715
|
function responsiveBoxDisplayStyle(props) {
|
|
714
|
-
const { media } =
|
|
716
|
+
const { media } = props.theme.sanity.v2;
|
|
715
717
|
return _responsive(media, props.$display, (display) => ({
|
|
716
718
|
"&:not([hidden])": { display }
|
|
717
719
|
}));
|
|
718
720
|
}
|
|
719
721
|
function responsiveBoxSizingStyle(props) {
|
|
720
|
-
const { media } =
|
|
722
|
+
const { media } = props.theme.sanity.v2;
|
|
721
723
|
return _responsive(media, props.$sizing, (sizing) => ({
|
|
722
724
|
boxSizing: BOX_SIZING[sizing]
|
|
723
725
|
}));
|
|
724
726
|
}
|
|
725
727
|
function responsiveBoxHeightStyle(props) {
|
|
726
|
-
const { media } =
|
|
728
|
+
const { media } = props.theme.sanity.v2;
|
|
727
729
|
return _responsive(media, props.$height, (height) => ({
|
|
728
730
|
height: BOX_HEIGHT[height]
|
|
729
731
|
}));
|
|
730
732
|
}
|
|
731
733
|
function responsiveBoxOverflowStyle(props) {
|
|
732
|
-
const { media } =
|
|
734
|
+
const { media } = props.theme.sanity.v2;
|
|
733
735
|
return _responsive(media, props.$overflow, (overflow) => ({
|
|
734
736
|
overflow
|
|
735
737
|
}));
|
|
@@ -750,25 +752,25 @@ function responsiveFlexStyle() {
|
|
|
750
752
|
];
|
|
751
753
|
}
|
|
752
754
|
function responsiveFlexAlignStyle(props) {
|
|
753
|
-
const { media } =
|
|
755
|
+
const { media } = props.theme.sanity.v2;
|
|
754
756
|
return _responsive(media, props.$align, (align) => ({ alignItems: align }));
|
|
755
757
|
}
|
|
756
758
|
function responsiveFlexGapStyle(props) {
|
|
757
|
-
const { media, space } =
|
|
759
|
+
const { media, space } = props.theme.sanity.v2;
|
|
758
760
|
return _responsive(media, props.$gap, (gap) => ({
|
|
759
761
|
gap: gap ? rem(space[gap]) : void 0
|
|
760
762
|
}));
|
|
761
763
|
}
|
|
762
764
|
function responsiveFlexWrapStyle(props) {
|
|
763
|
-
const { media } =
|
|
765
|
+
const { media } = props.theme.sanity.v2;
|
|
764
766
|
return _responsive(media, props.$wrap, (wrap) => ({ flexWrap: wrap }));
|
|
765
767
|
}
|
|
766
768
|
function responsiveFlexJustifyStyle(props) {
|
|
767
|
-
const { media } =
|
|
769
|
+
const { media } = props.theme.sanity.v2;
|
|
768
770
|
return _responsive(media, props.$justify, (justify) => ({ justifyContent: justify }));
|
|
769
771
|
}
|
|
770
772
|
function responsiveFlexDirectionStyle(props) {
|
|
771
|
-
const { media } =
|
|
773
|
+
const { media } = props.theme.sanity.v2;
|
|
772
774
|
return _responsive(media, props.$direction, (direction) => ({ flexDirection: direction }));
|
|
773
775
|
}
|
|
774
776
|
const BASE_STYLE$2 = {
|
|
@@ -779,7 +781,7 @@ function flexItemStyle() {
|
|
|
779
781
|
return [BASE_STYLE$2, responsiveFlexItemStyle];
|
|
780
782
|
}
|
|
781
783
|
function responsiveFlexItemStyle(props) {
|
|
782
|
-
const { media } =
|
|
784
|
+
const { media } = props.theme.sanity.v2;
|
|
783
785
|
return props.$flex ? _responsive(media, props.$flex, (flex) => ({ flex })) : EMPTY_ARRAY;
|
|
784
786
|
}
|
|
785
787
|
function focusRingBorderStyle(border2) {
|
|
@@ -826,49 +828,49 @@ function responsiveGridStyle() {
|
|
|
826
828
|
];
|
|
827
829
|
}
|
|
828
830
|
function responsiveGridAutoFlowStyle(props) {
|
|
829
|
-
const { media } =
|
|
831
|
+
const { media } = props.theme.sanity.v2;
|
|
830
832
|
return _responsive(media, props.$autoFlow, (autoFlow) => ({
|
|
831
833
|
gridAutoFlow: autoFlow
|
|
832
834
|
}));
|
|
833
835
|
}
|
|
834
836
|
function responsiveGridAutoRowsStyle(props) {
|
|
835
|
-
const { media } =
|
|
837
|
+
const { media } = props.theme.sanity.v2;
|
|
836
838
|
return _responsive(media, props.$autoRows, (autoRows) => ({
|
|
837
839
|
gridAutoRows: autoRows && GRID_AUTO_ROWS[autoRows]
|
|
838
840
|
}));
|
|
839
841
|
}
|
|
840
842
|
function responsiveGridAutoColsStyle(props) {
|
|
841
|
-
const { media } =
|
|
843
|
+
const { media } = props.theme.sanity.v2;
|
|
842
844
|
return _responsive(media, props.$autoCols, (autoCols) => ({
|
|
843
845
|
gridAutoColumns: autoCols && GRID_AUTO_COLUMS[autoCols]
|
|
844
846
|
}));
|
|
845
847
|
}
|
|
846
848
|
function responsiveGridColumnsStyle(props) {
|
|
847
|
-
const { media } =
|
|
849
|
+
const { media } = props.theme.sanity.v2;
|
|
848
850
|
return _responsive(media, props.$columns, (columns) => ({
|
|
849
851
|
gridTemplateColumns: columns && `repeat(${columns},minmax(0,1fr));`
|
|
850
852
|
}));
|
|
851
853
|
}
|
|
852
854
|
function responsiveGridRowsStyle(props) {
|
|
853
|
-
const { media } =
|
|
855
|
+
const { media } = props.theme.sanity.v2;
|
|
854
856
|
return _responsive(media, props.$rows, (rows) => ({
|
|
855
857
|
gridTemplateRows: rows && `repeat(${rows},minmax(0,1fr));`
|
|
856
858
|
}));
|
|
857
859
|
}
|
|
858
860
|
function responsiveGridGapStyle(props) {
|
|
859
|
-
const { media, space } =
|
|
861
|
+
const { media, space } = props.theme.sanity.v2;
|
|
860
862
|
return _responsive(media, props.$gap, (gap) => ({
|
|
861
863
|
gridGap: gap ? rem(space[gap]) : void 0
|
|
862
864
|
}));
|
|
863
865
|
}
|
|
864
866
|
function responsiveGridGapXStyle(props) {
|
|
865
|
-
const { media, space } =
|
|
867
|
+
const { media, space } = props.theme.sanity.v2;
|
|
866
868
|
return _responsive(media, props.$gapX, (gapX) => ({
|
|
867
869
|
columnGap: gapX ? rem(space[gapX]) : void 0
|
|
868
870
|
}));
|
|
869
871
|
}
|
|
870
872
|
function responsiveGridGapYStyle(props) {
|
|
871
|
-
const { media, space } =
|
|
873
|
+
const { media, space } = props.theme.sanity.v2;
|
|
872
874
|
return _responsive(media, props.$gapY, (gapY) => ({
|
|
873
875
|
rowGap: gapY ? rem(space[gapY]) : void 0
|
|
874
876
|
}));
|
|
@@ -891,37 +893,37 @@ const GRID_ITEM_ROW = {
|
|
|
891
893
|
full: "1 / -1"
|
|
892
894
|
};
|
|
893
895
|
function responsiveGridItemRowStyle(props) {
|
|
894
|
-
const { media } =
|
|
896
|
+
const { media } = props.theme.sanity.v2;
|
|
895
897
|
return _responsive(media, props.$row, (row) => typeof row == "number" ? { gridRow: `span ${row} / span ${row}` } : { gridRow: GRID_ITEM_ROW[row] });
|
|
896
898
|
}
|
|
897
899
|
function responsiveGridItemRowStartStyle(props) {
|
|
898
|
-
const { media } =
|
|
900
|
+
const { media } = props.theme.sanity.v2;
|
|
899
901
|
return _responsive(media, props.$rowStart, (rowStart) => ({
|
|
900
902
|
gridRowStart: rowStart
|
|
901
903
|
}));
|
|
902
904
|
}
|
|
903
905
|
function responsiveGridItemRowEndStyle(props) {
|
|
904
|
-
const { media } =
|
|
906
|
+
const { media } = props.theme.sanity.v2;
|
|
905
907
|
return _responsive(media, props.$rowEnd, (rowEnd) => ({ gridRowEnd: rowEnd }));
|
|
906
908
|
}
|
|
907
909
|
function responsiveGridItemColumnStyle(props) {
|
|
908
|
-
const { media } =
|
|
910
|
+
const { media } = props.theme.sanity.v2;
|
|
909
911
|
return _responsive(media, props.$column, (column) => typeof column == "number" ? { gridColumn: `span ${column} / span ${column}` } : { gridColumn: GRID_ITEM_COLUMN[column] });
|
|
910
912
|
}
|
|
911
913
|
function responsiveGridItemColumnStartStyle(props) {
|
|
912
|
-
const { media } =
|
|
914
|
+
const { media } = props.theme.sanity.v2;
|
|
913
915
|
return _responsive(media, props.$columnStart, (columnStart) => ({
|
|
914
916
|
gridColumnStart: columnStart
|
|
915
917
|
}));
|
|
916
918
|
}
|
|
917
919
|
function responsiveGridItemColumnEndStyle(props) {
|
|
918
|
-
const { media } =
|
|
920
|
+
const { media } = props.theme.sanity.v2;
|
|
919
921
|
return _responsive(media, props.$columnEnd, (columnEnd) => ({
|
|
920
922
|
gridColumnEnd: columnEnd
|
|
921
923
|
}));
|
|
922
924
|
}
|
|
923
925
|
function responsiveInputPaddingStyle(props) {
|
|
924
|
-
const { $fontSize, $iconLeft, $iconRight, $padding, $space } = props, { font, media, space } =
|
|
926
|
+
const { $fontSize, $iconLeft, $iconRight, $padding, $space } = props, { font, media, space } = props.theme.sanity.v2, len = Math.max($padding.length, $space.length, $fontSize.length), _padding = [], _space = [], _fontSize = [];
|
|
925
927
|
for (let i = 0; i < len; i += 1)
|
|
926
928
|
_fontSize[i] = $fontSize[i] === void 0 ? _fontSize[i - 1] : $fontSize[i], _padding[i] = $padding[i] === void 0 ? _padding[i - 1] : $padding[i], _space[i] = $space[i] === void 0 ? _space[i - 1] : $space[i];
|
|
927
929
|
return _responsive(media, _padding, (_, i) => {
|
|
@@ -948,7 +950,7 @@ function textInputRootStyle() {
|
|
|
948
950
|
return ROOT_STYLE;
|
|
949
951
|
}
|
|
950
952
|
function textInputBaseStyle(props) {
|
|
951
|
-
const { $scheme, $tone, $weight } = props, { color, font } =
|
|
953
|
+
const { $scheme, $tone, $weight } = props, { color, font } = props.theme.sanity.v2;
|
|
952
954
|
return css`
|
|
953
955
|
appearance: none;
|
|
954
956
|
background: none;
|
|
@@ -1016,7 +1018,7 @@ function textInputBaseStyle(props) {
|
|
|
1016
1018
|
`;
|
|
1017
1019
|
}
|
|
1018
1020
|
function textInputFontSizeStyle(props) {
|
|
1019
|
-
const { font, media } =
|
|
1021
|
+
const { font, media } = props.theme.sanity.v2;
|
|
1020
1022
|
return _responsive(media, props.$fontSize, (sizeIndex) => {
|
|
1021
1023
|
const size2 = font.text.sizes[sizeIndex] || font.text.sizes[2];
|
|
1022
1024
|
return {
|
|
@@ -1026,7 +1028,7 @@ function textInputFontSizeStyle(props) {
|
|
|
1026
1028
|
});
|
|
1027
1029
|
}
|
|
1028
1030
|
function textInputRepresentationStyle(props) {
|
|
1029
|
-
const { $hasPrefix, $hasSuffix, $scheme, $tone, $unstableDisableFocusRing } = props, { color, input } =
|
|
1031
|
+
const { $hasPrefix, $hasSuffix, $scheme, $tone, $unstableDisableFocusRing } = props, { color, input } = props.theme.sanity.v2;
|
|
1030
1032
|
return css`
|
|
1031
1033
|
--input-box-shadow: none;
|
|
1032
1034
|
|
|
@@ -1178,7 +1180,7 @@ function responsivePaddingStyle(props) {
|
|
|
1178
1180
|
].filter(Boolean);
|
|
1179
1181
|
}
|
|
1180
1182
|
function responsiveRadiusStyle(props) {
|
|
1181
|
-
const { media, radius } =
|
|
1183
|
+
const { media, radius } = props.theme.sanity.v2;
|
|
1182
1184
|
return _responsive(media, props.$radius, (value) => {
|
|
1183
1185
|
let borderRadius = 0;
|
|
1184
1186
|
return typeof value == "number" && (borderRadius = rem(radius[value])), value === "full" && (borderRadius = "9999px"), { borderRadius };
|
|
@@ -1194,7 +1196,7 @@ function shadowStyle(shadow, outlineWidth = 1) {
|
|
|
1194
1196
|
return { boxShadow: `${outline}, ${umbra}, ${penumbra}, ${ambient}` };
|
|
1195
1197
|
}
|
|
1196
1198
|
function responsiveShadowStyle(props) {
|
|
1197
|
-
const { card, media, shadow } =
|
|
1199
|
+
const { card, media, shadow } = props.theme.sanity.v2;
|
|
1198
1200
|
return _responsive(
|
|
1199
1201
|
media,
|
|
1200
1202
|
props.$shadow,
|
|
@@ -1202,7 +1204,7 @@ function responsiveShadowStyle(props) {
|
|
|
1202
1204
|
);
|
|
1203
1205
|
}
|
|
1204
1206
|
function labelBaseStyle(props) {
|
|
1205
|
-
const { $accent, $muted } = props, { font } =
|
|
1207
|
+
const { $accent, $muted } = props, { font } = props.theme.sanity.v2;
|
|
1206
1208
|
return css`
|
|
1207
1209
|
text-transform: uppercase;
|
|
1208
1210
|
|
|
@@ -1313,7 +1315,7 @@ function avatarArrowStyle() {
|
|
|
1313
1315
|
};
|
|
1314
1316
|
}
|
|
1315
1317
|
function avatarRootStyle(props) {
|
|
1316
|
-
const { $color } = props, { avatar } =
|
|
1318
|
+
const { $color } = props, { avatar } = props.theme.sanity.v2;
|
|
1317
1319
|
return {
|
|
1318
1320
|
"--avatar-bg-color": `var(--card-avatar-${$color}-bg-color)`,
|
|
1319
1321
|
"--avatar-fg-color": `var(--card-avatar-${$color}-fg-color)`,
|
|
@@ -1350,7 +1352,7 @@ function avatarRootStyle(props) {
|
|
|
1350
1352
|
};
|
|
1351
1353
|
}
|
|
1352
1354
|
function responsiveAvatarSizeStyle(props) {
|
|
1353
|
-
const { avatar, media } =
|
|
1355
|
+
const { avatar, media } = props.theme.sanity.v2;
|
|
1354
1356
|
return _responsive(media, props.$size, (size2) => {
|
|
1355
1357
|
const avatarSize = avatar.sizes[size2] || avatar.sizes[0];
|
|
1356
1358
|
return {
|
|
@@ -1497,7 +1499,7 @@ const Root$B = styled.div(
|
|
|
1497
1499
|
);
|
|
1498
1500
|
});
|
|
1499
1501
|
function _responsiveAvatarCounterSizeStyle(props) {
|
|
1500
|
-
const { avatar, media } =
|
|
1502
|
+
const { avatar, media } = props.theme.sanity.v2;
|
|
1501
1503
|
return _responsive(media, props.$size, (size2) => {
|
|
1502
1504
|
const avatarSize = avatar.sizes[size2];
|
|
1503
1505
|
return avatarSize ? {
|
|
@@ -1508,7 +1510,7 @@ function _responsiveAvatarCounterSizeStyle(props) {
|
|
|
1508
1510
|
});
|
|
1509
1511
|
}
|
|
1510
1512
|
function _avatarCounterBaseStyle(props) {
|
|
1511
|
-
const { space } =
|
|
1513
|
+
const { space } = props.theme.sanity.v2;
|
|
1512
1514
|
return css`
|
|
1513
1515
|
align-items: center;
|
|
1514
1516
|
justify-content: center;
|
|
@@ -1557,7 +1559,7 @@ function avatarStackStyle() {
|
|
|
1557
1559
|
return BASE_STYLES;
|
|
1558
1560
|
}
|
|
1559
1561
|
function responsiveAvatarStackSizeStyle(props) {
|
|
1560
|
-
const { avatar, media } =
|
|
1562
|
+
const { avatar, media } = props.theme.sanity.v2;
|
|
1561
1563
|
return _responsive(media, props.$size, (size2) => {
|
|
1562
1564
|
const avatarSize = avatar.sizes[size2];
|
|
1563
1565
|
return avatarSize ? {
|
|
@@ -1656,7 +1658,7 @@ const Root$z = styled.div(responsiveAvatarStackSizeStyle, avatarStackStyle), Ava
|
|
|
1656
1658
|
);
|
|
1657
1659
|
});
|
|
1658
1660
|
function textBaseStyle(props) {
|
|
1659
|
-
const { $accent, $muted } = props, { font } =
|
|
1661
|
+
const { $accent, $muted } = props, { font } = props.theme.sanity.v2;
|
|
1660
1662
|
return css`
|
|
1661
1663
|
color: var(--card-fg-color);
|
|
1662
1664
|
|
|
@@ -1900,7 +1902,7 @@ function _cardColorStyle(base, color, checkered = !1) {
|
|
|
1900
1902
|
};
|
|
1901
1903
|
}
|
|
1902
1904
|
function buttonBaseStyles(props) {
|
|
1903
|
-
const { $width } = props, { style } =
|
|
1905
|
+
const { $width } = props, { style } = props.theme.sanity.v2;
|
|
1904
1906
|
return css`
|
|
1905
1907
|
${style == null ? void 0 : style.button};
|
|
1906
1908
|
|
|
@@ -1946,7 +1948,7 @@ function combineBoxShadow(...boxShadows) {
|
|
|
1946
1948
|
}
|
|
1947
1949
|
function buttonColorStyles(props) {
|
|
1948
1950
|
var _a;
|
|
1949
|
-
const { $mode } = props, { button, color: baseColor, style } =
|
|
1951
|
+
const { $mode } = props, { button, color: baseColor, style } = props.theme.sanity.v2, shadow = props.$mode === "ghost", mode = baseColor.button[$mode] || baseColor.button.default, color = mode[props.$tone] || mode.default, border2 = {
|
|
1950
1952
|
width: button.border.width,
|
|
1951
1953
|
color: "var(--card-border-color)"
|
|
1952
1954
|
}, defaultBoxShadow = void 0;
|
|
@@ -2085,7 +2087,7 @@ function cardStyle(props) {
|
|
|
2085
2087
|
return [cardBaseStyle(props), cardColorStyle(props)];
|
|
2086
2088
|
}
|
|
2087
2089
|
function cardBaseStyle(props) {
|
|
2088
|
-
const { $checkered } = props, { space } =
|
|
2090
|
+
const { $checkered } = props, { space } = props.theme.sanity.v2;
|
|
2089
2091
|
return css`
|
|
2090
2092
|
${$checkered && css`
|
|
2091
2093
|
background-size: ${space[3]}px ${space[3]}px;
|
|
@@ -2119,7 +2121,7 @@ function cardBaseStyle(props) {
|
|
|
2119
2121
|
}
|
|
2120
2122
|
function cardColorStyle(props) {
|
|
2121
2123
|
var _a;
|
|
2122
|
-
const { $checkered, $focusRing } = props, { card, color, style } =
|
|
2124
|
+
const { $checkered, $focusRing } = props, { card, color, style } = props.theme.sanity.v2, border2 = { width: card.border.width, color: "var(--card-border-color)" };
|
|
2123
2125
|
return css`
|
|
2124
2126
|
color-scheme: ${color._dark ? "dark" : "light"};
|
|
2125
2127
|
|
|
@@ -2259,7 +2261,7 @@ function checkboxBaseStyles() {
|
|
|
2259
2261
|
`;
|
|
2260
2262
|
}
|
|
2261
2263
|
function inputElementStyles(props) {
|
|
2262
|
-
const { color, input, radius } =
|
|
2264
|
+
const { color, input, radius } = props.theme.sanity.v2, { focusRing } = input.checkbox;
|
|
2263
2265
|
return css`
|
|
2264
2266
|
position: absolute;
|
|
2265
2267
|
top: 0;
|
|
@@ -2405,9 +2407,7 @@ const Root$r = styled.div(checkboxBaseStyles), Input$5 = styled.input(inputEleme
|
|
|
2405
2407
|
] });
|
|
2406
2408
|
});
|
|
2407
2409
|
function codeSyntaxHighlightingStyle({ theme }) {
|
|
2408
|
-
const
|
|
2409
|
-
color: { syntax: color }
|
|
2410
|
-
} = getTheme_v2(theme);
|
|
2410
|
+
const color = theme.sanity.v2.color.syntax;
|
|
2411
2411
|
return {
|
|
2412
2412
|
"&.atrule": { color: color.atrule },
|
|
2413
2413
|
"&.attr-name": { color: color.attrName },
|
|
@@ -2490,7 +2490,7 @@ function containerBaseStyle() {
|
|
|
2490
2490
|
return BASE_STYLE$1;
|
|
2491
2491
|
}
|
|
2492
2492
|
function responsiveContainerWidthStyle(props) {
|
|
2493
|
-
const { container, media } =
|
|
2493
|
+
const { container, media } = props.theme.sanity.v2;
|
|
2494
2494
|
return _responsive(media, props.$width, (val) => ({
|
|
2495
2495
|
maxWidth: val === "auto" ? "none" : rem(container[val])
|
|
2496
2496
|
}));
|
|
@@ -2533,7 +2533,7 @@ const Root$p = styled(Box)(
|
|
|
2533
2533
|
);
|
|
2534
2534
|
});
|
|
2535
2535
|
function headingBaseStyle(props) {
|
|
2536
|
-
const { $accent, $muted } = props, { font } =
|
|
2536
|
+
const { $accent, $muted } = props, { font } = props.theme.sanity.v2;
|
|
2537
2537
|
return css`
|
|
2538
2538
|
${$accent && css`
|
|
2539
2539
|
color: var(--card-accent-fg-color);
|
|
@@ -2632,7 +2632,7 @@ function inlineBaseStyle() {
|
|
|
2632
2632
|
};
|
|
2633
2633
|
}
|
|
2634
2634
|
function inlineSpaceStyle(props) {
|
|
2635
|
-
const { media, space } =
|
|
2635
|
+
const { media, space } = props.theme.sanity.v2;
|
|
2636
2636
|
return _responsive(media, props.$space, (spaceIndex) => {
|
|
2637
2637
|
const _space = rem(spaceIndex === 0.5 ? space[1] / 2 : space[spaceIndex]);
|
|
2638
2638
|
return {
|
|
@@ -3501,7 +3501,7 @@ function radioBaseStyle() {
|
|
|
3501
3501
|
`;
|
|
3502
3502
|
}
|
|
3503
3503
|
function inputElementStyle(props) {
|
|
3504
|
-
const { color, input } =
|
|
3504
|
+
const { color, input } = props.theme.sanity.v2, dist = (input.radio.size - input.radio.markSize) / 2;
|
|
3505
3505
|
return css`
|
|
3506
3506
|
appearance: none;
|
|
3507
3507
|
position: absolute;
|
|
@@ -3626,7 +3626,7 @@ function rootStyle() {
|
|
|
3626
3626
|
`;
|
|
3627
3627
|
}
|
|
3628
3628
|
function inputBaseStyle(props) {
|
|
3629
|
-
const { font } =
|
|
3629
|
+
const { font } = props.theme.sanity.v2;
|
|
3630
3630
|
return css`
|
|
3631
3631
|
-webkit-font-smoothing: antialiased;
|
|
3632
3632
|
appearance: none;
|
|
@@ -3643,7 +3643,7 @@ function inputBaseStyle(props) {
|
|
|
3643
3643
|
`;
|
|
3644
3644
|
}
|
|
3645
3645
|
function inputColorStyle(props) {
|
|
3646
|
-
const { color, input } =
|
|
3646
|
+
const { color, input } = props.theme.sanity.v2;
|
|
3647
3647
|
return css`
|
|
3648
3648
|
/* enabled */
|
|
3649
3649
|
background-color: ${color.input.default.enabled.bg};
|
|
@@ -3698,7 +3698,7 @@ function textSize(size2) {
|
|
|
3698
3698
|
return { fontSize: rem(size2.fontSize), lineHeight: rem(size2.lineHeight) };
|
|
3699
3699
|
}
|
|
3700
3700
|
function inputTextSizeStyle(props) {
|
|
3701
|
-
const { $fontSize } = props, { font, media } =
|
|
3701
|
+
const { $fontSize } = props, { font, media } = props.theme.sanity.v2;
|
|
3702
3702
|
return _responsive(
|
|
3703
3703
|
media,
|
|
3704
3704
|
$fontSize,
|
|
@@ -3715,7 +3715,7 @@ function inputStyle() {
|
|
|
3715
3715
|
];
|
|
3716
3716
|
}
|
|
3717
3717
|
function iconBoxStyle(props) {
|
|
3718
|
-
const { color } =
|
|
3718
|
+
const { color } = props.theme.sanity.v2;
|
|
3719
3719
|
return css`
|
|
3720
3720
|
pointer-events: none;
|
|
3721
3721
|
position: absolute;
|
|
@@ -3791,7 +3791,7 @@ function stackBaseStyle() {
|
|
|
3791
3791
|
return BASE_STYLE;
|
|
3792
3792
|
}
|
|
3793
3793
|
function responsiveStackSpaceStyle(props) {
|
|
3794
|
-
const { media, space } =
|
|
3794
|
+
const { media, space } = props.theme.sanity.v2;
|
|
3795
3795
|
return _responsive(media, props.$space, (spaceIndex) => ({
|
|
3796
3796
|
gridGap: rem(space[spaceIndex])
|
|
3797
3797
|
}));
|
|
@@ -3837,7 +3837,7 @@ function switchInputStyles() {
|
|
|
3837
3837
|
`;
|
|
3838
3838
|
}
|
|
3839
3839
|
function switchRepresentationStyles(props) {
|
|
3840
|
-
const { color, input } =
|
|
3840
|
+
const { color, input } = props.theme.sanity.v2;
|
|
3841
3841
|
return css`
|
|
3842
3842
|
--switch-bg-color: ${color.input.default.enabled.border};
|
|
3843
3843
|
--switch-fg-color: ${color.input.default.enabled.bg};
|
|
@@ -3910,7 +3910,7 @@ function switchRepresentationStyles(props) {
|
|
|
3910
3910
|
`;
|
|
3911
3911
|
}
|
|
3912
3912
|
function switchTrackStyles(props) {
|
|
3913
|
-
const { input } =
|
|
3913
|
+
const { input } = props.theme.sanity.v2;
|
|
3914
3914
|
return css`
|
|
3915
3915
|
&:not([hidden]) {
|
|
3916
3916
|
display: block;
|
|
@@ -3925,7 +3925,7 @@ function switchTrackStyles(props) {
|
|
|
3925
3925
|
`;
|
|
3926
3926
|
}
|
|
3927
3927
|
function switchThumbStyles(props) {
|
|
3928
|
-
const { $indeterminate } = props, { input } =
|
|
3928
|
+
const { $indeterminate } = props, { input } = props.theme.sanity.v2, trackWidth = input.switch.width, trackHeight = input.switch.height, trackPadding = input.switch.padding, size2 = trackHeight - input.switch.padding * 2, checkedOffset = trackWidth - trackPadding * 2 - size2, indeterminateOffset = trackWidth / 2 - size2 / 2 - trackPadding, checked = $indeterminate !== !0 && props.$checked === !0;
|
|
3929
3929
|
return css`
|
|
3930
3930
|
&:not([hidden]) {
|
|
3931
3931
|
display: block;
|
|
@@ -5004,7 +5004,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
|
5004
5004
|
] }, itemIndex)) });
|
|
5005
5005
|
});
|
|
5006
5006
|
function dialogStyle({ theme }) {
|
|
5007
|
-
const { color } =
|
|
5007
|
+
const { color } = theme.sanity.v2;
|
|
5008
5008
|
return {
|
|
5009
5009
|
"&:not([hidden])": {
|
|
5010
5010
|
display: "flex"
|
|
@@ -5020,7 +5020,7 @@ function dialogStyle({ theme }) {
|
|
|
5020
5020
|
};
|
|
5021
5021
|
}
|
|
5022
5022
|
function responsiveDialogPositionStyle(props) {
|
|
5023
|
-
const { media } =
|
|
5023
|
+
const { media } = props.theme.sanity.v2;
|
|
5024
5024
|
return _responsive(media, props.$position, (position) => ({ "&&": { position } }));
|
|
5025
5025
|
}
|
|
5026
5026
|
function animationDialogStyle(props) {
|
|
@@ -5699,7 +5699,7 @@ function selectableBaseStyle() {
|
|
|
5699
5699
|
}
|
|
5700
5700
|
function selectableColorStyle(props) {
|
|
5701
5701
|
var _a;
|
|
5702
|
-
const { $tone } = props, { color, style } =
|
|
5702
|
+
const { $tone } = props, { color, style } = props.theme.sanity.v2, tone = color.selectable[$tone];
|
|
5703
5703
|
return css`
|
|
5704
5704
|
${_cardColorStyle(color, tone.enabled)}
|
|
5705
5705
|
|
|
@@ -6044,7 +6044,7 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
|
|
|
6044
6044
|
}
|
|
6045
6045
|
);
|
|
6046
6046
|
}), Root$3 = styled(Skeleton)((props) => {
|
|
6047
|
-
const { $size, $style } = props, { font, media } =
|
|
6047
|
+
const { $size, $style } = props, { font, media } = props.theme.sanity.v2, fontStyle = font[$style];
|
|
6048
6048
|
return _responsive(media, $size, (sizeIndex) => {
|
|
6049
6049
|
const fontSize2 = fontStyle.sizes[sizeIndex];
|
|
6050
6050
|
return { height: fontSize2.lineHeight - fontSize2.ascenderHeight - fontSize2.descenderHeight };
|
|
@@ -6543,7 +6543,7 @@ function treeItemRootStyle() {
|
|
|
6543
6543
|
`;
|
|
6544
6544
|
}
|
|
6545
6545
|
function treeItemRootColorStyle(props) {
|
|
6546
|
-
const $tone = "default", { color } =
|
|
6546
|
+
const $tone = "default", { color } = props.theme.sanity.v2, tone = color.selectable[$tone];
|
|
6547
6547
|
return css`
|
|
6548
6548
|
&[role='none'] {
|
|
6549
6549
|
& > [role='treeitem'] {
|
|
@@ -6587,7 +6587,7 @@ function treeItemRootColorStyle(props) {
|
|
|
6587
6587
|
`;
|
|
6588
6588
|
}
|
|
6589
6589
|
function treeItemBoxStyle(props) {
|
|
6590
|
-
const { $level } = props, { space } =
|
|
6590
|
+
const { $level } = props, { space } = props.theme.sanity.v2;
|
|
6591
6591
|
return css`
|
|
6592
6592
|
padding-left: ${rem(space[2] * $level)};
|
|
6593
6593
|
|