@salty-css/react 0.0.1-alpha.189 → 0.0.1-alpha.190
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/class-name.cjs +1 -0
- package/class-name.d.ts +2 -2
- package/class-name.js +18 -0
- package/element-factory.d.ts +2 -2
- package/index.cjs +1 -1
- package/index.js +7 -9
- package/package.json +2 -2
- package/styled-client.d.ts +2 -2
- package/styled.cjs +1 -1
- package/styled.js +28 -66
- package/styles-generator-CvvtKU2d.cjs +1 -0
- package/styles-generator-DvUWzifu.js +35 -0
- package/class-name-BOBdg_Ln.js +0 -36
- package/class-name-DmDKHwBz.cjs +0 -1
- package/className.cjs +0 -1
- package/className.js +0 -13
package/class-name.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./styles-generator-CvvtKU2d.cjs");class a extends r.StylesGenerator{constructor(e){super(e),this._params=e}}const n=s=>{const e=new a(s),t=new String(e.cssClassName);return Object.assign(t,{get isClassName(){return!0},factory:e}),t};exports.className=n;
|
package/class-name.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StyledParams } from '@salty-css/core/types';
|
|
2
|
-
import {
|
|
2
|
+
import { ClassNameGenerator } from '@salty-css/core/generators';
|
|
3
3
|
export declare const className: <const STYLE_PARAMS extends StyledParams>(params: STYLE_PARAMS) => string & {
|
|
4
4
|
isClassName: boolean;
|
|
5
|
-
factory:
|
|
5
|
+
factory: ClassNameGenerator<STYLE_PARAMS>;
|
|
6
6
|
};
|
package/class-name.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { S as r } from "./styles-generator-DvUWzifu.js";
|
|
2
|
+
class a extends r {
|
|
3
|
+
constructor(s) {
|
|
4
|
+
super(s), this._params = s;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
const o = (e) => {
|
|
8
|
+
const s = new a(e), t = new String(s.cssClassName);
|
|
9
|
+
return Object.assign(t, {
|
|
10
|
+
get isClassName() {
|
|
11
|
+
return !0;
|
|
12
|
+
},
|
|
13
|
+
factory: s
|
|
14
|
+
}), t;
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
o as className
|
|
18
|
+
};
|
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/index.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("./keyframes.cjs"),n=require("./media.cjs"),a=r=>`{${r}}`,o=(...r)=>r.flat().reduce((t,e)=>e!=null&&e._current?{...t,...e._current}:{...t,...e},{});exports.keyframes=u.keyframes;exports.MediaQueryFactory=n.MediaQueryFactory;exports.media=n.media;exports.mergeStyles=o;exports.token=a;
|
package/index.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { keyframes as
|
|
2
|
-
import { MediaQueryFactory as c, media as
|
|
3
|
-
|
|
4
|
-
const t = (e) => `{${e}}`, a = (...e) => e.flat().reduce((o, r) => r != null && r._current ? { ...o, ...r._current } : { ...o, ...r }, {});
|
|
1
|
+
import { keyframes as m } from "./keyframes.js";
|
|
2
|
+
import { MediaQueryFactory as c, media as d } from "./media.js";
|
|
3
|
+
const n = (e) => `{${e}}`, t = (...e) => e.flat().reduce((o, r) => r != null && r._current ? { ...o, ...r._current } : { ...o, ...r }, {});
|
|
5
4
|
export {
|
|
6
|
-
d as ClassNameFactory,
|
|
7
5
|
c as MediaQueryFactory,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
m as keyframes,
|
|
7
|
+
d as media,
|
|
8
|
+
t as mergeStyles,
|
|
9
|
+
n as token
|
|
12
10
|
};
|
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.190",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"typings": "./dist/index.d.ts",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@salty-css/core": "^0.0.1-alpha.
|
|
61
|
+
"@salty-css/core": "^0.0.1-alpha.190",
|
|
62
62
|
"clsx": ">=2.x",
|
|
63
63
|
"react": ">=19.x || >=18.3.x"
|
|
64
64
|
}
|
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.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./styles-generator-CvvtKU2d.cjs"),g=require("./element-factory-D4kpeFoW.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;
|
package/styled.js
CHANGED
|
@@ -1,85 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { e as _ } from "./element-factory-C7JVLDq7.js";
|
|
7
|
-
const b = (e) => Object.keys(e);
|
|
8
|
-
class $ {
|
|
9
|
-
constructor(t, s) {
|
|
10
|
-
c(this, "_isProd");
|
|
11
|
-
c(this, "_callerName");
|
|
12
|
-
c(this, "_context");
|
|
13
|
-
this.tagName = t, this.params = s;
|
|
14
|
-
}
|
|
15
|
-
get hash() {
|
|
16
|
-
return y(this.params.base || this.params);
|
|
1
|
+
import { S as y } from "./styles-generator-DvUWzifu.js";
|
|
2
|
+
import { e as h } from "./element-factory-C7JVLDq7.js";
|
|
3
|
+
class g extends y {
|
|
4
|
+
constructor(e, t) {
|
|
5
|
+
super(t), this.tagName = e, this._params = t;
|
|
17
6
|
}
|
|
18
7
|
get priority() {
|
|
19
|
-
var
|
|
20
|
-
return typeof this.tagName == "function" || typeof this.tagName == "object" ? (((
|
|
21
|
-
}
|
|
22
|
-
get classNames() {
|
|
23
|
-
const t = [this.hash], { className: s } = this.params;
|
|
24
|
-
return typeof s == "string" && t.push(s), typeof s == "object" && t.push(...s), t.join(" ");
|
|
25
|
-
}
|
|
26
|
-
get cssClassName() {
|
|
27
|
-
return this.hash;
|
|
28
|
-
}
|
|
29
|
-
get cssDisplayNameVar() {
|
|
30
|
-
return `--${this.hash}-display-name: ${this._callerName};`;
|
|
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;
|
|
31
10
|
}
|
|
32
|
-
get
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var t;
|
|
37
|
-
return (t = this._context) != null && t.config.templates ? b(this._context.config.templates) : [];
|
|
38
|
-
}
|
|
39
|
-
get css() {
|
|
40
|
-
var n;
|
|
41
|
-
const { base: t = {}, variants: s = {}, compoundVariants: r = [] } = this.params, i = { ...t, variants: s, compoundVariants: r };
|
|
42
|
-
return g(i, `.${this.cssClassName}`, (n = this._context) == null ? void 0 : n.config);
|
|
43
|
-
}
|
|
44
|
-
get props() {
|
|
45
|
-
const { element: t, variants: s = {}, compoundVariants: r = [], defaultVariants: i = {}, defaultProps: p = {}, passProps: n } = this.params, h = /* @__PURE__ */ new Set([]), m = (a) => {
|
|
46
|
-
const o = i[a];
|
|
47
|
-
o !== void 0 ? h.add(`${a}=${String(o)}`) : h.add(a);
|
|
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);
|
|
48
15
|
};
|
|
49
|
-
Object.keys(
|
|
50
|
-
const
|
|
16
|
+
Object.keys(t).forEach(i), s.map((a) => Object.keys(a).forEach(i));
|
|
17
|
+
const c = /* @__PURE__ */ new Set([]);
|
|
51
18
|
if (this.params.base) {
|
|
52
19
|
const a = JSON.stringify(this.params.base).match(/\{props\.([\w\d]+)\}/gi);
|
|
53
|
-
a && a.forEach((
|
|
54
|
-
const
|
|
55
|
-
|
|
20
|
+
a && a.forEach((r) => {
|
|
21
|
+
const p = r.replace(/\{props\.([\w\d]+)\}/gi, "$1");
|
|
22
|
+
p && c.add(p);
|
|
56
23
|
});
|
|
57
24
|
}
|
|
58
25
|
return {
|
|
59
|
-
element:
|
|
60
|
-
variantKeys: [...
|
|
61
|
-
propValueKeys: [...
|
|
62
|
-
passProps:
|
|
63
|
-
defaultProps:
|
|
26
|
+
element: e,
|
|
27
|
+
variantKeys: [...o],
|
|
28
|
+
propValueKeys: [...c],
|
|
29
|
+
passProps: f,
|
|
30
|
+
defaultProps: l,
|
|
64
31
|
attr: {
|
|
65
|
-
"data-component-name":
|
|
32
|
+
"data-component-name": u ? void 0 : m
|
|
66
33
|
}
|
|
67
34
|
};
|
|
68
35
|
}
|
|
69
|
-
_withBuildContext(t) {
|
|
70
|
-
this._context = t;
|
|
71
|
-
const { name: s, config: r, prod: i } = t;
|
|
72
|
-
return this._isProd = i, this._callerName = s, this;
|
|
73
|
-
}
|
|
74
36
|
}
|
|
75
|
-
const
|
|
76
|
-
const
|
|
37
|
+
const v = (n, e) => {
|
|
38
|
+
const t = new g(n, e), s = h(n, t.cssClassName, t.clientProps, {
|
|
77
39
|
"data-unoptimized-client-component": !0
|
|
78
40
|
});
|
|
79
|
-
return Object.assign(
|
|
80
|
-
generator:
|
|
81
|
-
}),
|
|
41
|
+
return Object.assign(s, {
|
|
42
|
+
generator: t
|
|
43
|
+
}), s;
|
|
82
44
|
};
|
|
83
45
|
export {
|
|
84
|
-
|
|
46
|
+
v as styled
|
|
85
47
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var h=Object.defineProperty;var o=(e,s,t)=>s in e?h(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t;var a=(e,s,t)=>o(e,typeof s!="symbol"?s+"":s,t);const r=require("./parse-styles-JzVmxd-u.cjs"),l=require("./parse-tokens-p68muVgG.cjs");class u{constructor(s){a(this,"buildContext",{});this.params=s}get hash(){return r.toHash(this.params.base||this.params)}get cssClassName(){return this.hash}get classNames(){const s=[this.hash],{className:t}=this.params;return typeof t=="string"&&s.push(t),typeof t=="object"&&s.push(...t),s.join(" ")}get cssFileName(){const{callerName:s}=this.buildContext;return s?`cl_${l.dashCase(s)}-${this.hash}.css`:`${this.hash}.css`}get css(){const{base:s={},variants:t={},compoundVariants:i=[]}=this.params,{config:n}=this.buildContext,c={...s,variants:t,compoundVariants:i};return r.parseStyles(c,`.${this.cssClassName}`,n)}_withBuildContext(s){return this.buildContext=s,this}}exports.StylesGenerator=u;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var o = Object.defineProperty;
|
|
2
|
+
var n = (a, s, t) => s in a ? o(a, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[s] = t;
|
|
3
|
+
var e = (a, s, t) => n(a, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
+
import { t as c, p as l } from "./parse-styles-lB6EJuGj.js";
|
|
5
|
+
import { d as m } from "./parse-tokens-YUi047xd.js";
|
|
6
|
+
class f {
|
|
7
|
+
constructor(s) {
|
|
8
|
+
e(this, "buildContext", {});
|
|
9
|
+
this.params = s;
|
|
10
|
+
}
|
|
11
|
+
get hash() {
|
|
12
|
+
return c(this.params.base || this.params);
|
|
13
|
+
}
|
|
14
|
+
get cssClassName() {
|
|
15
|
+
return this.hash;
|
|
16
|
+
}
|
|
17
|
+
get classNames() {
|
|
18
|
+
const s = [this.hash], { className: t } = this.params;
|
|
19
|
+
return typeof t == "string" && s.push(t), typeof t == "object" && s.push(...t), s.join(" ");
|
|
20
|
+
}
|
|
21
|
+
get cssFileName() {
|
|
22
|
+
const { callerName: s } = this.buildContext;
|
|
23
|
+
return s ? `cl_${m(s)}-${this.hash}.css` : `${this.hash}.css`;
|
|
24
|
+
}
|
|
25
|
+
get css() {
|
|
26
|
+
const { base: s = {}, variants: t = {}, compoundVariants: r = [] } = this.params, { config: i } = this.buildContext, h = { ...s, variants: t, compoundVariants: r };
|
|
27
|
+
return l(h, `.${this.cssClassName}`, i);
|
|
28
|
+
}
|
|
29
|
+
_withBuildContext(s) {
|
|
30
|
+
return this.buildContext = s, this;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
f as S
|
|
35
|
+
};
|
package/class-name-BOBdg_Ln.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
var i = Object.defineProperty;
|
|
2
|
-
var c = (t, s, a) => s in t ? i(t, s, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[s] = a;
|
|
3
|
-
var r = (t, s, a) => c(t, typeof s != "symbol" ? s + "" : s, a);
|
|
4
|
-
import { t as o, p as m } from "./parse-styles-lB6EJuGj.js";
|
|
5
|
-
import { d as n } from "./parse-tokens-YUi047xd.js";
|
|
6
|
-
class N {
|
|
7
|
-
constructor(s) {
|
|
8
|
-
r(this, "_isProd");
|
|
9
|
-
r(this, "_callerName");
|
|
10
|
-
this.params = s;
|
|
11
|
-
}
|
|
12
|
-
get hash() {
|
|
13
|
-
return o(this.params.base || this.params);
|
|
14
|
-
}
|
|
15
|
-
get cssClassName() {
|
|
16
|
-
return this.hash;
|
|
17
|
-
}
|
|
18
|
-
get classNames() {
|
|
19
|
-
const s = [this.hash], { className: a } = this.params;
|
|
20
|
-
return a && s.push(a), s.join(" ");
|
|
21
|
-
}
|
|
22
|
-
get cssFileName() {
|
|
23
|
-
return this._callerName ? `cl_${n(this._callerName)}-${this.hash}.css` : `${this.hash}.css`;
|
|
24
|
-
}
|
|
25
|
-
get css() {
|
|
26
|
-
const { base: s = {}, variants: a = {}, compoundVariants: e = [] } = this.params, h = { ...s, variants: a, compoundVariants: e };
|
|
27
|
-
return m(h, `.${this.cssClassName}`);
|
|
28
|
-
}
|
|
29
|
-
_withBuildContext(s) {
|
|
30
|
-
const { name: a, prod: e } = s;
|
|
31
|
-
return this._isProd = e, this._callerName = a, this;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
export {
|
|
35
|
-
N as C
|
|
36
|
-
};
|
package/class-name-DmDKHwBz.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var i=Object.defineProperty;var n=(e,s,a)=>s in e?i(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a;var r=(e,s,a)=>n(e,typeof s!="symbol"?s+"":s,a);const c=require("./parse-styles-JzVmxd-u.cjs"),o=require("./parse-tokens-p68muVgG.cjs");class l{constructor(s){r(this,"_isProd");r(this,"_callerName");this.params=s}get hash(){return c.toHash(this.params.base||this.params)}get cssClassName(){return this.hash}get classNames(){const s=[this.hash],{className:a}=this.params;return a&&s.push(a),s.join(" ")}get cssFileName(){return this._callerName?`cl_${o.dashCase(this._callerName)}-${this.hash}.css`:`${this.hash}.css`}get css(){const{base:s={},variants:a={},compoundVariants:t=[]}=this.params,h={...s,variants:a,compoundVariants:t};return c.parseStyles(h,`.${this.cssClassName}`)}_withBuildContext(s){const{name:a,prod:t}=s;return this._isProd=t,this._callerName=a,this}}exports.ClassNameFactory=l;
|
package/className.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./class-name-DmDKHwBz.cjs"),r=t=>{const s=new a.ClassNameFactory(t),e=new String(s.cssClassName);return Object.assign(e,{get isClassName(){return!0},factory:s}),e};exports.className=r;
|
package/className.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { C as e } from "./class-name-BOBdg_Ln.js";
|
|
2
|
-
const n = (a) => {
|
|
3
|
-
const s = new e(a), t = new String(s.cssClassName);
|
|
4
|
-
return Object.assign(t, {
|
|
5
|
-
get isClassName() {
|
|
6
|
-
return !0;
|
|
7
|
-
},
|
|
8
|
-
factory: s
|
|
9
|
-
}), t;
|
|
10
|
-
};
|
|
11
|
-
export {
|
|
12
|
-
n as className
|
|
13
|
-
};
|