@soroush.tech/styled-system 5.6.0 → 5.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@soroush.tech/styled-system.svg)](https://www.npmjs.com/package/@soroush.tech/styled-system)
4
4
  [![npm downloads](https://img.shields.io/npm/dm/@soroush.tech/styled-system.svg)](https://www.npmjs.com/package/@soroush.tech/styled-system)
5
- [![coverage](https://codecov.io/gh/soroush-tech/soroush.tech/branch/main/graph/badge.svg?flag=styled-system)](https://app.codecov.io/gh/soroush-tech/soroush.tech?flags%5B0%5D=styled-system)
5
+ [![coverage](https://codecov.io/gh/soroush-tech/core/branch/main/graph/badge.svg?flag=styled-system)](https://app.codecov.io/gh/soroush-tech/core?flags%5B0%5D=styled-system)
6
6
  [![unpacked size](https://img.shields.io/npm/unpacked-size/@soroush.tech/styled-system.svg)](https://www.npmjs.com/package/@soroush.tech/styled-system)
7
7
  [![types included](https://img.shields.io/npm/types/@soroush.tech/styled-system.svg)](https://www.npmjs.com/package/@soroush.tech/styled-system)
8
8
  [![license](https://img.shields.io/npm/l/@soroush.tech/styled-system.svg)](./LICENSE)
@@ -145,18 +145,18 @@ Types resolve under both modern module resolution (`node16`/`nodenext`/`bundler`
145
145
 
146
146
  Full docs live in [`docs/`](./docs/README.md):
147
147
 
148
- - [Getting Started](https://github.com/soroush-tech/soroush.tech/tree/main/packages/styled-system/docs/getting-started.md)
149
- - [Responsive Styles](https://github.com/soroush-tech/soroush.tech/tree/main/packages/styled-system/docs/responsive-styles.md)
150
- - [How it Works](https://github.com/soroush-tech/soroush.tech/tree/main/packages/styled-system/docs/how-it-works.md)
151
- - [Custom Props](https://github.com/soroush-tech/soroush.tech/tree/main/packages/styled-system/docs/custom-props.md)
152
- - [Variants](https://github.com/soroush-tech/soroush.tech/tree/main/packages/styled-system/docs/variants.md)
153
- - [API](https://github.com/soroush-tech/soroush.tech/tree/main/packages/styled-system/docs/api.md)
154
- - [Reference Table](https://github.com/soroush-tech/soroush.tech/tree/main/packages/styled-system/docs/table.md)
155
- - [TypeScript](https://github.com/soroush-tech/soroush.tech/tree/main/packages/styled-system/docs/typescript.md)
156
- - [Guides](https://github.com/soroush-tech/soroush.tech/tree/main/packages/styled-system/docs/guides/index.md)
148
+ - [Getting Started](https://github.com/soroush-tech/core/tree/main/packages/styled-system/docs/getting-started.md)
149
+ - [Responsive Styles](https://github.com/soroush-tech/core/tree/main/packages/styled-system/docs/responsive-styles.md)
150
+ - [How it Works](https://github.com/soroush-tech/core/tree/main/packages/styled-system/docs/how-it-works.md)
151
+ - [Custom Props](https://github.com/soroush-tech/core/tree/main/packages/styled-system/docs/custom-props.md)
152
+ - [Variants](https://github.com/soroush-tech/core/tree/main/packages/styled-system/docs/variants.md)
153
+ - [API](https://github.com/soroush-tech/core/tree/main/packages/styled-system/docs/api.md)
154
+ - [Reference Table](https://github.com/soroush-tech/core/tree/main/packages/styled-system/docs/table.md)
155
+ - [TypeScript](https://github.com/soroush-tech/core/tree/main/packages/styled-system/docs/typescript.md)
156
+ - [Guides](https://github.com/soroush-tech/core/tree/main/packages/styled-system/docs/guides/index.md)
157
157
 
158
- Runnable demos live in [`examples/styled-system/`](https://github.com/soroush-tech/soroush.tech/tree/main/examples/styled-system).
158
+ Runnable demos live in the [examples repo](https://github.com/soroush-tech/examples/tree/main/styled-system).
159
159
 
160
160
  ## License
161
161
 
162
- MIT — a rewrite of styled-system (© 2017–2021 Brent Jackson), see [`LICENSE`](https://github.com/soroush-tech/soroush.tech/tree/main/packages/styled-system/LICENSE).
162
+ MIT — a rewrite of styled-system (© 2017–2021 Brent Jackson), see [`LICENSE`](https://github.com/soroush-tech/core/tree/main/packages/styled-system/LICENSE).
@@ -184,7 +184,8 @@ const css = (args) => (props = {}) => {
184
184
  ...props.theme || props
185
185
  };
186
186
  let result = {};
187
- const styles = responsive(typeof args === "function" ? args(theme) : args)(theme);
187
+ const obj = typeof args === "function" ? args(theme) : args;
188
+ const styles = responsive(obj)(theme);
188
189
  for (const key in styles) {
189
190
  const x = styles[key];
190
191
  const val = typeof x === "function" ? x(theme) : x;
@@ -201,7 +202,8 @@ const css = (args) => (props = {}) => {
201
202
  continue;
202
203
  }
203
204
  const prop = get(aliases, key, key);
204
- const scale = get(theme, get(scales, prop), get(theme, prop, {}));
205
+ const scaleName = get(scales, prop);
206
+ const scale = get(theme, scaleName, get(theme, prop, {}));
205
207
  const value = get(transforms, prop, get)(scale, val, val);
206
208
  if (multiples[prop]) {
207
209
  const dirs = multiples[prop];
@@ -184,7 +184,8 @@ const css = (args) => (props = {}) => {
184
184
  ...props.theme || props
185
185
  };
186
186
  let result = {};
187
- const styles = responsive(typeof args === "function" ? args(theme) : args)(theme);
187
+ const obj = typeof args === "function" ? args(theme) : args;
188
+ const styles = responsive(obj)(theme);
188
189
  for (const key in styles) {
189
190
  const x = styles[key];
190
191
  const val = typeof x === "function" ? x(theme) : x;
@@ -201,7 +202,8 @@ const css = (args) => (props = {}) => {
201
202
  continue;
202
203
  }
203
204
  const prop = get(aliases, key, key);
204
- const scale = get(theme, get(scales, prop), get(theme, prop, {}));
205
+ const scaleName = get(scales, prop);
206
+ const scale = get(theme, scaleName, get(theme, prop, {}));
205
207
  const value = get(transforms, prop, get)(scale, val, val);
206
208
  if (multiples[prop]) {
207
209
  const dirs = multiples[prop];
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-BQ6QmZDs.cjs");
5
+ const require_css = require("./css-KTNhyd0w.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.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { n as get, r as responsive, t as css } from "./css-DPyZNAmX.mjs";
1
+ import { n as get, r as responsive, t as css } from "./css-BQylBMEo.mjs";
2
2
  export { css, css as default, get, responsive };
package/dist/index.cjs CHANGED
@@ -10,7 +10,7 @@ const require_position = require("./position-zWvCE4hD.cjs");
10
10
  const require_typography = require("./typography-DD_eWLLx.cjs");
11
11
  const require_space = require("./space-CAX_62yL.cjs");
12
12
  const require_shadow = require("./shadow-BrDnaQQl.cjs");
13
- const require_variant = require("./variant-C7vPzZHo.cjs");
13
+ const require_variant = require("./variant-DE0Cwy7S.cjs");
14
14
  //#region src/style/style.ts
15
15
  const style = ({ prop, cssProperty, alias, key, transformValue, scale, properties }) => {
16
16
  const config = {};
package/dist/index.mjs CHANGED
@@ -9,7 +9,7 @@ import { t as position } from "./position-jf6VlRyR.mjs";
9
9
  import { t as typography } from "./typography-CptBXSy0.mjs";
10
10
  import { n as padding, r as space, t as margin } from "./space-DEf9-0r9.mjs";
11
11
  import { t as shadow } from "./shadow-Bp7lx_41.mjs";
12
- import { i as variant, n as colorStyle, r as textStyle, t as buttonStyle } from "./variant-DQA9pqwW.mjs";
12
+ import { i as variant, n as colorStyle, r as textStyle, t as buttonStyle } from "./variant-p-ooclB1.mjs";
13
13
  //#region src/style/style.ts
14
14
  const style = ({ prop, cssProperty, alias, key, transformValue, scale, properties }) => {
15
15
  const config = {};
@@ -9,7 +9,7 @@ import { t as position } from "./position-jf6VlRyR.mjs";
9
9
  import { t as typography } from "./typography-CptBXSy0.mjs";
10
10
  import { r as space } from "./space-DEf9-0r9.mjs";
11
11
  import { t as shadow } from "./shadow-Bp7lx_41.mjs";
12
- import { n as colorStyle, r as textStyle, t as buttonStyle } from "./variant-DQA9pqwW.mjs";
12
+ import { n as colorStyle, r as textStyle, t as buttonStyle } from "./variant-p-ooclB1.mjs";
13
13
  //#region src/presets/presets.ts
14
14
  const all = compose(space, typography, color, layout, flexbox, border, background, position, grid, shadow, buttonStyle, textStyle, colorStyle);
15
15
  //#endregion
@@ -9,7 +9,7 @@ const require_position = require("./position-zWvCE4hD.cjs");
9
9
  const require_typography = require("./typography-DD_eWLLx.cjs");
10
10
  const require_space = require("./space-CAX_62yL.cjs");
11
11
  const require_shadow = require("./shadow-BrDnaQQl.cjs");
12
- const require_variant = require("./variant-C7vPzZHo.cjs");
12
+ const require_variant = require("./variant-DE0Cwy7S.cjs");
13
13
  //#region src/presets/presets.ts
14
14
  const all = require_core.compose(require_space.space, require_typography.typography, require_color.color, require_layout.layout, require_flexbox.flexbox, require_border.border, require_background.background, require_position.position, require_grid.grid, require_shadow.shadow, require_variant.buttonStyle, require_variant.textStyle, require_variant.colorStyle);
15
15
  //#endregion
@@ -13,7 +13,7 @@ const require_position = require("./position-zWvCE4hD.cjs");
13
13
  const require_typography = require("./typography-DD_eWLLx.cjs");
14
14
  const require_space = require("./space-CAX_62yL.cjs");
15
15
  const require_shadow = require("./shadow-BrDnaQQl.cjs");
16
- const require_variant = require("./variant-C7vPzZHo.cjs");
16
+ const require_variant = require("./variant-DE0Cwy7S.cjs");
17
17
  let prop_types = require("prop-types");
18
18
  prop_types = require_rolldown_runtime.__toESM(prop_types, 1);
19
19
  //#region src/prop-types/prop-types.ts
@@ -8,7 +8,7 @@ import { t as position } from "./position-jf6VlRyR.mjs";
8
8
  import { t as typography } from "./typography-CptBXSy0.mjs";
9
9
  import { r as space } from "./space-DEf9-0r9.mjs";
10
10
  import { t as shadow } from "./shadow-Bp7lx_41.mjs";
11
- import { n as colorStyle, r as textStyle, t as buttonStyle } from "./variant-DQA9pqwW.mjs";
11
+ import { n as colorStyle, r as textStyle, t as buttonStyle } from "./variant-p-ooclB1.mjs";
12
12
  import PropTypes from "prop-types";
13
13
  //#region src/prop-types/prop-types.ts
14
14
  const propType = PropTypes.oneOfType([
package/dist/props.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_presets = require("./presets-BgKBhlRl.cjs");
2
+ const require_presets = require("./presets-Dj-syv_1.cjs");
3
3
  //#region src/props/props.ts
4
4
  const styledSystemProps = new Set(require_presets.all.propNames);
5
5
  const omit = (props) => {
package/dist/props.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as all } from "./presets-CcKoA0BA.mjs";
1
+ import { t as all } from "./presets-BJo9-Lcu.mjs";
2
2
  //#region src/props/props.ts
3
3
  const styledSystemProps = new Set(all.propNames);
4
4
  const omit = (props) => {
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_rolldown_runtime = require("./rolldown-runtime-D6vf50IK.cjs");
6
- const require_presets = require("./presets-BgKBhlRl.cjs");
6
+ const require_presets = require("./presets-Dj-syv_1.cjs");
7
7
  let _emotion_is_prop_valid = require("@emotion/is-prop-valid");
8
8
  _emotion_is_prop_valid = require_rolldown_runtime.__toESM(_emotion_is_prop_valid, 1);
9
9
  //#region src/should-forward-prop/should-forward-prop.ts
@@ -1,4 +1,4 @@
1
- import { t as all } from "./presets-CcKoA0BA.mjs";
1
+ import { t as all } from "./presets-BJo9-Lcu.mjs";
2
2
  import isPropValid from "@emotion/is-prop-valid";
3
3
  //#region src/should-forward-prop/should-forward-prop.ts
4
4
  const memoize = (fn) => {
@@ -1,5 +1,5 @@
1
1
  const require_core = require("./core.cjs");
2
- const require_css = require("./css-BQ6QmZDs.cjs");
2
+ const require_css = require("./css-KTNhyd0w.cjs");
3
3
  //#region src/variant/variant.ts
4
4
  const variant = (options = {}) => {
5
5
  const { scale, prop = "variant", variants = {}, key } = options;
@@ -1,5 +1,5 @@
1
1
  import { createParser, get } from "./core.mjs";
2
- import { t as css } from "./css-DPyZNAmX.mjs";
2
+ import { t as css } from "./css-BQylBMEo.mjs";
3
3
  //#region src/variant/variant.ts
4
4
  const variant = (options = {}) => {
5
5
  const { scale, prop = "variant", variants = {}, key } = options;
package/dist/variant.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_variant = require("./variant-C7vPzZHo.cjs");
5
+ const require_variant = require("./variant-DE0Cwy7S.cjs");
6
6
  exports.buttonStyle = require_variant.buttonStyle;
7
7
  exports.colorStyle = require_variant.colorStyle;
8
8
  exports.default = require_variant.variant;
package/dist/variant.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { i as variant, n as colorStyle, r as textStyle, t as buttonStyle } from "./variant-DQA9pqwW.mjs";
1
+ import { i as variant, n as colorStyle, r as textStyle, t as buttonStyle } from "./variant-p-ooclB1.mjs";
2
2
  export { buttonStyle, colorStyle, variant as default, variant, textStyle };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soroush.tech/styled-system",
3
- "version": "5.6.0",
3
+ "version": "5.6.1",
4
4
  "description": "Maintained, first-class-TypeScript rewrite of styled-system — responsive, theme-aware style props for CSS-in-JS. Drop-in replacement for styled-system v5.",
5
5
  "keywords": [
6
6
  "styled-system",
@@ -13,14 +13,14 @@
13
13
  ],
14
14
  "author": "Masoud Soroush <masoud@soroush.tech>",
15
15
  "license": "MIT",
16
- "homepage": "https://github.com/soroush-tech/soroush.tech/tree/main/packages/styled-system#readme",
16
+ "homepage": "https://soroush.tech/styled-system/",
17
17
  "repository": {
18
18
  "type": "git",
19
- "url": "git+https://github.com/soroush-tech/soroush.tech.git",
19
+ "url": "git+https://github.com/soroush-tech/core.git",
20
20
  "directory": "packages/styled-system"
21
21
  },
22
22
  "bugs": {
23
- "url": "https://github.com/soroush-tech/soroush.tech/issues"
23
+ "url": "https://github.com/soroush-tech/core/issues"
24
24
  },
25
25
  "type": "module",
26
26
  "sideEffects": false,
@@ -217,7 +217,7 @@
217
217
  "access": "public"
218
218
  },
219
219
  "dependencies": {
220
- "csstype": "^3.1.3"
220
+ "csstype": "^3.2.3"
221
221
  },
222
222
  "peerDependencies": {
223
223
  "@emotion/is-prop-valid": "^1.4.0",
@@ -233,9 +233,9 @@
233
233
  },
234
234
  "devDependencies": {
235
235
  "@emotion/is-prop-valid": "^1.4.0",
236
- "@types/prop-types": "^15.7.12",
236
+ "@types/prop-types": "^15.7.15",
237
237
  "@vitest/coverage-v8": "^4.1.9",
238
- "eslint": "^10.5.0",
238
+ "eslint": "^10.6.0",
239
239
  "globals": "^17.7.0",
240
240
  "prop-types": "^15.8.1",
241
241
  "tsdown": "^0.22.3",