@sanity/ui 2.0.11 → 2.0.13-alpha.1
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 +73 -73
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +81 -81
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +73 -73
- 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 +6 -6
- package/src/core/components/dialog/styles.ts +3 -3
- package/src/core/components/skeleton/textSkeleton.tsx +2 -2
- package/src/core/components/tree/style.ts +2 -3
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +1 -1
- package/src/core/primitives/_selectable/style.ts +1 -2
- package/src/core/primitives/avatar/avatarCounter.tsx +2 -3
- package/src/core/primitives/avatar/avatarStack.tsx +1 -2
- package/src/core/primitives/avatar/styles.ts +3 -3
- package/src/core/primitives/button/styles.ts +3 -3
- package/src/core/primitives/card/__workshop__/selected.tsx +2 -2
- package/src/core/primitives/card/styles.ts +2 -3
- package/src/core/primitives/checkbox/styles.ts +1 -2
- package/src/core/primitives/code/styles.ts +1 -4
- package/src/core/primitives/container/styles.ts +2 -2
- package/src/core/primitives/heading/styles.ts +1 -2
- package/src/core/primitives/inline/styles.ts +2 -2
- package/src/core/primitives/label/styles.ts +1 -2
- package/src/core/primitives/radio/styles.ts +1 -2
- package/src/core/primitives/select/styles.ts +5 -5
- package/src/core/primitives/stack/styles.ts +2 -2
- package/src/core/primitives/switch/styles.ts +3 -4
- package/src/core/primitives/text/__workshop__/colored.tsx +2 -2
- package/src/core/primitives/text/styles.ts +1 -2
- 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/theme/system/theme.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3
|
-
var theme = require("@sanity/ui/theme"), jsxRuntime = require("react/jsx-runtime"), react = require("react"), ReactIs = require("react-is"), styledComponents = require("styled-components")
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
var theme = require("@sanity/ui/theme"), jsxRuntime = require("react/jsx-runtime"), react = require("react"), ReactIs = require("react-is"), styledComponents = require("styled-components");
|
|
4
|
+
require("@sanity/color");
|
|
5
|
+
var getScopedTheme = require("./_chunks-cjs/getScopedTheme.js"), icons = require("@sanity/icons"), Refractor = require("react-refractor"), reactDom$1 = require("@floating-ui/react-dom"), framerMotion = require("framer-motion"), reactDom = require("react-dom");
|
|
6
|
+
function _interopDefaultCompat(e) {
|
|
7
|
+
return e && typeof e == "object" && "default" in e ? e : { default: e };
|
|
6
8
|
}
|
|
7
|
-
var ReactIs__default = /* @__PURE__ */
|
|
9
|
+
var ReactIs__default = /* @__PURE__ */ _interopDefaultCompat(ReactIs), Refractor__default = /* @__PURE__ */ _interopDefaultCompat(Refractor);
|
|
8
10
|
const createColorTheme = theme.createColorTheme, hexToRgb = theme.hexToRgb, hslToRgb = theme.hslToRgb, multiply = theme.multiply, parseColor = theme.parseColor, rgbToHex = theme.rgbToHex, rgbToHsl = theme.rgbToHsl, rgba = theme.rgba, screen = theme.screen, studioTheme = theme.buildTheme(), EMPTY_ARRAY = [], EMPTY_RECORD = {}, POPOVER_MOTION_CONTENT_OPACITY_PROPERTY = "--motion-content-opacity", POPOVER_MOTION_PROPS = {
|
|
9
11
|
initial: {
|
|
10
12
|
opacity: 0.5,
|
|
@@ -37,12 +39,12 @@ function _responsive(media, values, callback) {
|
|
|
37
39
|
function _getArrayProp(val, defaultVal) {
|
|
38
40
|
return val === void 0 ? defaultVal || EMPTY_ARRAY : Array.isArray(val) ? val : [val];
|
|
39
41
|
}
|
|
40
|
-
function _getResponsiveSpace(
|
|
42
|
+
function _getResponsiveSpace(theme2, props, spaceIndexes = EMPTY_ARRAY) {
|
|
41
43
|
if (!Array.isArray(spaceIndexes))
|
|
42
44
|
throw new Error("the property must be array of numbers");
|
|
43
45
|
if (spaceIndexes.length === 0)
|
|
44
46
|
return null;
|
|
45
|
-
const { media, space } =
|
|
47
|
+
const { media, space } = theme2.sanity.v2;
|
|
46
48
|
return _responsive(
|
|
47
49
|
media,
|
|
48
50
|
spaceIndexes,
|
|
@@ -50,7 +52,7 @@ function _getResponsiveSpace(theme$1, props, spaceIndexes = EMPTY_ARRAY) {
|
|
|
50
52
|
);
|
|
51
53
|
}
|
|
52
54
|
function responsiveFont(fontKey, props) {
|
|
53
|
-
const { $size, $weight } = props, { font, media } = theme.
|
|
55
|
+
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 = {
|
|
54
56
|
position: "relative",
|
|
55
57
|
fontFamily: family,
|
|
56
58
|
fontWeight,
|
|
@@ -111,7 +113,7 @@ function responsiveLabelFont(props) {
|
|
|
111
113
|
return responsiveFont("label", props);
|
|
112
114
|
}
|
|
113
115
|
function responsiveTextAlignStyle(props) {
|
|
114
|
-
const { media } = theme.
|
|
116
|
+
const { media } = props.theme.sanity.v2;
|
|
115
117
|
return _responsive(media, props.$align, (textAlign) => ({ textAlign }));
|
|
116
118
|
}
|
|
117
119
|
function responsiveTextFont(props) {
|
|
@@ -528,8 +530,8 @@ function ThemeProvider(props) {
|
|
|
528
530
|
theme: rootTheme,
|
|
529
531
|
scheme,
|
|
530
532
|
tone
|
|
531
|
-
} : null, [rootTheme, scheme, tone]),
|
|
532
|
-
return
|
|
533
|
+
} : null, [rootTheme, scheme, tone]), theme2 = react.useMemo(() => rootTheme ? getScopedTheme.getScopedTheme(rootTheme, scheme, tone) : null, [scheme, rootTheme, tone]);
|
|
534
|
+
return theme2 ? theme2.sanity.v2 ? /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value: themeContext, children: /* @__PURE__ */ jsxRuntime.jsx(styledComponents.ThemeProvider, { theme: theme2, children }) }) : /* @__PURE__ */ jsxRuntime.jsx("pre", { children: 'ThemeProvider: no "theme.sanity.v2" property in theme' }) : /* @__PURE__ */ jsxRuntime.jsx("pre", { children: 'ThemeProvider: no "theme" property provided' });
|
|
533
535
|
}
|
|
534
536
|
function useRootTheme() {
|
|
535
537
|
const value = react.useContext(ThemeContext);
|
|
@@ -545,7 +547,7 @@ function useTheme() {
|
|
|
545
547
|
return styledComponents.useTheme();
|
|
546
548
|
}
|
|
547
549
|
function useTheme_v2() {
|
|
548
|
-
return
|
|
550
|
+
return getScopedTheme.getTheme_v2(styledComponents.useTheme());
|
|
549
551
|
}
|
|
550
552
|
const MEDIA_STORE_CACHE = /* @__PURE__ */ new WeakMap();
|
|
551
553
|
function _getMediaQuery(media, index) {
|
|
@@ -642,7 +644,7 @@ function responsiveBorderStyle() {
|
|
|
642
644
|
}
|
|
643
645
|
function border(props) {
|
|
644
646
|
var _a, _b;
|
|
645
|
-
const { card, media } = theme.
|
|
647
|
+
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)`;
|
|
646
648
|
return _responsive(
|
|
647
649
|
media,
|
|
648
650
|
props.$border,
|
|
@@ -651,7 +653,7 @@ function border(props) {
|
|
|
651
653
|
}
|
|
652
654
|
function borderTop(props) {
|
|
653
655
|
var _a, _b;
|
|
654
|
-
const { card, media } = theme.
|
|
656
|
+
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)`;
|
|
655
657
|
return _responsive(
|
|
656
658
|
media,
|
|
657
659
|
props.$borderTop,
|
|
@@ -660,7 +662,7 @@ function borderTop(props) {
|
|
|
660
662
|
}
|
|
661
663
|
function borderRight(props) {
|
|
662
664
|
var _a, _b;
|
|
663
|
-
const { card, media } = theme.
|
|
665
|
+
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)`;
|
|
664
666
|
return _responsive(
|
|
665
667
|
media,
|
|
666
668
|
props.$borderRight,
|
|
@@ -669,7 +671,7 @@ function borderRight(props) {
|
|
|
669
671
|
}
|
|
670
672
|
function borderBottom(props) {
|
|
671
673
|
var _a, _b;
|
|
672
|
-
const { card, media } = theme.
|
|
674
|
+
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)`;
|
|
673
675
|
return _responsive(
|
|
674
676
|
media,
|
|
675
677
|
props.$borderBottom,
|
|
@@ -678,7 +680,7 @@ function borderBottom(props) {
|
|
|
678
680
|
}
|
|
679
681
|
function borderLeft(props) {
|
|
680
682
|
var _a, _b;
|
|
681
|
-
const { card, media } = theme.
|
|
683
|
+
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)`;
|
|
682
684
|
return _responsive(
|
|
683
685
|
media,
|
|
684
686
|
props.$borderLeft,
|
|
@@ -708,25 +710,25 @@ function responsiveBoxStyle() {
|
|
|
708
710
|
];
|
|
709
711
|
}
|
|
710
712
|
function responsiveBoxDisplayStyle(props) {
|
|
711
|
-
const { media } = theme.
|
|
713
|
+
const { media } = props.theme.sanity.v2;
|
|
712
714
|
return _responsive(media, props.$display, (display) => ({
|
|
713
715
|
"&:not([hidden])": { display }
|
|
714
716
|
}));
|
|
715
717
|
}
|
|
716
718
|
function responsiveBoxSizingStyle(props) {
|
|
717
|
-
const { media } = theme.
|
|
719
|
+
const { media } = props.theme.sanity.v2;
|
|
718
720
|
return _responsive(media, props.$sizing, (sizing) => ({
|
|
719
721
|
boxSizing: BOX_SIZING[sizing]
|
|
720
722
|
}));
|
|
721
723
|
}
|
|
722
724
|
function responsiveBoxHeightStyle(props) {
|
|
723
|
-
const { media } = theme.
|
|
725
|
+
const { media } = props.theme.sanity.v2;
|
|
724
726
|
return _responsive(media, props.$height, (height) => ({
|
|
725
727
|
height: BOX_HEIGHT[height]
|
|
726
728
|
}));
|
|
727
729
|
}
|
|
728
730
|
function responsiveBoxOverflowStyle(props) {
|
|
729
|
-
const { media } = theme.
|
|
731
|
+
const { media } = props.theme.sanity.v2;
|
|
730
732
|
return _responsive(media, props.$overflow, (overflow) => ({
|
|
731
733
|
overflow
|
|
732
734
|
}));
|
|
@@ -747,25 +749,25 @@ function responsiveFlexStyle() {
|
|
|
747
749
|
];
|
|
748
750
|
}
|
|
749
751
|
function responsiveFlexAlignStyle(props) {
|
|
750
|
-
const { media } = theme.
|
|
752
|
+
const { media } = props.theme.sanity.v2;
|
|
751
753
|
return _responsive(media, props.$align, (align) => ({ alignItems: align }));
|
|
752
754
|
}
|
|
753
755
|
function responsiveFlexGapStyle(props) {
|
|
754
|
-
const { media, space } = theme.
|
|
756
|
+
const { media, space } = props.theme.sanity.v2;
|
|
755
757
|
return _responsive(media, props.$gap, (gap) => ({
|
|
756
758
|
gap: gap ? rem(space[gap]) : void 0
|
|
757
759
|
}));
|
|
758
760
|
}
|
|
759
761
|
function responsiveFlexWrapStyle(props) {
|
|
760
|
-
const { media } = theme.
|
|
762
|
+
const { media } = props.theme.sanity.v2;
|
|
761
763
|
return _responsive(media, props.$wrap, (wrap) => ({ flexWrap: wrap }));
|
|
762
764
|
}
|
|
763
765
|
function responsiveFlexJustifyStyle(props) {
|
|
764
|
-
const { media } = theme.
|
|
766
|
+
const { media } = props.theme.sanity.v2;
|
|
765
767
|
return _responsive(media, props.$justify, (justify) => ({ justifyContent: justify }));
|
|
766
768
|
}
|
|
767
769
|
function responsiveFlexDirectionStyle(props) {
|
|
768
|
-
const { media } = theme.
|
|
770
|
+
const { media } = props.theme.sanity.v2;
|
|
769
771
|
return _responsive(media, props.$direction, (direction) => ({ flexDirection: direction }));
|
|
770
772
|
}
|
|
771
773
|
const BASE_STYLE$2 = {
|
|
@@ -776,7 +778,7 @@ function flexItemStyle() {
|
|
|
776
778
|
return [BASE_STYLE$2, responsiveFlexItemStyle];
|
|
777
779
|
}
|
|
778
780
|
function responsiveFlexItemStyle(props) {
|
|
779
|
-
const { media } = theme.
|
|
781
|
+
const { media } = props.theme.sanity.v2;
|
|
780
782
|
return props.$flex ? _responsive(media, props.$flex, (flex) => ({ flex })) : EMPTY_ARRAY;
|
|
781
783
|
}
|
|
782
784
|
function focusRingBorderStyle(border2) {
|
|
@@ -823,49 +825,49 @@ function responsiveGridStyle() {
|
|
|
823
825
|
];
|
|
824
826
|
}
|
|
825
827
|
function responsiveGridAutoFlowStyle(props) {
|
|
826
|
-
const { media } = theme.
|
|
828
|
+
const { media } = props.theme.sanity.v2;
|
|
827
829
|
return _responsive(media, props.$autoFlow, (autoFlow) => ({
|
|
828
830
|
gridAutoFlow: autoFlow
|
|
829
831
|
}));
|
|
830
832
|
}
|
|
831
833
|
function responsiveGridAutoRowsStyle(props) {
|
|
832
|
-
const { media } = theme.
|
|
834
|
+
const { media } = props.theme.sanity.v2;
|
|
833
835
|
return _responsive(media, props.$autoRows, (autoRows) => ({
|
|
834
836
|
gridAutoRows: autoRows && GRID_AUTO_ROWS[autoRows]
|
|
835
837
|
}));
|
|
836
838
|
}
|
|
837
839
|
function responsiveGridAutoColsStyle(props) {
|
|
838
|
-
const { media } = theme.
|
|
840
|
+
const { media } = props.theme.sanity.v2;
|
|
839
841
|
return _responsive(media, props.$autoCols, (autoCols) => ({
|
|
840
842
|
gridAutoColumns: autoCols && GRID_AUTO_COLUMS[autoCols]
|
|
841
843
|
}));
|
|
842
844
|
}
|
|
843
845
|
function responsiveGridColumnsStyle(props) {
|
|
844
|
-
const { media } = theme.
|
|
846
|
+
const { media } = props.theme.sanity.v2;
|
|
845
847
|
return _responsive(media, props.$columns, (columns) => ({
|
|
846
848
|
gridTemplateColumns: columns && `repeat(${columns},minmax(0,1fr));`
|
|
847
849
|
}));
|
|
848
850
|
}
|
|
849
851
|
function responsiveGridRowsStyle(props) {
|
|
850
|
-
const { media } = theme.
|
|
852
|
+
const { media } = props.theme.sanity.v2;
|
|
851
853
|
return _responsive(media, props.$rows, (rows) => ({
|
|
852
854
|
gridTemplateRows: rows && `repeat(${rows},minmax(0,1fr));`
|
|
853
855
|
}));
|
|
854
856
|
}
|
|
855
857
|
function responsiveGridGapStyle(props) {
|
|
856
|
-
const { media, space } = theme.
|
|
858
|
+
const { media, space } = props.theme.sanity.v2;
|
|
857
859
|
return _responsive(media, props.$gap, (gap) => ({
|
|
858
860
|
gridGap: gap ? rem(space[gap]) : void 0
|
|
859
861
|
}));
|
|
860
862
|
}
|
|
861
863
|
function responsiveGridGapXStyle(props) {
|
|
862
|
-
const { media, space } = theme.
|
|
864
|
+
const { media, space } = props.theme.sanity.v2;
|
|
863
865
|
return _responsive(media, props.$gapX, (gapX) => ({
|
|
864
866
|
columnGap: gapX ? rem(space[gapX]) : void 0
|
|
865
867
|
}));
|
|
866
868
|
}
|
|
867
869
|
function responsiveGridGapYStyle(props) {
|
|
868
|
-
const { media, space } = theme.
|
|
870
|
+
const { media, space } = props.theme.sanity.v2;
|
|
869
871
|
return _responsive(media, props.$gapY, (gapY) => ({
|
|
870
872
|
rowGap: gapY ? rem(space[gapY]) : void 0
|
|
871
873
|
}));
|
|
@@ -888,37 +890,37 @@ const GRID_ITEM_ROW = {
|
|
|
888
890
|
full: "1 / -1"
|
|
889
891
|
};
|
|
890
892
|
function responsiveGridItemRowStyle(props) {
|
|
891
|
-
const { media } = theme.
|
|
893
|
+
const { media } = props.theme.sanity.v2;
|
|
892
894
|
return _responsive(media, props.$row, (row) => typeof row == "number" ? { gridRow: `span ${row} / span ${row}` } : { gridRow: GRID_ITEM_ROW[row] });
|
|
893
895
|
}
|
|
894
896
|
function responsiveGridItemRowStartStyle(props) {
|
|
895
|
-
const { media } = theme.
|
|
897
|
+
const { media } = props.theme.sanity.v2;
|
|
896
898
|
return _responsive(media, props.$rowStart, (rowStart) => ({
|
|
897
899
|
gridRowStart: rowStart
|
|
898
900
|
}));
|
|
899
901
|
}
|
|
900
902
|
function responsiveGridItemRowEndStyle(props) {
|
|
901
|
-
const { media } = theme.
|
|
903
|
+
const { media } = props.theme.sanity.v2;
|
|
902
904
|
return _responsive(media, props.$rowEnd, (rowEnd) => ({ gridRowEnd: rowEnd }));
|
|
903
905
|
}
|
|
904
906
|
function responsiveGridItemColumnStyle(props) {
|
|
905
|
-
const { media } = theme.
|
|
907
|
+
const { media } = props.theme.sanity.v2;
|
|
906
908
|
return _responsive(media, props.$column, (column) => typeof column == "number" ? { gridColumn: `span ${column} / span ${column}` } : { gridColumn: GRID_ITEM_COLUMN[column] });
|
|
907
909
|
}
|
|
908
910
|
function responsiveGridItemColumnStartStyle(props) {
|
|
909
|
-
const { media } = theme.
|
|
911
|
+
const { media } = props.theme.sanity.v2;
|
|
910
912
|
return _responsive(media, props.$columnStart, (columnStart) => ({
|
|
911
913
|
gridColumnStart: columnStart
|
|
912
914
|
}));
|
|
913
915
|
}
|
|
914
916
|
function responsiveGridItemColumnEndStyle(props) {
|
|
915
|
-
const { media } = theme.
|
|
917
|
+
const { media } = props.theme.sanity.v2;
|
|
916
918
|
return _responsive(media, props.$columnEnd, (columnEnd) => ({
|
|
917
919
|
gridColumnEnd: columnEnd
|
|
918
920
|
}));
|
|
919
921
|
}
|
|
920
922
|
function responsiveInputPaddingStyle(props) {
|
|
921
|
-
const { $fontSize, $iconLeft, $iconRight, $padding, $space } = props, { font, media, space } = theme.
|
|
923
|
+
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 = [];
|
|
922
924
|
for (let i = 0; i < len; i += 1)
|
|
923
925
|
_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];
|
|
924
926
|
return _responsive(media, _padding, (_, i) => {
|
|
@@ -945,7 +947,7 @@ function textInputRootStyle() {
|
|
|
945
947
|
return ROOT_STYLE;
|
|
946
948
|
}
|
|
947
949
|
function textInputBaseStyle(props) {
|
|
948
|
-
const { $scheme, $tone, $weight } = props, { color, font } = theme.
|
|
950
|
+
const { $scheme, $tone, $weight } = props, { color, font } = props.theme.sanity.v2;
|
|
949
951
|
return styledComponents.css`
|
|
950
952
|
appearance: none;
|
|
951
953
|
background: none;
|
|
@@ -1013,7 +1015,7 @@ function textInputBaseStyle(props) {
|
|
|
1013
1015
|
`;
|
|
1014
1016
|
}
|
|
1015
1017
|
function textInputFontSizeStyle(props) {
|
|
1016
|
-
const { font, media } = theme.
|
|
1018
|
+
const { font, media } = props.theme.sanity.v2;
|
|
1017
1019
|
return _responsive(media, props.$fontSize, (sizeIndex) => {
|
|
1018
1020
|
const size2 = font.text.sizes[sizeIndex] || font.text.sizes[2];
|
|
1019
1021
|
return {
|
|
@@ -1023,7 +1025,7 @@ function textInputFontSizeStyle(props) {
|
|
|
1023
1025
|
});
|
|
1024
1026
|
}
|
|
1025
1027
|
function textInputRepresentationStyle(props) {
|
|
1026
|
-
const { $hasPrefix, $hasSuffix, $scheme, $tone, $unstableDisableFocusRing } = props, { color, input } = theme.
|
|
1028
|
+
const { $hasPrefix, $hasSuffix, $scheme, $tone, $unstableDisableFocusRing } = props, { color, input } = props.theme.sanity.v2;
|
|
1027
1029
|
return styledComponents.css`
|
|
1028
1030
|
--input-box-shadow: none;
|
|
1029
1031
|
|
|
@@ -1175,7 +1177,7 @@ function responsivePaddingStyle(props) {
|
|
|
1175
1177
|
].filter(Boolean);
|
|
1176
1178
|
}
|
|
1177
1179
|
function responsiveRadiusStyle(props) {
|
|
1178
|
-
const { media, radius } = theme.
|
|
1180
|
+
const { media, radius } = props.theme.sanity.v2;
|
|
1179
1181
|
return _responsive(media, props.$radius, (value) => {
|
|
1180
1182
|
let borderRadius = 0;
|
|
1181
1183
|
return typeof value == "number" && (borderRadius = rem(radius[value])), value === "full" && (borderRadius = "9999px"), { borderRadius };
|
|
@@ -1191,7 +1193,7 @@ function shadowStyle(shadow, outlineWidth = 1) {
|
|
|
1191
1193
|
return { boxShadow: `${outline}, ${umbra}, ${penumbra}, ${ambient}` };
|
|
1192
1194
|
}
|
|
1193
1195
|
function responsiveShadowStyle(props) {
|
|
1194
|
-
const { card, media, shadow } = theme.
|
|
1196
|
+
const { card, media, shadow } = props.theme.sanity.v2;
|
|
1195
1197
|
return _responsive(
|
|
1196
1198
|
media,
|
|
1197
1199
|
props.$shadow,
|
|
@@ -1199,7 +1201,7 @@ function responsiveShadowStyle(props) {
|
|
|
1199
1201
|
);
|
|
1200
1202
|
}
|
|
1201
1203
|
function labelBaseStyle(props) {
|
|
1202
|
-
const { $accent, $muted } = props, { font } = theme.
|
|
1204
|
+
const { $accent, $muted } = props, { font } = props.theme.sanity.v2;
|
|
1203
1205
|
return styledComponents.css`
|
|
1204
1206
|
text-transform: uppercase;
|
|
1205
1207
|
|
|
@@ -1310,7 +1312,7 @@ function avatarArrowStyle() {
|
|
|
1310
1312
|
};
|
|
1311
1313
|
}
|
|
1312
1314
|
function avatarRootStyle(props) {
|
|
1313
|
-
const { $color } = props, { avatar } = theme.
|
|
1315
|
+
const { $color } = props, { avatar } = props.theme.sanity.v2;
|
|
1314
1316
|
return {
|
|
1315
1317
|
"--avatar-bg-color": `var(--card-avatar-${$color}-bg-color)`,
|
|
1316
1318
|
"--avatar-fg-color": `var(--card-avatar-${$color}-fg-color)`,
|
|
@@ -1347,7 +1349,7 @@ function avatarRootStyle(props) {
|
|
|
1347
1349
|
};
|
|
1348
1350
|
}
|
|
1349
1351
|
function responsiveAvatarSizeStyle(props) {
|
|
1350
|
-
const { avatar, media } = theme.
|
|
1352
|
+
const { avatar, media } = props.theme.sanity.v2;
|
|
1351
1353
|
return _responsive(media, props.$size, (size2) => {
|
|
1352
1354
|
const avatarSize = avatar.sizes[size2] || avatar.sizes[0];
|
|
1353
1355
|
return {
|
|
@@ -1494,7 +1496,7 @@ const Root$B = styledComponents.styled.div(
|
|
|
1494
1496
|
);
|
|
1495
1497
|
});
|
|
1496
1498
|
function _responsiveAvatarCounterSizeStyle(props) {
|
|
1497
|
-
const { avatar, media } = theme.
|
|
1499
|
+
const { avatar, media } = props.theme.sanity.v2;
|
|
1498
1500
|
return _responsive(media, props.$size, (size2) => {
|
|
1499
1501
|
const avatarSize = avatar.sizes[size2];
|
|
1500
1502
|
return avatarSize ? {
|
|
@@ -1505,7 +1507,7 @@ function _responsiveAvatarCounterSizeStyle(props) {
|
|
|
1505
1507
|
});
|
|
1506
1508
|
}
|
|
1507
1509
|
function _avatarCounterBaseStyle(props) {
|
|
1508
|
-
const { space } = theme.
|
|
1510
|
+
const { space } = props.theme.sanity.v2;
|
|
1509
1511
|
return styledComponents.css`
|
|
1510
1512
|
align-items: center;
|
|
1511
1513
|
justify-content: center;
|
|
@@ -1554,7 +1556,7 @@ function avatarStackStyle() {
|
|
|
1554
1556
|
return BASE_STYLES;
|
|
1555
1557
|
}
|
|
1556
1558
|
function responsiveAvatarStackSizeStyle(props) {
|
|
1557
|
-
const { avatar, media } = theme.
|
|
1559
|
+
const { avatar, media } = props.theme.sanity.v2;
|
|
1558
1560
|
return _responsive(media, props.$size, (size2) => {
|
|
1559
1561
|
const avatarSize = avatar.sizes[size2];
|
|
1560
1562
|
return avatarSize ? {
|
|
@@ -1653,7 +1655,7 @@ const Root$z = styledComponents.styled.div(responsiveAvatarStackSizeStyle, avata
|
|
|
1653
1655
|
);
|
|
1654
1656
|
});
|
|
1655
1657
|
function textBaseStyle(props) {
|
|
1656
|
-
const { $accent, $muted } = props, { font } = theme.
|
|
1658
|
+
const { $accent, $muted } = props, { font } = props.theme.sanity.v2;
|
|
1657
1659
|
return styledComponents.css`
|
|
1658
1660
|
color: var(--card-fg-color);
|
|
1659
1661
|
|
|
@@ -1897,7 +1899,7 @@ function _cardColorStyle(base, color, checkered = !1) {
|
|
|
1897
1899
|
};
|
|
1898
1900
|
}
|
|
1899
1901
|
function buttonBaseStyles(props) {
|
|
1900
|
-
const { $width } = props, { style } = theme.
|
|
1902
|
+
const { $width } = props, { style } = props.theme.sanity.v2;
|
|
1901
1903
|
return styledComponents.css`
|
|
1902
1904
|
${style == null ? void 0 : style.button};
|
|
1903
1905
|
|
|
@@ -1943,7 +1945,7 @@ function combineBoxShadow(...boxShadows) {
|
|
|
1943
1945
|
}
|
|
1944
1946
|
function buttonColorStyles(props) {
|
|
1945
1947
|
var _a;
|
|
1946
|
-
const { $mode } = props, { button, color: baseColor, style } = theme.
|
|
1948
|
+
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 = {
|
|
1947
1949
|
width: button.border.width,
|
|
1948
1950
|
color: "var(--card-border-color)"
|
|
1949
1951
|
}, defaultBoxShadow = void 0;
|
|
@@ -2082,7 +2084,7 @@ function cardStyle(props) {
|
|
|
2082
2084
|
return [cardBaseStyle(props), cardColorStyle(props)];
|
|
2083
2085
|
}
|
|
2084
2086
|
function cardBaseStyle(props) {
|
|
2085
|
-
const { $checkered } = props, { space } = theme.
|
|
2087
|
+
const { $checkered } = props, { space } = props.theme.sanity.v2;
|
|
2086
2088
|
return styledComponents.css`
|
|
2087
2089
|
${$checkered && styledComponents.css`
|
|
2088
2090
|
background-size: ${space[3]}px ${space[3]}px;
|
|
@@ -2116,7 +2118,7 @@ function cardBaseStyle(props) {
|
|
|
2116
2118
|
}
|
|
2117
2119
|
function cardColorStyle(props) {
|
|
2118
2120
|
var _a;
|
|
2119
|
-
const { $checkered, $focusRing } = props, { card, color, style } = theme.
|
|
2121
|
+
const { $checkered, $focusRing } = props, { card, color, style } = props.theme.sanity.v2, border2 = { width: card.border.width, color: "var(--card-border-color)" };
|
|
2120
2122
|
return styledComponents.css`
|
|
2121
2123
|
color-scheme: ${color._dark ? "dark" : "light"};
|
|
2122
2124
|
|
|
@@ -2256,7 +2258,7 @@ function checkboxBaseStyles() {
|
|
|
2256
2258
|
`;
|
|
2257
2259
|
}
|
|
2258
2260
|
function inputElementStyles(props) {
|
|
2259
|
-
const { color, input, radius } = theme.
|
|
2261
|
+
const { color, input, radius } = props.theme.sanity.v2, { focusRing } = input.checkbox;
|
|
2260
2262
|
return styledComponents.css`
|
|
2261
2263
|
position: absolute;
|
|
2262
2264
|
top: 0;
|
|
@@ -2401,10 +2403,8 @@ const Root$r = styledComponents.styled.div(checkboxBaseStyles), Input$5 = styled
|
|
|
2401
2403
|
] })
|
|
2402
2404
|
] });
|
|
2403
2405
|
});
|
|
2404
|
-
function codeSyntaxHighlightingStyle({ theme:
|
|
2405
|
-
const
|
|
2406
|
-
color: { syntax: color }
|
|
2407
|
-
} = theme.getTheme_v2(theme$1);
|
|
2406
|
+
function codeSyntaxHighlightingStyle({ theme: theme2 }) {
|
|
2407
|
+
const color = theme2.sanity.v2.color.syntax;
|
|
2408
2408
|
return {
|
|
2409
2409
|
"&.atrule": { color: color.atrule },
|
|
2410
2410
|
"&.attr-name": { color: color.attrName },
|
|
@@ -2487,7 +2487,7 @@ function containerBaseStyle() {
|
|
|
2487
2487
|
return BASE_STYLE$1;
|
|
2488
2488
|
}
|
|
2489
2489
|
function responsiveContainerWidthStyle(props) {
|
|
2490
|
-
const { container, media } = theme.
|
|
2490
|
+
const { container, media } = props.theme.sanity.v2;
|
|
2491
2491
|
return _responsive(media, props.$width, (val) => ({
|
|
2492
2492
|
maxWidth: val === "auto" ? "none" : rem(container[val])
|
|
2493
2493
|
}));
|
|
@@ -2530,7 +2530,7 @@ const Root$p = styledComponents.styled(Box)(
|
|
|
2530
2530
|
);
|
|
2531
2531
|
});
|
|
2532
2532
|
function headingBaseStyle(props) {
|
|
2533
|
-
const { $accent, $muted } = props, { font } = theme.
|
|
2533
|
+
const { $accent, $muted } = props, { font } = props.theme.sanity.v2;
|
|
2534
2534
|
return styledComponents.css`
|
|
2535
2535
|
${$accent && styledComponents.css`
|
|
2536
2536
|
color: var(--card-accent-fg-color);
|
|
@@ -2629,7 +2629,7 @@ function inlineBaseStyle() {
|
|
|
2629
2629
|
};
|
|
2630
2630
|
}
|
|
2631
2631
|
function inlineSpaceStyle(props) {
|
|
2632
|
-
const { media, space } = theme.
|
|
2632
|
+
const { media, space } = props.theme.sanity.v2;
|
|
2633
2633
|
return _responsive(media, props.$space, (spaceIndex) => {
|
|
2634
2634
|
const _space = rem(spaceIndex === 0.5 ? space[1] / 2 : space[spaceIndex]);
|
|
2635
2635
|
return {
|
|
@@ -3498,7 +3498,7 @@ function radioBaseStyle() {
|
|
|
3498
3498
|
`;
|
|
3499
3499
|
}
|
|
3500
3500
|
function inputElementStyle(props) {
|
|
3501
|
-
const { color, input } = theme.
|
|
3501
|
+
const { color, input } = props.theme.sanity.v2, dist = (input.radio.size - input.radio.markSize) / 2;
|
|
3502
3502
|
return styledComponents.css`
|
|
3503
3503
|
appearance: none;
|
|
3504
3504
|
position: absolute;
|
|
@@ -3623,7 +3623,7 @@ function rootStyle() {
|
|
|
3623
3623
|
`;
|
|
3624
3624
|
}
|
|
3625
3625
|
function inputBaseStyle(props) {
|
|
3626
|
-
const { font } = theme.
|
|
3626
|
+
const { font } = props.theme.sanity.v2;
|
|
3627
3627
|
return styledComponents.css`
|
|
3628
3628
|
-webkit-font-smoothing: antialiased;
|
|
3629
3629
|
appearance: none;
|
|
@@ -3640,7 +3640,7 @@ function inputBaseStyle(props) {
|
|
|
3640
3640
|
`;
|
|
3641
3641
|
}
|
|
3642
3642
|
function inputColorStyle(props) {
|
|
3643
|
-
const { color, input } = theme.
|
|
3643
|
+
const { color, input } = props.theme.sanity.v2;
|
|
3644
3644
|
return styledComponents.css`
|
|
3645
3645
|
/* enabled */
|
|
3646
3646
|
background-color: ${color.input.default.enabled.bg};
|
|
@@ -3695,7 +3695,7 @@ function textSize(size2) {
|
|
|
3695
3695
|
return { fontSize: rem(size2.fontSize), lineHeight: rem(size2.lineHeight) };
|
|
3696
3696
|
}
|
|
3697
3697
|
function inputTextSizeStyle(props) {
|
|
3698
|
-
const { $fontSize } = props, { font, media } = theme.
|
|
3698
|
+
const { $fontSize } = props, { font, media } = props.theme.sanity.v2;
|
|
3699
3699
|
return _responsive(
|
|
3700
3700
|
media,
|
|
3701
3701
|
$fontSize,
|
|
@@ -3712,7 +3712,7 @@ function inputStyle() {
|
|
|
3712
3712
|
];
|
|
3713
3713
|
}
|
|
3714
3714
|
function iconBoxStyle(props) {
|
|
3715
|
-
const { color } = theme.
|
|
3715
|
+
const { color } = props.theme.sanity.v2;
|
|
3716
3716
|
return styledComponents.css`
|
|
3717
3717
|
pointer-events: none;
|
|
3718
3718
|
position: absolute;
|
|
@@ -3788,7 +3788,7 @@ function stackBaseStyle() {
|
|
|
3788
3788
|
return BASE_STYLE;
|
|
3789
3789
|
}
|
|
3790
3790
|
function responsiveStackSpaceStyle(props) {
|
|
3791
|
-
const { media, space } = theme.
|
|
3791
|
+
const { media, space } = props.theme.sanity.v2;
|
|
3792
3792
|
return _responsive(media, props.$space, (spaceIndex) => ({
|
|
3793
3793
|
gridGap: rem(space[spaceIndex])
|
|
3794
3794
|
}));
|
|
@@ -3834,7 +3834,7 @@ function switchInputStyles() {
|
|
|
3834
3834
|
`;
|
|
3835
3835
|
}
|
|
3836
3836
|
function switchRepresentationStyles(props) {
|
|
3837
|
-
const { color, input } = theme.
|
|
3837
|
+
const { color, input } = props.theme.sanity.v2;
|
|
3838
3838
|
return styledComponents.css`
|
|
3839
3839
|
--switch-bg-color: ${color.input.default.enabled.border};
|
|
3840
3840
|
--switch-fg-color: ${color.input.default.enabled.bg};
|
|
@@ -3907,7 +3907,7 @@ function switchRepresentationStyles(props) {
|
|
|
3907
3907
|
`;
|
|
3908
3908
|
}
|
|
3909
3909
|
function switchTrackStyles(props) {
|
|
3910
|
-
const { input } = theme.
|
|
3910
|
+
const { input } = props.theme.sanity.v2;
|
|
3911
3911
|
return styledComponents.css`
|
|
3912
3912
|
&:not([hidden]) {
|
|
3913
3913
|
display: block;
|
|
@@ -3922,7 +3922,7 @@ function switchTrackStyles(props) {
|
|
|
3922
3922
|
`;
|
|
3923
3923
|
}
|
|
3924
3924
|
function switchThumbStyles(props) {
|
|
3925
|
-
const { $indeterminate } = props, { input } = theme.
|
|
3925
|
+
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;
|
|
3926
3926
|
return styledComponents.css`
|
|
3927
3927
|
&:not([hidden]) {
|
|
3928
3928
|
display: block;
|
|
@@ -5000,8 +5000,8 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
|
5000
5000
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { as: "li", children: item })
|
|
5001
5001
|
] }, itemIndex)) });
|
|
5002
5002
|
});
|
|
5003
|
-
function dialogStyle({ theme:
|
|
5004
|
-
const { color } =
|
|
5003
|
+
function dialogStyle({ theme: theme2 }) {
|
|
5004
|
+
const { color } = theme2.sanity.v2;
|
|
5005
5005
|
return {
|
|
5006
5006
|
"&:not([hidden])": {
|
|
5007
5007
|
display: "flex"
|
|
@@ -5017,7 +5017,7 @@ function dialogStyle({ theme: theme$1 }) {
|
|
|
5017
5017
|
};
|
|
5018
5018
|
}
|
|
5019
5019
|
function responsiveDialogPositionStyle(props) {
|
|
5020
|
-
const { media } = theme.
|
|
5020
|
+
const { media } = props.theme.sanity.v2;
|
|
5021
5021
|
return _responsive(media, props.$position, (position) => ({ "&&": { position } }));
|
|
5022
5022
|
}
|
|
5023
5023
|
function animationDialogStyle(props) {
|
|
@@ -5696,7 +5696,7 @@ function selectableBaseStyle() {
|
|
|
5696
5696
|
}
|
|
5697
5697
|
function selectableColorStyle(props) {
|
|
5698
5698
|
var _a;
|
|
5699
|
-
const { $tone } = props, { color, style } = theme.
|
|
5699
|
+
const { $tone } = props, { color, style } = props.theme.sanity.v2, tone = color.selectable[$tone];
|
|
5700
5700
|
return styledComponents.css`
|
|
5701
5701
|
${_cardColorStyle(color, tone.enabled)}
|
|
5702
5702
|
|
|
@@ -6041,7 +6041,7 @@ const MenuItem = react.forwardRef(function(props, forwardedRef) {
|
|
|
6041
6041
|
}
|
|
6042
6042
|
);
|
|
6043
6043
|
}), Root$3 = styledComponents.styled(Skeleton)((props) => {
|
|
6044
|
-
const { $size, $style } = props, { font, media } = theme.
|
|
6044
|
+
const { $size, $style } = props, { font, media } = props.theme.sanity.v2, fontStyle = font[$style];
|
|
6045
6045
|
return _responsive(media, $size, (sizeIndex) => {
|
|
6046
6046
|
const fontSize2 = fontStyle.sizes[sizeIndex];
|
|
6047
6047
|
return { height: fontSize2.lineHeight - fontSize2.ascenderHeight - fontSize2.descenderHeight };
|
|
@@ -6540,7 +6540,7 @@ function treeItemRootStyle() {
|
|
|
6540
6540
|
`;
|
|
6541
6541
|
}
|
|
6542
6542
|
function treeItemRootColorStyle(props) {
|
|
6543
|
-
const $tone = "default", { color } = theme.
|
|
6543
|
+
const $tone = "default", { color } = props.theme.sanity.v2, tone = color.selectable[$tone];
|
|
6544
6544
|
return styledComponents.css`
|
|
6545
6545
|
&[role='none'] {
|
|
6546
6546
|
& > [role='treeitem'] {
|
|
@@ -6584,7 +6584,7 @@ function treeItemRootColorStyle(props) {
|
|
|
6584
6584
|
`;
|
|
6585
6585
|
}
|
|
6586
6586
|
function treeItemBoxStyle(props) {
|
|
6587
|
-
const { $level } = props, { space } = theme.
|
|
6587
|
+
const { $level } = props, { space } = props.theme.sanity.v2;
|
|
6588
6588
|
return styledComponents.css`
|
|
6589
6589
|
padding-left: ${rem(space[2] * $level)};
|
|
6590
6590
|
|