@salty-css/react 0.2.0 → 0.2.2-refactor-vite-8.4

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.
Files changed (81) hide show
  1. package/README.md +24 -24
  2. package/dist/class-name-client.cjs +1 -0
  3. package/{class-name-client.d.ts → dist/class-name-client.d.ts} +1 -0
  4. package/dist/class-name-client.d.ts.map +1 -0
  5. package/dist/class-name-client.js +12 -0
  6. package/dist/class-name.cjs +1 -0
  7. package/{class-name.d.ts → dist/class-name.d.ts} +3 -2
  8. package/dist/class-name.d.ts.map +1 -0
  9. package/dist/class-name.js +17 -0
  10. package/dist/config.cjs +1 -0
  11. package/dist/config.d.ts +2 -0
  12. package/dist/config.d.ts.map +1 -0
  13. package/dist/element-factory-Bz7Aq422.js +56 -0
  14. package/dist/element-factory-DjX4Quuc.cjs +1 -0
  15. package/{element-factory.d.ts → dist/element-factory.d.ts} +3 -2
  16. package/dist/element-factory.d.ts.map +1 -0
  17. package/dist/factories.cjs +1 -0
  18. package/dist/factories.d.ts +2 -0
  19. package/dist/factories.d.ts.map +1 -0
  20. package/dist/helpers.cjs +1 -0
  21. package/dist/helpers.d.ts +2 -0
  22. package/dist/helpers.d.ts.map +1 -0
  23. package/dist/index.cjs +1 -0
  24. package/dist/index.d.ts +2 -0
  25. package/dist/index.d.ts.map +1 -0
  26. package/dist/keyframes.cjs +1 -0
  27. package/dist/keyframes.d.ts +2 -0
  28. package/dist/keyframes.d.ts.map +1 -0
  29. package/dist/media.cjs +1 -0
  30. package/dist/media.d.ts +2 -0
  31. package/dist/media.d.ts.map +1 -0
  32. package/dist/runtime.cjs +1 -0
  33. package/dist/runtime.d.ts +2 -0
  34. package/dist/runtime.d.ts.map +1 -0
  35. package/dist/styled-client.cjs +1 -0
  36. package/dist/styled-client.d.ts +4 -0
  37. package/dist/styled-client.d.ts.map +1 -0
  38. package/dist/styled-client.js +5 -0
  39. package/dist/styled.cjs +1 -0
  40. package/{styled.d.ts → dist/styled.d.ts} +3 -2
  41. package/dist/styled.d.ts.map +1 -0
  42. package/dist/styled.js +9 -0
  43. package/dist/transform-salty-file.cjs +1 -0
  44. package/{transform-salty-file.d.ts → dist/transform-salty-file.d.ts} +2 -1
  45. package/dist/transform-salty-file.d.ts.map +1 -0
  46. package/dist/transform-salty-file.js +42 -0
  47. package/package.json +52 -46
  48. package/class-name-client.cjs +0 -1
  49. package/class-name-client.js +0 -15
  50. package/class-name.cjs +0 -1
  51. package/class-name.js +0 -20
  52. package/config.cjs +0 -1
  53. package/config.d.ts +0 -1
  54. package/element-factory-13FoC0gV.cjs +0 -1
  55. package/element-factory-Dse2ZLfl.js +0 -69
  56. package/factories.cjs +0 -1
  57. package/factories.d.ts +0 -1
  58. package/helpers.cjs +0 -1
  59. package/helpers.d.ts +0 -1
  60. package/index.cjs +0 -1
  61. package/index.d.ts +0 -1
  62. package/keyframes.cjs +0 -1
  63. package/keyframes.d.ts +0 -1
  64. package/media.cjs +0 -1
  65. package/media.d.ts +0 -1
  66. package/runtime.cjs +0 -1
  67. package/runtime.d.ts +0 -1
  68. package/styled-client.cjs +0 -1
  69. package/styled-client.d.ts +0 -3
  70. package/styled-client.js +0 -5
  71. package/styled.cjs +0 -1
  72. package/styled.js +0 -13
  73. package/transform-salty-file.cjs +0 -2
  74. package/transform-salty-file.js +0 -42
  75. /package/{config.js → dist/config.js} +0 -0
  76. /package/{factories.js → dist/factories.js} +0 -0
  77. /package/{helpers.js → dist/helpers.js} +0 -0
  78. /package/{index.js → dist/index.js} +0 -0
  79. /package/{keyframes.js → dist/keyframes.js} +0 -0
  80. /package/{media.js → dist/media.js} +0 -0
  81. /package/{runtime.js → dist/runtime.js} +0 -0
package/README.md CHANGED
@@ -79,29 +79,29 @@ Full reference → [salty-css.dev/docs/eslint](https://salty-css.dev/docs/eslint
79
79
 
80
80
  ## API index
81
81
 
82
- | Symbol | Import | One-liner | Docs |
83
- | ----------------------------------------------- | ------------------------------ | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
84
- | [`styled`](#styled) | `@salty-css/react/styled` | React component factory with variants & extension. | [api/styled](https://salty-css.dev/docs/api/styled) |
85
- | [`className`](#classname) | `@salty-css/react/class-name` | CSS class string with `.variant()` chaining. | [api/classname](https://salty-css.dev/docs/api/classname) |
86
- | [Variants](#variants) | — | `variants`, `compoundVariants`, `anyOfVariants`, `defaultVariants` semantics. | [variants](https://salty-css.dev/docs/variants) |
87
- | [Overrides](#overrides) | — | Extend components, swap element, override per-instance via `style`. | [overrides](https://salty-css.dev/docs/overrides) |
88
- | [ESLint plugin](#eslint) | `@salty-css/eslint-config-core` | Two rules: enforce `export` and correct `variants` placement on Salty files. | [eslint](https://salty-css.dev/docs/eslint) |
89
- | [`defineConfig`](#defineconfig) | `@salty-css/core/config` | Top-level project config. | [api/config](https://salty-css.dev/docs/api/config) |
90
- | [`defineVariables`](#definevariables) | `@salty-css/core/factories` | Static, responsive, and conditional CSS variables (tokens). | [variables](https://salty-css.dev/docs/variables) |
91
- | [Theming](#theming) | — | `data-theme` switcher built on conditional variables. | [theming](https://salty-css.dev/docs/theming) |
92
- | [`defineGlobalStyles`](#defineglobalstyles) | `@salty-css/core/factories` | Global rules (`html`, `body`, etc.). | [api/define-factories](https://salty-css.dev/docs/api/define-factories) |
93
- | [`defineMediaQuery`](#definemediaquery) | `@salty-css/core/factories` | Named, reusable media queries. | [media-queries](https://salty-css.dev/docs/media-queries) |
94
- | [`defineTemplates`](#definetemplates) | `@salty-css/core/factories` | Reusable style bundles, optionally with variants. | [templates](https://salty-css.dev/docs/templates) |
95
- | [`defineFont`](#definefont) | `@salty-css/core/factories` | `@font-face` (or `@import`) + CSS variable in one. | [fonts](https://salty-css.dev/docs/fonts) |
96
- | [`defineImport`](#defineimport) | `@salty-css/core/factories` | Pull external CSS into Salty's `imports` layer. | [imports](https://salty-css.dev/docs/imports) |
97
- | [`keyframes`](#keyframes) | `@salty-css/react/keyframes` | Typed `@keyframes` with params and initial-state injection. | [animations](https://salty-css.dev/docs/animations) |
98
- | [`defineViewportClamp`](#defineviewportclamp) | `@salty-css/core/helpers` | Fluid `clamp()` values that scale with the viewport. | [viewport-clamp](https://salty-css.dev/docs/viewport-clamp) |
99
- | [`color`](#color) | `@salty-css/core/helpers` | Color manipulation (`alpha`, `darken`, …). | [color-function](https://salty-css.dev/docs/color-function) |
100
- | [Modifiers](#modifiers) | (on `defineConfig`) | Custom value transformers, e.g. `'space:3'` → `'12px'`. | [modifiers](https://salty-css.dev/docs/modifiers) |
101
- | [`withSaltyCss`](#withsaltycss-nextjs) | `@salty-css/next` | Next.js config wrapper (Webpack + Turbopack). | [installation](https://salty-css.dev/docs/installation) |
102
- | [`saltyPlugin` (Vite)](#saltyplugin-vite) | `@salty-css/vite` | Vite plugin. | [installation](https://salty-css.dev/docs/installation) |
103
- | [`saltyPlugin` (Webpack)](#saltyplugin-webpack) | `@salty-css/webpack` | Webpack loader + plugin. | [installation](https://salty-css.dev/docs/installation) |
104
- | [`saltyIntegration`](#saltyintegration-astro) | `@salty-css/astro/integration` | Astro integration. | [installation](https://salty-css.dev/docs/installation) |
82
+ | Symbol | Import | One-liner | Docs |
83
+ | ----------------------------------------------- | ------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
84
+ | [`styled`](#styled) | `@salty-css/react/styled` | React component factory with variants & extension. | [api/styled](https://salty-css.dev/docs/api/styled) |
85
+ | [`className`](#classname) | `@salty-css/react/class-name` | CSS class string with `.variant()` chaining. | [api/classname](https://salty-css.dev/docs/api/classname) |
86
+ | [Variants](#variants) | — | `variants`, `compoundVariants`, `anyOfVariants`, `defaultVariants` semantics. | [variants](https://salty-css.dev/docs/variants) |
87
+ | [Overrides](#overrides) | — | Extend components, swap element, override per-instance via `style`. | [overrides](https://salty-css.dev/docs/overrides) |
88
+ | [ESLint plugin](#eslint) | `@salty-css/eslint-config-core` | Two rules: enforce `export` and correct `variants` placement on Salty files. | [eslint](https://salty-css.dev/docs/eslint) |
89
+ | [`defineConfig`](#defineconfig) | `@salty-css/core/config` | Top-level project config. | [api/config](https://salty-css.dev/docs/api/config) |
90
+ | [`defineVariables`](#definevariables) | `@salty-css/core/factories` | Static, responsive, and conditional CSS variables (tokens). | [variables](https://salty-css.dev/docs/variables) |
91
+ | [Theming](#theming) | — | `data-theme` switcher built on conditional variables. | [theming](https://salty-css.dev/docs/theming) |
92
+ | [`defineGlobalStyles`](#defineglobalstyles) | `@salty-css/core/factories` | Global rules (`html`, `body`, etc.). | [api/define-factories](https://salty-css.dev/docs/api/define-factories) |
93
+ | [`defineMediaQuery`](#definemediaquery) | `@salty-css/core/factories` | Named, reusable media queries. | [media-queries](https://salty-css.dev/docs/media-queries) |
94
+ | [`defineTemplates`](#definetemplates) | `@salty-css/core/factories` | Reusable style bundles, optionally with variants. | [templates](https://salty-css.dev/docs/templates) |
95
+ | [`defineFont`](#definefont) | `@salty-css/core/factories` | `@font-face` (or `@import`) + CSS variable in one. | [fonts](https://salty-css.dev/docs/fonts) |
96
+ | [`defineImport`](#defineimport) | `@salty-css/core/factories` | Pull external CSS into Salty's `imports` layer. | [imports](https://salty-css.dev/docs/imports) |
97
+ | [`keyframes`](#keyframes) | `@salty-css/react/keyframes` | Typed `@keyframes` with params and initial-state injection. | [animations](https://salty-css.dev/docs/animations) |
98
+ | [`defineViewportClamp`](#defineviewportclamp) | `@salty-css/core/helpers` | Fluid `clamp()` values that scale with the viewport. | [viewport-clamp](https://salty-css.dev/docs/viewport-clamp) |
99
+ | [`color`](#color) | `@salty-css/core/helpers` | Color manipulation (`alpha`, `darken`, …). | [color-function](https://salty-css.dev/docs/color-function) |
100
+ | [Modifiers](#modifiers) | (on `defineConfig`) | Custom value transformers, e.g. `'space:3'` → `'12px'`. | [modifiers](https://salty-css.dev/docs/modifiers) |
101
+ | [`withSaltyCss`](#withsaltycss-nextjs) | `@salty-css/next` | Next.js config wrapper (Webpack + Turbopack). | [installation](https://salty-css.dev/docs/installation) |
102
+ | [`saltyPlugin` (Vite)](#saltyplugin-vite) | `@salty-css/vite` | Vite plugin. | [installation](https://salty-css.dev/docs/installation) |
103
+ | [`saltyPlugin` (Webpack)](#saltyplugin-webpack) | `@salty-css/webpack` | Webpack loader + plugin. | [installation](https://salty-css.dev/docs/installation) |
104
+ | [`saltyIntegration`](#saltyintegration-astro) | `@salty-css/astro/integration` | Astro integration. | [installation](https://salty-css.dev/docs/installation) |
105
105
 
106
106
  ---
107
107
 
@@ -376,7 +376,7 @@ export default defineImport(
376
376
  '/fonts/inter.css', // public/ folder
377
377
  'https://fonts.googleapis.com/css2?family=Inter', // URL
378
378
  { url: './print.css', media: 'print' }, // media-conditional
379
- { url: './p3.css', supports: 'color(display-p3 1 1 1)' } // supports-conditional
379
+ { url: './p3.css', supports: 'color(display-p3 1 1 1)' }, // supports-conditional
380
380
  );
381
381
  ```
382
382
 
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=t=>{let n=new String(t);return Object.assign(n,{get isClassName(){return!0},variant:(n,r)=>e(`${t} ${`${n}-${r}`}`)}),n};exports.className=e;
@@ -5,3 +5,4 @@ interface ClassNameMethods {
5
5
  type ClassNameFunction = string & ClassNameMethods;
6
6
  export declare const className: (classNameStr: string) => ClassNameFunction;
7
7
  export {};
8
+ //# sourceMappingURL=class-name-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"class-name-client.d.ts","sourceRoot":"","sources":["../src/class-name-client.ts"],"names":[],"mappings":"AAAA,UAAU,gBAAgB;IACxB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,iBAAiB,CAAC;CACtE;AAED,KAAK,iBAAiB,GAAG,MAAM,GAAG,gBAAgB,CAAC;AAEnD,eAAO,MAAM,SAAS,GAAI,cAAc,MAAM,KAc9B,iBACf,CAAC"}
@@ -0,0 +1,12 @@
1
+ //#region src/class-name-client.ts
2
+ var e = (t) => {
3
+ let n = new String(t);
4
+ return Object.assign(n, {
5
+ get isClassName() {
6
+ return !0;
7
+ },
8
+ variant: (n, r) => e(`${t} ${`${n}-${r}`}`)
9
+ }), n;
10
+ };
11
+ //#endregion
12
+ export { e as className };
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@salty-css/core/generators");var t=t=>{let n=new e.ClassNameGenerator(t),r=e=>{let t=new String(e);return Object.assign(t,{get isClassName(){return!0},variant:(e,n)=>r(`${t} ${`${e}-${n}`}`),generator:n}),t};return r(n.cssClassName)};exports.className=t;
@@ -1,5 +1,5 @@
1
- import { StyledParams } from '@salty-css/core/types';
2
- import { ClassNameGenerator } from '@salty-css/core/generators';
1
+ import { StyledParams } from '../../core/dist/types';
2
+ import { ClassNameGenerator } from '../../core/dist/generators';
3
3
  interface ClassNameMethods<STYLE_PARAMS extends StyledParams> {
4
4
  generator: ClassNameGenerator<STYLE_PARAMS>;
5
5
  isClassName: boolean;
@@ -8,3 +8,4 @@ interface ClassNameMethods<STYLE_PARAMS extends StyledParams> {
8
8
  type ClassNameFunction<STYLE_PARAMS extends StyledParams> = string & ClassNameMethods<STYLE_PARAMS>;
9
9
  export declare const className: <const STYLE_PARAMS extends StyledParams>(params: STYLE_PARAMS) => ClassNameFunction<STYLE_PARAMS>;
10
10
  export {};
11
+ //# sourceMappingURL=class-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"class-name.d.ts","sourceRoot":"","sources":["../src/class-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,UAAU,gBAAgB,CAAC,YAAY,SAAS,YAAY;IAC1D,SAAS,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAC5C,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;CACpF;AAED,KAAK,iBAAiB,CAAC,YAAY,SAAS,YAAY,IAAI,MAAM,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAC;AAEpG,eAAO,MAAM,SAAS,GAAI,KAAK,CAAC,YAAY,SAAS,YAAY,EAAE,QAAQ,YAAY,oCAoBtF,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { ClassNameGenerator as e } from "@salty-css/core/generators";
2
+ //#region src/class-name.ts
3
+ var t = (t) => {
4
+ let n = new e(t), r = (e) => {
5
+ let t = new String(e);
6
+ return Object.assign(t, {
7
+ get isClassName() {
8
+ return !0;
9
+ },
10
+ variant: (e, n) => r(`${t} ${`${e}-${n}`}`),
11
+ generator: n
12
+ }), t;
13
+ };
14
+ return r(n.cssClassName);
15
+ };
16
+ //#endregion
17
+ export { t as className };
@@ -0,0 +1 @@
1
+ var e=require("@salty-css/core/config");Object.keys(e).forEach(function(t){t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1,2 @@
1
+ export * from '../../core/dist/config';
2
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,56 @@
1
+ import { createElement as e, forwardRef as t } from "react";
2
+ import { dashCase as n } from "@salty-css/core/util";
3
+ import { parseVariableTokens as r } from "@salty-css/core/parsers";
4
+ //#region ../../node_modules/clsx/dist/clsx.mjs
5
+ function i(e) {
6
+ var t, n, r = "";
7
+ if (typeof e == "string" || typeof e == "number") r += e;
8
+ else if (typeof e == "object") if (Array.isArray(e)) {
9
+ var a = e.length;
10
+ for (t = 0; t < a; t++) e[t] && (n = i(e[t])) && (r && (r += " "), r += n);
11
+ } else for (n in e) e[n] && (r && (r += " "), r += n);
12
+ return r;
13
+ }
14
+ function a() {
15
+ for (var e, t, n = 0, r = "", a = arguments.length; n < a; n++) (e = arguments[n]) && (t = i(e)) && (r && (r += " "), r += t);
16
+ return r;
17
+ }
18
+ //#endregion
19
+ //#region src/element-factory.ts
20
+ var o = ["passProps"], s = (i, s = "", c = {}, l) => {
21
+ let u = t(({ extend: t = i, element: u, as: d, className: f = "", children: p, passProps: m = c.passProps, _vks: h = /* @__PURE__ */ new Set(), ...g }, _) => {
22
+ let v = d ?? u ?? c.element, y = { passProps: m };
23
+ c.attr && Object.assign(y, c.attr), l && Object.assign(y, l), c.defaultProps && Object.assign(g, c.defaultProps), g && Object.assign(y, g);
24
+ let b = new Set([...s.split(" "), ...f.split(" ")]), x = typeof t == "function" || typeof t == "object", S = x && "isStyled" in t, C = x ? t : v || t;
25
+ if (!C) throw Error("No element provided");
26
+ let w = y.style || {};
27
+ y.style ||= w, Object.entries(w).forEach(([e, t]) => {
28
+ let n = r(t);
29
+ n && (w[e] = n.transformed);
30
+ }), c.propValueKeys && c.propValueKeys.forEach((e) => {
31
+ let t = `css-${e}`, r = g[t];
32
+ if (r === void 0) return;
33
+ let i = `--props-${n(e)}`;
34
+ w[i] = r, h && h.add(t);
35
+ }), c.variantKeys && c.variantKeys.forEach((e) => {
36
+ let [t, n] = e.split("=");
37
+ g[t] === void 0 ? n !== void 0 && b.add(`${t}-${n}`) : (b.add(`${t}-${g[t]}`), h && h.add(t));
38
+ }), h && (!x || !S) ? h.forEach((e) => {
39
+ if (!m || m !== !0 && !m.includes(e)) return delete y[e];
40
+ }) : S && Object.assign(y, { _vks: h }), S || o.forEach((e) => delete y[e]);
41
+ let T = a(...b);
42
+ return e(C, {
43
+ element: x ? v : void 0,
44
+ className: T,
45
+ ref: _,
46
+ ...y
47
+ }, p);
48
+ });
49
+ return Object.assign(u, {
50
+ isStyled: !0,
51
+ className: s,
52
+ toString: () => `.${c.hash}`
53
+ }), u;
54
+ };
55
+ //#endregion
56
+ export { s as t };
@@ -0,0 +1 @@
1
+ let e=require("react"),t=require("@salty-css/core/util"),n=require("@salty-css/core/parsers");function r(e){var t,n,i=``;if(typeof e==`string`||typeof e==`number`)i+=e;else if(typeof e==`object`)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=r(e[t]))&&(i&&(i+=` `),i+=n)}else for(n in e)e[n]&&(i&&(i+=` `),i+=n);return i}function i(){for(var e,t,n=0,i=``,a=arguments.length;n<a;n++)(e=arguments[n])&&(t=r(e))&&(i&&(i+=` `),i+=t);return i}var a=[`passProps`],o=(r,o=``,s={},c)=>{let l=(0,e.forwardRef)(({extend:l=r,element:u,as:d,className:f=``,children:p,passProps:m=s.passProps,_vks:h=new Set,...g},_)=>{let v=d??u??s.element,y={passProps:m};s.attr&&Object.assign(y,s.attr),c&&Object.assign(y,c),s.defaultProps&&Object.assign(g,s.defaultProps),g&&Object.assign(y,g);let b=new Set([...o.split(` `),...f.split(` `)]),x=typeof l==`function`||typeof l==`object`,S=x&&`isStyled`in l,C=x?l:v||l;if(!C)throw Error(`No element provided`);let w=y.style||{};y.style||=w,Object.entries(w).forEach(([e,t])=>{let r=(0,n.parseVariableTokens)(t);r&&(w[e]=r.transformed)}),s.propValueKeys&&s.propValueKeys.forEach(e=>{let n=`css-${e}`,r=g[n];if(r===void 0)return;let i=`--props-${(0,t.dashCase)(e)}`;w[i]=r,h&&h.add(n)}),s.variantKeys&&s.variantKeys.forEach(e=>{let[t,n]=e.split(`=`);g[t]===void 0?n!==void 0&&b.add(`${t}-${n}`):(b.add(`${t}-${g[t]}`),h&&h.add(t))}),h&&(!x||!S)?h.forEach(e=>{if(!m||m!==!0&&!m.includes(e))return delete y[e]}):S&&Object.assign(y,{_vks:h}),S||a.forEach(e=>delete y[e]);let T=i(...b);return(0,e.createElement)(C,{element:x?v:void 0,className:T,ref:_,...y},p)});return Object.assign(l,{isStyled:!0,className:o,toString:()=>`.${s.hash}`}),l};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
@@ -1,3 +1,4 @@
1
- import { StyledComponentProps, Tag } from '@salty-css/core/types';
2
- import { StyledGeneratorClientProps } from '@salty-css/core/generators';
1
+ import { StyledComponentProps, Tag } from '../../core/dist/types';
2
+ import { StyledGeneratorClientProps } from '../../core/dist/generators';
3
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>>;
4
+ //# sourceMappingURL=element-factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-factory.d.ts","sourceRoot":"","sources":["../src/element-factory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAGlE,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAKxE,eAAO,MAAM,cAAc,GAAI,SAAS,GAAG,CAAC,GAAG,CAAC,EAAE,mBAAe,EAAE,kBAAiB,0BAA+B,EAAE,mBAAmB,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,sHAoF/J,CAAC"}
@@ -0,0 +1 @@
1
+ var e=require("@salty-css/core/factories");Object.keys(e).forEach(function(t){t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1,2 @@
1
+ export * from '../../core/dist/factories';
2
+ //# sourceMappingURL=factories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factories.d.ts","sourceRoot":"","sources":["../src/factories.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
@@ -0,0 +1 @@
1
+ var e=require("@salty-css/core/helpers");Object.keys(e).forEach(function(t){t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1,2 @@
1
+ export * from '../../core/dist/helpers';
2
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ var e=require("@salty-css/core/css");Object.keys(e).forEach(function(t){t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1,2 @@
1
+ export * from '../../core/dist/css';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1 @@
1
+ var e=require("@salty-css/core/css/keyframes");Object.keys(e).forEach(function(t){t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1,2 @@
1
+ export * from '../../core/dist/css/keyframes';
2
+ //# sourceMappingURL=keyframes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyframes.d.ts","sourceRoot":"","sources":["../src/keyframes.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
package/dist/media.cjs ADDED
@@ -0,0 +1 @@
1
+ var e=require("@salty-css/core/css/media");Object.keys(e).forEach(function(t){t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1,2 @@
1
+ export * from '../../core/dist/css/media';
2
+ //# sourceMappingURL=media.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../src/media.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
@@ -0,0 +1 @@
1
+ var e=require("@salty-css/core/runtime");Object.keys(e).forEach(function(t){t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1,2 @@
1
+ export * from '../../core/dist/runtime';
2
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./element-factory-DjX4Quuc.cjs");var t=(t,n,r)=>e.t(t,n,r);exports.styledClient=t;
@@ -0,0 +1,4 @@
1
+ import { StyledGeneratorClientProps } from '../../core/dist/generators';
2
+ import { Tag } from '../../core/dist/types';
3
+ export declare const styledClient: (tagName: Tag<any>, className: string, generatorProps: StyledGeneratorClientProps) => import('react').ForwardRefExoticComponent<Omit<import('../../core/dist/types').StyledComponentProps, "ref"> & import('react').RefAttributes<any>>;
4
+ //# sourceMappingURL=styled-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styled-client.d.ts","sourceRoot":"","sources":["../src/styled-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAGjD,eAAO,MAAM,YAAY,GAAI,SAAS,GAAG,CAAC,GAAG,CAAC,EAAE,WAAW,MAAM,EAAE,gBAAgB,0BAA0B,sJAE5G,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { t as e } from "./element-factory-Bz7Aq422.js";
2
+ //#region src/styled-client.ts
3
+ var t = (t, n, r) => e(t, n, r);
4
+ //#endregion
5
+ export { t as styledClient };
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./element-factory-DjX4Quuc.cjs");let t=require("@salty-css/core/generators");var n=(n,r)=>{let i=new t.StyledGenerator(n,r),a=e.t(n,i.cssClassName,i.clientProps,{"data-unoptimized-client-component":!0});return Object.assign(a,{generator:i}),a};exports.styled=n;
@@ -1,8 +1,9 @@
1
1
  import { AllHTMLAttributes, JSX, ReactNode } from 'react';
2
- import { Tag, StyledComponentProps, CreateElementProps, VariantProps, ParentComponentProps, StyledParams, ValueProps, Merge } from '@salty-css/core/types';
3
- import { StyledGenerator } from '@salty-css/core/generators';
2
+ import { Tag, StyledComponentProps, CreateElementProps, VariantProps, ParentComponentProps, StyledParams, ValueProps, Merge } from '../../core/dist/types';
3
+ import { StyledGenerator } from '../../core/dist/generators';
4
4
  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 ? {
5
5
  ref?: any;
6
6
  } : 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 & {
7
7
  generator: StyledGenerator;
8
8
  };
9
+ //# sourceMappingURL=styled.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../src/styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,GAAG,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC3J,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAG7D,eAAO,MAAM,MAAM,GAAI,KAAK,CAAC,KAAK,SAAS,oBAAoB,EAAE,KAAK,CAAC,GAAG,SAAS,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,YAAY,SAAS,YAAY,EAC9I,SAAS,GAAG,EACZ,QAAQ,YAAY,KAoBI,SAHf,kBAAkB;UAHa,GAAG;cAGP,KAAK,CAAC,oBAAoB,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC,GAAG,UAAU,GAAG,IAAI,sIAAgB,MAAM,kBAAkB,CAAC,KACzJ,SAAS,IAE0B,MAAM,GAAG;IAAE,SAAS,EAAE,eAAe,CAAA;CAC9E,CAAC"}
package/dist/styled.js ADDED
@@ -0,0 +1,9 @@
1
+ import { t as e } from "./element-factory-Bz7Aq422.js";
2
+ import { StyledGenerator as t } from "@salty-css/core/generators";
3
+ //#region src/styled.ts
4
+ var n = (n, r) => {
5
+ let i = new t(n, r), a = e(n, i.cssClassName, i.clientProps, { "data-unoptimized-client-component": !0 });
6
+ return Object.assign(a, { generator: i }), a;
7
+ };
8
+ //#endregion
9
+ export { n as styled };
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@salty-css/core/util"),t=require("fs"),n=require("path"),r=require("@salty-css/core/compiler/helpers"),i=require("@salty-css/core/compiler/get-function-range");var a=async(a,o)=>{try{if(!(0,r.isSaltyFile)(o))return;let s=await a.getDestDir(),c=(0,t.readFileSync)(o,`utf8`),l=await a.getConfig(),{contents:u}=await a.compileSaltyFile(o,s),d=c;for(let[e,t]of Object.entries(u)){let n=await(0,r.resolveExportValue)(t,1);if(n.isKeyframes||!n.generator)continue;let o=n.generator._withBuildContext({callerName:e,isProduction:a.isProduction,config:l}),[s,c]=await(0,i.getFunctionRange)(d,e),u=d.slice(s,c);if(n.isClassName){let t=d,n=` ${e} = className("${o.classNames}")`;d=d.replace(u,n),t===d&&console.error(`Minimize file failed to change content`,{name:e})}if(u.includes(`styled`)){let t=/styled\(([^,]+),/.exec(u)?.at(1)?.trim(),n=d,r=` ${e} = styled(${t}, "${o.classNames}", ${JSON.stringify(o.clientProps)})`;d=d.replace(u,r),n===d&&console.error(`Minimize file failed to change content`,{name:e,tagName:t})}}if(l.importStrategy===`component`){let t=(0,e.toHash)(o,6);d=`import '../../saltygen/css/${`f_${(0,e.dashCase)((0,n.parse)(o).name)}-${t}.css`}';\n${d}`}return d=d.replace(`@salty-css/react/class-name`,`@salty-css/react/class-name-client`),d=d.replace(`{ styled }`,`{ styledClient as styled }`),d=d.replace(`@salty-css/react/styled`,`@salty-css/react/styled-client`),d}catch(e){console.error(`Error in transformSaltyFile:`,e);return}};exports.transformSaltyFile=a;
@@ -1,4 +1,4 @@
1
- import { SaltyCompiler } from '@salty-css/core/compiler/salty-compiler';
1
+ import { SaltyCompiler } from '../../core/dist/compiler/salty-compiler';
2
2
  /**
3
3
  * React-specific minimize transform for salty files. Rewrites `styled()` and
4
4
  * `className()` calls to their pre-resolved client-side variants and swaps the
@@ -6,3 +6,4 @@ import { SaltyCompiler } from '@salty-css/core/compiler/salty-compiler';
6
6
  * the runtime ships only the minimal client logic.
7
7
  */
8
8
  export declare const transformSaltyFile: (compiler: SaltyCompiler, file: string) => Promise<string | undefined>;
9
+ //# sourceMappingURL=transform-salty-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform-salty-file.d.ts","sourceRoot":"","sources":["../src/transform-salty-file.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAG7E;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAU,UAAU,aAAa,EAAE,MAAM,MAAM,KAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CA+D1G,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { dashCase as e, toHash as t } from "@salty-css/core/util";
2
+ import { readFileSync as n } from "fs";
3
+ import { parse as r } from "path";
4
+ import { isSaltyFile as i, resolveExportValue as a } from "@salty-css/core/compiler/helpers";
5
+ import { getFunctionRange as o } from "@salty-css/core/compiler/get-function-range";
6
+ //#region src/transform-salty-file.ts
7
+ var s = async (s, c) => {
8
+ try {
9
+ if (!i(c)) return;
10
+ let l = await s.getDestDir(), u = n(c, "utf8"), d = await s.getConfig(), { contents: f } = await s.compileSaltyFile(c, l), p = u;
11
+ for (let [e, t] of Object.entries(f)) {
12
+ let n = await a(t, 1);
13
+ if (n.isKeyframes || !n.generator) continue;
14
+ let r = n.generator._withBuildContext({
15
+ callerName: e,
16
+ isProduction: s.isProduction,
17
+ config: d
18
+ }), [i, c] = await o(p, e), l = p.slice(i, c);
19
+ if (n.isClassName) {
20
+ let t = p, n = ` ${e} = className("${r.classNames}")`;
21
+ p = p.replace(l, n), t === p && console.error("Minimize file failed to change content", { name: e });
22
+ }
23
+ if (l.includes("styled")) {
24
+ let t = /styled\(([^,]+),/.exec(l)?.at(1)?.trim(), n = p, i = ` ${e} = styled(${t}, "${r.classNames}", ${JSON.stringify(r.clientProps)})`;
25
+ p = p.replace(l, i), n === p && console.error("Minimize file failed to change content", {
26
+ name: e,
27
+ tagName: t
28
+ });
29
+ }
30
+ }
31
+ if (d.importStrategy === "component") {
32
+ let n = t(c, 6);
33
+ p = `import '../../saltygen/css/${`f_${e(r(c).name)}-${n}.css`}';\n${p}`;
34
+ }
35
+ return p = p.replace("@salty-css/react/class-name", "@salty-css/react/class-name-client"), p = p.replace("{ styled }", "{ styledClient as styled }"), p = p.replace("@salty-css/react/styled", "@salty-css/react/styled-client"), p;
36
+ } catch (e) {
37
+ console.error("Error in transformSaltyFile:", e);
38
+ return;
39
+ }
40
+ };
41
+ //#endregion
42
+ export { s as transformSaltyFile };
package/package.json CHANGED
@@ -1,16 +1,11 @@
1
1
  {
2
2
  "name": "@salty-css/react",
3
- "version": "0.2.0",
4
- "main": "./dist/index.js",
5
- "module": "./dist/index.mjs",
6
- "typings": "./dist/index.d.ts",
7
- "type": "module",
8
3
  "license": "MIT",
9
4
  "private": false,
10
5
  "publishConfig": {
11
6
  "access": "public"
12
7
  },
13
- "description": "React library for Salty CSS",
8
+ "description": "Vite plugin for Salty CSS",
14
9
  "homepage": "https://salty-css.dev/",
15
10
  "repository": {
16
11
  "type": "git",
@@ -19,71 +14,82 @@
19
14
  "bugs": {
20
15
  "url": "https://github.com/margarita-form/salty-css/issues"
21
16
  },
22
- "files": [
23
- "**/*",
24
- "!**/*.tsbuildinfo"
25
- ],
17
+ "version": "0.2.2-refactor-vite-8.4",
18
+ "type": "module",
19
+ "scripts": {
20
+ "build": "vite build",
21
+ "test": "vitest run"
22
+ },
23
+ "dependencies": {
24
+ "@salty-css/core": "0.2.2-refactor-vite-8.4",
25
+ "clsx": ">=2.x",
26
+ "react": ">=19.x || >=18.3.x"
27
+ },
28
+ "devDependencies": {
29
+ "@types/react-dom": "^19.2.3",
30
+ "jsdom": "^29.1.1"
31
+ },
26
32
  "nx": {
27
- "sourceRoot": "libs/react/src",
28
- "name": "react"
33
+ "targets": {
34
+ "build": {
35
+ "dependsOn": [
36
+ "^build"
37
+ ]
38
+ }
39
+ }
29
40
  },
41
+ "files": [
42
+ "dist",
43
+ "README.md"
44
+ ],
30
45
  "exports": {
31
46
  ".": {
32
- "import": "./index.js",
33
- "require": "./index.cjs"
47
+ "import": "./dist/index.js",
48
+ "require": "./dist/index.cjs"
34
49
  },
35
50
  "./styled": {
36
- "import": "./styled.js",
37
- "require": "./styled.cjs"
51
+ "import": "./dist/styled.js",
52
+ "require": "./dist/styled.cjs"
38
53
  },
39
54
  "./styled-client": {
40
- "import": "./styled-client.js",
41
- "require": "./styled-client.cjs"
55
+ "import": "./dist/styled-client.js",
56
+ "require": "./dist/styled-client.cjs"
42
57
  },
43
58
  "./class-name": {
44
- "import": "./class-name.js",
45
- "require": "./class-name.cjs"
59
+ "import": "./dist/class-name.js",
60
+ "require": "./dist/class-name.cjs"
46
61
  },
47
62
  "./class-name-client": {
48
- "import": "./class-name-client.js",
49
- "require": "./class-name-client.cjs"
63
+ "import": "./dist/class-name-client.js",
64
+ "require": "./dist/class-name-client.cjs"
50
65
  },
51
66
  "./keyframes": {
52
- "import": "./keyframes.js",
53
- "require": "./keyframes.cjs"
67
+ "import": "./dist/keyframes.js",
68
+ "require": "./dist/keyframes.cjs"
54
69
  },
55
70
  "./media": {
56
- "import": "./media.js",
57
- "require": "./media.cjs"
71
+ "import": "./dist/media.js",
72
+ "require": "./dist/media.cjs"
58
73
  },
59
74
  "./factories": {
60
- "import": "./factories.js",
61
- "require": "./factories.cjs"
75
+ "import": "./dist/factories.js",
76
+ "require": "./dist/factories.cjs"
62
77
  },
63
78
  "./config": {
64
- "import": "./config.js",
65
- "require": "./config.cjs"
79
+ "import": "./dist/config.js",
80
+ "require": "./dist/config.cjs"
66
81
  },
67
82
  "./helpers": {
68
- "import": "./helpers.js",
69
- "require": "./helpers.cjs"
83
+ "import": "./dist/helpers.js",
84
+ "require": "./dist/helpers.cjs"
70
85
  },
71
86
  "./runtime": {
72
- "import": "./runtime.js",
73
- "require": "./runtime.cjs"
87
+ "import": "./dist/runtime.js",
88
+ "require": "./dist/runtime.cjs"
74
89
  },
75
90
  "./transform-salty-file": {
76
- "import": "./transform-salty-file.js",
77
- "require": "./transform-salty-file.cjs"
91
+ "import": "./dist/transform-salty-file.js",
92
+ "require": "./dist/transform-salty-file.cjs"
78
93
  }
79
- },
80
- "dependencies": {
81
- "@salty-css/core": "0.2.0",
82
- "@testing-library/react": "^16.3.2",
83
- "clsx": ">=2.x",
84
- "react": ">=19.x || >=18.3.x"
85
- },
86
- "devDependencies": {
87
- "@types/react-dom": "^19.2.3"
88
94
  }
89
- }
95
+ }
@@ -1 +0,0 @@
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,15 +0,0 @@
1
- const c = (s) => {
2
- const t = new String(s);
3
- return Object.assign(t, {
4
- get isClassName() {
5
- return !0;
6
- },
7
- variant: (n, r) => {
8
- const e = `${n}-${r}`, a = `${s} ${e}`;
9
- return c(a);
10
- }
11
- }), t;
12
- };
13
- export {
14
- c as className
15
- };
package/class-name.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@salty-css/core/generators"),u=r=>{const s=new i.ClassNameGenerator(r),t=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 t(l)},generator:s}),e};return t(s.cssClassName)};exports.className=u;
package/class-name.js DELETED
@@ -1,20 +0,0 @@
1
- import { ClassNameGenerator as l } from "@salty-css/core/generators";
2
- const C = (r) => {
3
- const t = new l(r), e = (a) => {
4
- const s = new String(a);
5
- return Object.assign(s, {
6
- get isClassName() {
7
- return !0;
8
- },
9
- variant: (n, o) => {
10
- const c = `${n}-${o}`, i = `${s} ${c}`;
11
- return e(i);
12
- },
13
- generator: t
14
- }), s;
15
- };
16
- return e(t.cssClassName);
17
- };
18
- export {
19
- C as className
20
- };
package/config.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@salty-css/core/config");Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
package/config.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from '@salty-css/core/config';
@@ -1 +0,0 @@
1
- "use strict";const K=require("react"),g=require("@salty-css/core/util"),A=require("@salty-css/core/parsers");function O(s){var i,e,t="";if(typeof s=="string"||typeof s=="number")t+=s;else if(typeof s=="object")if(Array.isArray(s)){var o=s.length;for(i=0;i<o;i++)s[i]&&(e=O(s[i]))&&(t&&(t+=" "),t+=e)}else for(e in s)s[e]&&(t&&(t+=" "),t+=e);return t}function F(){for(var s,i,e=0,t="",o=arguments.length;e<o;e++)(s=arguments[e])&&(i=O(s))&&(t&&(t+=" "),t+=i);return t}const R=["passProps"],T=(s,i="",e={},t)=>{const o=({extend:u=s,element:$,as:w,className:V="",children:q,passProps:d=e.passProps,_vks:l=new Set,...r},v)=>{const S=w??$??e.element,a={passProps:d};e.attr&&Object.assign(a,e.attr),t&&Object.assign(a,t),e.defaultProps&&Object.assign(r,e.defaultProps),r&&Object.assign(a,r);const b=new Set([...i.split(" "),...V.split(" ")]),y=typeof u=="function"||typeof u=="object",h=y&&"isStyled"in u,E=y?u:S||u;if(!E)throw new Error("No element provided");const m=a.style||{};a.style||(a.style=m),Object.entries(m).forEach(([n,c])=>{const f=A.parseVariableTokens(c);f&&(m[n]=f.transformed)}),e.propValueKeys&&e.propValueKeys.forEach(n=>{const c=`css-${n}`,f=r[c];if(f===void 0)return;const N=`--props-${g.dashCase(n)}`;m[N]=f,l&&l.add(c)}),e.variantKeys&&e.variantKeys.forEach(n=>{const[c,f]=n.split("=");r[c]!==void 0?(b.add(`${c}-${r[c]}`),l&&l.add(c)):f!==void 0&&b.add(`${c}-${f}`)}),l&&(!y||!h)?l.forEach(n=>{if(!d)return delete a[n];if(d!==!0&&!d.includes(n))return delete a[n]}):h&&Object.assign(a,{_vks:l}),h||R.forEach(n=>delete a[n]);const C=F(...b);return K.createElement(E,{element:y?S:void 0,className:C,ref:v,...a},q)},j=K.forwardRef(o);return Object.assign(j,{isStyled:!0,className:i,toString:()=>`.${e.hash}`}),j};exports.elementFactory=T;
@@ -1,69 +0,0 @@
1
- import { forwardRef as p, createElement as g } from "react";
2
- import { dashCase as A } from "@salty-css/core/util";
3
- import { parseVariableTokens as R } from "@salty-css/core/parsers";
4
- function K(s) {
5
- var n, e, t = "";
6
- if (typeof s == "string" || typeof s == "number") t += s;
7
- else if (typeof s == "object") if (Array.isArray(s)) {
8
- var d = s.length;
9
- for (n = 0; n < d; n++) s[n] && (e = K(s[n])) && (t && (t += " "), t += e);
10
- } else for (e in s) s[e] && (t && (t += " "), t += e);
11
- return t;
12
- }
13
- function q() {
14
- for (var s, n, e = 0, t = "", d = arguments.length; e < d; e++) (s = arguments[e]) && (n = K(s)) && (t && (t += " "), t += n);
15
- return t;
16
- }
17
- const F = ["passProps"], D = (s, n = "", e = {}, t) => {
18
- const j = p(({
19
- extend: o = s,
20
- element: O,
21
- as: $,
22
- className: w = "",
23
- children: V,
24
- passProps: u = e.passProps,
25
- _vks: c = /* @__PURE__ */ new Set(),
26
- ...r
27
- }, v) => {
28
- const S = $ ?? O ?? e.element, f = { passProps: u };
29
- e.attr && Object.assign(f, e.attr), t && Object.assign(f, t), e.defaultProps && Object.assign(r, e.defaultProps), r && Object.assign(f, r);
30
- const b = /* @__PURE__ */ new Set([...n.split(" "), ...w.split(" ")]), m = typeof o == "function" || typeof o == "object", h = m && "isStyled" in o, E = m ? o : S || o;
31
- if (!E) throw new Error("No element provided");
32
- const y = f.style || {};
33
- f.style || (f.style = y), Object.entries(y).forEach(([i, a]) => {
34
- const l = R(a);
35
- l && (y[i] = l.transformed);
36
- }), e.propValueKeys && e.propValueKeys.forEach((i) => {
37
- const a = `css-${i}`, l = r[a];
38
- if (l === void 0) return;
39
- const N = `--props-${A(i)}`;
40
- y[N] = l, c && c.add(a);
41
- }), e.variantKeys && e.variantKeys.forEach((i) => {
42
- const [a, l] = i.split("=");
43
- r[a] !== void 0 ? (b.add(`${a}-${r[a]}`), c && c.add(a)) : l !== void 0 && b.add(`${a}-${l}`);
44
- }), c && (!m || !h) ? c.forEach((i) => {
45
- if (!u) return delete f[i];
46
- if (u !== !0 && !u.includes(i))
47
- return delete f[i];
48
- }) : h && Object.assign(f, { _vks: c }), h || F.forEach((i) => delete f[i]);
49
- const C = q(...b);
50
- return g(
51
- E,
52
- {
53
- element: m ? S : void 0,
54
- className: C,
55
- ref: v,
56
- ...f
57
- },
58
- V
59
- );
60
- });
61
- return Object.assign(j, {
62
- isStyled: !0,
63
- className: n,
64
- toString: () => `.${e.hash}`
65
- }), j;
66
- };
67
- export {
68
- D as e
69
- };
package/factories.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@salty-css/core/factories");Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
package/factories.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from '@salty-css/core/factories';
package/helpers.cjs DELETED
@@ -1 +0,0 @@
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 DELETED
@@ -1 +0,0 @@
1
- export * from '@salty-css/core/helpers';
package/index.cjs DELETED
@@ -1 +0,0 @@
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 DELETED
@@ -1 +0,0 @@
1
- export * from '@salty-css/core/css';
package/keyframes.cjs DELETED
@@ -1 +0,0 @@
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 DELETED
@@ -1 +0,0 @@
1
- export * from '@salty-css/core/css/keyframes';
package/media.cjs DELETED
@@ -1 +0,0 @@
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 DELETED
@@ -1 +0,0 @@
1
- export * from '@salty-css/core/css/media';
package/runtime.cjs DELETED
@@ -1 +0,0 @@
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 DELETED
@@ -1 +0,0 @@
1
- export * from '@salty-css/core/runtime';
package/styled-client.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./element-factory-13FoC0gV.cjs"),n=(e,t,r)=>l.elementFactory(e,t,r);exports.styledClient=n;
@@ -1,3 +0,0 @@
1
- import { StyledGeneratorClientProps } from '@salty-css/core/generators';
2
- import { Tag } from '@salty-css/core/types';
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 DELETED
@@ -1,5 +0,0 @@
1
- import { e as o } from "./element-factory-Dse2ZLfl.js";
2
- const l = (e, t, r) => o(e, t, r);
3
- export {
4
- l as styledClient
5
- };
package/styled.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@salty-css/core/generators"),s=require("./element-factory-13FoC0gV.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.js DELETED
@@ -1,13 +0,0 @@
1
- import { StyledGenerator as r } from "@salty-css/core/generators";
2
- import { e as s } from "./element-factory-Dse2ZLfl.js";
3
- const i = (t, o) => {
4
- const e = new r(t, o), n = s(t, e.cssClassName, e.clientProps, {
5
- "data-unoptimized-client-component": !0
6
- });
7
- return Object.assign(n, {
8
- generator: e
9
- }), n;
10
- };
11
- export {
12
- i as styled
13
- };
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("fs"),w=require("path"),g=require("@salty-css/core/compiler/helpers"),q=require("@salty-css/core/compiler/get-function-range"),m=require("@salty-css/core/util"),C=async(a,s)=>{var d,y;try{if(!g.isSaltyFile(s))return;const p=await a.getDestDir(),F=v.readFileSync(s,"utf8"),f=await a.getConfig(),{contents:h}=await a.compileSaltyFile(s,p);let e=F;for(const[t,o]of Object.entries(h)){const n=await g.resolveExportValue(o,1);if(n.isKeyframes||!n.generator)continue;const r=n.generator._withBuildContext({callerName:t,isProduction:a.isProduction,config:f}),[S,$]=await q.getFunctionRange(e,t),c=e.slice(S,$);if(n.isClassName){const i=e,l=` ${t} = className("${r.classNames}")`;e=e.replace(c,l),i===e&&console.error("Minimize file failed to change content",{name:t})}if(c.includes("styled")){const i=(y=(d=/styled\(([^,]+),/.exec(c))==null?void 0:d.at(1))==null?void 0:y.trim(),l=e,N=` ${t} = styled(${i}, "${r.classNames}", ${JSON.stringify(r.clientProps)})`;e=e.replace(c,N),l===e&&console.error("Minimize file failed to change content",{name:t,tagName:i})}}if(f.importStrategy==="component"){const t=m.toHash(s,6),o=w.parse(s);e=`import '../../saltygen/css/${`f_${m.dashCase(o.name)}-${t}.css`}';
2
- ${e}`}return e=e.replace("@salty-css/react/class-name","@salty-css/react/class-name-client"),e=e.replace("{ styled }","{ styledClient as styled }"),e=e.replace("@salty-css/react/styled","@salty-css/react/styled-client"),e}catch(u){console.error("Error in transformSaltyFile:",u);return}};exports.transformSaltyFile=C;
@@ -1,42 +0,0 @@
1
- import { readFileSync as N } from "fs";
2
- import { parse as v } from "path";
3
- import { isSaltyFile as S, resolveExportValue as w } from "@salty-css/core/compiler/helpers";
4
- import { getFunctionRange as C } from "@salty-css/core/compiler/get-function-range";
5
- import { toHash as x, dashCase as z } from "@salty-css/core/util";
6
- const M = async (n, s) => {
7
- var m, d;
8
- try {
9
- if (!S(s)) return;
10
- const p = await n.getDestDir(), g = N(s, "utf8"), f = await n.getConfig(), { contents: u } = await n.compileSaltyFile(s, p);
11
- let e = g;
12
- for (const [t, c] of Object.entries(u)) {
13
- const a = await w(c, 1);
14
- if (a.isKeyframes || !a.generator) continue;
15
- const o = a.generator._withBuildContext({
16
- callerName: t,
17
- isProduction: n.isProduction,
18
- config: f
19
- }), [F, $] = await C(e, t), r = e.slice(F, $);
20
- if (a.isClassName) {
21
- const i = e, l = ` ${t} = className("${o.classNames}")`;
22
- e = e.replace(r, l), i === e && console.error("Minimize file failed to change content", { name: t });
23
- }
24
- if (r.includes("styled")) {
25
- const i = (d = (m = /styled\(([^,]+),/.exec(r)) == null ? void 0 : m.at(1)) == null ? void 0 : d.trim(), l = e, h = ` ${t} = styled(${i}, "${o.classNames}", ${JSON.stringify(o.clientProps)})`;
26
- e = e.replace(r, h), l === e && console.error("Minimize file failed to change content", { name: t, tagName: i });
27
- }
28
- }
29
- if (f.importStrategy === "component") {
30
- const t = x(s, 6), c = v(s);
31
- e = `import '../../saltygen/css/${`f_${z(c.name)}-${t}.css`}';
32
- ${e}`;
33
- }
34
- return e = e.replace("@salty-css/react/class-name", "@salty-css/react/class-name-client"), e = e.replace("{ styled }", "{ styledClient as styled }"), e = e.replace("@salty-css/react/styled", "@salty-css/react/styled-client"), e;
35
- } catch (y) {
36
- console.error("Error in transformSaltyFile:", y);
37
- return;
38
- }
39
- };
40
- export {
41
- M as transformSaltyFile
42
- };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes