@soroush.tech/styled-system 5.8.3 → 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 +28 -24
- package/dist/core.d.cts +3 -2
- package/dist/core.d.mts +3 -2
- package/dist/core.mjs +23 -25
- package/dist/{css-BTuRmXCo.mjs → css-Ba4jdXOq.mjs} +27 -17
- package/dist/{css-CeNnKyGm.cjs → css-D1zAlDVz.cjs} +27 -17
- package/dist/css.cjs +1 -1
- package/dist/css.d.cts +2 -1
- package/dist/css.d.mts +2 -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-6cAxfKIl.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-O6xVfQo3.d.cts → index-CgJzEbXW.d.cts} +2 -2
- package/dist/{index-DbknCBOx.d.mts → index-ClbGlQxq.d.mts} +2 -2
- package/dist/{index-bHspW0eP.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-C0SM54dQ.d.cts → index-IulNhyDt.d.mts} +4 -3
- package/dist/index-MbcUN6uf.d.mts +6 -0
- package/dist/index-aRomguCQ.d.mts +6 -0
- package/dist/{index-C0SM54dQ.d.mts → index-iVqAMF2L.d.cts} +4 -3
- package/dist/index-nfjmLzHF.d.mts +6 -0
- package/dist/index-pzogdlkS.d.mts +6 -0
- package/dist/index.cjs +14 -3
- package/dist/index.d.cts +15 -14
- package/dist/index.d.mts +15 -14
- package/dist/index.mjs +5 -4
- 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-Dg3yjRZU.mjs → presets-DsxPfpSE.mjs} +4 -4
- package/dist/{presets-B2nFh_Zn.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-B52XAdkx.d.cts → types-Cv5WjcVA.d.cts} +36 -4
- package/dist/{types-B52XAdkx.d.mts → types-Cv5WjcVA.d.mts} +36 -4
- package/dist/typography.d.cts +2 -2
- package/dist/typography.d.mts +2 -2
- package/dist/{variant-BSwNEY5l.cjs → variant-BSPTyRcQ.cjs} +1 -1
- package/dist/{variant-NupmzzRg.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 +4 -4
- package/dist/grid-Bpk-QjhF.mjs +0 -41
- package/dist/grid-CpvRIng4.cjs +0 -47
- package/dist/index-B89zA95f.d.mts +0 -6
- package/dist/index-BBuQfHYC.d.cts +0 -6
- package/dist/index-BNnm8JPL.d.mts +0 -6
- package/dist/index-B_swWveU.d.cts +0 -6
- package/dist/index-Bqj29Szo.d.mts +0 -6
- package/dist/index-C-8kLZ_X.d.mts +0 -6
- package/dist/index-ClSRfFkX.d.cts +0 -6
- package/dist/index-CpDyBw8z.d.cts +0 -6
- package/dist/index-D11y4gdv.d.mts +0 -6
- package/dist/index-DLQzYvfH.d.mts +0 -6
- package/dist/index-DOmnNWoA.d.cts +0 -6
- package/dist/index-Daclwf93.d.cts +0 -6
- package/dist/index-DdlTo1c6.d.mts +0 -6
- package/dist/index-DluQIAXz.d.cts +0 -6
- package/dist/index-DuI1XGHT.d.mts +0 -6
- package/dist/index-NT55TmXe.d.cts +0 -6
- package/dist/index-RXhfbqjT.d.cts +0 -6
- package/dist/index-yC71Yo0d.d.mts +0 -6
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { o as responsiveQueries } from "./media-Bho3l7WK.mjs";
|
|
2
|
+
import { get, system } from "./core.mjs";
|
|
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 grid = system({
|
|
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
|
+
//#endregion
|
|
42
|
+
//#region src/grid/layoutGrid.ts
|
|
43
|
+
const spaceValue = (theme, value) => {
|
|
44
|
+
const resolved = get(theme, `space.${value}`, value);
|
|
45
|
+
return typeof resolved === "number" ? `${resolved}px` : resolved;
|
|
46
|
+
};
|
|
47
|
+
const declarations = (theme, display, entry) => {
|
|
48
|
+
const { columns, margin, gutter, mode, maxWidth } = entry;
|
|
49
|
+
const isFixed = mode === "fixed";
|
|
50
|
+
const gap = gutter === void 0 ? void 0 : spaceValue(theme, gutter);
|
|
51
|
+
const styles = {
|
|
52
|
+
"--layout-columns": columns,
|
|
53
|
+
"--layout-gutter": gap,
|
|
54
|
+
gridTemplateColumns: display === "grid" && columns !== void 0 ? `repeat(${columns}, minmax(0, 1fr))` : void 0,
|
|
55
|
+
columnGap: gap,
|
|
56
|
+
paddingInline: margin === void 0 ? void 0 : spaceValue(theme, margin),
|
|
57
|
+
maxWidth: isFixed && maxWidth !== void 0 ? spaceValue(theme, maxWidth) : "none",
|
|
58
|
+
marginInline: isFixed ? "auto" : 0
|
|
59
|
+
};
|
|
60
|
+
return Object.fromEntries(Object.entries(styles).filter(([, value]) => value !== void 0));
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* The layout grid from `theme.layout`, per breakpoint: each breakpoint's `content` (columns,
|
|
64
|
+
* margin, gutter, fluid or fixed), inherited mobile-first. An entry in `value` replaces the
|
|
65
|
+
* theme's at the breakpoint it names only; the next breakpoint is back to the theme. Every
|
|
66
|
+
* written block carries the full set, so no block inherits a stale `max-width`.
|
|
67
|
+
*/
|
|
68
|
+
const layoutGridStyles = (theme, value, display = "grid") => {
|
|
69
|
+
if (!value) return {};
|
|
70
|
+
const breakpoints = get(theme, "breakpoints", {});
|
|
71
|
+
const layout = get(theme, "layout", {});
|
|
72
|
+
const overrides = typeof value === "object" ? value : {};
|
|
73
|
+
const { keyed } = responsiveQueries(breakpoints);
|
|
74
|
+
const styles = display === "grid" ? { display: "grid" } : {
|
|
75
|
+
display: "flex",
|
|
76
|
+
flexDirection: "row",
|
|
77
|
+
flexWrap: "wrap"
|
|
78
|
+
};
|
|
79
|
+
let themed = {};
|
|
80
|
+
let overridden = false;
|
|
81
|
+
for (const key of Object.keys(breakpoints)) {
|
|
82
|
+
const layer = layout[key]?.content;
|
|
83
|
+
const override = Object.hasOwn(overrides, key) ? overrides[key] : void 0;
|
|
84
|
+
themed = {
|
|
85
|
+
...themed,
|
|
86
|
+
...layer
|
|
87
|
+
};
|
|
88
|
+
if (layer || override || overridden) {
|
|
89
|
+
const block = declarations(theme, display, {
|
|
90
|
+
...themed,
|
|
91
|
+
...override
|
|
92
|
+
});
|
|
93
|
+
const media = keyed.get(key);
|
|
94
|
+
if (media) styles[media] = block;
|
|
95
|
+
else Object.assign(styles, block);
|
|
96
|
+
}
|
|
97
|
+
overridden = override !== void 0;
|
|
98
|
+
}
|
|
99
|
+
return styles;
|
|
100
|
+
};
|
|
101
|
+
const layoutParser = (display) => Object.assign((props) => layoutGridStyles(props.theme, props.layout, display), {
|
|
102
|
+
config: {},
|
|
103
|
+
propNames: ["layout"],
|
|
104
|
+
cache: {}
|
|
105
|
+
});
|
|
106
|
+
/** The `layout` prop on a grid container - see {@link layoutGridStyles}. */
|
|
107
|
+
const layoutGrid = layoutParser("grid");
|
|
108
|
+
/** The `layout` prop on a flex container: a wrapping row with the same gutter and margin. */
|
|
109
|
+
const layoutFlex = layoutParser("flex");
|
|
110
|
+
const flexSpan = (n) => {
|
|
111
|
+
const columns = "var(--layout-columns, 1)";
|
|
112
|
+
const gutter = "var(--layout-gutter, 0px)";
|
|
113
|
+
return `0 0 calc((100% - (${columns} - 1) * ${gutter}) / ${columns} * ${n} + ${n - 1} * ${gutter})`;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* The `span` prop: how many layout-grid columns an element takes. It writes both
|
|
117
|
+
* `grid-column: span N` (read by a Grid parent) and a flex basis from the parent's
|
|
118
|
+
* `--layout-columns` / `--layout-gutter` (read by a Flex parent); each container ignores the
|
|
119
|
+
* other's property. Responsive like any prop: `span={{ xs: 4, md: 6 }}`.
|
|
120
|
+
*/
|
|
121
|
+
const span = system({ span: (n) => ({
|
|
122
|
+
gridColumn: `span ${n}`,
|
|
123
|
+
flex: flexSpan(n)
|
|
124
|
+
}) });
|
|
125
|
+
//#endregion
|
|
126
|
+
export { grid as a, span as i, layoutGrid as n, layoutGridStyles as r, layoutFlex as t };
|
package/dist/grid.cjs
CHANGED
|
@@ -2,6 +2,10 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_grid = require("./grid-
|
|
5
|
+
const require_grid = require("./grid-BlMUPDJM.cjs");
|
|
6
6
|
exports.default = require_grid.grid;
|
|
7
7
|
exports.grid = require_grid.grid;
|
|
8
|
+
exports.layoutFlex = require_grid.layoutFlex;
|
|
9
|
+
exports.layoutGrid = require_grid.layoutGrid;
|
|
10
|
+
exports.layoutGridStyles = require_grid.layoutGridStyles;
|
|
11
|
+
exports.span = require_grid.span;
|
package/dist/grid.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export { type GridAreaProps, type GridAutoColumnsProps, type GridAutoFlowProps, type GridAutoRowsProps, type GridColumnGapProps, type GridColumnProps, type GridGapProps, type GridProps, type GridRowGapProps, type GridRowProps, type GridTemplateAreasProps, type GridTemplateColumnsProps, type GridTemplateRowsProps, grid as default, grid };
|
|
1
|
+
import { $ as GridTemplateRowsProps, G as GridColumnGapProps, H as GridAutoColumnsProps, J as GridProps, K as GridColumnProps, Ot as SpanProps, Q as GridTemplateColumnsProps, U as GridAutoFlowProps, V as GridAreaProps, W as GridAutoRowsProps, X as GridRowProps, Y as GridRowGapProps, Z as GridTemplateAreasProps, it as LayoutGridProps, q as GridGapProps } from "./types-Cv5WjcVA.cjs";
|
|
2
|
+
import { a as layoutGrid, c as grid, i as layoutFlex, n as LayoutGridEntry, o as layoutGridStyles, r as LayoutGridValue, s as span, t as LayoutGridDisplay } from "./index-CXK27dY_.cjs";
|
|
3
|
+
export { type GridAreaProps, type GridAutoColumnsProps, type GridAutoFlowProps, type GridAutoRowsProps, type GridColumnGapProps, type GridColumnProps, type GridGapProps, type GridProps, type GridRowGapProps, type GridRowProps, type GridTemplateAreasProps, type GridTemplateColumnsProps, type GridTemplateRowsProps, LayoutGridDisplay, LayoutGridEntry, type LayoutGridProps, LayoutGridValue, type SpanProps, grid as default, grid, layoutFlex, layoutGrid, layoutGridStyles, span };
|
package/dist/grid.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export { type GridAreaProps, type GridAutoColumnsProps, type GridAutoFlowProps, type GridAutoRowsProps, type GridColumnGapProps, type GridColumnProps, type GridGapProps, type GridProps, type GridRowGapProps, type GridRowProps, type GridTemplateAreasProps, type GridTemplateColumnsProps, type GridTemplateRowsProps, grid as default, grid };
|
|
1
|
+
import { $ as GridTemplateRowsProps, G as GridColumnGapProps, H as GridAutoColumnsProps, J as GridProps, K as GridColumnProps, Ot as SpanProps, Q as GridTemplateColumnsProps, U as GridAutoFlowProps, V as GridAreaProps, W as GridAutoRowsProps, X as GridRowProps, Y as GridRowGapProps, Z as GridTemplateAreasProps, it as LayoutGridProps, q as GridGapProps } from "./types-Cv5WjcVA.mjs";
|
|
2
|
+
import { a as layoutGrid, c as grid, i as layoutFlex, n as LayoutGridEntry, o as layoutGridStyles, r as LayoutGridValue, s as span, t as LayoutGridDisplay } from "./index-D7IZ8-Zq.mjs";
|
|
3
|
+
export { type GridAreaProps, type GridAutoColumnsProps, type GridAutoFlowProps, type GridAutoRowsProps, type GridColumnGapProps, type GridColumnProps, type GridGapProps, type GridProps, type GridRowGapProps, type GridRowProps, type GridTemplateAreasProps, type GridTemplateColumnsProps, type GridTemplateRowsProps, LayoutGridDisplay, LayoutGridEntry, type LayoutGridProps, LayoutGridValue, type SpanProps, grid as default, grid, layoutFlex, layoutGrid, layoutGridStyles, span };
|
package/dist/grid.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { grid as default, grid };
|
|
1
|
+
import { a as grid, i as span, n as layoutGrid, r as layoutGridStyles, t as layoutFlex } from "./grid-CYjL4-gb.mjs";
|
|
2
|
+
export { grid as default, grid, layoutFlex, layoutGrid, layoutGridStyles, span };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as Parser } from "./index-
|
|
2
|
-
import "./types-
|
|
1
|
+
import { a as Parser } from "./index-IulNhyDt.mjs";
|
|
2
|
+
import "./types-Cv5WjcVA.mjs";
|
|
3
3
|
//#region src/space/space.d.ts
|
|
4
4
|
declare const margin: Parser;
|
|
5
5
|
declare const padding: Parser;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { a as Parser, l as StyleObject } from "./index-iVqAMF2L.cjs";
|
|
2
|
+
import "./types-Cv5WjcVA.cjs";
|
|
3
|
+
//#region src/grid/grid.d.ts
|
|
4
|
+
declare const grid: Parser;
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/grid/layoutGrid.d.ts
|
|
7
|
+
/** The layout grid at one breakpoint - the `content` part of a `theme.layout` entry. */
|
|
8
|
+
interface LayoutGridEntry {
|
|
9
|
+
/** Equal columns. */
|
|
10
|
+
columns?: number;
|
|
11
|
+
/** Inline padding - a `theme.space` key or a CSS length. */
|
|
12
|
+
margin?: string | number;
|
|
13
|
+
/** Gap between columns - a `theme.space` key or a CSS length. */
|
|
14
|
+
gutter?: string | number;
|
|
15
|
+
/** `fluid` spans the space; `fixed` is a container centred at `maxWidth`. */
|
|
16
|
+
mode?: 'fluid' | 'fixed';
|
|
17
|
+
maxWidth?: string | number;
|
|
18
|
+
}
|
|
19
|
+
/** `true` for the theme's layout grid, or entries for named breakpoints that replace it there. */
|
|
20
|
+
type LayoutGridValue = boolean | Record<string, LayoutGridEntry>;
|
|
21
|
+
/** The container a layout grid is drawn on: column tracks, or a wrapping flex row. */
|
|
22
|
+
type LayoutGridDisplay = 'grid' | 'flex';
|
|
23
|
+
/**
|
|
24
|
+
* The layout grid from `theme.layout`, per breakpoint: each breakpoint's `content` (columns,
|
|
25
|
+
* margin, gutter, fluid or fixed), inherited mobile-first. An entry in `value` replaces the
|
|
26
|
+
* theme's at the breakpoint it names only; the next breakpoint is back to the theme. Every
|
|
27
|
+
* written block carries the full set, so no block inherits a stale `max-width`.
|
|
28
|
+
*/
|
|
29
|
+
declare const layoutGridStyles: (theme: unknown, value: LayoutGridValue | undefined, display?: LayoutGridDisplay) => StyleObject;
|
|
30
|
+
/** The `layout` prop on a grid container - see {@link layoutGridStyles}. */
|
|
31
|
+
declare const layoutGrid: Parser;
|
|
32
|
+
/** The `layout` prop on a flex container: a wrapping row with the same gutter and margin. */
|
|
33
|
+
declare const layoutFlex: Parser;
|
|
34
|
+
/**
|
|
35
|
+
* The `span` prop: how many layout-grid columns an element takes. It writes both
|
|
36
|
+
* `grid-column: span N` (read by a Grid parent) and a flex basis from the parent's
|
|
37
|
+
* `--layout-columns` / `--layout-gutter` (read by a Flex parent); each container ignores the
|
|
38
|
+
* other's property. Responsive like any prop: `span={{ xs: 4, md: 6 }}`.
|
|
39
|
+
*/
|
|
40
|
+
declare const span: Parser;
|
|
41
|
+
//#endregion
|
|
42
|
+
export { layoutGrid as a, grid as c, layoutFlex as i, LayoutGridEntry as n, layoutGridStyles as o, LayoutGridValue as r, span as s, LayoutGridDisplay as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as Parser } from "./index-
|
|
2
|
-
import "./types-
|
|
1
|
+
import { a as Parser } from "./index-iVqAMF2L.cjs";
|
|
2
|
+
import "./types-Cv5WjcVA.cjs";
|
|
3
3
|
//#region src/space/space.d.ts
|
|
4
4
|
declare const margin: Parser;
|
|
5
5
|
declare const padding: Parser;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { a as Parser, l as StyleObject } from "./index-IulNhyDt.mjs";
|
|
2
|
+
import "./types-Cv5WjcVA.mjs";
|
|
3
|
+
//#region src/grid/grid.d.ts
|
|
4
|
+
declare const grid: Parser;
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/grid/layoutGrid.d.ts
|
|
7
|
+
/** The layout grid at one breakpoint - the `content` part of a `theme.layout` entry. */
|
|
8
|
+
interface LayoutGridEntry {
|
|
9
|
+
/** Equal columns. */
|
|
10
|
+
columns?: number;
|
|
11
|
+
/** Inline padding - a `theme.space` key or a CSS length. */
|
|
12
|
+
margin?: string | number;
|
|
13
|
+
/** Gap between columns - a `theme.space` key or a CSS length. */
|
|
14
|
+
gutter?: string | number;
|
|
15
|
+
/** `fluid` spans the space; `fixed` is a container centred at `maxWidth`. */
|
|
16
|
+
mode?: 'fluid' | 'fixed';
|
|
17
|
+
maxWidth?: string | number;
|
|
18
|
+
}
|
|
19
|
+
/** `true` for the theme's layout grid, or entries for named breakpoints that replace it there. */
|
|
20
|
+
type LayoutGridValue = boolean | Record<string, LayoutGridEntry>;
|
|
21
|
+
/** The container a layout grid is drawn on: column tracks, or a wrapping flex row. */
|
|
22
|
+
type LayoutGridDisplay = 'grid' | 'flex';
|
|
23
|
+
/**
|
|
24
|
+
* The layout grid from `theme.layout`, per breakpoint: each breakpoint's `content` (columns,
|
|
25
|
+
* margin, gutter, fluid or fixed), inherited mobile-first. An entry in `value` replaces the
|
|
26
|
+
* theme's at the breakpoint it names only; the next breakpoint is back to the theme. Every
|
|
27
|
+
* written block carries the full set, so no block inherits a stale `max-width`.
|
|
28
|
+
*/
|
|
29
|
+
declare const layoutGridStyles: (theme: unknown, value: LayoutGridValue | undefined, display?: LayoutGridDisplay) => StyleObject;
|
|
30
|
+
/** The `layout` prop on a grid container - see {@link layoutGridStyles}. */
|
|
31
|
+
declare const layoutGrid: Parser;
|
|
32
|
+
/** The `layout` prop on a flex container: a wrapping row with the same gutter and margin. */
|
|
33
|
+
declare const layoutFlex: Parser;
|
|
34
|
+
/**
|
|
35
|
+
* The `span` prop: how many layout-grid columns an element takes. It writes both
|
|
36
|
+
* `grid-column: span N` (read by a Grid parent) and a flex basis from the parent's
|
|
37
|
+
* `--layout-columns` / `--layout-gutter` (read by a Flex parent); each container ignores the
|
|
38
|
+
* other's property. Responsive like any prop: `span={{ xs: 4, md: 6 }}`.
|
|
39
|
+
*/
|
|
40
|
+
declare const span: Parser;
|
|
41
|
+
//#endregion
|
|
42
|
+
export { layoutGrid as a, grid as c, layoutFlex as i, LayoutGridEntry as n, layoutGridStyles as o, LayoutGridValue as r, span as s, LayoutGridDisplay as t };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { a as ResponsiveQueries, n as Breakpoints } from "./media-CfYDomHt.mjs";
|
|
1
2
|
import * as CSS from "csstype";
|
|
2
3
|
//#region src/core/core.d.ts
|
|
3
4
|
type StyleObject = Record<string, any>;
|
|
@@ -12,7 +13,7 @@ interface CSSObject extends CSS.Properties<CSSLength>, CSS.PropertiesHyphen<CSSL
|
|
|
12
13
|
[selectorOrAtRule: string]: CSSObject | string | number | undefined;
|
|
13
14
|
}
|
|
14
15
|
interface Theme {
|
|
15
|
-
breakpoints?:
|
|
16
|
+
breakpoints?: Breakpoints;
|
|
16
17
|
disableStyledSystemCache?: boolean;
|
|
17
18
|
[key: string]: any;
|
|
18
19
|
}
|
|
@@ -39,8 +40,8 @@ type styleFn = Parser;
|
|
|
39
40
|
type Config = SystemConfig;
|
|
40
41
|
type ConfigFunction = StyleFn;
|
|
41
42
|
interface ParserCache {
|
|
42
|
-
breakpoints?:
|
|
43
|
-
|
|
43
|
+
breakpoints?: Breakpoints;
|
|
44
|
+
queries?: ResponsiveQueries;
|
|
44
45
|
}
|
|
45
46
|
interface Parser {
|
|
46
47
|
(...args: any[]): any;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { a as ResponsiveQueries, n as Breakpoints } from "./media-CfYDomHt.cjs";
|
|
1
2
|
import * as CSS from "csstype";
|
|
2
3
|
//#region src/core/core.d.ts
|
|
3
4
|
type StyleObject = Record<string, any>;
|
|
@@ -12,7 +13,7 @@ interface CSSObject extends CSS.Properties<CSSLength>, CSS.PropertiesHyphen<CSSL
|
|
|
12
13
|
[selectorOrAtRule: string]: CSSObject | string | number | undefined;
|
|
13
14
|
}
|
|
14
15
|
interface Theme {
|
|
15
|
-
breakpoints?:
|
|
16
|
+
breakpoints?: Breakpoints;
|
|
16
17
|
disableStyledSystemCache?: boolean;
|
|
17
18
|
[key: string]: any;
|
|
18
19
|
}
|
|
@@ -39,8 +40,8 @@ type styleFn = Parser;
|
|
|
39
40
|
type Config = SystemConfig;
|
|
40
41
|
type ConfigFunction = StyleFn;
|
|
41
42
|
interface ParserCache {
|
|
42
|
-
breakpoints?:
|
|
43
|
-
|
|
43
|
+
breakpoints?: Breakpoints;
|
|
44
|
+
queries?: ResponsiveQueries;
|
|
44
45
|
}
|
|
45
46
|
interface Parser {
|
|
46
47
|
(...args: any[]): any;
|
package/dist/index.cjs
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_media = require("./media-DSJdRy_k.cjs");
|
|
2
3
|
const require_core = require("./core.cjs");
|
|
3
4
|
const require_background = require("./background-wugr6cG7.cjs");
|
|
4
5
|
const require_border = require("./border-UuT-fTpy.cjs");
|
|
5
6
|
const require_color = require("./color-BNs17Gw-.cjs");
|
|
6
7
|
const require_flexbox = require("./flexbox-CFkO6PrP.cjs");
|
|
7
|
-
const require_grid = require("./grid-
|
|
8
|
-
const require_layout = require("./layout-
|
|
8
|
+
const require_grid = require("./grid-BlMUPDJM.cjs");
|
|
9
|
+
const require_layout = require("./layout-D3pG7vBp.cjs");
|
|
9
10
|
const require_position = require("./position-zWvCE4hD.cjs");
|
|
10
11
|
const require_typography = require("./typography-7jHZXqtc.cjs");
|
|
11
12
|
const require_space = require("./space-Q-1mECZz.cjs");
|
|
12
13
|
const require_shadow = require("./shadow-BrDnaQQl.cjs");
|
|
13
|
-
const require_variant = require("./variant-
|
|
14
|
+
const require_variant = require("./variant-BSPTyRcQ.cjs");
|
|
14
15
|
//#region src/style/style.ts
|
|
15
16
|
const style = ({ prop, cssProperty, alias, key, transformValue, scale, properties }) => {
|
|
16
17
|
const config = {};
|
|
@@ -125,10 +126,15 @@ exports.borderWidth = borderWidth;
|
|
|
125
126
|
exports.borders = require_border.border;
|
|
126
127
|
exports.bottom = bottom;
|
|
127
128
|
exports.boxShadow = require_shadow.shadow;
|
|
129
|
+
exports.breakpointQueries = require_media.breakpointQueries;
|
|
128
130
|
exports.buttonStyle = require_variant.buttonStyle;
|
|
129
131
|
exports.color = require_color.color;
|
|
130
132
|
exports.colorStyle = require_variant.colorStyle;
|
|
131
133
|
exports.compose = require_core.compose;
|
|
134
|
+
exports.containerKey = require_media.containerKey;
|
|
135
|
+
exports.createContainerQueries = require_media.createContainerQueries;
|
|
136
|
+
exports.createMediaHelpers = require_media.createMediaHelpers;
|
|
137
|
+
exports.createMediaQuery = require_media.createMediaQuery;
|
|
132
138
|
exports.createParser = require_core.createParser;
|
|
133
139
|
exports.createStyleFunction = require_core.createStyleFunction;
|
|
134
140
|
exports.display = display;
|
|
@@ -163,6 +169,9 @@ exports.justifyContent = justifyContent;
|
|
|
163
169
|
exports.justifyItems = justifyItems;
|
|
164
170
|
exports.justifySelf = justifySelf;
|
|
165
171
|
exports.layout = require_layout.layout;
|
|
172
|
+
exports.layoutFlex = require_grid.layoutFlex;
|
|
173
|
+
exports.layoutGrid = require_grid.layoutGrid;
|
|
174
|
+
exports.layoutGridStyles = require_grid.layoutGridStyles;
|
|
166
175
|
exports.left = left;
|
|
167
176
|
exports.letterSpacing = letterSpacing;
|
|
168
177
|
exports.lineHeight = lineHeight;
|
|
@@ -178,10 +187,12 @@ exports.overflowX = overflowX;
|
|
|
178
187
|
exports.overflowY = overflowY;
|
|
179
188
|
exports.padding = require_space.padding;
|
|
180
189
|
exports.position = require_position.position;
|
|
190
|
+
exports.responsiveQueries = require_media.responsiveQueries;
|
|
181
191
|
exports.right = right;
|
|
182
192
|
exports.shadow = require_shadow.shadow;
|
|
183
193
|
exports.size = size;
|
|
184
194
|
exports.space = require_space.space;
|
|
195
|
+
exports.span = require_grid.span;
|
|
185
196
|
exports.style = style;
|
|
186
197
|
exports.system = require_core.system;
|
|
187
198
|
exports.textAlign = textAlign;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
8
|
-
import { i as
|
|
9
|
-
import { t as
|
|
10
|
-
import { t as
|
|
11
|
-
import { t as
|
|
12
|
-
import { t as
|
|
13
|
-
import {
|
|
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 { a as Parser, c as StyleFn, 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, u as SystemConfig, v as styleFn, y as system } from "./index-iVqAMF2L.cjs";
|
|
3
|
+
import { t as background } from "./index-Bwpwvg1h.cjs";
|
|
4
|
+
import { $ as GridTemplateRowsProps, A as FlexDirectionProps, At as TextAlignLastProps, B as GapProps, Bt as TextStyleProps, C as ButtonStyleProps, Ct as RowGapProps, D as ContainerProps, Dt as SpaceProps, E as ColumnGapProps, Et as SizeProps, F as FlexboxProps, Ft as TextDecorationProps, G as GridColumnGapProps, Gt as TypographyProps, H as GridAutoColumnsProps, Ht as Theme, I as FontFamilyProps, It as TextDecorationStyleProps, J as GridProps, Jt as WidthProps, K as GridColumnProps, Kt as VerticalAlignProps, L as FontSizeProps, Lt as TextDecorationThicknessProps, M as FlexProps, Mt as TextColorProps, N as FlexShrinkProps, Nt as TextDecorationColorProps, O as DisplayProps, Ot as SpanProps, P as FlexWrapProps, Pt as TextDecorationLineProps, Q as GridTemplateColumnsProps, R as FontStyleProps, Rt as TextOverflowProps, S as BreakpointName, St as RightProps, T as ColorStyleProps, Tt as ShadowProps, U as GridAutoFlowProps, Ut as ThemeValue, V as GridAreaProps, Vt as TextTransformProps, W as GridAutoRowsProps, Wt as TopProps, X as GridRowProps, Y as GridRowGapProps, Yt as ZIndexProps, Z as GridTemplateAreasProps, _ as BorderStyleProps, _t as OverflowProps, a as BackgroundColorProps, at as LayoutProps, b as BottomProps, bt as RequiredTheme, c as BackgroundProps, ct as LineHeightProps, d as BorderBottomProps, dt as MaxWidthProps, et as HeightProps, f as BorderColorProps, ft as MinHeightProps, g as BorderRightProps, gt as OrderProps, h as BorderRadiusProps, ht as OpacityProps, i as AspectRatioProps, it as LayoutGridProps, j as FlexGrowProps, jt as TextAlignProps, k as FlexBasisProps, kt as TLengthStyledSystem, l as BackgroundRepeatProps, lt as MarginProps, m as BorderProps, mt as ObjectOrArray, n as AlignItemsProps, nt as JustifyItemsProps, o as BackgroundImageProps, ot as LeftProps, p as BorderLeftProps, pt as MinWidthProps, q as GridGapProps, qt as WhiteSpaceProps, r as AlignSelfProps, rt as JustifySelfProps, s as BackgroundPositionProps, st as LetterSpacingProps, t as AlignContentProps, tt as JustifyContentProps, u as BackgroundSizeProps, ut as MaxHeightProps, v as BorderTopProps, vt as PaddingProps, w as ColorProps, wt as Scale, x as BoxShadowProps, xt as ResponsiveValue, y as BorderWidthProps, yt as PositionProps, z as FontWeightProps, zt as TextShadowProps } from "./types-Cv5WjcVA.cjs";
|
|
5
|
+
import { t as border } from "./index-D5xp7RWT.cjs";
|
|
6
|
+
import { t as color } from "./index-ByDfI1go.cjs";
|
|
7
|
+
import { t as flexbox } from "./index-CQyvhO-h.cjs";
|
|
8
|
+
import { a as layoutGrid, c as grid, i as layoutFlex, n as LayoutGridEntry, o as layoutGridStyles, r as LayoutGridValue, s as span, t as LayoutGridDisplay } from "./index-CXK27dY_.cjs";
|
|
9
|
+
import { i as space, n as margin, r as padding, t as gap } from "./index-CgJzEbXW.cjs";
|
|
10
|
+
import { t as layout } from "./index-Bxh1FNcS.cjs";
|
|
11
|
+
import { t as typography } from "./index-BmyL5qR7.cjs";
|
|
12
|
+
import { t as position } from "./index-D2v_oJEm.cjs";
|
|
13
|
+
import { t as shadow } from "./index-D1mRMWDm.cjs";
|
|
14
|
+
import { a as textStyle, i as colorStyle, n as VariantOptions, o as variant, r as buttonStyle, t as VariantArgs } from "./index-Csbxj8Yo.cjs";
|
|
14
15
|
//#region src/style/style.d.ts
|
|
15
16
|
interface StyleOptions {
|
|
16
17
|
prop: string;
|
|
@@ -98,4 +99,4 @@ declare const right: Parser;
|
|
|
98
99
|
declare const bottom: Parser;
|
|
99
100
|
declare const left: Parser;
|
|
100
101
|
//#endregion
|
|
101
|
-
export { AlignContentProps, AlignItemsProps, AlignSelfProps, AspectRatioProps, BackgroundColorProps, BackgroundImageProps, BackgroundPositionProps, BackgroundProps, BackgroundRepeatProps, BackgroundSizeProps, BorderBottomProps, BorderColorProps, BorderLeftProps, BorderProps, BorderRadiusProps, BorderRightProps, BorderStyleProps, BorderTopProps, BorderWidthProps, BottomProps, BoxShadowProps, ButtonStyleProps, ColorProps, ColorStyleProps, ColumnGapProps, type Config, type ConfigFunction, type ConfigStyle, DisplayProps, FlexBasisProps, FlexDirectionProps, FlexGrowProps, FlexProps, FlexShrinkProps, FlexWrapProps, FlexboxProps, FontFamilyProps, FontSizeProps, FontStyleProps, FontWeightProps, GapProps, GridAreaProps, GridAutoColumnsProps, GridAutoFlowProps, GridAutoRowsProps, GridColumnGapProps, GridColumnProps, GridGapProps, GridProps, GridRowGapProps, GridRowProps, GridTemplateAreasProps, GridTemplateColumnsProps, GridTemplateRowsProps, HeightProps, JustifyContentProps, JustifyItemsProps, JustifySelfProps, LayoutProps, LeftProps, LetterSpacingProps, LineHeightProps, type LowLevelStyleFunctionArguments, MarginProps, MaxHeightProps, MaxWidthProps, MinHeightProps, MinWidthProps, ObjectOrArray, OpacityProps, OrderProps, OverflowProps, PaddingProps, type Parser, type ParserConfig, PositionProps, type Props, RequiredTheme, ResponsiveValue, RightProps, RowGapProps, Scale, ShadowProps, SizeProps, SpaceProps, type StyleFn, type StyleObject, type StyleOptions, type SystemConfig, TLengthStyledSystem, TextAlignLastProps, TextAlignProps, TextColorProps, TextDecorationColorProps, TextDecorationLineProps, TextDecorationProps, TextDecorationStyleProps, TextDecorationThicknessProps, TextOverflowProps, TextShadowProps, TextStyleProps, TextTransformProps, Theme, ThemeValue, TopProps, type Transform, TypographyProps, type VariantArgs, type VariantOptions, VerticalAlignProps, WhiteSpaceProps, WidthProps, ZIndexProps, alignContent, alignItems, alignSelf, background, backgroundImage, backgroundPosition, backgroundRepeat, backgroundSize, border, border as borders, borderBottom, borderColor, borderLeft, borderRadius, borderRight, borderStyle, borderTop, borderWidth, bottom, shadow as boxShadow, shadow, shadow as textShadow, buttonStyle, color, colorStyle, compose, createParser, createStyleFunction, display, flex, flexBasis, flexDirection, flexGrow, flexShrink, flexWrap, flexbox, fontFamily, fontSize, fontStyle, fontWeight, gap, get, grid, gridArea, gridAutoColumns, gridAutoFlow, gridAutoRows, gridColumn, gridColumnGap, gridGap, gridRow, gridRowGap, gridTemplateAreas, gridTemplateColumns, gridTemplateRows, height, justifyContent, justifyItems, justifySelf, layout, left, letterSpacing, lineHeight, margin, maxHeight, maxWidth, minHeight, minWidth, opacity, order, overflow, overflowX, overflowY, padding, position, right, size, space, style, type styleFn, system, textAlign, textAlignLast, textDecoration, textDecorationColor, textDecorationLine, textDecorationStyle, textDecorationThickness, textOverflow, textStyle, textTransform, top, typography, variant, verticalAlign, whiteSpace, width, zIndex };
|
|
102
|
+
export { AlignContentProps, AlignItemsProps, AlignSelfProps, AspectRatioProps, BackgroundColorProps, BackgroundImageProps, BackgroundPositionProps, BackgroundProps, BackgroundRepeatProps, BackgroundSizeProps, BorderBottomProps, BorderColorProps, BorderLeftProps, BorderProps, BorderRadiusProps, BorderRightProps, BorderStyleProps, BorderTopProps, BorderWidthProps, BottomProps, BoxShadowProps, type BreakpointInput, BreakpointName, type Breakpoints, ButtonStyleProps, ColorProps, ColorStyleProps, ColumnGapProps, type Config, type ConfigFunction, type ConfigStyle, ContainerProps, type ContainerQueries, DisplayProps, FlexBasisProps, FlexDirectionProps, FlexGrowProps, FlexProps, FlexShrinkProps, FlexWrapProps, FlexboxProps, FontFamilyProps, FontSizeProps, FontStyleProps, FontWeightProps, GapProps, GridAreaProps, GridAutoColumnsProps, GridAutoFlowProps, GridAutoRowsProps, GridColumnGapProps, GridColumnProps, GridGapProps, GridProps, GridRowGapProps, GridRowProps, GridTemplateAreasProps, GridTemplateColumnsProps, GridTemplateRowsProps, HeightProps, JustifyContentProps, JustifyItemsProps, JustifySelfProps, type LayoutGridDisplay, type LayoutGridEntry, LayoutGridProps, type LayoutGridValue, LayoutProps, LeftProps, LetterSpacingProps, LineHeightProps, type LowLevelStyleFunctionArguments, MarginProps, MaxHeightProps, MaxWidthProps, MinHeightProps, MinWidthProps, ObjectOrArray, OpacityProps, OrderProps, OverflowProps, PaddingProps, type Parser, type ParserConfig, PositionProps, type Props, type QueryHelpers, RequiredTheme, type ResponsiveQueries, ResponsiveValue, RightProps, RowGapProps, Scale, ShadowProps, SizeProps, SpaceProps, SpanProps, type StyleFn, type StyleObject, type StyleOptions, type SystemConfig, TLengthStyledSystem, TextAlignLastProps, TextAlignProps, TextColorProps, TextDecorationColorProps, TextDecorationLineProps, TextDecorationProps, TextDecorationStyleProps, TextDecorationThicknessProps, TextOverflowProps, TextShadowProps, TextStyleProps, TextTransformProps, Theme, ThemeValue, TopProps, type Transform, TypographyProps, type VariantArgs, type VariantOptions, VerticalAlignProps, WhiteSpaceProps, WidthProps, ZIndexProps, alignContent, alignItems, alignSelf, background, backgroundImage, backgroundPosition, backgroundRepeat, backgroundSize, border, border as borders, borderBottom, borderColor, borderLeft, borderRadius, borderRight, borderStyle, borderTop, borderWidth, bottom, shadow as boxShadow, shadow, shadow as textShadow, breakpointQueries, buttonStyle, color, colorStyle, compose, containerKey, createContainerQueries, createMediaHelpers, createMediaQuery, createParser, createStyleFunction, display, flex, flexBasis, flexDirection, flexGrow, flexShrink, flexWrap, flexbox, fontFamily, fontSize, fontStyle, fontWeight, gap, get, grid, gridArea, gridAutoColumns, gridAutoFlow, gridAutoRows, gridColumn, gridColumnGap, gridGap, gridRow, gridRowGap, gridTemplateAreas, gridTemplateColumns, gridTemplateRows, height, justifyContent, justifyItems, justifySelf, layout, layoutFlex, layoutGrid, layoutGridStyles, left, letterSpacing, lineHeight, margin, maxHeight, maxWidth, minHeight, minWidth, opacity, order, overflow, overflowX, overflowY, padding, position, responsiveQueries, right, size, space, span, style, type styleFn, system, textAlign, textAlignLast, textDecoration, textDecorationColor, textDecorationLine, textDecorationStyle, textDecorationThickness, textOverflow, textStyle, textTransform, top, typography, variant, verticalAlign, whiteSpace, width, zIndex };
|