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.
@@ -391,25 +391,26 @@ var init_src2 = __esm({
391
391
  }
392
392
  return native.extractTwStateConfigs(source, filename);
393
393
  };
394
- generateStaticStateCss = (entries, _themeConfig) => {
395
- const rules = [];
396
- for (const entry of entries) {
397
- const stateConfig = JSON.parse(entry.statesJson);
398
- for (const [stateName, classes] of Object.entries(stateConfig)) {
399
- rules.push({
400
- selector: `.${entry.componentName}[data-state="${stateName}"]`,
401
- declarations: classes,
402
- cssRule: `.${entry.componentName}[data-state="${stateName}"]{${classes}}`,
403
- componentName: entry.componentName,
404
- stateName
405
- });
406
- }
394
+ generateStaticStateCss = (entries, resolvedCssOrThemeConfig) => {
395
+ const native = getNativeBridge();
396
+ if (!native?.generateStaticStateCss) {
397
+ throw new Error("FATAL: Native binding 'generateStaticStateCss' is required but not available.");
407
398
  }
408
- return rules;
399
+ const resolvedCss = typeof resolvedCssOrThemeConfig === "string" ? resolvedCssOrThemeConfig : null;
400
+ const inputs = entries.map((e) => ({
401
+ tag: e.tag,
402
+ componentName: e.componentName,
403
+ statesJson: e.statesJson
404
+ }));
405
+ return native.generateStaticStateCss(inputs, resolvedCss);
409
406
  };
410
407
  extractAndGenerateStateCss = (source, filename) => {
411
- const entries = extractTwStateConfigs(source, filename);
412
- return generateStaticStateCss(entries);
408
+ const native = getNativeBridge();
409
+ if (!native?.extractAndGenerateStateCss) {
410
+ const entries = extractTwStateConfigs(source, filename);
411
+ return generateStaticStateCss(entries);
412
+ }
413
+ return native.extractAndGenerateStateCss(source, filename);
413
414
  };
414
415
  }
415
416
  });