@salty-css/react 0.0.1-alpha.225 → 0.0.1-alpha.226

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
@@ -88,6 +88,7 @@ export const Component = styled('div', {
88
88
  // Add additional default props for the component (eg, id and other html element attributes)
89
89
  },
90
90
  passProps: true, // Pass variant props to the rendered element / parent component (default: false)
91
+ priority: 1, // Override automatic priotity layer with a custom value (0-8), higher is considered more important
91
92
  });
92
93
  ```
93
94
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salty-css/react",
3
- "version": "0.0.1-alpha.225",
3
+ "version": "0.0.1-alpha.226",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "typings": "./dist/index.d.ts",
@@ -62,7 +62,7 @@
62
62
  }
63
63
  },
64
64
  "dependencies": {
65
- "@salty-css/core": "^0.0.1-alpha.225",
65
+ "@salty-css/core": "^0.0.1-alpha.226",
66
66
  "clsx": ">=2.x",
67
67
  "react": ">=19.x || >=18.3.x"
68
68
  }
package/styled.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./styles-generator-CD8r4Qz6.cjs"),g=require("./element-factory-DjYdX8Jd.cjs");class h extends m.StylesGenerator{constructor(e,t){super(t),this.tagName=e,this._params=t}get priority(){var e;return typeof this.tagName=="function"||typeof this.tagName=="object"?(((e=this.tagName.generator)==null?void 0:e.priority)||0)+1:0}get clientProps(){const{element:e,variants:t={},compoundVariants:a=[],defaultVariants:d={},defaultProps:l={},passProps:u}=this.params,{callerName:y,isProduction:f}=this.buildContext,o=new Set([]),i=s=>{const r=d[s];r!==void 0?o.add(`${s}=${String(r)}`):o.add(s)};Object.keys(t).forEach(i),a.map(s=>Object.keys(s).forEach(i));const c=new Set([]);if(this.params.base){const s=JSON.stringify(this.params.base).match(/\{props\.([\w\d]+)\}/gi);s&&s.forEach(r=>{const p=r.replace(/\{props\.([\w\d]+)\}/gi,"$1");p&&c.add(p)})}return{element:e,variantKeys:[...o],propValueKeys:[...c],passProps:u,defaultProps:l,attr:{"data-component-name":f?void 0:y}}}}const b=(n,e)=>{const t=new h(n,e),a=g.elementFactory(n,t.cssClassName,t.clientProps,{"data-unoptimized-client-component":!0});return Object.assign(a,{generator:t}),a};exports.styled=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./styles-generator-CD8r4Qz6.cjs"),h=require("./element-factory-DjYdX8Jd.cjs");class g extends m.StylesGenerator{constructor(e,t){super(t),this.tagName=e,this._params=t}get priority(){var e;return this.params.priority?this.params.priority:typeof this.tagName=="function"||typeof this.tagName=="object"?(((e=this.tagName.generator)==null?void 0:e.priority)||0)+1:0}get clientProps(){const{element:e,variants:t={},compoundVariants:s=[],defaultVariants:d={},defaultProps:l={},passProps:u}=this.params,{callerName:y,isProduction:f}=this.buildContext,o=new Set([]),i=r=>{const a=d[r];a!==void 0?o.add(`${r}=${String(a)}`):o.add(r)};Object.keys(t).forEach(i),s.map(r=>Object.keys(r).forEach(i));const c=new Set([]);if(this.params.base){const r=JSON.stringify(this.params.base).match(/\{props\.([\w\d]+)\}/gi);r&&r.forEach(a=>{const p=a.replace(/\{props\.([\w\d]+)\}/gi,"$1");p&&c.add(p)})}return{element:e,variantKeys:[...o],propValueKeys:[...c],passProps:u,defaultProps:l,attr:{"data-component-name":f?void 0:y}}}}const b=(n,e)=>{const t=new g(n,e),s=h.elementFactory(n,t.cssClassName,t.clientProps,{"data-unoptimized-client-component":!0});return Object.assign(s,{generator:t}),s};exports.styled=b;
package/styled.js CHANGED
@@ -6,19 +6,19 @@ class g extends y {
6
6
  }
7
7
  get priority() {
8
8
  var e;
9
- return typeof this.tagName == "function" || typeof this.tagName == "object" ? (((e = this.tagName.generator) == null ? void 0 : e.priority) || 0) + 1 : 0;
9
+ return this.params.priority ? this.params.priority : typeof this.tagName == "function" || typeof this.tagName == "object" ? (((e = this.tagName.generator) == null ? void 0 : e.priority) || 0) + 1 : 0;
10
10
  }
11
11
  get clientProps() {
12
- const { element: e, variants: t = {}, compoundVariants: s = [], defaultVariants: d = {}, defaultProps: l = {}, passProps: f } = this.params, { callerName: m, isProduction: u } = this.buildContext, o = /* @__PURE__ */ new Set([]), i = (a) => {
13
- const r = d[a];
14
- r !== void 0 ? o.add(`${a}=${String(r)}`) : o.add(a);
12
+ const { element: e, variants: t = {}, compoundVariants: r = [], defaultVariants: d = {}, defaultProps: m = {}, passProps: f } = this.params, { callerName: l, isProduction: u } = this.buildContext, o = /* @__PURE__ */ new Set([]), i = (a) => {
13
+ const s = d[a];
14
+ s !== void 0 ? o.add(`${a}=${String(s)}`) : o.add(a);
15
15
  };
16
- Object.keys(t).forEach(i), s.map((a) => Object.keys(a).forEach(i));
16
+ Object.keys(t).forEach(i), r.map((a) => Object.keys(a).forEach(i));
17
17
  const c = /* @__PURE__ */ new Set([]);
18
18
  if (this.params.base) {
19
19
  const a = JSON.stringify(this.params.base).match(/\{props\.([\w\d]+)\}/gi);
20
- a && a.forEach((r) => {
21
- const p = r.replace(/\{props\.([\w\d]+)\}/gi, "$1");
20
+ a && a.forEach((s) => {
21
+ const p = s.replace(/\{props\.([\w\d]+)\}/gi, "$1");
22
22
  p && c.add(p);
23
23
  });
24
24
  }
@@ -27,20 +27,20 @@ class g extends y {
27
27
  variantKeys: [...o],
28
28
  propValueKeys: [...c],
29
29
  passProps: f,
30
- defaultProps: l,
30
+ defaultProps: m,
31
31
  attr: {
32
- "data-component-name": u ? void 0 : m
32
+ "data-component-name": u ? void 0 : l
33
33
  }
34
34
  };
35
35
  }
36
36
  }
37
37
  const v = (n, e) => {
38
- const t = new g(n, e), s = h(n, t.cssClassName, t.clientProps, {
38
+ const t = new g(n, e), r = h(n, t.cssClassName, t.clientProps, {
39
39
  "data-unoptimized-client-component": !0
40
40
  });
41
- return Object.assign(s, {
41
+ return Object.assign(r, {
42
42
  generator: t
43
- }), s;
43
+ }), r;
44
44
  };
45
45
  export {
46
46
  v as styled