@salty-css/react 0.0.1-alpha.252 → 0.0.1-alpha.254

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 CHANGED
@@ -242,7 +242,7 @@ Example usage:
242
242
  styled('span', {
243
243
  base: {
244
244
  // Use of static font family variable
245
- fontFamily: '{colors.fontFamily.heading}',
245
+ fontFamily: '{fontFamily.heading}',
246
246
  // Use of responsive font size variable
247
247
  fontSize: '{fontSize.heading.regular}',
248
248
  // Use of conditional theme text color variable
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=t=>{const e=new String(t);return Object.assign(e,{get isClassName(){return!0}}),e};exports.className=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=t=>{const s=new String(t);return Object.assign(s,{get isClassName(){return!0},variant:(n,r)=>{const a=`${n}-${r}`,c=`${t} ${a}`;return e(c)}}),s};exports.className=e;
@@ -1,3 +1,7 @@
1
- export declare const className: (className: string) => string & {
1
+ interface ClassNameMethods {
2
2
  isClassName: boolean;
3
- };
3
+ variant: (name: string, value: string) => string & ClassNameFunction;
4
+ }
5
+ type ClassNameFunction = string & ClassNameMethods;
6
+ export declare const className: (classNameStr: string) => ClassNameFunction;
7
+ export {};
@@ -1,11 +1,15 @@
1
- const e = (t) => {
2
- const s = new String(t);
3
- return Object.assign(s, {
1
+ const c = (s) => {
2
+ const t = new String(s);
3
+ return Object.assign(t, {
4
4
  get isClassName() {
5
5
  return !0;
6
+ },
7
+ variant: (n, r) => {
8
+ const e = `${n}-${r}`, a = `${s} ${e}`;
9
+ return c(a);
6
10
  }
7
- }), s;
11
+ }), t;
8
12
  };
9
13
  export {
10
- e as className
14
+ c as className
11
15
  };
package/class-name.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./styles-generator-BYrIpvu6.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},generator:e}),t};exports.className=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./styles-generator-BYrIpvu6.cjs");class u extends i.StylesGenerator{constructor(s){super(s),this._params=s}}const m=t=>{const s=new u(t),r=a=>{const e=new String(a);return Object.assign(e,{get isClassName(){return!0},variant:(n,c)=>{const o=`${n}-${c}`,l=`${e} ${o}`;return r(l)},generator:s}),e};return r(s.cssClassName)};exports.className=m;
package/class-name.d.ts CHANGED
@@ -1,6 +1,10 @@
1
1
  import { StyledParams } from '@salty-css/core/types';
2
2
  import { ClassNameGenerator } from '@salty-css/core/generators';
3
- export declare const className: <const STYLE_PARAMS extends StyledParams>(params: STYLE_PARAMS) => string & {
4
- isClassName: boolean;
3
+ interface ClassNameMethods<STYLE_PARAMS extends StyledParams> {
5
4
  generator: ClassNameGenerator<STYLE_PARAMS>;
6
- };
5
+ isClassName: boolean;
6
+ variant: (name: string, value: string) => string & ClassNameFunction<STYLE_PARAMS>;
7
+ }
8
+ type ClassNameFunction<STYLE_PARAMS extends StyledParams> = string & ClassNameMethods<STYLE_PARAMS>;
9
+ export declare const className: <const STYLE_PARAMS extends StyledParams>(params: STYLE_PARAMS) => ClassNameFunction<STYLE_PARAMS>;
10
+ export {};
package/class-name.js CHANGED
@@ -1,18 +1,25 @@
1
- import { S as r } from "./styles-generator-CwRnWDqg.js";
2
- class a extends r {
1
+ import { S as i } from "./styles-generator-CwRnWDqg.js";
2
+ class m extends i {
3
3
  constructor(s) {
4
4
  super(s), this._params = s;
5
5
  }
6
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
- generator: s
14
- }), t;
7
+ const C = (e) => {
8
+ const s = new m(e), r = (a) => {
9
+ const t = new String(a);
10
+ return Object.assign(t, {
11
+ get isClassName() {
12
+ return !0;
13
+ },
14
+ variant: (n, o) => {
15
+ const c = `${n}-${o}`, l = `${t} ${c}`;
16
+ return r(l);
17
+ },
18
+ generator: s
19
+ }), t;
20
+ };
21
+ return r(s.cssClassName);
15
22
  };
16
23
  export {
17
- o as className
24
+ C as className
18
25
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salty-css/react",
3
- "version": "0.0.1-alpha.252",
3
+ "version": "0.0.1-alpha.254",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "typings": "./dist/index.d.ts",
@@ -66,7 +66,7 @@
66
66
  }
67
67
  },
68
68
  "dependencies": {
69
- "@salty-css/core": "^0.0.1-alpha.252",
69
+ "@salty-css/core": "^0.0.1-alpha.254",
70
70
  "clsx": ">=2.x",
71
71
  "react": ">=19.x || >=18.3.x"
72
72
  }