tailwind-styled-v4 5.0.22 → 5.0.23

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.
@@ -368,25 +368,26 @@ var init_src2 = __esm({
368
368
  }
369
369
  return native.extractTwStateConfigs(source, filename);
370
370
  };
371
- generateStaticStateCss = (entries, _themeConfig) => {
372
- const rules = [];
373
- for (const entry of entries) {
374
- const stateConfig = JSON.parse(entry.statesJson);
375
- for (const [stateName, classes] of Object.entries(stateConfig)) {
376
- rules.push({
377
- selector: `.${entry.componentName}[data-state="${stateName}"]`,
378
- declarations: classes,
379
- cssRule: `.${entry.componentName}[data-state="${stateName}"]{${classes}}`,
380
- componentName: entry.componentName,
381
- stateName
382
- });
383
- }
371
+ generateStaticStateCss = (entries, resolvedCssOrThemeConfig) => {
372
+ const native = getNativeBridge();
373
+ if (!native?.generateStaticStateCss) {
374
+ throw new Error("FATAL: Native binding 'generateStaticStateCss' is required but not available.");
384
375
  }
385
- return rules;
376
+ const resolvedCss = typeof resolvedCssOrThemeConfig === "string" ? resolvedCssOrThemeConfig : null;
377
+ const inputs = entries.map((e) => ({
378
+ tag: e.tag,
379
+ componentName: e.componentName,
380
+ statesJson: e.statesJson
381
+ }));
382
+ return native.generateStaticStateCss(inputs, resolvedCss);
386
383
  };
387
384
  extractAndGenerateStateCss = (source, filename) => {
388
- const entries = extractTwStateConfigs(source, filename);
389
- return generateStaticStateCss(entries);
385
+ const native = getNativeBridge();
386
+ if (!native?.extractAndGenerateStateCss) {
387
+ const entries = extractTwStateConfigs(source, filename);
388
+ return generateStaticStateCss(entries);
389
+ }
390
+ return native.extractAndGenerateStateCss(source, filename);
390
391
  };
391
392
  }
392
393
  });