@salty-css/react 0.0.1-alpha.98 → 0.0.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 +415 -47
- package/class-name-client.cjs +1 -0
- package/class-name-client.d.ts +7 -0
- package/class-name-client.js +15 -0
- package/class-name.cjs +1 -0
- package/class-name.d.ts +10 -0
- package/class-name.js +20 -0
- package/clsx-C11secjj.cjs +1 -0
- package/clsx-OuTLNxxd.js +16 -0
- package/config.cjs +1 -0
- package/config.d.ts +1 -0
- package/config.js +1 -0
- package/dynamic-styles.cjs +2 -0
- package/dynamic-styles.d.ts +23 -0
- package/dynamic-styles.js +29 -0
- package/element-factory-BPI0pGIH.cjs +1 -0
- package/element-factory-D5vMsSwp.js +56 -0
- package/element-factory.d.ts +2 -2
- package/helpers.cjs +1 -0
- package/helpers.d.ts +1 -0
- package/helpers.js +1 -0
- package/index.cjs +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/keyframes.cjs +1 -1
- package/keyframes.d.ts +1 -22
- package/keyframes.js +1 -33
- package/media.cjs +1 -1
- package/media.d.ts +1 -71
- package/media.js +1 -85
- package/package.json +30 -2
- package/runtime.cjs +1 -0
- package/runtime.d.ts +1 -0
- package/runtime.js +1 -0
- package/styled-client.cjs +1 -1
- package/styled-client.d.ts +2 -2
- package/styled-client.js +1 -1
- package/styled.cjs +1 -1
- package/styled.d.ts +4 -4
- package/styled.js +8 -69
- package/element-factory-D1ozgqO7.cjs +0 -1
- package/element-factory-Dupolv6C.js +0 -67
- package/parse-styles-CVYekczt.js +0 -89
- package/parse-styles-DjwCLt3X.cjs +0 -7
- package/parse-tokens-CRGUYhKC.cjs +0 -1
- package/parse-tokens-DAW55Na6.js +0 -8
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as s, jsxs as p, Fragment as y } from "react/jsx-runtime";
|
|
2
|
+
import { parseStyles as u } from "@salty-css/core/parsers";
|
|
3
|
+
import { resolveDynamicConfigCache as g } from "@salty-css/core/cache/resolve-dynamic-config-cache";
|
|
4
|
+
import { toHash as d } from "@salty-css/core/util";
|
|
5
|
+
import { c as h } from "./clsx-OuTLNxxd.js";
|
|
6
|
+
import { createElement as C } from "react";
|
|
7
|
+
const w = (t) => d(t), i = async (t, r) => {
|
|
8
|
+
const n = await g();
|
|
9
|
+
return (await u(t, r, n)).join(`
|
|
10
|
+
`);
|
|
11
|
+
}, E = async ({ as: t, scope: r, styles: n, ...o }) => {
|
|
12
|
+
if (t) {
|
|
13
|
+
const c = (a) => typeof t == "string" ? C(t, a) : t(a);
|
|
14
|
+
if (!n) return /* @__PURE__ */ s(c, { ...o });
|
|
15
|
+
const e = w(n), l = await i(n, r || `.${e}`), f = { ...o, className: h(e, o.className) };
|
|
16
|
+
return /* @__PURE__ */ p(y, { children: [
|
|
17
|
+
/* @__PURE__ */ s("style", { children: l }),
|
|
18
|
+
/* @__PURE__ */ s(c, { ...f })
|
|
19
|
+
] });
|
|
20
|
+
}
|
|
21
|
+
if (!n) return null;
|
|
22
|
+
const m = await i(n, r);
|
|
23
|
+
return /* @__PURE__ */ s("style", { children: m });
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
E as DynamicStyles,
|
|
27
|
+
w as getDynamicStylesClassName,
|
|
28
|
+
i as getDynamicStylesCss
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const S=require("react"),C=require("./clsx-C11secjj.cjs"),N=require("@salty-css/core/util"),F=require("@salty-css/core/parsers"),R=["passProps"],v=(E,y="",t={},m)=>{const K=({extend:l=E,element:h=t.element,className:O="",children:$,passProps:f=t.passProps,_vks:c=new Set,...a},w)=>{const s={passProps:f};t.attr&&Object.assign(s,t.attr),m&&Object.assign(s,m),t.defaultProps&&Object.assign(a,t.defaultProps),a&&Object.assign(s,a);const o=new Set([...y.split(" "),...O.split(" ")]),d=typeof l=="function"||typeof l=="object",r=d&&"isStyled"in l,j=d?l:h||l;if(!j)throw new Error("No element provided");const u=s.style||{};s.style||(s.style=u),Object.entries(u).forEach(([e,i])=>{const n=F.parseVariableTokens(i);n&&(u[e]=n.transformed)}),t.propValueKeys&&t.propValueKeys.forEach(e=>{const i=`css-${e}`,n=a[i];if(n===void 0)return;const q=`--props-${N.dashCase(e)}`;u[q]=n,c&&c.add(i)}),t.variantKeys&&t.variantKeys.forEach(e=>{const[i,n]=e.split("=");a[i]!==void 0?(o.add(`${i}-${a[i]}`),c&&c.add(i)):n!==void 0&&o.add(`${i}-${n}`)}),c&&(!d||!r)?c.forEach(e=>{if(!f)return delete s[e];if(f!==!0&&!f.includes(e))return delete s[e]}):r&&Object.assign(s,{_vks:c}),r||R.forEach(e=>delete s[e]);const V=C.clsx(...o);return S.createElement(j,{element:d?h:void 0,className:V,ref:w,...s},$)},b=S.forwardRef(K);return Object.assign(b,{isStyled:!0,className:y,toString:()=>`.${t.hash}`}),b};exports.elementFactory=v;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { forwardRef as V, createElement as C } from "react";
|
|
2
|
+
import { c as N } from "./clsx-OuTLNxxd.js";
|
|
3
|
+
import { dashCase as R } from "@salty-css/core/util";
|
|
4
|
+
import { parseVariableTokens as p } from "@salty-css/core/parsers";
|
|
5
|
+
const q = ["passProps"], B = (S, m = "", t = {}, y) => {
|
|
6
|
+
const b = V(({
|
|
7
|
+
extend: c = S,
|
|
8
|
+
element: h = t.element,
|
|
9
|
+
className: E = "",
|
|
10
|
+
children: K,
|
|
11
|
+
passProps: l = t.passProps,
|
|
12
|
+
_vks: n = /* @__PURE__ */ new Set(),
|
|
13
|
+
...a
|
|
14
|
+
}, O) => {
|
|
15
|
+
const s = { passProps: l };
|
|
16
|
+
t.attr && Object.assign(s, t.attr), y && Object.assign(s, y), t.defaultProps && Object.assign(a, t.defaultProps), a && Object.assign(s, a);
|
|
17
|
+
const r = /* @__PURE__ */ new Set([...m.split(" "), ...E.split(" ")]), o = typeof c == "function" || typeof c == "object", u = o && "isStyled" in c, j = o ? c : h || c;
|
|
18
|
+
if (!j) throw new Error("No element provided");
|
|
19
|
+
const d = s.style || {};
|
|
20
|
+
s.style || (s.style = d), Object.entries(d).forEach(([e, i]) => {
|
|
21
|
+
const f = p(i);
|
|
22
|
+
f && (d[e] = f.transformed);
|
|
23
|
+
}), t.propValueKeys && t.propValueKeys.forEach((e) => {
|
|
24
|
+
const i = `css-${e}`, f = a[i];
|
|
25
|
+
if (f === void 0) return;
|
|
26
|
+
const w = `--props-${R(e)}`;
|
|
27
|
+
d[w] = f, n && n.add(i);
|
|
28
|
+
}), t.variantKeys && t.variantKeys.forEach((e) => {
|
|
29
|
+
const [i, f] = e.split("=");
|
|
30
|
+
a[i] !== void 0 ? (r.add(`${i}-${a[i]}`), n && n.add(i)) : f !== void 0 && r.add(`${i}-${f}`);
|
|
31
|
+
}), n && (!o || !u) ? n.forEach((e) => {
|
|
32
|
+
if (!l) return delete s[e];
|
|
33
|
+
if (l !== !0 && !l.includes(e))
|
|
34
|
+
return delete s[e];
|
|
35
|
+
}) : u && Object.assign(s, { _vks: n }), u || q.forEach((e) => delete s[e]);
|
|
36
|
+
const $ = N(...r);
|
|
37
|
+
return C(
|
|
38
|
+
j,
|
|
39
|
+
{
|
|
40
|
+
element: o ? h : void 0,
|
|
41
|
+
className: $,
|
|
42
|
+
ref: O,
|
|
43
|
+
...s
|
|
44
|
+
},
|
|
45
|
+
K
|
|
46
|
+
);
|
|
47
|
+
});
|
|
48
|
+
return Object.assign(b, {
|
|
49
|
+
isStyled: !0,
|
|
50
|
+
className: m,
|
|
51
|
+
toString: () => `.${t.hash}`
|
|
52
|
+
}), b;
|
|
53
|
+
};
|
|
54
|
+
export {
|
|
55
|
+
B as e
|
|
56
|
+
};
|
package/element-factory.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { GeneratorProps } from '@salty-css/core/generator';
|
|
2
1
|
import { StyledComponentProps, Tag } from '@salty-css/core/types';
|
|
3
|
-
|
|
2
|
+
import { StyledGeneratorClientProps } from '@salty-css/core/generators';
|
|
3
|
+
export declare const elementFactory: (tagName: Tag<any>, _className?: string, _generatorProps?: StyledGeneratorClientProps, _additionalProps?: Record<PropertyKey, any>) => import('react').ForwardRefExoticComponent<Omit<StyledComponentProps, "ref"> & import('react').RefAttributes<any>>;
|
package/helpers.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@salty-css/core/helpers");Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
package/helpers.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@salty-css/core/helpers';
|
package/helpers.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@salty-css/core/helpers";
|
package/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@salty-css/core/css");Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@salty-css/core/css';
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@salty-css/core/css";
|
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 t=require("@salty-css/core/css/keyframes");Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
package/keyframes.d.ts
CHANGED
|
@@ -1,22 +1 @@
|
|
|
1
|
-
|
|
2
|
-
type KeyframeKeys = number | 'from' | 'to' | `${number}%`;
|
|
3
|
-
type Keyframes = {
|
|
4
|
-
[key in KeyframeKeys]?: CssStyles;
|
|
5
|
-
};
|
|
6
|
-
interface KeyframesConfig {
|
|
7
|
-
animationName?: string;
|
|
8
|
-
appendInitialStyles?: boolean;
|
|
9
|
-
params?: KeyframesParams;
|
|
10
|
-
}
|
|
11
|
-
interface KeyframesParams {
|
|
12
|
-
duration?: string;
|
|
13
|
-
delay?: string;
|
|
14
|
-
iterationCount?: string | number;
|
|
15
|
-
easing?: StyleValue<'animationTimingFunction'>;
|
|
16
|
-
direction?: StyleValue<'animationDirection'>;
|
|
17
|
-
fillMode?: StyleValue<'animationFillMode'>;
|
|
18
|
-
playState?: StyleValue<'animationPlayState'>;
|
|
19
|
-
}
|
|
20
|
-
type KeyframesProps = Keyframes & KeyframesConfig;
|
|
21
|
-
export declare const keyframes: ({ animationName: _name, params: _params, appendInitialStyles, ...keyframes }: KeyframesProps) => (params?: KeyframesParams) => string;
|
|
22
|
-
export {};
|
|
1
|
+
export * from '@salty-css/core/css/keyframes';
|
package/keyframes.js
CHANGED
|
@@ -1,33 +1 @@
|
|
|
1
|
-
|
|
2
|
-
const N = ({ animationName: u, params: f, appendInitialStyles: l, ...t }) => {
|
|
3
|
-
const e = u || j(t), o = (s = {}) => {
|
|
4
|
-
const {
|
|
5
|
-
duration: n = "500ms",
|
|
6
|
-
easing: r = "ease-in-out",
|
|
7
|
-
delay: a = "0s",
|
|
8
|
-
iterationCount: i = "1",
|
|
9
|
-
direction: y = "normal",
|
|
10
|
-
fillMode: g = "forwards",
|
|
11
|
-
playState: S = "running"
|
|
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,
|
|
25
|
-
isKeyframes: !0,
|
|
26
|
-
animationName: e,
|
|
27
|
-
css: d,
|
|
28
|
-
keyframes: t
|
|
29
|
-
}), o;
|
|
30
|
-
};
|
|
31
|
-
export {
|
|
32
|
-
N as keyframes
|
|
33
|
-
};
|
|
1
|
+
export * from "@salty-css/core/css/keyframes";
|
package/media.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@salty-css/core/css/media");Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
package/media.d.ts
CHANGED
|
@@ -1,71 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare class MediaQueryFactory {
|
|
3
|
-
private base;
|
|
4
|
-
constructor(base?: string);
|
|
5
|
-
private next;
|
|
6
|
-
custom(value: string): string & {
|
|
7
|
-
and: MediaQueryFactory;
|
|
8
|
-
or: MediaQueryFactory;
|
|
9
|
-
};
|
|
10
|
-
minWidth(width: OrString | OrNumber): string & {
|
|
11
|
-
and: MediaQueryFactory;
|
|
12
|
-
or: MediaQueryFactory;
|
|
13
|
-
};
|
|
14
|
-
maxWidth(width: OrString | OrNumber): string & {
|
|
15
|
-
and: MediaQueryFactory;
|
|
16
|
-
or: MediaQueryFactory;
|
|
17
|
-
};
|
|
18
|
-
minHeight(height: OrString | OrNumber): string & {
|
|
19
|
-
and: MediaQueryFactory;
|
|
20
|
-
or: MediaQueryFactory;
|
|
21
|
-
};
|
|
22
|
-
maxHeight(height: OrString | OrNumber): string & {
|
|
23
|
-
and: MediaQueryFactory;
|
|
24
|
-
or: MediaQueryFactory;
|
|
25
|
-
};
|
|
26
|
-
get portrait(): string & {
|
|
27
|
-
and: MediaQueryFactory;
|
|
28
|
-
or: MediaQueryFactory;
|
|
29
|
-
};
|
|
30
|
-
get landscape(): string & {
|
|
31
|
-
and: MediaQueryFactory;
|
|
32
|
-
or: MediaQueryFactory;
|
|
33
|
-
};
|
|
34
|
-
prefersColorScheme(scheme: 'dark' | 'light' | OrString): string & {
|
|
35
|
-
and: MediaQueryFactory;
|
|
36
|
-
or: MediaQueryFactory;
|
|
37
|
-
};
|
|
38
|
-
get dark(): string & {
|
|
39
|
-
and: MediaQueryFactory;
|
|
40
|
-
or: MediaQueryFactory;
|
|
41
|
-
};
|
|
42
|
-
get light(): string & {
|
|
43
|
-
and: MediaQueryFactory;
|
|
44
|
-
or: MediaQueryFactory;
|
|
45
|
-
};
|
|
46
|
-
get print(): string & {
|
|
47
|
-
and: MediaQueryFactory;
|
|
48
|
-
or: MediaQueryFactory;
|
|
49
|
-
};
|
|
50
|
-
get screen(): string & {
|
|
51
|
-
and: MediaQueryFactory;
|
|
52
|
-
or: MediaQueryFactory;
|
|
53
|
-
};
|
|
54
|
-
get speech(): string & {
|
|
55
|
-
and: MediaQueryFactory;
|
|
56
|
-
or: MediaQueryFactory;
|
|
57
|
-
};
|
|
58
|
-
get all(): string & {
|
|
59
|
-
and: MediaQueryFactory;
|
|
60
|
-
or: MediaQueryFactory;
|
|
61
|
-
};
|
|
62
|
-
get not(): string & {
|
|
63
|
-
and: MediaQueryFactory;
|
|
64
|
-
or: MediaQueryFactory;
|
|
65
|
-
};
|
|
66
|
-
get reducedMotion(): string & {
|
|
67
|
-
and: MediaQueryFactory;
|
|
68
|
-
or: MediaQueryFactory;
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
export declare const media: MediaQueryFactory;
|
|
1
|
+
export * from '@salty-css/core/css/media';
|
package/media.js
CHANGED
|
@@ -1,85 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var a = (s, t, e) => t in s ? o(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
|
-
var i = (s, t, e) => a(s, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
-
class r {
|
|
5
|
-
constructor(t = "@media") {
|
|
6
|
-
i(this, "next", (t) => {
|
|
7
|
-
const e = new String(t);
|
|
8
|
-
return Object.assign(e, {
|
|
9
|
-
get and() {
|
|
10
|
-
return new r(`${t} and`);
|
|
11
|
-
},
|
|
12
|
-
get or() {
|
|
13
|
-
return new r(`${t},`);
|
|
14
|
-
}
|
|
15
|
-
}), e;
|
|
16
|
-
});
|
|
17
|
-
this.base = t;
|
|
18
|
-
}
|
|
19
|
-
custom(t) {
|
|
20
|
-
return this.next(`${this.base} ${t}`);
|
|
21
|
-
}
|
|
22
|
-
minWidth(t) {
|
|
23
|
-
const e = typeof t == "number" ? `${t}px` : t, n = `${this.base} (min-width: ${e})`;
|
|
24
|
-
return this.next(n);
|
|
25
|
-
}
|
|
26
|
-
maxWidth(t) {
|
|
27
|
-
const e = typeof t == "number" ? `${t}px` : t, n = `${this.base} (max-width: ${e})`;
|
|
28
|
-
return this.next(n);
|
|
29
|
-
}
|
|
30
|
-
minHeight(t) {
|
|
31
|
-
const e = typeof t == "number" ? `${t}px` : t, n = `${this.base} (min-height: ${e})`;
|
|
32
|
-
return this.next(n);
|
|
33
|
-
}
|
|
34
|
-
maxHeight(t) {
|
|
35
|
-
const e = typeof t == "number" ? `${t}px` : t, n = `${this.base} (max-height: ${e})`;
|
|
36
|
-
return this.next(n);
|
|
37
|
-
}
|
|
38
|
-
get portrait() {
|
|
39
|
-
const t = `${this.base} (orientation: portrait)`;
|
|
40
|
-
return this.next(t);
|
|
41
|
-
}
|
|
42
|
-
get landscape() {
|
|
43
|
-
const t = `${this.base} (orientation: landscape)`;
|
|
44
|
-
return this.next(t);
|
|
45
|
-
}
|
|
46
|
-
prefersColorScheme(t) {
|
|
47
|
-
const e = `${this.base} (prefers-color-scheme: ${t})`;
|
|
48
|
-
return this.next(e);
|
|
49
|
-
}
|
|
50
|
-
get dark() {
|
|
51
|
-
return this.prefersColorScheme("dark");
|
|
52
|
-
}
|
|
53
|
-
get light() {
|
|
54
|
-
return this.prefersColorScheme("light");
|
|
55
|
-
}
|
|
56
|
-
get print() {
|
|
57
|
-
const t = `${this.base} print`;
|
|
58
|
-
return this.next(t);
|
|
59
|
-
}
|
|
60
|
-
get screen() {
|
|
61
|
-
const t = `${this.base} screen`;
|
|
62
|
-
return this.next(t);
|
|
63
|
-
}
|
|
64
|
-
get speech() {
|
|
65
|
-
const t = `${this.base} speech`;
|
|
66
|
-
return this.next(t);
|
|
67
|
-
}
|
|
68
|
-
get all() {
|
|
69
|
-
const t = `${this.base} all`;
|
|
70
|
-
return this.next(t);
|
|
71
|
-
}
|
|
72
|
-
get not() {
|
|
73
|
-
const t = `${this.base} not`;
|
|
74
|
-
return this.next(t);
|
|
75
|
-
}
|
|
76
|
-
get reducedMotion() {
|
|
77
|
-
const t = `${this.base} (prefers-reduced-motion: reduce)`;
|
|
78
|
-
return this.next(t);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
const u = new r();
|
|
82
|
-
export {
|
|
83
|
-
r as MediaQueryFactory,
|
|
84
|
-
u as media
|
|
85
|
-
};
|
|
1
|
+
export * from "@salty-css/core/css/media";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salty-css/react",
|
|
3
|
-
"version": "0.0.1
|
|
3
|
+
"version": "0.0.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"typings": "./dist/index.d.ts",
|
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
"name": "react"
|
|
29
29
|
},
|
|
30
30
|
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"import": "./index.js",
|
|
33
|
+
"require": "./index.cjs"
|
|
34
|
+
},
|
|
31
35
|
"./styled": {
|
|
32
36
|
"import": "./styled.js",
|
|
33
37
|
"require": "./styled.cjs"
|
|
@@ -36,6 +40,14 @@
|
|
|
36
40
|
"import": "./styled-client.js",
|
|
37
41
|
"require": "./styled-client.cjs"
|
|
38
42
|
},
|
|
43
|
+
"./class-name": {
|
|
44
|
+
"import": "./class-name.js",
|
|
45
|
+
"require": "./class-name.cjs"
|
|
46
|
+
},
|
|
47
|
+
"./class-name-client": {
|
|
48
|
+
"import": "./class-name-client.js",
|
|
49
|
+
"require": "./class-name-client.cjs"
|
|
50
|
+
},
|
|
39
51
|
"./keyframes": {
|
|
40
52
|
"import": "./keyframes.js",
|
|
41
53
|
"require": "./keyframes.cjs"
|
|
@@ -43,10 +55,26 @@
|
|
|
43
55
|
"./media": {
|
|
44
56
|
"import": "./media.js",
|
|
45
57
|
"require": "./media.cjs"
|
|
58
|
+
},
|
|
59
|
+
"./config": {
|
|
60
|
+
"import": "./config.js",
|
|
61
|
+
"require": "./config.cjs"
|
|
62
|
+
},
|
|
63
|
+
"./helpers": {
|
|
64
|
+
"import": "./helpers.js",
|
|
65
|
+
"require": "./helpers.cjs"
|
|
66
|
+
},
|
|
67
|
+
"./dynamic-styles": {
|
|
68
|
+
"import": "./dynamic-styles.js",
|
|
69
|
+
"require": "./dynamic-styles.cjs"
|
|
70
|
+
},
|
|
71
|
+
"./runtime": {
|
|
72
|
+
"import": "./runtime.js",
|
|
73
|
+
"require": "./runtime.cjs"
|
|
46
74
|
}
|
|
47
75
|
},
|
|
48
76
|
"dependencies": {
|
|
49
|
-
"@salty-css/core": "^0.0.1
|
|
77
|
+
"@salty-css/core": "^0.0.1",
|
|
50
78
|
"clsx": ">=2.x",
|
|
51
79
|
"react": ">=19.x || >=18.3.x"
|
|
52
80
|
}
|
package/runtime.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@salty-css/core/runtime");Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
package/runtime.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@salty-css/core/runtime';
|
package/runtime.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@salty-css/core/runtime";
|
package/styled-client.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./element-factory-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./element-factory-BPI0pGIH.cjs"),n=(e,t,r)=>l.elementFactory(e,t,r);exports.styledClient=n;
|
package/styled-client.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StyledGeneratorClientProps } from '@salty-css/core/generators';
|
|
2
2
|
import { Tag } from '@salty-css/core/types';
|
|
3
|
-
export declare const styledClient: (tagName: Tag<any>, className: string, generatorProps:
|
|
3
|
+
export declare const styledClient: (tagName: Tag<any>, className: string, generatorProps: StyledGeneratorClientProps) => import('react').ForwardRefExoticComponent<Omit<import('@salty-css/core/types').StyledComponentProps, "ref"> & import('react').RefAttributes<any>>;
|
package/styled-client.js
CHANGED
package/styled.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@salty-css/core/generators"),s=require("./element-factory-BPI0pGIH.cjs"),c=(t,r)=>{const e=new o.StyledGenerator(t,r),n=s.elementFactory(t,e.cssClassName,e.clientProps,{"data-unoptimized-client-component":!0});return Object.assign(n,{generator:e}),n};exports.styled=c;
|
package/styled.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AllHTMLAttributes, JSX, ReactNode } from 'react';
|
|
2
|
-
import { Tag, StyledComponentProps, CreateElementProps, VariantProps, ParentComponentProps, StyledParams, ValueProps } from '@salty-css/core/types';
|
|
3
|
-
export declare const styled: <const PROPS extends StyledComponentProps, const TAG extends Tag<Required<PROPS>>, const STYLE_PARAMS extends StyledParams>(tagName: TAG, params: STYLE_PARAMS) => ((props:
|
|
4
|
-
ref
|
|
5
|
-
} :
|
|
2
|
+
import { Tag, StyledComponentProps, CreateElementProps, VariantProps, ParentComponentProps, StyledParams, ValueProps, Merge } from '@salty-css/core/types';
|
|
3
|
+
export declare const styled: <const PROPS extends StyledComponentProps, const TAG extends Tag<Required<PROPS>>, const STYLE_PARAMS extends StyledParams>(tagName: TAG, params: STYLE_PARAMS) => ((props: CreateElementProps & (TAG extends string ? {
|
|
4
|
+
ref?: any;
|
|
5
|
+
} : object) & Merge<ParentComponentProps<TAG> | VariantProps<STYLE_PARAMS>> & ValueProps & Omit<TAG extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[TAG] : TAG extends string ? AllHTMLAttributes<HTMLElement> : object, keyof CreateElementProps>) => ReactNode) & string;
|
package/styled.js
CHANGED
|
@@ -1,74 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { e as g } from "./element-factory-Dupolv6C.js";
|
|
6
|
-
const y = (e) => Object.keys(e);
|
|
7
|
-
class d {
|
|
8
|
-
constructor(t, s) {
|
|
9
|
-
o(this, "_isProd");
|
|
10
|
-
o(this, "_callerName");
|
|
11
|
-
o(this, "_context");
|
|
12
|
-
this.tagName = t, this.params = s;
|
|
13
|
-
}
|
|
14
|
-
get hash() {
|
|
15
|
-
return l(this.params.base || this.params);
|
|
16
|
-
}
|
|
17
|
-
get priority() {
|
|
18
|
-
var t;
|
|
19
|
-
return typeof this.tagName == "function" || typeof this.tagName == "object" ? (((t = this.tagName.generator) == null ? void 0 : t.priority) || 0) + 1 : 0;
|
|
20
|
-
}
|
|
21
|
-
get classNames() {
|
|
22
|
-
const t = [this.hash], { className: s } = this.params;
|
|
23
|
-
return s && t.push(s), t.join(" ");
|
|
24
|
-
}
|
|
25
|
-
get cssClassName() {
|
|
26
|
-
return this.hash;
|
|
27
|
-
}
|
|
28
|
-
get cssDisplayNameVar() {
|
|
29
|
-
return `--${this.hash}-display-name: ${this._callerName};`;
|
|
30
|
-
}
|
|
31
|
-
get templateKeys() {
|
|
32
|
-
var t;
|
|
33
|
-
return (t = this._context) != null && t.config.templates ? y(this._context.config.templates) : [];
|
|
34
|
-
}
|
|
35
|
-
get css() {
|
|
36
|
-
var r;
|
|
37
|
-
const { base: t = {}, variants: s = {}, compoundVariants: a = [] } = this.params, i = { ...t, variants: s, compoundVariants: a };
|
|
38
|
-
return u(i, `.${this.cssClassName}`, this.priority, (r = this._context) == null ? void 0 : r.config);
|
|
39
|
-
}
|
|
40
|
-
get props() {
|
|
41
|
-
const { element: t } = this.params, s = this.params.variants ? Object.keys(this.params.variants).map((r) => {
|
|
42
|
-
var n;
|
|
43
|
-
const c = (n = this.params.defaultVariants) == null ? void 0 : n[r];
|
|
44
|
-
return c !== void 0 ? `${r}=${String(c)}` : r;
|
|
45
|
-
}) : void 0, a = /* @__PURE__ */ new Set([]), i = /\{props\.([\w\d]+)\}/gi.exec(JSON.stringify(this.params.base));
|
|
46
|
-
return i && i.forEach((r, c, n) => {
|
|
47
|
-
const p = n.at(1);
|
|
48
|
-
p && a.add(p);
|
|
49
|
-
}), {
|
|
50
|
-
element: t,
|
|
51
|
-
variantKeys: s,
|
|
52
|
-
propValueKeys: [...a],
|
|
53
|
-
attr: {
|
|
54
|
-
"data-component-name": this._isProd ? void 0 : this._callerName
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
_withBuildContext(t) {
|
|
59
|
-
this._context = t;
|
|
60
|
-
const { name: s, config: a, prod: i } = t;
|
|
61
|
-
return this._isProd = i, this._callerName = s, this;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
const v = (e, t) => {
|
|
65
|
-
const s = new d(e, t), a = g(e, s.cssClassName, s.props, {
|
|
1
|
+
import { StyledGenerator as r } from "@salty-css/core/generators";
|
|
2
|
+
import { e as s } from "./element-factory-D5vMsSwp.js";
|
|
3
|
+
const i = (t, o) => {
|
|
4
|
+
const e = new r(t, o), n = s(t, e.cssClassName, e.clientProps, {
|
|
66
5
|
"data-unoptimized-client-component": !0
|
|
67
6
|
});
|
|
68
|
-
return Object.assign(
|
|
69
|
-
generator:
|
|
70
|
-
}),
|
|
7
|
+
return Object.assign(n, {
|
|
8
|
+
generator: e
|
|
9
|
+
}), n;
|
|
71
10
|
};
|
|
72
11
|
export {
|
|
73
|
-
|
|
12
|
+
i as styled
|
|
74
13
|
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const K=require("react"),$=require("./parse-tokens-CRGUYhKC.cjs");function w(n){var s,e,t="";if(typeof n=="string"||typeof n=="number")t+=n;else if(typeof n=="object")if(Array.isArray(n)){var o=n.length;for(s=0;s<o;s++)n[s]&&(e=w(n[s]))&&(t&&(t+=" "),t+=e)}else for(e in n)n[e]&&(t&&(t+=" "),t+=e);return t}function N(){for(var n,s,e=0,t="",o=arguments.length;e<o;e++)(n=arguments[e])&&(s=w(n))&&(t&&(t+=" "),t+=s);return t}const q=["passVariantProps"],A=(n,s,e,t)=>{const o=({extend:l=n,element:S=e.element,className:O="",children:g,passVariantProps:d,_vks:f=new Set,...u},v)=>{const r={passVariantProps:d};e.attr&&Object.assign(r,e.attr),t&&Object.assign(r,t),u&&Object.assign(r,u);const b=new Set(O.split(" ")),y=typeof l=="function"||typeof l=="object",h=y&&"isStyled"in l,E=y?l:S||l;if(!E)throw new Error("No element provided");const m=r.style||{};r.style||(r.style=m),Object.entries(m).forEach(([i,c])=>{const{result:a}=$.parseValueTokens(c);m[i]=a}),e.propValueKeys&&e.propValueKeys.forEach(i=>{const c=`css-${i}`,a=u[c];if(a===void 0)return;const V=`--props-${$.dashCase(i)}`;m[V]=a,f&&f.add(c)}),e.variantKeys&&e.variantKeys.forEach(i=>{const[c,a]=i.split("=");u[c]!==void 0?(b.add(`${c}-${u[c]}`),f&&f.add(c)):a!==void 0&&b.add(`${c}-${a}`)}),f&&(!y||!h)?f.forEach(i=>{if(!d)return delete r[i];if(d!==!0&&!d.includes(i))return delete r[i]}):h&&Object.assign(r,{_vks:f}),h||q.forEach(i=>delete r[i]);const C=N(s,...b);return K.createElement(E,{element:y?S:void 0,className:C,ref:v,...r},g)},j=K.forwardRef(o);return Object.assign(j,{isStyled:!0,className:s,toString:()=>`.${s}`}),j};exports.elementFactory=A;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { forwardRef as v, createElement as C } from "react";
|
|
2
|
-
import { p as V, d as N } from "./parse-tokens-DAW55Na6.js";
|
|
3
|
-
function K(n) {
|
|
4
|
-
var s, e, t = "";
|
|
5
|
-
if (typeof n == "string" || typeof n == "number") t += n;
|
|
6
|
-
else if (typeof n == "object") if (Array.isArray(n)) {
|
|
7
|
-
var d = n.length;
|
|
8
|
-
for (s = 0; s < d; s++) n[s] && (e = K(n[s])) && (t && (t += " "), t += e);
|
|
9
|
-
} else for (e in n) n[e] && (t && (t += " "), t += e);
|
|
10
|
-
return t;
|
|
11
|
-
}
|
|
12
|
-
function A() {
|
|
13
|
-
for (var n, s, e = 0, t = "", d = arguments.length; e < d; e++) (n = arguments[e]) && (s = K(n)) && (t && (t += " "), t += s);
|
|
14
|
-
return t;
|
|
15
|
-
}
|
|
16
|
-
const R = ["passVariantProps"], x = (n, s, e, t) => {
|
|
17
|
-
const j = v(({
|
|
18
|
-
extend: c = n,
|
|
19
|
-
element: S = e.element,
|
|
20
|
-
className: $ = "",
|
|
21
|
-
children: w,
|
|
22
|
-
passVariantProps: u,
|
|
23
|
-
_vks: o = /* @__PURE__ */ new Set(),
|
|
24
|
-
...l
|
|
25
|
-
}, O) => {
|
|
26
|
-
const f = { passVariantProps: u };
|
|
27
|
-
e.attr && Object.assign(f, e.attr), t && Object.assign(f, t), l && Object.assign(f, l);
|
|
28
|
-
const b = new Set($.split(" ")), y = typeof c == "function" || typeof c == "object", h = y && "isStyled" in c, E = y ? c : S || c;
|
|
29
|
-
if (!E) throw new Error("No element provided");
|
|
30
|
-
const m = f.style || {};
|
|
31
|
-
f.style || (f.style = m), Object.entries(m).forEach(([i, r]) => {
|
|
32
|
-
const { result: a } = V(r);
|
|
33
|
-
m[i] = a;
|
|
34
|
-
}), e.propValueKeys && e.propValueKeys.forEach((i) => {
|
|
35
|
-
const r = `css-${i}`, a = l[r];
|
|
36
|
-
if (a === void 0) return;
|
|
37
|
-
const p = `--props-${N(i)}`;
|
|
38
|
-
m[p] = a, o && o.add(r);
|
|
39
|
-
}), e.variantKeys && e.variantKeys.forEach((i) => {
|
|
40
|
-
const [r, a] = i.split("=");
|
|
41
|
-
l[r] !== void 0 ? (b.add(`${r}-${l[r]}`), o && o.add(r)) : a !== void 0 && b.add(`${r}-${a}`);
|
|
42
|
-
}), o && (!y || !h) ? o.forEach((i) => {
|
|
43
|
-
if (!u) return delete f[i];
|
|
44
|
-
if (u !== !0 && !u.includes(i))
|
|
45
|
-
return delete f[i];
|
|
46
|
-
}) : h && Object.assign(f, { _vks: o }), h || R.forEach((i) => delete f[i]);
|
|
47
|
-
const g = A(s, ...b);
|
|
48
|
-
return C(
|
|
49
|
-
E,
|
|
50
|
-
{
|
|
51
|
-
element: y ? S : void 0,
|
|
52
|
-
className: g,
|
|
53
|
-
ref: O,
|
|
54
|
-
...f
|
|
55
|
-
},
|
|
56
|
-
w
|
|
57
|
-
);
|
|
58
|
-
});
|
|
59
|
-
return Object.assign(j, {
|
|
60
|
-
isStyled: !0,
|
|
61
|
-
className: s,
|
|
62
|
-
toString: () => `.${s}`
|
|
63
|
-
}), j;
|
|
64
|
-
};
|
|
65
|
-
export {
|
|
66
|
-
x as e
|
|
67
|
-
};
|