@salty-css/astro 0.2.0-alpha.0 → 0.2.0-alpha.2

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/element-props.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("@salty-css/core/util"),j=require("@salty-css/core/parsers"),A=["passProps"],O=(p={},t={},y="",d)=>{const{class:v="",className:m,element:k,passProps:i=t.passProps,_vks:u,style:r,...b}=p,n={passProps:i};if(t.attr)for(const[s,e]of Object.entries(t.attr))e!==void 0&&(n[s]=e);d&&Object.assign(n,d);const c={...b};if(t.defaultProps)for(const[s,e]of Object.entries(t.defaultProps))c[s]===void 0&&(c[s]=e);Object.assign(n,c);const f=new Set;for(const s of String(y).split(" "))s&&f.add(s);for(const s of String(v||"").split(" "))s&&f.add(s);for(const s of String(m||"").split(" "))s&&f.add(s);const l={};if(r&&typeof r=="object")for(const[s,e]of Object.entries(r)){const o=j.parseVariableTokens(e);l[s]=o?o.transformed:e}const a=new Set(Array.isArray(u)?u:[]);if(t.propValueKeys)for(const s of t.propValueKeys){const e=`css-${s}`,o=c[e];o!==void 0&&(l[`--props-${S.dashCase(s)}`]=o,a.add(e))}if(t.variantKeys)for(const s of t.variantKeys){const[e,o]=s.split("=");c[e]!==void 0?(f.add(`${e}-${c[e]}`),a.add(e)):o!==void 0&&f.add(`${e}-${o}`)}for(const s of a)i!==!0&&(Array.isArray(i)&&i.includes(s)||typeof i=="string"&&i===s||delete n[s]);for(const s of A)delete n[s];return{class:[...f],style:l,rest:n,element:k||t.element,_vks:[...a]}};exports.resolveAstroProps=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("@salty-css/core/util"),A=require("@salty-css/core/parsers"),O=["passProps"],$=(p={},t={},y="",d)=>{const{class:v="",className:m,element:k,as:b,passProps:i=t.passProps,_vks:u,style:r,...S}=p,n={passProps:i};if(t.attr)for(const[s,e]of Object.entries(t.attr))e!==void 0&&(n[s]=e);d&&Object.assign(n,d);const c={...S};if(t.defaultProps)for(const[s,e]of Object.entries(t.defaultProps))c[s]===void 0&&(c[s]=e);Object.assign(n,c);const a=new Set;for(const s of String(y).split(" "))s&&a.add(s);for(const s of String(v||"").split(" "))s&&a.add(s);for(const s of String(m||"").split(" "))s&&a.add(s);const l={};if(r&&typeof r=="object")for(const[s,e]of Object.entries(r)){const o=A.parseVariableTokens(e);l[s]=o?o.transformed:e}const f=new Set(Array.isArray(u)?u:[]);if(t.propValueKeys)for(const s of t.propValueKeys){const e=`css-${s}`,o=c[e];o!==void 0&&(l[`--props-${j.dashCase(s)}`]=o,f.add(e))}if(t.variantKeys)for(const s of t.variantKeys){const[e,o]=s.split("=");c[e]!==void 0?(a.add(`${e}-${c[e]}`),f.add(e)):o!==void 0&&a.add(`${e}-${o}`)}for(const s of f)i!==!0&&(Array.isArray(i)&&i.includes(s)||typeof i=="string"&&i===s||delete n[s]);for(const s of O)delete n[s];return{class:[...a],style:l,rest:n,element:b??k??t.element,_vks:[...f]}};exports.resolveAstroProps=$;
package/element-props.js CHANGED
@@ -1,20 +1,21 @@
1
- import { dashCase as j } from "@salty-css/core/util";
1
+ import { dashCase as A } from "@salty-css/core/util";
2
2
  import { parseVariableTokens as S } from "@salty-css/core/parsers";
3
- const $ = ["passProps"], O = (y = {}, t = {}, m = "", d) => {
3
+ const $ = ["passProps"], V = (y = {}, t = {}, m = "", d) => {
4
4
  const {
5
5
  class: u = "",
6
6
  className: v,
7
7
  element: k,
8
+ as: b,
8
9
  passProps: i = t.passProps,
9
10
  _vks: p,
10
11
  style: l,
11
- ...b
12
+ ...j
12
13
  } = y, n = { passProps: i };
13
14
  if (t.attr)
14
15
  for (const [s, e] of Object.entries(t.attr))
15
16
  e !== void 0 && (n[s] = e);
16
17
  d && Object.assign(n, d);
17
- const c = { ...b };
18
+ const c = { ...j };
18
19
  if (t.defaultProps)
19
20
  for (const [s, e] of Object.entries(t.defaultProps))
20
21
  c[s] === void 0 && (c[s] = e);
@@ -33,7 +34,7 @@ const $ = ["passProps"], O = (y = {}, t = {}, m = "", d) => {
33
34
  if (t.propValueKeys)
34
35
  for (const s of t.propValueKeys) {
35
36
  const e = `css-${s}`, o = c[e];
36
- o !== void 0 && (r[`--props-${j(s)}`] = o, a.add(e));
37
+ o !== void 0 && (r[`--props-${A(s)}`] = o, a.add(e));
37
38
  }
38
39
  if (t.variantKeys)
39
40
  for (const s of t.variantKeys) {
@@ -47,10 +48,10 @@ const $ = ["passProps"], O = (y = {}, t = {}, m = "", d) => {
47
48
  class: [...f],
48
49
  style: r,
49
50
  rest: n,
50
- element: k || t.element,
51
+ element: b ?? k ?? t.element,
51
52
  _vks: [...a]
52
53
  };
53
54
  };
54
55
  export {
55
- O as resolveAstroProps
56
+ V as resolveAstroProps
56
57
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salty-css/astro",
3
- "version": "0.2.0-alpha.0",
3
+ "version": "0.2.0-alpha.2",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "typings": "./dist/index.d.ts",
@@ -78,12 +78,12 @@
78
78
  }
79
79
  },
80
80
  "dependencies": {
81
- "@salty-css/core": "0.2.0-alpha.0",
81
+ "@salty-css/core": "0.2.0-alpha.2",
82
82
  "astro": "^5.13.2",
83
83
  "vite": "^6.3.5"
84
84
  },
85
85
  "peerDependencies": {
86
- "@salty-css/react": "0.2.0-alpha.0"
86
+ "@salty-css/react": "0.2.0-alpha.2"
87
87
  },
88
88
  "peerDependenciesMeta": {
89
89
  "@salty-css/react": {