@salty-css/react 0.0.1-alpha.48 → 0.0.1-alpha.49
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/keyframes.cjs +1 -1
- package/keyframes.d.ts +1 -1
- package/keyframes.js +23 -20
- package/package.json +2 -2
package/keyframes.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./parse-styles-SPT4zc_H.cjs"),j=({animationName:m,params:l,appendInitialStyles:f,...t})=>{const r=m||u.toHash(t),o=(n={})=>{const{duration:e="500ms",easing:s="ease-in-out",delay:a="0s",iterationCount:i="1",direction:d="normal",fillMode:g="forwards",playState:p="running"}={...l,...n},c=`${r} ${e} ${s} ${a} ${i} ${d} ${g} ${p}`;if(!f)return c;const $=t.from||t["0%"];if(!$)return c;const b=u.parseStyles($,"");return`${c};${b}`},y=Object.entries(t).reduce((n,[e,s])=>{if(!s)return n;const a=u.parseStyles(s,""),i=typeof e=="number"?`${e}%`:e;return`${n}${i}{${a}}`},""),S=`@keyframes ${r} {${y}}`;return Object.assign(o,{toString:o,isKeyframes:!0,animationName:r,css:S,keyframes:t}),o};exports.keyframes=j;
|
package/keyframes.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { CssStyles, StyleValue } from '@salty-css/core/types';
|
2
2
|
type KeyframeKeys = number | 'from' | 'to' | `${number}%`;
|
3
3
|
type Keyframes = {
|
4
|
-
[key in KeyframeKeys]
|
4
|
+
[key in KeyframeKeys]?: CssStyles;
|
5
5
|
};
|
6
6
|
interface KeyframesConfig {
|
7
7
|
animationName?: string;
|
package/keyframes.js
CHANGED
@@ -1,30 +1,33 @@
|
|
1
|
-
import { t as
|
2
|
-
const
|
3
|
-
const
|
1
|
+
import { t as j, p as m } from "./parse-styles-T74HIH4_.js";
|
2
|
+
const N = ({ animationName: u, params: f, appendInitialStyles: l, ...t }) => {
|
3
|
+
const e = u || j(t), o = (s = {}) => {
|
4
4
|
const {
|
5
5
|
duration: n = "500ms",
|
6
|
-
easing:
|
6
|
+
easing: r = "ease-in-out",
|
7
7
|
delay: a = "0s",
|
8
8
|
iterationCount: i = "1",
|
9
|
-
direction:
|
10
|
-
fillMode:
|
9
|
+
direction: y = "normal",
|
10
|
+
fillMode: g = "forwards",
|
11
11
|
playState: S = "running"
|
12
|
-
} = { ...
|
13
|
-
if (!
|
14
|
-
const
|
15
|
-
return
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
12
|
+
} = { ...f, ...s }, $ = `${e} ${n} ${r} ${a} ${i} ${y} ${g} ${S}`;
|
13
|
+
if (!l) return $;
|
14
|
+
const c = t.from || t["0%"];
|
15
|
+
if (!c) return $;
|
16
|
+
const b = m(c, "");
|
17
|
+
return `${$};${b}`;
|
18
|
+
}, p = Object.entries(t).reduce((s, [n, r]) => {
|
19
|
+
if (!r) return s;
|
20
|
+
const a = m(r, ""), i = typeof n == "number" ? `${n}%` : n;
|
21
|
+
return `${s}${i}{${a}}`;
|
22
|
+
}, ""), d = `@keyframes ${e} {${p}}`;
|
23
|
+
return Object.assign(o, {
|
24
|
+
toString: o,
|
22
25
|
isKeyframes: !0,
|
23
|
-
animationName:
|
24
|
-
css:
|
26
|
+
animationName: e,
|
27
|
+
css: d,
|
25
28
|
keyframes: t
|
26
|
-
}),
|
29
|
+
}), o;
|
27
30
|
};
|
28
31
|
export {
|
29
|
-
|
32
|
+
N as keyframes
|
30
33
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salty-css/react",
|
3
|
-
"version": "0.0.1-alpha.
|
3
|
+
"version": "0.0.1-alpha.49",
|
4
4
|
"main": "./dist/index.js",
|
5
5
|
"module": "./dist/index.mjs",
|
6
6
|
"typings": "./dist/index.d.ts",
|
@@ -41,7 +41,7 @@
|
|
41
41
|
}
|
42
42
|
},
|
43
43
|
"dependencies": {
|
44
|
-
"@salty-css/core": "^0.0.1-alpha.
|
44
|
+
"@salty-css/core": "^0.0.1-alpha.49",
|
45
45
|
"clsx": ">=2.x",
|
46
46
|
"react": ">=19.x || >=18.3.x"
|
47
47
|
}
|