@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 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 { ClassNameFactory } from '@salty-css/core/css';
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: ClassNameFactory<STYLE_PARAMS>;
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
+ };
@@ -1,3 +1,3 @@
1
- import { GeneratorProps } from '@salty-css/core/generator';
2
1
  import { StyledComponentProps, Tag } from '@salty-css/core/types';
3
- export declare const elementFactory: (tagName: Tag<any>, _className: string, _generatorProps: GeneratorProps, _additionalProps?: Record<PropertyKey, any>) => import('react').ForwardRefExoticComponent<Omit<StyledComponentProps, "ref"> & import('react').RefAttributes<any>>;
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 o=require("./keyframes.cjs"),t=require("./media.cjs"),n=require("./class-name-DmDKHwBz.cjs"),u=r=>`{${r}}`,c=(...r)=>r.flat().reduce((a,e)=>e!=null&&e._current?{...a,...e._current}:{...a,...e},{});exports.keyframes=o.keyframes;exports.MediaQueryFactory=t.MediaQueryFactory;exports.media=t.media;exports.ClassNameFactory=n.ClassNameFactory;exports.mergeStyles=c;exports.token=u;
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 u } from "./keyframes.js";
2
- import { MediaQueryFactory as c, media as p } from "./media.js";
3
- import { C as d } from "./class-name-BOBdg_Ln.js";
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
- u as keyframes,
9
- p as media,
10
- a as mergeStyles,
11
- t as token
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.189",
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.189",
61
+ "@salty-css/core": "^0.0.1-alpha.190",
62
62
  "clsx": ">=2.x",
63
63
  "react": ">=19.x || >=18.3.x"
64
64
  }
@@ -1,3 +1,3 @@
1
- import { GeneratorProps } from '@salty-css/core/generator';
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: GeneratorProps) => import('react').ForwardRefExoticComponent<Omit<import('@salty-css/core/types').StyledComponentProps, "ref"> & import('react').RefAttributes<any>>;
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";var y=Object.defineProperty;var f=(e,t,s)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var c=(e,t,s)=>f(e,typeof t!="symbol"?t+"":t,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./parse-styles-JzVmxd-u.cjs"),g=require("./parse-tokens-p68muVgG.cjs"),N=require("./element-factory-D4kpeFoW.cjs"),_=e=>Object.keys(e);class b{constructor(t,s){c(this,"_isProd");c(this,"_callerName");c(this,"_context");this.tagName=t,this.params=s}get hash(){return u.toHash(this.params.base||this.params)}get priority(){var t;return typeof this.tagName=="function"||typeof this.tagName=="object"?(((t=this.tagName.generator)==null?void 0:t.priority)||0)+1:0}get classNames(){const t=[this.hash],{className:s}=this.params;return typeof s=="string"&&t.push(s),typeof s=="object"&&t.push(...s),t.join(" ")}get cssClassName(){return this.hash}get cssDisplayNameVar(){return`--${this.hash}-display-name: ${this._callerName};`}get cssFileName(){return this._callerName?`c_${g.dashCase(this._callerName)}-${this.hash}-${this.priority}.css`:`${this.hash}-${this.priority}.css`}get templateKeys(){var t;return(t=this._context)!=null&&t.config.templates?_(this._context.config.templates):[]}get css(){var n;const{base:t={},variants:s={},compoundVariants:r=[]}=this.params,i={...t,variants:s,compoundVariants:r};return u.parseStyles(i,`.${this.cssClassName}`,(n=this._context)==null?void 0:n.config)}get props(){const{element:t,variants:s={},compoundVariants:r=[],defaultVariants:i={},defaultProps:p={},passProps:n}=this.params,h=new Set([]),l=a=>{const o=i[a];o!==void 0?h.add(`${a}=${String(o)}`):h.add(a)};Object.keys(s).forEach(l),r.map(a=>Object.keys(a).forEach(l));const m=new Set([]);if(this.params.base){const a=JSON.stringify(this.params.base).match(/\{props\.([\w\d]+)\}/gi);a&&a.forEach(o=>{const d=o.replace(/\{props\.([\w\d]+)\}/gi,"$1");d&&m.add(d)})}return{element:t,variantKeys:[...h],propValueKeys:[...m],passProps:n,defaultProps:p,attr:{"data-component-name":this._isProd?void 0:this._callerName}}}_withBuildContext(t){this._context=t;const{name:s,config:r,prod:i}=t;return this._isProd=i,this._callerName=s,this}}const $=(e,t)=>{const s=new b(e,t),r=N.elementFactory(e,s.cssClassName,s.props,{"data-unoptimized-client-component":!0});return Object.assign(r,{generator:s}),r};exports.styled=$;
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
- var u = Object.defineProperty;
2
- var f = (e, t, s) => t in e ? u(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
- var c = (e, t, s) => f(e, typeof t != "symbol" ? t + "" : t, s);
4
- import { t as y, p as g } from "./parse-styles-lB6EJuGj.js";
5
- import { d as N } from "./parse-tokens-YUi047xd.js";
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 t;
20
- return typeof this.tagName == "function" || typeof this.tagName == "object" ? (((t = this.tagName.generator) == null ? void 0 : t.priority) || 0) + 1 : 0;
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 cssFileName() {
33
- return this._callerName ? `c_${N(this._callerName)}-${this.hash}-${this.priority}.css` : `${this.hash}-${this.priority}.css`;
34
- }
35
- get templateKeys() {
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(s).forEach(m), r.map((a) => Object.keys(a).forEach(m));
50
- const l = /* @__PURE__ */ new Set([]);
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((o) => {
54
- const d = o.replace(/\{props\.([\w\d]+)\}/gi, "$1");
55
- d && l.add(d);
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: t,
60
- variantKeys: [...h],
61
- propValueKeys: [...l],
62
- passProps: n,
63
- defaultProps: p,
26
+ element: e,
27
+ variantKeys: [...o],
28
+ propValueKeys: [...c],
29
+ passProps: f,
30
+ defaultProps: l,
64
31
  attr: {
65
- "data-component-name": this._isProd ? void 0 : this._callerName
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 S = (e, t) => {
76
- const s = new $(e, t), r = _(e, s.cssClassName, s.props, {
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(r, {
80
- generator: s
81
- }), r;
41
+ return Object.assign(s, {
42
+ generator: t
43
+ }), s;
82
44
  };
83
45
  export {
84
- S as styled
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
+ };
@@ -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
- };
@@ -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
- };