@soroush.tech/styled-system 5.9.0-alpha.0 → 6.0.0-alpha.0
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/background.d.cts +2 -2
- package/dist/background.d.mts +2 -2
- package/dist/border.d.cts +2 -2
- package/dist/border.d.mts +2 -2
- package/dist/color.d.cts +2 -2
- package/dist/color.d.mts +2 -2
- package/dist/core.cjs +24 -21
- package/dist/core.d.cts +3 -3
- package/dist/core.d.mts +3 -3
- package/dist/core.mjs +21 -22
- package/dist/{css-CunBKyMl.mjs → css-Ba4jdXOq.mjs} +26 -18
- package/dist/{css-BnnO16Cw.cjs → css-D1zAlDVz.cjs} +26 -18
- package/dist/css.cjs +1 -1
- package/dist/css.d.cts +1 -1
- package/dist/css.d.mts +1 -1
- package/dist/css.mjs +1 -1
- package/dist/flexbox.d.cts +2 -2
- package/dist/flexbox.d.mts +2 -2
- package/dist/grid-BlMUPDJM.cjs +156 -0
- package/dist/grid-CYjL4-gb.mjs +126 -0
- package/dist/grid.cjs +5 -1
- package/dist/grid.d.cts +3 -3
- package/dist/grid.d.mts +3 -3
- package/dist/grid.mjs +2 -2
- package/dist/index-90_abc05.d.mts +6 -0
- package/dist/{index-wKeENlqd.d.mts → index-BQPI7z-B.d.mts} +2 -2
- package/dist/index-BmyL5qR7.d.cts +6 -0
- package/dist/index-Bwpwvg1h.d.cts +6 -0
- package/dist/index-Bxh1FNcS.d.cts +6 -0
- package/dist/index-ByDfI1go.d.cts +6 -0
- package/dist/index-C1IdMVtQ.d.mts +6 -0
- package/dist/index-CQWZd4iQ.d.mts +6 -0
- package/dist/index-CQyvhO-h.d.cts +6 -0
- package/dist/index-CXK27dY_.d.cts +42 -0
- package/dist/{index-Bq7teef_.d.cts → index-CgJzEbXW.d.cts} +2 -2
- package/dist/{index-BKofCDzL.d.mts → index-ClbGlQxq.d.mts} +2 -2
- package/dist/{index-DzcXmzdT.d.cts → index-Csbxj8Yo.d.cts} +2 -2
- package/dist/index-D1mRMWDm.d.cts +6 -0
- package/dist/index-D2v_oJEm.d.cts +6 -0
- package/dist/index-D5xp7RWT.d.cts +6 -0
- package/dist/index-D7IZ8-Zq.d.mts +42 -0
- package/dist/index-DKz4zEeT.d.mts +6 -0
- package/dist/{index-BXP1-da3.d.mts → index-IulNhyDt.d.mts} +2 -2
- package/dist/index-MbcUN6uf.d.mts +6 -0
- package/dist/index-aRomguCQ.d.mts +6 -0
- package/dist/{index-BYkO78Xl.d.cts → index-iVqAMF2L.d.cts} +2 -2
- package/dist/index-nfjmLzHF.d.mts +6 -0
- package/dist/index-pzogdlkS.d.mts +6 -0
- package/dist/index.cjs +12 -4
- package/dist/index.d.cts +15 -15
- package/dist/index.d.mts +15 -15
- package/dist/index.mjs +5 -5
- package/dist/{layout-kqQ2OsL5.cjs → layout-D3pG7vBp.cjs} +3 -1
- package/dist/{layout-lG3i5mWZ.mjs → layout-DF83ooFn.mjs} +3 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.cts +3 -3
- package/dist/layout.d.mts +3 -3
- package/dist/layout.mjs +1 -1
- package/dist/media-Bho3l7WK.mjs +85 -0
- package/dist/media-CfYDomHt.d.cts +54 -0
- package/dist/media-CfYDomHt.d.mts +54 -0
- package/dist/media-DSJdRy_k.cjs +120 -0
- package/dist/position.d.cts +2 -2
- package/dist/position.d.mts +2 -2
- package/dist/{presets-CV_TIXQ4.mjs → presets-DsxPfpSE.mjs} +4 -4
- package/dist/{presets-CCvtQotd.cjs → presets-KURYP1_7.cjs} +4 -4
- package/dist/prop-types.cjs +3 -3
- package/dist/prop-types.mjs +3 -3
- package/dist/props.cjs +1 -1
- package/dist/props.mjs +1 -1
- package/dist/shadow.d.cts +2 -2
- package/dist/shadow.d.mts +2 -2
- package/dist/should-forward-prop.cjs +1 -1
- package/dist/should-forward-prop.mjs +1 -1
- package/dist/space.d.cts +2 -2
- package/dist/space.d.mts +2 -2
- package/dist/{types-B0SNbm6V.d.cts → types-Cv5WjcVA.d.cts} +36 -7
- package/dist/{types-B0SNbm6V.d.mts → types-Cv5WjcVA.d.mts} +36 -7
- package/dist/typography.d.cts +2 -2
- package/dist/typography.d.mts +2 -2
- package/dist/{variant-DdSForfI.cjs → variant-BSPTyRcQ.cjs} +1 -1
- package/dist/{variant-DfRW-ZJe.mjs → variant-D1u5rSqm.mjs} +1 -1
- package/dist/variant.cjs +1 -1
- package/dist/variant.d.cts +2 -2
- package/dist/variant.d.mts +2 -2
- package/dist/variant.mjs +1 -1
- package/package.json +1 -1
- package/dist/grid-Bpk-QjhF.mjs +0 -41
- package/dist/grid-CpvRIng4.cjs +0 -47
- package/dist/index-0k2kzlK5.d.cts +0 -6
- package/dist/index-BReBwT6c.d.mts +0 -6
- package/dist/index-BhbWZw53.d.mts +0 -6
- package/dist/index-C-B6-_Ku.d.mts +0 -6
- package/dist/index-C9CxJ5Zn.d.cts +0 -6
- package/dist/index-CIccdXWj.d.cts +0 -6
- package/dist/index-CJT-n3Vq.d.mts +0 -6
- package/dist/index-CcorN1bQ.d.mts +0 -6
- package/dist/index-Cd_CcxMh.d.cts +0 -6
- package/dist/index-Co0JY1hd.d.cts +0 -6
- package/dist/index-D9dwDAhC.d.mts +0 -6
- package/dist/index-DP40bJIa.d.cts +0 -6
- package/dist/index-DQhcFrR9.d.mts +0 -6
- package/dist/index-DcRfFIAZ.d.mts +0 -6
- package/dist/index-Dsc6RgbZ.d.cts +0 -6
- package/dist/index-Q8q5VND1.d.cts +0 -6
- package/dist/index-UGE-V15i.d.cts +0 -6
- package/dist/index-sk97pkUE.d.mts +0 -6
- package/dist/media-B8UpEDpY.mjs +0 -18
- package/dist/media-BoIPXBPV.cjs +0 -29
- package/dist/media-np0uvO4C.d.cts +0 -14
- package/dist/media-np0uvO4C.d.mts +0 -14
package/dist/background.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as background } from "./index-
|
|
2
|
-
import { c as BackgroundProps, l as BackgroundRepeatProps, o as BackgroundImageProps, s as BackgroundPositionProps, u as BackgroundSizeProps } from "./types-
|
|
1
|
+
import { t as background } from "./index-Bwpwvg1h.cjs";
|
|
2
|
+
import { c as BackgroundProps, l as BackgroundRepeatProps, o as BackgroundImageProps, s as BackgroundPositionProps, u as BackgroundSizeProps } from "./types-Cv5WjcVA.cjs";
|
|
3
3
|
export { type BackgroundImageProps, type BackgroundPositionProps, type BackgroundProps, type BackgroundRepeatProps, type BackgroundSizeProps, background, background as default };
|
package/dist/background.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as background } from "./index-
|
|
2
|
-
import { c as BackgroundProps, l as BackgroundRepeatProps, o as BackgroundImageProps, s as BackgroundPositionProps, u as BackgroundSizeProps } from "./types-
|
|
1
|
+
import { t as background } from "./index-DKz4zEeT.mjs";
|
|
2
|
+
import { c as BackgroundProps, l as BackgroundRepeatProps, o as BackgroundImageProps, s as BackgroundPositionProps, u as BackgroundSizeProps } from "./types-Cv5WjcVA.mjs";
|
|
3
3
|
export { type BackgroundImageProps, type BackgroundPositionProps, type BackgroundProps, type BackgroundRepeatProps, type BackgroundSizeProps, background, background as default };
|
package/dist/border.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _ as BorderStyleProps, d as BorderBottomProps, f as BorderColorProps, g as BorderRightProps, h as BorderRadiusProps, m as BorderProps, p as BorderLeftProps, v as BorderTopProps, y as BorderWidthProps } from "./types-
|
|
2
|
-
import { t as border } from "./index-
|
|
1
|
+
import { _ as BorderStyleProps, d as BorderBottomProps, f as BorderColorProps, g as BorderRightProps, h as BorderRadiusProps, m as BorderProps, p as BorderLeftProps, v as BorderTopProps, y as BorderWidthProps } from "./types-Cv5WjcVA.cjs";
|
|
2
|
+
import { t as border } from "./index-D5xp7RWT.cjs";
|
|
3
3
|
export { type BorderBottomProps, type BorderColorProps, type BorderLeftProps, type BorderProps, type BorderRadiusProps, type BorderRightProps, type BorderStyleProps, type BorderTopProps, type BorderWidthProps, border, border as default };
|
package/dist/border.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _ as BorderStyleProps, d as BorderBottomProps, f as BorderColorProps, g as BorderRightProps, h as BorderRadiusProps, m as BorderProps, p as BorderLeftProps, v as BorderTopProps, y as BorderWidthProps } from "./types-
|
|
2
|
-
import { t as border } from "./index-
|
|
1
|
+
import { _ as BorderStyleProps, d as BorderBottomProps, f as BorderColorProps, g as BorderRightProps, h as BorderRadiusProps, m as BorderProps, p as BorderLeftProps, v as BorderTopProps, y as BorderWidthProps } from "./types-Cv5WjcVA.mjs";
|
|
2
|
+
import { t as border } from "./index-CQWZd4iQ.mjs";
|
|
3
3
|
export { type BorderBottomProps, type BorderColorProps, type BorderLeftProps, type BorderProps, type BorderRadiusProps, type BorderRightProps, type BorderStyleProps, type BorderTopProps, type BorderWidthProps, border, border as default };
|
package/dist/color.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as color } from "./index-
|
|
1
|
+
import { Mt as TextColorProps, a as BackgroundColorProps, ht as OpacityProps, w as ColorProps } from "./types-Cv5WjcVA.cjs";
|
|
2
|
+
import { t as color } from "./index-ByDfI1go.cjs";
|
|
3
3
|
export { type BackgroundColorProps, type ColorProps, type OpacityProps, type TextColorProps, color, color as default };
|
package/dist/color.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as color } from "./index-
|
|
1
|
+
import { Mt as TextColorProps, a as BackgroundColorProps, ht as OpacityProps, w as ColorProps } from "./types-Cv5WjcVA.mjs";
|
|
2
|
+
import { t as color } from "./index-90_abc05.mjs";
|
|
3
3
|
export { type BackgroundColorProps, type ColorProps, type OpacityProps, type TextColorProps, color, color as default };
|
package/dist/core.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_media = require("./media-
|
|
2
|
+
const require_media = require("./media-DSJdRy_k.cjs");
|
|
3
3
|
//#region src/core/core.ts
|
|
4
4
|
const merge = (a, b) => {
|
|
5
5
|
const result = {
|
|
@@ -12,10 +12,10 @@ const merge = (a, b) => {
|
|
|
12
12
|
}
|
|
13
13
|
return result;
|
|
14
14
|
};
|
|
15
|
-
const sort = (obj,
|
|
15
|
+
const sort = (obj, order) => {
|
|
16
16
|
const next = {};
|
|
17
|
-
for (const key in obj) if (!
|
|
18
|
-
for (const key of
|
|
17
|
+
for (const key in obj) if (!order.includes(key)) next[key] = obj[key];
|
|
18
|
+
for (const key of order) if (key in obj) next[key] = obj[key];
|
|
19
19
|
return next;
|
|
20
20
|
};
|
|
21
21
|
const defaults = { breakpoints: [
|
|
@@ -43,24 +43,21 @@ const parseResponsiveStyle = (mediaQueries, sx, scale, raw, props) => {
|
|
|
43
43
|
});
|
|
44
44
|
return styles;
|
|
45
45
|
};
|
|
46
|
-
const parseResponsiveObject = (
|
|
46
|
+
const parseResponsiveObject = (keyed, sx, scale, raw, props) => {
|
|
47
47
|
const styles = {};
|
|
48
48
|
for (const key in raw) {
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
...style
|
|
57
|
-
} });
|
|
58
|
-
} else Object.assign(styles, style);
|
|
49
|
+
const media = keyed.get(key);
|
|
50
|
+
const style = sx(raw[key], scale, props);
|
|
51
|
+
if (media) Object.assign(styles, { [media]: {
|
|
52
|
+
...styles[media],
|
|
53
|
+
...style
|
|
54
|
+
} });
|
|
55
|
+
else Object.assign(styles, style);
|
|
59
56
|
}
|
|
60
57
|
return styles;
|
|
61
58
|
};
|
|
62
59
|
const createParser = (config) => {
|
|
63
|
-
const cache = {
|
|
60
|
+
const cache = {};
|
|
64
61
|
const parse = ((props) => {
|
|
65
62
|
let styles = {};
|
|
66
63
|
let shouldSort = false;
|
|
@@ -72,23 +69,25 @@ const createParser = (config) => {
|
|
|
72
69
|
const scale = get(props.theme, sx.scale, sx.defaults);
|
|
73
70
|
if (typeof raw === "object") {
|
|
74
71
|
const breakpoints = get(props.theme, "breakpoints", defaults.breakpoints);
|
|
75
|
-
if (isCacheDisabled || cache.breakpoints !== breakpoints) {
|
|
72
|
+
if (isCacheDisabled || cache.breakpoints !== breakpoints || !cache.queries) {
|
|
76
73
|
cache.breakpoints = breakpoints;
|
|
77
|
-
cache.
|
|
74
|
+
cache.queries = require_media.responsiveQueries(breakpoints);
|
|
78
75
|
}
|
|
76
|
+
const queries = cache.queries;
|
|
79
77
|
if (Array.isArray(raw)) {
|
|
80
|
-
styles = merge(styles, parseResponsiveStyle(
|
|
78
|
+
styles = merge(styles, parseResponsiveStyle(queries.array, sx, scale, raw, props));
|
|
79
|
+
shouldSort = true;
|
|
81
80
|
continue;
|
|
82
81
|
}
|
|
83
82
|
if (raw !== null) {
|
|
84
|
-
styles = merge(styles, parseResponsiveObject(
|
|
83
|
+
styles = merge(styles, parseResponsiveObject(queries.keyed, sx, scale, raw, props));
|
|
85
84
|
shouldSort = true;
|
|
86
85
|
}
|
|
87
86
|
continue;
|
|
88
87
|
}
|
|
89
88
|
Object.assign(styles, sx(raw, scale, props));
|
|
90
89
|
}
|
|
91
|
-
if (shouldSort) styles = sort(styles, cache.
|
|
90
|
+
if (shouldSort && cache.queries) styles = sort(styles, cache.queries.order);
|
|
92
91
|
return styles;
|
|
93
92
|
});
|
|
94
93
|
parse.config = config;
|
|
@@ -145,9 +144,13 @@ const compose = (...parsers) => {
|
|
|
145
144
|
//#endregion
|
|
146
145
|
exports.breakpointQueries = require_media.breakpointQueries;
|
|
147
146
|
exports.compose = compose;
|
|
147
|
+
exports.containerKey = require_media.containerKey;
|
|
148
|
+
exports.createContainerQueries = require_media.createContainerQueries;
|
|
149
|
+
exports.createMediaHelpers = require_media.createMediaHelpers;
|
|
148
150
|
exports.createMediaQuery = require_media.createMediaQuery;
|
|
149
151
|
exports.createParser = createParser;
|
|
150
152
|
exports.createStyleFunction = createStyleFunction;
|
|
151
153
|
exports.get = get;
|
|
152
154
|
exports.merge = merge;
|
|
155
|
+
exports.responsiveQueries = require_media.responsiveQueries;
|
|
153
156
|
exports.system = system;
|
package/dist/core.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as breakpointQueries, r as
|
|
2
|
-
import { _ as merge, a as Parser, c as StyleFn, d as Theme, f as Transform, g as get, h as createStyleFunction, i as ConfigStyle, l as StyleObject, m as createParser, n as Config, o as ParserConfig, p as compose, r as ConfigFunction, s as Props, t as CSSObject, u as SystemConfig, v as styleFn, y as system } from "./index-
|
|
3
|
-
export { Breakpoints, CSSObject, Config, ConfigFunction, ConfigStyle, Parser, ParserConfig, Props, StyleFn, StyleObject, SystemConfig, Theme, Transform, breakpointQueries, compose, createMediaQuery, createParser, createStyleFunction, get, merge, styleFn, system };
|
|
1
|
+
import { a as ResponsiveQueries, c as createContainerQueries, d as responsiveQueries, i as QueryHelpers, l as createMediaHelpers, n as Breakpoints, o as breakpointQueries, r as ContainerQueries, s as containerKey, t as BreakpointInput, u as createMediaQuery } from "./media-CfYDomHt.cjs";
|
|
2
|
+
import { _ as merge, a as Parser, c as StyleFn, d as Theme, f as Transform, g as get, h as createStyleFunction, i as ConfigStyle, l as StyleObject, m as createParser, n as Config, o as ParserConfig, p as compose, r as ConfigFunction, s as Props, t as CSSObject, u as SystemConfig, v as styleFn, y as system } from "./index-iVqAMF2L.cjs";
|
|
3
|
+
export { BreakpointInput, Breakpoints, CSSObject, Config, ConfigFunction, ConfigStyle, ContainerQueries, Parser, ParserConfig, Props, QueryHelpers, ResponsiveQueries, StyleFn, StyleObject, SystemConfig, Theme, Transform, breakpointQueries, compose, containerKey, createContainerQueries, createMediaHelpers, createMediaQuery, createParser, createStyleFunction, get, merge, responsiveQueries, styleFn, system };
|
package/dist/core.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as breakpointQueries, r as
|
|
2
|
-
import { _ as merge, a as Parser, c as StyleFn, d as Theme, f as Transform, g as get, h as createStyleFunction, i as ConfigStyle, l as StyleObject, m as createParser, n as Config, o as ParserConfig, p as compose, r as ConfigFunction, s as Props, t as CSSObject, u as SystemConfig, v as styleFn, y as system } from "./index-
|
|
3
|
-
export { Breakpoints, CSSObject, Config, ConfigFunction, ConfigStyle, Parser, ParserConfig, Props, StyleFn, StyleObject, SystemConfig, Theme, Transform, breakpointQueries, compose, createMediaQuery, createParser, createStyleFunction, get, merge, styleFn, system };
|
|
1
|
+
import { a as ResponsiveQueries, c as createContainerQueries, d as responsiveQueries, i as QueryHelpers, l as createMediaHelpers, n as Breakpoints, o as breakpointQueries, r as ContainerQueries, s as containerKey, t as BreakpointInput, u as createMediaQuery } from "./media-CfYDomHt.mjs";
|
|
2
|
+
import { _ as merge, a as Parser, c as StyleFn, d as Theme, f as Transform, g as get, h as createStyleFunction, i as ConfigStyle, l as StyleObject, m as createParser, n as Config, o as ParserConfig, p as compose, r as ConfigFunction, s as Props, t as CSSObject, u as SystemConfig, v as styleFn, y as system } from "./index-IulNhyDt.mjs";
|
|
3
|
+
export { BreakpointInput, Breakpoints, CSSObject, Config, ConfigFunction, ConfigStyle, ContainerQueries, Parser, ParserConfig, Props, QueryHelpers, ResponsiveQueries, StyleFn, StyleObject, SystemConfig, Theme, Transform, breakpointQueries, compose, containerKey, createContainerQueries, createMediaHelpers, createMediaQuery, createParser, createStyleFunction, get, merge, responsiveQueries, styleFn, system };
|
package/dist/core.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as createMediaQuery, i as createMediaHelpers, n as containerKey, o as responsiveQueries, r as createContainerQueries, t as breakpointQueries } from "./media-Bho3l7WK.mjs";
|
|
2
2
|
//#region src/core/core.ts
|
|
3
3
|
const merge = (a, b) => {
|
|
4
4
|
const result = {
|
|
@@ -11,10 +11,10 @@ const merge = (a, b) => {
|
|
|
11
11
|
}
|
|
12
12
|
return result;
|
|
13
13
|
};
|
|
14
|
-
const sort = (obj,
|
|
14
|
+
const sort = (obj, order) => {
|
|
15
15
|
const next = {};
|
|
16
|
-
for (const key in obj) if (!
|
|
17
|
-
for (const key of
|
|
16
|
+
for (const key in obj) if (!order.includes(key)) next[key] = obj[key];
|
|
17
|
+
for (const key of order) if (key in obj) next[key] = obj[key];
|
|
18
18
|
return next;
|
|
19
19
|
};
|
|
20
20
|
const defaults = { breakpoints: [
|
|
@@ -42,24 +42,21 @@ const parseResponsiveStyle = (mediaQueries, sx, scale, raw, props) => {
|
|
|
42
42
|
});
|
|
43
43
|
return styles;
|
|
44
44
|
};
|
|
45
|
-
const parseResponsiveObject = (
|
|
45
|
+
const parseResponsiveObject = (keyed, sx, scale, raw, props) => {
|
|
46
46
|
const styles = {};
|
|
47
47
|
for (const key in raw) {
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
...style
|
|
56
|
-
} });
|
|
57
|
-
} else Object.assign(styles, style);
|
|
48
|
+
const media = keyed.get(key);
|
|
49
|
+
const style = sx(raw[key], scale, props);
|
|
50
|
+
if (media) Object.assign(styles, { [media]: {
|
|
51
|
+
...styles[media],
|
|
52
|
+
...style
|
|
53
|
+
} });
|
|
54
|
+
else Object.assign(styles, style);
|
|
58
55
|
}
|
|
59
56
|
return styles;
|
|
60
57
|
};
|
|
61
58
|
const createParser = (config) => {
|
|
62
|
-
const cache = {
|
|
59
|
+
const cache = {};
|
|
63
60
|
const parse = ((props) => {
|
|
64
61
|
let styles = {};
|
|
65
62
|
let shouldSort = false;
|
|
@@ -71,23 +68,25 @@ const createParser = (config) => {
|
|
|
71
68
|
const scale = get(props.theme, sx.scale, sx.defaults);
|
|
72
69
|
if (typeof raw === "object") {
|
|
73
70
|
const breakpoints = get(props.theme, "breakpoints", defaults.breakpoints);
|
|
74
|
-
if (isCacheDisabled || cache.breakpoints !== breakpoints) {
|
|
71
|
+
if (isCacheDisabled || cache.breakpoints !== breakpoints || !cache.queries) {
|
|
75
72
|
cache.breakpoints = breakpoints;
|
|
76
|
-
cache.
|
|
73
|
+
cache.queries = responsiveQueries(breakpoints);
|
|
77
74
|
}
|
|
75
|
+
const queries = cache.queries;
|
|
78
76
|
if (Array.isArray(raw)) {
|
|
79
|
-
styles = merge(styles, parseResponsiveStyle(
|
|
77
|
+
styles = merge(styles, parseResponsiveStyle(queries.array, sx, scale, raw, props));
|
|
78
|
+
shouldSort = true;
|
|
80
79
|
continue;
|
|
81
80
|
}
|
|
82
81
|
if (raw !== null) {
|
|
83
|
-
styles = merge(styles, parseResponsiveObject(
|
|
82
|
+
styles = merge(styles, parseResponsiveObject(queries.keyed, sx, scale, raw, props));
|
|
84
83
|
shouldSort = true;
|
|
85
84
|
}
|
|
86
85
|
continue;
|
|
87
86
|
}
|
|
88
87
|
Object.assign(styles, sx(raw, scale, props));
|
|
89
88
|
}
|
|
90
|
-
if (shouldSort) styles = sort(styles, cache.
|
|
89
|
+
if (shouldSort && cache.queries) styles = sort(styles, cache.queries.order);
|
|
91
90
|
return styles;
|
|
92
91
|
});
|
|
93
92
|
parse.config = config;
|
|
@@ -142,4 +141,4 @@ const compose = (...parsers) => {
|
|
|
142
141
|
return createParser(config);
|
|
143
142
|
};
|
|
144
143
|
//#endregion
|
|
145
|
-
export { breakpointQueries, compose, createMediaQuery, createParser, createStyleFunction, get, merge, system };
|
|
144
|
+
export { breakpointQueries, compose, containerKey, createContainerQueries, createMediaHelpers, createMediaQuery, createParser, createStyleFunction, get, merge, responsiveQueries, system };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as responsiveQueries } from "./media-Bho3l7WK.mjs";
|
|
2
2
|
//#region src/css/css.ts
|
|
3
3
|
const get = (obj, key, def, p = 0, undef) => {
|
|
4
4
|
const path = typeof key === "string" ? key.split(".") : [key];
|
|
@@ -155,29 +155,37 @@ const transforms = [
|
|
|
155
155
|
...acc,
|
|
156
156
|
[curr]: positiveOrNegative
|
|
157
157
|
}), {});
|
|
158
|
+
const isResponsiveObject = (value, keyed) => typeof value === "object" && value !== null && !Array.isArray(value) && Object.keys(value).length > 0 && Object.keys(value).every((key) => keyed.has(key));
|
|
158
159
|
const responsive = (styles) => (theme) => {
|
|
159
160
|
const next = {};
|
|
161
|
+
const blocks = /* @__PURE__ */ new Map();
|
|
160
162
|
const breakpoints = get(theme, "breakpoints", defaultBreakpoints);
|
|
161
|
-
const
|
|
163
|
+
const { array, keyed, order } = responsiveQueries(breakpoints);
|
|
164
|
+
const place = (key, media, value) => {
|
|
165
|
+
if (!media) {
|
|
166
|
+
next[key] = value;
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const block = blocks.get(media) ?? {};
|
|
170
|
+
blocks.set(media, block);
|
|
171
|
+
if (value != null) block[key] = value;
|
|
172
|
+
};
|
|
162
173
|
for (const key in styles) {
|
|
163
174
|
const value = typeof styles[key] === "function" ? styles[key](theme) : styles[key];
|
|
164
175
|
if (value == null) continue;
|
|
165
|
-
if (
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
if (slice[i] == null) continue;
|
|
179
|
-
block[key] = slice[i];
|
|
180
|
-
}
|
|
176
|
+
if (Array.isArray(value)) value.slice(0, array.length).forEach((item, i) => place(key, array[i], item));
|
|
177
|
+
else if (isResponsiveObject(value, keyed)) for (const [name, item] of Object.entries(value)) place(key, keyed.get(name), item);
|
|
178
|
+
else next[key] = value;
|
|
179
|
+
}
|
|
180
|
+
for (const media of order) {
|
|
181
|
+
const block = blocks.get(media);
|
|
182
|
+
if (!block) continue;
|
|
183
|
+
const own = next[media];
|
|
184
|
+
delete next[media];
|
|
185
|
+
next[media] = {
|
|
186
|
+
...own,
|
|
187
|
+
...block
|
|
188
|
+
};
|
|
181
189
|
}
|
|
182
190
|
return next;
|
|
183
191
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_media = require("./media-
|
|
1
|
+
const require_media = require("./media-DSJdRy_k.cjs");
|
|
2
2
|
//#region src/css/css.ts
|
|
3
3
|
const get = (obj, key, def, p = 0, undef) => {
|
|
4
4
|
const path = typeof key === "string" ? key.split(".") : [key];
|
|
@@ -155,29 +155,37 @@ const transforms = [
|
|
|
155
155
|
...acc,
|
|
156
156
|
[curr]: positiveOrNegative
|
|
157
157
|
}), {});
|
|
158
|
+
const isResponsiveObject = (value, keyed) => typeof value === "object" && value !== null && !Array.isArray(value) && Object.keys(value).length > 0 && Object.keys(value).every((key) => keyed.has(key));
|
|
158
159
|
const responsive = (styles) => (theme) => {
|
|
159
160
|
const next = {};
|
|
161
|
+
const blocks = /* @__PURE__ */ new Map();
|
|
160
162
|
const breakpoints = get(theme, "breakpoints", defaultBreakpoints);
|
|
161
|
-
const
|
|
163
|
+
const { array, keyed, order } = require_media.responsiveQueries(breakpoints);
|
|
164
|
+
const place = (key, media, value) => {
|
|
165
|
+
if (!media) {
|
|
166
|
+
next[key] = value;
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const block = blocks.get(media) ?? {};
|
|
170
|
+
blocks.set(media, block);
|
|
171
|
+
if (value != null) block[key] = value;
|
|
172
|
+
};
|
|
162
173
|
for (const key in styles) {
|
|
163
174
|
const value = typeof styles[key] === "function" ? styles[key](theme) : styles[key];
|
|
164
175
|
if (value == null) continue;
|
|
165
|
-
if (
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
if (slice[i] == null) continue;
|
|
179
|
-
block[key] = slice[i];
|
|
180
|
-
}
|
|
176
|
+
if (Array.isArray(value)) value.slice(0, array.length).forEach((item, i) => place(key, array[i], item));
|
|
177
|
+
else if (isResponsiveObject(value, keyed)) for (const [name, item] of Object.entries(value)) place(key, keyed.get(name), item);
|
|
178
|
+
else next[key] = value;
|
|
179
|
+
}
|
|
180
|
+
for (const media of order) {
|
|
181
|
+
const block = blocks.get(media);
|
|
182
|
+
if (!block) continue;
|
|
183
|
+
const own = next[media];
|
|
184
|
+
delete next[media];
|
|
185
|
+
next[media] = {
|
|
186
|
+
...own,
|
|
187
|
+
...block
|
|
188
|
+
};
|
|
181
189
|
}
|
|
182
190
|
return next;
|
|
183
191
|
};
|
package/dist/css.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_css = require("./css-
|
|
5
|
+
const require_css = require("./css-D1zAlDVz.cjs");
|
|
6
6
|
exports.css = require_css.css;
|
|
7
7
|
exports.default = require_css.css;
|
|
8
8
|
exports.get = require_css.get;
|
package/dist/css.d.cts
CHANGED
package/dist/css.d.mts
CHANGED
package/dist/css.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as get, r as responsive, t as css } from "./css-
|
|
1
|
+
import { n as get, r as responsive, t as css } from "./css-Ba4jdXOq.mjs";
|
|
2
2
|
export { css, css as default, get, responsive };
|
package/dist/flexbox.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as flexbox } from "./index-
|
|
1
|
+
import { A as FlexDirectionProps, F as FlexboxProps, M as FlexProps, N as FlexShrinkProps, P as FlexWrapProps, gt as OrderProps, j as FlexGrowProps, k as FlexBasisProps, n as AlignItemsProps, nt as JustifyItemsProps, r as AlignSelfProps, rt as JustifySelfProps, t as AlignContentProps, tt as JustifyContentProps } from "./types-Cv5WjcVA.cjs";
|
|
2
|
+
import { t as flexbox } from "./index-CQyvhO-h.cjs";
|
|
3
3
|
export { type AlignContentProps, type AlignItemsProps, type AlignSelfProps, type FlexBasisProps, type FlexDirectionProps, type FlexGrowProps, type FlexProps, type FlexShrinkProps, type FlexWrapProps, type FlexboxProps, type JustifyContentProps, type JustifyItemsProps, type JustifySelfProps, type OrderProps, flexbox as default, flexbox };
|
package/dist/flexbox.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as flexbox } from "./index-
|
|
1
|
+
import { A as FlexDirectionProps, F as FlexboxProps, M as FlexProps, N as FlexShrinkProps, P as FlexWrapProps, gt as OrderProps, j as FlexGrowProps, k as FlexBasisProps, n as AlignItemsProps, nt as JustifyItemsProps, r as AlignSelfProps, rt as JustifySelfProps, t as AlignContentProps, tt as JustifyContentProps } from "./types-Cv5WjcVA.mjs";
|
|
2
|
+
import { t as flexbox } from "./index-aRomguCQ.mjs";
|
|
3
3
|
export { type AlignContentProps, type AlignItemsProps, type AlignSelfProps, type FlexBasisProps, type FlexDirectionProps, type FlexGrowProps, type FlexProps, type FlexShrinkProps, type FlexWrapProps, type FlexboxProps, type JustifyContentProps, type JustifyItemsProps, type JustifySelfProps, type OrderProps, flexbox as default, flexbox };
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
const require_media = require("./media-DSJdRy_k.cjs");
|
|
2
|
+
const require_core = require("./core.cjs");
|
|
3
|
+
//#region src/grid/grid.ts
|
|
4
|
+
const spaceScale = [
|
|
5
|
+
0,
|
|
6
|
+
4,
|
|
7
|
+
8,
|
|
8
|
+
16,
|
|
9
|
+
32,
|
|
10
|
+
64,
|
|
11
|
+
128,
|
|
12
|
+
256,
|
|
13
|
+
512
|
|
14
|
+
];
|
|
15
|
+
const config = {
|
|
16
|
+
gridGap: {
|
|
17
|
+
property: "gridGap",
|
|
18
|
+
scale: "space",
|
|
19
|
+
defaultScale: spaceScale
|
|
20
|
+
},
|
|
21
|
+
gridColumnGap: {
|
|
22
|
+
property: "gridColumnGap",
|
|
23
|
+
scale: "space",
|
|
24
|
+
defaultScale: spaceScale
|
|
25
|
+
},
|
|
26
|
+
gridRowGap: {
|
|
27
|
+
property: "gridRowGap",
|
|
28
|
+
scale: "space",
|
|
29
|
+
defaultScale: spaceScale
|
|
30
|
+
},
|
|
31
|
+
gridColumn: true,
|
|
32
|
+
gridRow: true,
|
|
33
|
+
gridAutoFlow: true,
|
|
34
|
+
gridAutoColumns: true,
|
|
35
|
+
gridAutoRows: true,
|
|
36
|
+
gridTemplateColumns: true,
|
|
37
|
+
gridTemplateRows: true,
|
|
38
|
+
gridTemplateAreas: true,
|
|
39
|
+
gridArea: true
|
|
40
|
+
};
|
|
41
|
+
const grid = require_core.system(config);
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/grid/layoutGrid.ts
|
|
44
|
+
const spaceValue = (theme, value) => {
|
|
45
|
+
const resolved = require_core.get(theme, `space.${value}`, value);
|
|
46
|
+
return typeof resolved === "number" ? `${resolved}px` : resolved;
|
|
47
|
+
};
|
|
48
|
+
const declarations = (theme, display, entry) => {
|
|
49
|
+
const { columns, margin, gutter, mode, maxWidth } = entry;
|
|
50
|
+
const isFixed = mode === "fixed";
|
|
51
|
+
const gap = gutter === void 0 ? void 0 : spaceValue(theme, gutter);
|
|
52
|
+
const styles = {
|
|
53
|
+
"--layout-columns": columns,
|
|
54
|
+
"--layout-gutter": gap,
|
|
55
|
+
gridTemplateColumns: display === "grid" && columns !== void 0 ? `repeat(${columns}, minmax(0, 1fr))` : void 0,
|
|
56
|
+
columnGap: gap,
|
|
57
|
+
paddingInline: margin === void 0 ? void 0 : spaceValue(theme, margin),
|
|
58
|
+
maxWidth: isFixed && maxWidth !== void 0 ? spaceValue(theme, maxWidth) : "none",
|
|
59
|
+
marginInline: isFixed ? "auto" : 0
|
|
60
|
+
};
|
|
61
|
+
return Object.fromEntries(Object.entries(styles).filter(([, value]) => value !== void 0));
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* The layout grid from `theme.layout`, per breakpoint: each breakpoint's `content` (columns,
|
|
65
|
+
* margin, gutter, fluid or fixed), inherited mobile-first. An entry in `value` replaces the
|
|
66
|
+
* theme's at the breakpoint it names only; the next breakpoint is back to the theme. Every
|
|
67
|
+
* written block carries the full set, so no block inherits a stale `max-width`.
|
|
68
|
+
*/
|
|
69
|
+
const layoutGridStyles = (theme, value, display = "grid") => {
|
|
70
|
+
if (!value) return {};
|
|
71
|
+
const breakpoints = require_core.get(theme, "breakpoints", {});
|
|
72
|
+
const layout = require_core.get(theme, "layout", {});
|
|
73
|
+
const overrides = typeof value === "object" ? value : {};
|
|
74
|
+
const { keyed } = require_media.responsiveQueries(breakpoints);
|
|
75
|
+
const styles = display === "grid" ? { display: "grid" } : {
|
|
76
|
+
display: "flex",
|
|
77
|
+
flexDirection: "row",
|
|
78
|
+
flexWrap: "wrap"
|
|
79
|
+
};
|
|
80
|
+
let themed = {};
|
|
81
|
+
let overridden = false;
|
|
82
|
+
for (const key of Object.keys(breakpoints)) {
|
|
83
|
+
const layer = layout[key]?.content;
|
|
84
|
+
const override = Object.hasOwn(overrides, key) ? overrides[key] : void 0;
|
|
85
|
+
themed = {
|
|
86
|
+
...themed,
|
|
87
|
+
...layer
|
|
88
|
+
};
|
|
89
|
+
if (layer || override || overridden) {
|
|
90
|
+
const block = declarations(theme, display, {
|
|
91
|
+
...themed,
|
|
92
|
+
...override
|
|
93
|
+
});
|
|
94
|
+
const media = keyed.get(key);
|
|
95
|
+
if (media) styles[media] = block;
|
|
96
|
+
else Object.assign(styles, block);
|
|
97
|
+
}
|
|
98
|
+
overridden = override !== void 0;
|
|
99
|
+
}
|
|
100
|
+
return styles;
|
|
101
|
+
};
|
|
102
|
+
const layoutParser = (display) => Object.assign((props) => layoutGridStyles(props.theme, props.layout, display), {
|
|
103
|
+
config: {},
|
|
104
|
+
propNames: ["layout"],
|
|
105
|
+
cache: {}
|
|
106
|
+
});
|
|
107
|
+
/** The `layout` prop on a grid container - see {@link layoutGridStyles}. */
|
|
108
|
+
const layoutGrid = layoutParser("grid");
|
|
109
|
+
/** The `layout` prop on a flex container: a wrapping row with the same gutter and margin. */
|
|
110
|
+
const layoutFlex = layoutParser("flex");
|
|
111
|
+
const flexSpan = (n) => {
|
|
112
|
+
const columns = "var(--layout-columns, 1)";
|
|
113
|
+
const gutter = "var(--layout-gutter, 0px)";
|
|
114
|
+
return `0 0 calc((100% - (${columns} - 1) * ${gutter}) / ${columns} * ${n} + ${n - 1} * ${gutter})`;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* The `span` prop: how many layout-grid columns an element takes. It writes both
|
|
118
|
+
* `grid-column: span N` (read by a Grid parent) and a flex basis from the parent's
|
|
119
|
+
* `--layout-columns` / `--layout-gutter` (read by a Flex parent); each container ignores the
|
|
120
|
+
* other's property. Responsive like any prop: `span={{ xs: 4, md: 6 }}`.
|
|
121
|
+
*/
|
|
122
|
+
const span = require_core.system({ span: (n) => ({
|
|
123
|
+
gridColumn: `span ${n}`,
|
|
124
|
+
flex: flexSpan(n)
|
|
125
|
+
}) });
|
|
126
|
+
//#endregion
|
|
127
|
+
Object.defineProperty(exports, "grid", {
|
|
128
|
+
enumerable: true,
|
|
129
|
+
get: function() {
|
|
130
|
+
return grid;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
Object.defineProperty(exports, "layoutFlex", {
|
|
134
|
+
enumerable: true,
|
|
135
|
+
get: function() {
|
|
136
|
+
return layoutFlex;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
Object.defineProperty(exports, "layoutGrid", {
|
|
140
|
+
enumerable: true,
|
|
141
|
+
get: function() {
|
|
142
|
+
return layoutGrid;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
Object.defineProperty(exports, "layoutGridStyles", {
|
|
146
|
+
enumerable: true,
|
|
147
|
+
get: function() {
|
|
148
|
+
return layoutGridStyles;
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
Object.defineProperty(exports, "span", {
|
|
152
|
+
enumerable: true,
|
|
153
|
+
get: function() {
|
|
154
|
+
return span;
|
|
155
|
+
}
|
|
156
|
+
});
|