@soroush.tech/styled-system 6.0.0-alpha.2 → 6.0.0-alpha.4

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.
Files changed (67) hide show
  1. package/dist/background.d.cts +2 -2
  2. package/dist/background.d.mts +2 -2
  3. package/dist/border.d.cts +2 -2
  4. package/dist/border.d.mts +2 -2
  5. package/dist/color.d.cts +2 -2
  6. package/dist/color.d.mts +2 -2
  7. package/dist/flexbox.d.cts +2 -2
  8. package/dist/flexbox.d.mts +2 -2
  9. package/dist/grid-D6l0ftY0.mjs +170 -0
  10. package/dist/grid-NyoJxJGh.cjs +200 -0
  11. package/dist/grid.cjs +1 -2
  12. package/dist/grid.d.cts +3 -3
  13. package/dist/grid.d.mts +3 -3
  14. package/dist/grid.mjs +2 -2
  15. package/dist/{index-CnVRmFIZ.d.mts → index--7PfXEZf.d.mts} +1 -1
  16. package/dist/{index-B7YL_4tg.d.cts → index-BDUZ7qQu.d.cts} +1 -1
  17. package/dist/{index-BvyUTPw5.d.mts → index-BQUTi5eL.d.mts} +1 -1
  18. package/dist/{index-fuBvJDhs.d.mts → index-BTZ4J3Ql.d.mts} +1 -1
  19. package/dist/{index-ILo8rb05.d.cts → index-BUX09rTq.d.cts} +1 -1
  20. package/dist/{index-Dpqn1WzM.d.cts → index-BUa_KRfs.d.cts} +1 -1
  21. package/dist/{index-CpS2pkHD.d.cts → index-BVNmdtmk.d.cts} +1 -1
  22. package/dist/index-BZI1xwTA.d.cts +55 -0
  23. package/dist/{index-D8sNCYCo.d.mts → index-BZs9fI-P.d.mts} +1 -1
  24. package/dist/{index-kkyge37R.d.mts → index-Bhpc-68J.d.mts} +1 -1
  25. package/dist/{index-C8kegqfi.d.cts → index-BqZjtkzF.d.cts} +1 -1
  26. package/dist/{index-PoT1oV9X.d.cts → index-C56_VCbD.d.cts} +1 -1
  27. package/dist/{index-eWVK6SXF.d.cts → index-DGGFii8s.d.cts} +1 -1
  28. package/dist/{index-BgSrVqHI.d.mts → index-DXURX22V.d.mts} +1 -1
  29. package/dist/{index-4_E8pg8R.d.mts → index-DYc5_RYF.d.mts} +1 -1
  30. package/dist/{index-BnfK4WNL.d.mts → index-D_XDxNlm.d.mts} +1 -1
  31. package/dist/{index-IfEDsoFj.d.cts → index-Di8gHXKt.d.cts} +1 -1
  32. package/dist/{index-DbwnL32Q.d.mts → index-Dr5JeEjc.d.mts} +1 -1
  33. package/dist/{index-CnHK2xHk.d.cts → index-Dv3K2IAS.d.cts} +1 -1
  34. package/dist/{index-DOzfQDfG.d.cts → index-DwJSd01p.d.cts} +1 -1
  35. package/dist/index-Np-KvYhu.d.mts +55 -0
  36. package/dist/{index-Xh-lC-ge.d.mts → index-mSyoGVmz.d.mts} +1 -1
  37. package/dist/index.cjs +1 -2
  38. package/dist/index.d.cts +13 -13
  39. package/dist/index.d.mts +13 -13
  40. package/dist/index.mjs +2 -2
  41. package/dist/layout.d.cts +2 -2
  42. package/dist/layout.d.mts +2 -2
  43. package/dist/position.d.cts +2 -2
  44. package/dist/position.d.mts +2 -2
  45. package/dist/{presets-B4QR0tKt.mjs → presets-CrIKAUbJ.mjs} +1 -1
  46. package/dist/{presets-Da2kvQPo.cjs → presets-DNjUFNNu.cjs} +1 -1
  47. package/dist/prop-types.cjs +1 -1
  48. package/dist/prop-types.mjs +1 -1
  49. package/dist/props.cjs +1 -1
  50. package/dist/props.mjs +1 -1
  51. package/dist/shadow.d.cts +2 -2
  52. package/dist/shadow.d.mts +2 -2
  53. package/dist/should-forward-prop.cjs +1 -1
  54. package/dist/should-forward-prop.mjs +1 -1
  55. package/dist/space.d.cts +2 -2
  56. package/dist/space.d.mts +2 -2
  57. package/dist/{types-Cj6Jx5LX.d.cts → types-Cl2haWqC.d.cts} +6 -6
  58. package/dist/{types-Cj6Jx5LX.d.mts → types-Cl2haWqC.d.mts} +6 -6
  59. package/dist/typography.d.cts +2 -2
  60. package/dist/typography.d.mts +2 -2
  61. package/dist/variant.d.cts +2 -2
  62. package/dist/variant.d.mts +2 -2
  63. package/package.json +1 -1
  64. package/dist/grid-CAuvylKs.mjs +0 -158
  65. package/dist/grid-Cv-XGWcr.cjs +0 -194
  66. package/dist/index-C0X-fL6a.d.mts +0 -55
  67. package/dist/index-DHAamdKa.d.cts +0 -55
@@ -1,3 +1,3 @@
1
- import { t as background } from "./index-IfEDsoFj.cjs";
2
- import { c as BackgroundProps, l as BackgroundRepeatProps, o as BackgroundImageProps, s as BackgroundPositionProps, u as BackgroundSizeProps } from "./types-Cj6Jx5LX.cjs";
1
+ import { t as background } from "./index-Di8gHXKt.cjs";
2
+ import { c as BackgroundProps, l as BackgroundRepeatProps, o as BackgroundImageProps, s as BackgroundPositionProps, u as BackgroundSizeProps } from "./types-Cl2haWqC.cjs";
3
3
  export { type BackgroundImageProps, type BackgroundPositionProps, type BackgroundProps, type BackgroundRepeatProps, type BackgroundSizeProps, background, background as default };
@@ -1,3 +1,3 @@
1
- import { t as background } from "./index-Xh-lC-ge.mjs";
2
- import { c as BackgroundProps, l as BackgroundRepeatProps, o as BackgroundImageProps, s as BackgroundPositionProps, u as BackgroundSizeProps } from "./types-Cj6Jx5LX.mjs";
1
+ import { t as background } from "./index-mSyoGVmz.mjs";
2
+ import { c as BackgroundProps, l as BackgroundRepeatProps, o as BackgroundImageProps, s as BackgroundPositionProps, u as BackgroundSizeProps } from "./types-Cl2haWqC.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-Cj6Jx5LX.cjs";
2
- import { t as border } from "./index-C8kegqfi.cjs";
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-Cl2haWqC.cjs";
2
+ import { t as border } from "./index-BqZjtkzF.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-Cj6Jx5LX.mjs";
2
- import { t as border } from "./index-BgSrVqHI.mjs";
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-Cl2haWqC.mjs";
2
+ import { t as border } from "./index-DXURX22V.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 { Nt as TextColorProps, a as BackgroundColorProps, gt as OpacityProps, w as ColorProps } from "./types-Cj6Jx5LX.cjs";
2
- import { t as color } from "./index-DOzfQDfG.cjs";
1
+ import { Nt as TextColorProps, a as BackgroundColorProps, gt as OpacityProps, w as ColorProps } from "./types-Cl2haWqC.cjs";
2
+ import { t as color } from "./index-DwJSd01p.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 { Nt as TextColorProps, a as BackgroundColorProps, gt as OpacityProps, w as ColorProps } from "./types-Cj6Jx5LX.mjs";
2
- import { t as color } from "./index-fuBvJDhs.mjs";
1
+ import { Nt as TextColorProps, a as BackgroundColorProps, gt as OpacityProps, w as ColorProps } from "./types-Cl2haWqC.mjs";
2
+ import { t as color } from "./index-BTZ4J3Ql.mjs";
3
3
  export { type BackgroundColorProps, type ColorProps, type OpacityProps, type TextColorProps, color, color as default };
@@ -1,3 +1,3 @@
1
- import { A as FlexDirectionProps, F as FlexboxProps, M as FlexProps, N as FlexShrinkProps, P as FlexWrapProps, _t 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-Cj6Jx5LX.cjs";
2
- import { t as flexbox } from "./index-ILo8rb05.cjs";
1
+ import { A as FlexDirectionProps, F as FlexboxProps, M as FlexProps, N as FlexShrinkProps, P as FlexWrapProps, _t 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-Cl2haWqC.cjs";
2
+ import { t as flexbox } from "./index-BUX09rTq.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 };
@@ -1,3 +1,3 @@
1
- import { A as FlexDirectionProps, F as FlexboxProps, M as FlexProps, N as FlexShrinkProps, P as FlexWrapProps, _t 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-Cj6Jx5LX.mjs";
2
- import { t as flexbox } from "./index-D8sNCYCo.mjs";
1
+ import { A as FlexDirectionProps, F as FlexboxProps, M as FlexProps, N as FlexShrinkProps, P as FlexWrapProps, _t 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-Cl2haWqC.mjs";
2
+ import { t as flexbox } from "./index-BZs9fI-P.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,170 @@
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 frameDeclarations = (theme, { margin, mode, maxWidth }) => {
48
+ const width = mode === "fixed" && maxWidth !== void 0 ? spaceValue(theme, maxWidth) : void 0;
49
+ return {
50
+ boxSizing: "border-box",
51
+ width: "100%",
52
+ paddingInline: margin === void 0 ? void 0 : spaceValue(theme, margin),
53
+ maxWidth: width ?? "none",
54
+ marginInline: width === void 0 ? 0 : "auto"
55
+ };
56
+ };
57
+ const gridDeclarations = (theme, { columns, gutter }) => ({
58
+ gridTemplateColumns: columns === void 0 ? void 0 : `repeat(${columns}, minmax(0, 1fr))`,
59
+ columnGap: gutter === void 0 ? void 0 : spaceValue(theme, gutter)
60
+ });
61
+ const declarations = (theme, part, entry) => {
62
+ const styles = part === "frame" ? frameDeclarations(theme, entry) : gridDeclarations(theme, entry);
63
+ return Object.fromEntries(Object.entries(styles).filter(([, value]) => value !== void 0));
64
+ };
65
+ const gapAsGutter = (breakpoints, gap) => {
66
+ if (gap === void 0 || gap === null) return {
67
+ field: {},
68
+ entries: {}
69
+ };
70
+ if (typeof gap !== "object") return {
71
+ field: { gutter: gap },
72
+ entries: {}
73
+ };
74
+ const names = Object.keys(breakpoints);
75
+ const pairs = Array.isArray(gap) ? gap.map((value, index) => [names[index], value]) : Object.entries(gap);
76
+ const entries = {};
77
+ for (const [name, value] of pairs) if (name !== void 0 && value !== null) entries[name] = { gutter: value };
78
+ return {
79
+ field: {},
80
+ entries
81
+ };
82
+ };
83
+ const layoutStyles = (theme, value, part, gap) => {
84
+ if (!value) return {};
85
+ const breakpoints = get(theme, "breakpoints", {});
86
+ const layout = get(theme, "layout", {});
87
+ const fields = typeof value === "object" ? Object.entries(value) : [];
88
+ const named = Object.fromEntries(fields.filter(([, field]) => typeof field === "object"));
89
+ const fromGap = gapAsGutter(breakpoints, gap);
90
+ const everywhere = {
91
+ ...Object.fromEntries(fields.filter(([, field]) => typeof field !== "object")),
92
+ ...fromGap.field
93
+ };
94
+ const hasEverywhere = Object.keys(everywhere).length > 0;
95
+ const { keyed } = responsiveQueries(breakpoints);
96
+ const styles = part === "grid" ? { display: "grid" } : {};
97
+ let themed = {};
98
+ let carried = {};
99
+ Object.keys(breakpoints).forEach((key, index) => {
100
+ const layer = layout[key]?.content;
101
+ const entry = Object.hasOwn(named, key) ? named[key] : void 0;
102
+ const gapEntry = Object.hasOwn(fromGap.entries, key) ? fromGap.entries[key] : void 0;
103
+ themed = {
104
+ ...themed,
105
+ ...layer
106
+ };
107
+ carried = {
108
+ ...carried,
109
+ ...entry,
110
+ ...gapEntry
111
+ };
112
+ if (layer || entry || gapEntry || index === 0 && hasEverywhere) {
113
+ const block = declarations(theme, part, {
114
+ ...themed,
115
+ ...everywhere,
116
+ ...carried
117
+ });
118
+ const media = keyed.get(key);
119
+ if (media) styles[media] = block;
120
+ else Object.assign(styles, block);
121
+ }
122
+ });
123
+ return styles;
124
+ };
125
+ /**
126
+ * The layout grid from `theme.layout`, per breakpoint: each breakpoint's `content` (columns,
127
+ * margin, gutter, fluid or fixed), mobile-first. A field in `value` replaces the theme's at
128
+ * every breakpoint (`{ maxWidth: '1280px' }`); an entry under a breakpoint name replaces it
129
+ * from that breakpoint up, on top of those fields (`{ lg: { columns: 16 } }`). `gap` - the
130
+ * element's own `gap` / `columnGap` - sets the gutter the same way, single or responsive; where
131
+ * it is not set, the theme's gutter applies. Every written block carries the full set, so no
132
+ * block inherits a stale `max-width`. Rows take `rowGap` (or `gap`'s row half), never the layout.
133
+ */
134
+ const layoutGridStyles = (theme, value, gap) => {
135
+ const grid = layoutStyles(theme, value, "grid", gap);
136
+ const frame = layoutStyles(theme, value, "frame");
137
+ for (const [key, block] of Object.entries(frame)) grid[key] = key.startsWith("@") ? {
138
+ ...grid[key],
139
+ ...block
140
+ } : block;
141
+ return grid;
142
+ };
143
+ /**
144
+ * The `layout` prop as the page frame alone: the margin and, in fixed mode, the centred max
145
+ * width per breakpoint - no columns, and `display` is left alone. Every View-based component
146
+ * takes it; compose it with `layoutGrid` for the columns.
147
+ */
148
+ const layoutFrame = Object.assign((props) => layoutStyles(props.theme, props.layout, "frame"), {
149
+ config: {},
150
+ propNames: ["layout"],
151
+ cache: {}
152
+ });
153
+ /**
154
+ * The `layout` prop's columns on a grid container: the tracks and the gutter. The gutter is the
155
+ * element's own `columnGap` or `gap` where it sets one, the theme's elsewhere - so `column-gap`
156
+ * has a single source and an explicit gap is never silently replaced.
157
+ */
158
+ const layoutGrid = Object.assign((props) => layoutStyles(props.theme, props.layout, "grid", props.columnGap ?? props.gap), {
159
+ config: {},
160
+ propNames: ["layout"],
161
+ cache: {}
162
+ });
163
+ /**
164
+ * The `span` prop: how many columns of a grid an element takes - `grid-column: span N` - or
165
+ * `span="full"` for the whole row whatever the column count. Responsive like any prop:
166
+ * `span={{ xs: 'full', md: 6 }}`.
167
+ */
168
+ const span = system({ span: (n) => ({ gridColumn: n === "full" ? "1 / -1" : `span ${n}` }) });
169
+ //#endregion
170
+ export { grid as a, span as i, layoutGrid as n, layoutGridStyles as r, layoutFrame as t };
@@ -0,0 +1,200 @@
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 frameDeclarations = (theme, { margin, mode, maxWidth }) => {
49
+ const width = mode === "fixed" && maxWidth !== void 0 ? spaceValue(theme, maxWidth) : void 0;
50
+ return {
51
+ boxSizing: "border-box",
52
+ width: "100%",
53
+ paddingInline: margin === void 0 ? void 0 : spaceValue(theme, margin),
54
+ maxWidth: width ?? "none",
55
+ marginInline: width === void 0 ? 0 : "auto"
56
+ };
57
+ };
58
+ const gridDeclarations = (theme, { columns, gutter }) => ({
59
+ gridTemplateColumns: columns === void 0 ? void 0 : `repeat(${columns}, minmax(0, 1fr))`,
60
+ columnGap: gutter === void 0 ? void 0 : spaceValue(theme, gutter)
61
+ });
62
+ const declarations = (theme, part, entry) => {
63
+ const styles = part === "frame" ? frameDeclarations(theme, entry) : gridDeclarations(theme, entry);
64
+ return Object.fromEntries(Object.entries(styles).filter(([, value]) => value !== void 0));
65
+ };
66
+ const gapAsGutter = (breakpoints, gap) => {
67
+ if (gap === void 0 || gap === null) return {
68
+ field: {},
69
+ entries: {}
70
+ };
71
+ if (typeof gap !== "object") return {
72
+ field: { gutter: gap },
73
+ entries: {}
74
+ };
75
+ const names = Object.keys(breakpoints);
76
+ const pairs = Array.isArray(gap) ? gap.map((value, index) => [names[index], value]) : Object.entries(gap);
77
+ const entries = {};
78
+ for (const [name, value] of pairs) if (name !== void 0 && value !== null) entries[name] = { gutter: value };
79
+ return {
80
+ field: {},
81
+ entries
82
+ };
83
+ };
84
+ const layoutStyles = (theme, value, part, gap) => {
85
+ if (!value) return {};
86
+ const breakpoints = require_core.get(theme, "breakpoints", {});
87
+ const layout = require_core.get(theme, "layout", {});
88
+ const fields = typeof value === "object" ? Object.entries(value) : [];
89
+ const named = Object.fromEntries(fields.filter(([, field]) => typeof field === "object"));
90
+ const fromGap = gapAsGutter(breakpoints, gap);
91
+ const everywhere = {
92
+ ...Object.fromEntries(fields.filter(([, field]) => typeof field !== "object")),
93
+ ...fromGap.field
94
+ };
95
+ const hasEverywhere = Object.keys(everywhere).length > 0;
96
+ const { keyed } = require_media.responsiveQueries(breakpoints);
97
+ const styles = part === "grid" ? { display: "grid" } : {};
98
+ let themed = {};
99
+ let carried = {};
100
+ Object.keys(breakpoints).forEach((key, index) => {
101
+ const layer = layout[key]?.content;
102
+ const entry = Object.hasOwn(named, key) ? named[key] : void 0;
103
+ const gapEntry = Object.hasOwn(fromGap.entries, key) ? fromGap.entries[key] : void 0;
104
+ themed = {
105
+ ...themed,
106
+ ...layer
107
+ };
108
+ carried = {
109
+ ...carried,
110
+ ...entry,
111
+ ...gapEntry
112
+ };
113
+ if (layer || entry || gapEntry || index === 0 && hasEverywhere) {
114
+ const block = declarations(theme, part, {
115
+ ...themed,
116
+ ...everywhere,
117
+ ...carried
118
+ });
119
+ const media = keyed.get(key);
120
+ if (media) styles[media] = block;
121
+ else Object.assign(styles, block);
122
+ }
123
+ });
124
+ return styles;
125
+ };
126
+ /**
127
+ * The layout grid from `theme.layout`, per breakpoint: each breakpoint's `content` (columns,
128
+ * margin, gutter, fluid or fixed), mobile-first. A field in `value` replaces the theme's at
129
+ * every breakpoint (`{ maxWidth: '1280px' }`); an entry under a breakpoint name replaces it
130
+ * from that breakpoint up, on top of those fields (`{ lg: { columns: 16 } }`). `gap` - the
131
+ * element's own `gap` / `columnGap` - sets the gutter the same way, single or responsive; where
132
+ * it is not set, the theme's gutter applies. Every written block carries the full set, so no
133
+ * block inherits a stale `max-width`. Rows take `rowGap` (or `gap`'s row half), never the layout.
134
+ */
135
+ const layoutGridStyles = (theme, value, gap) => {
136
+ const grid = layoutStyles(theme, value, "grid", gap);
137
+ const frame = layoutStyles(theme, value, "frame");
138
+ for (const [key, block] of Object.entries(frame)) grid[key] = key.startsWith("@") ? {
139
+ ...grid[key],
140
+ ...block
141
+ } : block;
142
+ return grid;
143
+ };
144
+ /**
145
+ * The `layout` prop as the page frame alone: the margin and, in fixed mode, the centred max
146
+ * width per breakpoint - no columns, and `display` is left alone. Every View-based component
147
+ * takes it; compose it with `layoutGrid` for the columns.
148
+ */
149
+ const layoutFrame = Object.assign((props) => layoutStyles(props.theme, props.layout, "frame"), {
150
+ config: {},
151
+ propNames: ["layout"],
152
+ cache: {}
153
+ });
154
+ /**
155
+ * The `layout` prop's columns on a grid container: the tracks and the gutter. The gutter is the
156
+ * element's own `columnGap` or `gap` where it sets one, the theme's elsewhere - so `column-gap`
157
+ * has a single source and an explicit gap is never silently replaced.
158
+ */
159
+ const layoutGrid = Object.assign((props) => layoutStyles(props.theme, props.layout, "grid", props.columnGap ?? props.gap), {
160
+ config: {},
161
+ propNames: ["layout"],
162
+ cache: {}
163
+ });
164
+ /**
165
+ * The `span` prop: how many columns of a grid an element takes - `grid-column: span N` - or
166
+ * `span="full"` for the whole row whatever the column count. Responsive like any prop:
167
+ * `span={{ xs: 'full', md: 6 }}`.
168
+ */
169
+ const span = require_core.system({ span: (n) => ({ gridColumn: n === "full" ? "1 / -1" : `span ${n}` }) });
170
+ //#endregion
171
+ Object.defineProperty(exports, "grid", {
172
+ enumerable: true,
173
+ get: function() {
174
+ return grid;
175
+ }
176
+ });
177
+ Object.defineProperty(exports, "layoutFrame", {
178
+ enumerable: true,
179
+ get: function() {
180
+ return layoutFrame;
181
+ }
182
+ });
183
+ Object.defineProperty(exports, "layoutGrid", {
184
+ enumerable: true,
185
+ get: function() {
186
+ return layoutGrid;
187
+ }
188
+ });
189
+ Object.defineProperty(exports, "layoutGridStyles", {
190
+ enumerable: true,
191
+ get: function() {
192
+ return layoutGridStyles;
193
+ }
194
+ });
195
+ Object.defineProperty(exports, "span", {
196
+ enumerable: true,
197
+ get: function() {
198
+ return span;
199
+ }
200
+ });
package/dist/grid.cjs CHANGED
@@ -2,10 +2,9 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_grid = require("./grid-Cv-XGWcr.cjs");
5
+ const require_grid = require("./grid-NyoJxJGh.cjs");
6
6
  exports.default = require_grid.grid;
7
7
  exports.grid = require_grid.grid;
8
- exports.layoutFlex = require_grid.layoutFlex;
9
8
  exports.layoutFrame = require_grid.layoutFrame;
10
9
  exports.layoutGrid = require_grid.layoutGrid;
11
10
  exports.layoutGridStyles = require_grid.layoutGridStyles;
package/dist/grid.d.cts CHANGED
@@ -1,3 +1,3 @@
1
- import { $ as GridTemplateRowsProps, G as GridColumnGapProps, H as GridAutoColumnsProps, J as GridProps, K as GridColumnProps, Q as GridTemplateColumnsProps, U as GridAutoFlowProps, V as GridAreaProps, W as GridAutoRowsProps, X as GridRowProps, Y as GridRowGapProps, Z as GridTemplateAreasProps, at as LayoutGridProps, it as LayoutFrameProps, kt as SpanProps, q as GridGapProps } from "./types-Cj6Jx5LX.cjs";
2
- import { a as layoutFrame, c as span, i as layoutFlex, l as grid, n as LayoutGridEntry, o as layoutGrid, r as LayoutGridValue, s as layoutGridStyles, t as LayoutGridDisplay } from "./index-DHAamdKa.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, type LayoutFrameProps, LayoutGridDisplay, LayoutGridEntry, type LayoutGridProps, LayoutGridValue, type SpanProps, grid as default, grid, layoutFlex, layoutFrame, layoutGrid, layoutGridStyles, span };
1
+ import { $ as GridTemplateRowsProps, G as GridColumnGapProps, H as GridAutoColumnsProps, J as GridProps, K as GridColumnProps, Q as GridTemplateColumnsProps, U as GridAutoFlowProps, V as GridAreaProps, W as GridAutoRowsProps, X as GridRowProps, Y as GridRowGapProps, Z as GridTemplateAreasProps, at as LayoutGridProps, it as LayoutFrameProps, kt as SpanProps, q as GridGapProps } from "./types-Cl2haWqC.cjs";
2
+ import { a as layoutGrid, c as grid, i as layoutFrame, n as LayoutGridGap, o as layoutGridStyles, r as LayoutGridValue, s as span, t as LayoutGridEntry } from "./index-BZI1xwTA.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, type LayoutFrameProps, LayoutGridEntry, LayoutGridGap, type LayoutGridProps, LayoutGridValue, type SpanProps, grid as default, grid, layoutFrame, layoutGrid, layoutGridStyles, span };
package/dist/grid.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { $ as GridTemplateRowsProps, G as GridColumnGapProps, H as GridAutoColumnsProps, J as GridProps, K as GridColumnProps, Q as GridTemplateColumnsProps, U as GridAutoFlowProps, V as GridAreaProps, W as GridAutoRowsProps, X as GridRowProps, Y as GridRowGapProps, Z as GridTemplateAreasProps, at as LayoutGridProps, it as LayoutFrameProps, kt as SpanProps, q as GridGapProps } from "./types-Cj6Jx5LX.mjs";
2
- import { a as layoutFrame, c as span, i as layoutFlex, l as grid, n as LayoutGridEntry, o as layoutGrid, r as LayoutGridValue, s as layoutGridStyles, t as LayoutGridDisplay } from "./index-C0X-fL6a.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, type LayoutFrameProps, LayoutGridDisplay, LayoutGridEntry, type LayoutGridProps, LayoutGridValue, type SpanProps, grid as default, grid, layoutFlex, layoutFrame, layoutGrid, layoutGridStyles, span };
1
+ import { $ as GridTemplateRowsProps, G as GridColumnGapProps, H as GridAutoColumnsProps, J as GridProps, K as GridColumnProps, Q as GridTemplateColumnsProps, U as GridAutoFlowProps, V as GridAreaProps, W as GridAutoRowsProps, X as GridRowProps, Y as GridRowGapProps, Z as GridTemplateAreasProps, at as LayoutGridProps, it as LayoutFrameProps, kt as SpanProps, q as GridGapProps } from "./types-Cl2haWqC.mjs";
2
+ import { a as layoutGrid, c as grid, i as layoutFrame, n as LayoutGridGap, o as layoutGridStyles, r as LayoutGridValue, s as span, t as LayoutGridEntry } from "./index-Np-KvYhu.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, type LayoutFrameProps, LayoutGridEntry, LayoutGridGap, type LayoutGridProps, LayoutGridValue, type SpanProps, grid as default, grid, layoutFrame, layoutGrid, layoutGridStyles, span };
package/dist/grid.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as span, i as layoutGridStyles, n as layoutFrame, o as grid, r as layoutGrid, t as layoutFlex } from "./grid-CAuvylKs.mjs";
2
- export { grid as default, grid, layoutFlex, layoutFrame, layoutGrid, layoutGridStyles, span };
1
+ import { a as grid, i as span, n as layoutGrid, r as layoutGridStyles, t as layoutFrame } from "./grid-D6l0ftY0.mjs";
2
+ export { grid as default, grid, layoutFrame, layoutGrid, layoutGridStyles, span };
@@ -1,5 +1,5 @@
1
1
  import { a as Parser } from "./index-IulNhyDt.mjs";
2
- import "./types-Cj6Jx5LX.mjs";
2
+ import "./types-Cl2haWqC.mjs";
3
3
  //#region src/shadow/shadow.d.ts
4
4
  declare const shadow: Parser;
5
5
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { a as Parser } from "./index-iVqAMF2L.cjs";
2
- import "./types-Cj6Jx5LX.cjs";
2
+ import "./types-Cl2haWqC.cjs";
3
3
  //#region src/variant/variant.d.ts
4
4
  interface VariantOptions {
5
5
  scale?: string;
@@ -1,5 +1,5 @@
1
1
  import { a as Parser } from "./index-IulNhyDt.mjs";
2
- import "./types-Cj6Jx5LX.mjs";
2
+ import "./types-Cl2haWqC.mjs";
3
3
  //#region src/typography/typography.d.ts
4
4
  declare const typography: Parser;
5
5
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { a as Parser } from "./index-IulNhyDt.mjs";
2
- import "./types-Cj6Jx5LX.mjs";
2
+ import "./types-Cl2haWqC.mjs";
3
3
  //#region src/color/color.d.ts
4
4
  declare const color: Parser;
5
5
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { a as Parser } from "./index-iVqAMF2L.cjs";
2
- import "./types-Cj6Jx5LX.cjs";
2
+ import "./types-Cl2haWqC.cjs";
3
3
  //#region src/flexbox/flexbox.d.ts
4
4
  declare const flexbox: Parser;
5
5
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { a as Parser } from "./index-iVqAMF2L.cjs";
2
- import "./types-Cj6Jx5LX.cjs";
2
+ import "./types-Cl2haWqC.cjs";
3
3
  //#region src/space/space.d.ts
4
4
  declare const margin: Parser;
5
5
  declare const padding: Parser;
@@ -1,5 +1,5 @@
1
1
  import { a as Parser } from "./index-iVqAMF2L.cjs";
2
- import "./types-Cj6Jx5LX.cjs";
2
+ import "./types-Cl2haWqC.cjs";
3
3
  //#region src/position/position.d.ts
4
4
  declare const position: Parser;
5
5
  //#endregion
@@ -0,0 +1,55 @@
1
+ import { a as Parser, l as StyleObject } from "./index-iVqAMF2L.cjs";
2
+ import "./types-Cl2haWqC.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. Set per element with `gap`. */
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
+ /**
20
+ * `true` for the theme's layout grid, or an entry: its fields replace the theme's at every
21
+ * breakpoint, and entries under breakpoint names replace it from that breakpoint up.
22
+ */
23
+ type LayoutGridValue = boolean | Record<string, LayoutGridEntry | LayoutGridEntry[keyof LayoutGridEntry]>;
24
+ /** A `gap` / `columnGap` value: one value, an array by breakpoint position, or an object by name. */
25
+ type LayoutGridGap = string | number | null | undefined | Array<string | number | null> | Record<string, string | number | null>;
26
+ /**
27
+ * The layout grid from `theme.layout`, per breakpoint: each breakpoint's `content` (columns,
28
+ * margin, gutter, fluid or fixed), mobile-first. A field in `value` replaces the theme's at
29
+ * every breakpoint (`{ maxWidth: '1280px' }`); an entry under a breakpoint name replaces it
30
+ * from that breakpoint up, on top of those fields (`{ lg: { columns: 16 } }`). `gap` - the
31
+ * element's own `gap` / `columnGap` - sets the gutter the same way, single or responsive; where
32
+ * it is not set, the theme's gutter applies. Every written block carries the full set, so no
33
+ * block inherits a stale `max-width`. Rows take `rowGap` (or `gap`'s row half), never the layout.
34
+ */
35
+ declare const layoutGridStyles: (theme: unknown, value: LayoutGridValue | undefined, gap?: LayoutGridGap) => StyleObject;
36
+ /**
37
+ * The `layout` prop as the page frame alone: the margin and, in fixed mode, the centred max
38
+ * width per breakpoint - no columns, and `display` is left alone. Every View-based component
39
+ * takes it; compose it with `layoutGrid` for the columns.
40
+ */
41
+ declare const layoutFrame: Parser;
42
+ /**
43
+ * The `layout` prop's columns on a grid container: the tracks and the gutter. The gutter is the
44
+ * element's own `columnGap` or `gap` where it sets one, the theme's elsewhere - so `column-gap`
45
+ * has a single source and an explicit gap is never silently replaced.
46
+ */
47
+ declare const layoutGrid: Parser;
48
+ /**
49
+ * The `span` prop: how many columns of a grid an element takes - `grid-column: span N` - or
50
+ * `span="full"` for the whole row whatever the column count. Responsive like any prop:
51
+ * `span={{ xs: 'full', md: 6 }}`.
52
+ */
53
+ declare const span: Parser;
54
+ //#endregion
55
+ export { layoutGrid as a, grid as c, layoutFrame as i, LayoutGridGap as n, layoutGridStyles as o, LayoutGridValue as r, span as s, LayoutGridEntry as t };
@@ -1,5 +1,5 @@
1
1
  import { a as Parser } from "./index-IulNhyDt.mjs";
2
- import "./types-Cj6Jx5LX.mjs";
2
+ import "./types-Cl2haWqC.mjs";
3
3
  //#region src/flexbox/flexbox.d.ts
4
4
  declare const flexbox: Parser;
5
5
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { a as Parser } from "./index-IulNhyDt.mjs";
2
- import "./types-Cj6Jx5LX.mjs";
2
+ import "./types-Cl2haWqC.mjs";
3
3
  //#region src/layout/layout.d.ts
4
4
  declare const layout: Parser;
5
5
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { a as Parser } from "./index-iVqAMF2L.cjs";
2
- import "./types-Cj6Jx5LX.cjs";
2
+ import "./types-Cl2haWqC.cjs";
3
3
  //#region src/border/border.d.ts
4
4
  declare const border: Parser;
5
5
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { a as Parser } from "./index-iVqAMF2L.cjs";
2
- import "./types-Cj6Jx5LX.cjs";
2
+ import "./types-Cl2haWqC.cjs";
3
3
  //#region src/typography/typography.d.ts
4
4
  declare const typography: Parser;
5
5
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { a as Parser } from "./index-iVqAMF2L.cjs";
2
- import "./types-Cj6Jx5LX.cjs";
2
+ import "./types-Cl2haWqC.cjs";
3
3
  //#region src/shadow/shadow.d.ts
4
4
  declare const shadow: Parser;
5
5
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { a as Parser } from "./index-IulNhyDt.mjs";
2
- import "./types-Cj6Jx5LX.mjs";
2
+ import "./types-Cl2haWqC.mjs";
3
3
  //#region src/border/border.d.ts
4
4
  declare const border: Parser;
5
5
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { a as Parser } from "./index-IulNhyDt.mjs";
2
- import "./types-Cj6Jx5LX.mjs";
2
+ import "./types-Cl2haWqC.mjs";
3
3
  //#region src/variant/variant.d.ts
4
4
  interface VariantOptions {
5
5
  scale?: string;
@@ -1,5 +1,5 @@
1
1
  import { a as Parser } from "./index-IulNhyDt.mjs";
2
- import "./types-Cj6Jx5LX.mjs";
2
+ import "./types-Cl2haWqC.mjs";
3
3
  //#region src/space/space.d.ts
4
4
  declare const margin: Parser;
5
5
  declare const padding: Parser;