@trops/dash-core 0.1.137 → 0.1.138

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.
@@ -8667,6 +8667,43 @@ function checkDashboardCompatibility(
8667
8667
  };
8668
8668
  }
8669
8669
 
8670
+ // Tailwind color family name → representative hex (500 shade)
8671
+ const TAILWIND_COLORS$1 = {
8672
+ slate: "#64748b",
8673
+ gray: "#6b7280",
8674
+ zinc: "#71717a",
8675
+ neutral: "#737373",
8676
+ stone: "#78716c",
8677
+ red: "#ef4444",
8678
+ orange: "#f97316",
8679
+ amber: "#f59e0b",
8680
+ yellow: "#eab308",
8681
+ lime: "#84cc16",
8682
+ green: "#22c55e",
8683
+ emerald: "#10b981",
8684
+ teal: "#14b8a6",
8685
+ cyan: "#06b6d4",
8686
+ sky: "#0ea5e9",
8687
+ blue: "#3b82f6",
8688
+ indigo: "#6366f1",
8689
+ violet: "#8b5cf6",
8690
+ purple: "#a855f7",
8691
+ fuchsia: "#d946ef",
8692
+ pink: "#ec4899",
8693
+ rose: "#f43f5e",
8694
+ };
8695
+
8696
+ /**
8697
+ * Convert a color value to a CSS-usable color.
8698
+ * If it's a Tailwind family name, map to its hex 500 shade.
8699
+ */
8700
+ function toDisplayColor$1(value) {
8701
+ if (!value) return "";
8702
+ const lower = value.toLowerCase().trim();
8703
+ if (TAILWIND_COLORS$1[lower]) return TAILWIND_COLORS$1[lower];
8704
+ return value;
8705
+ }
8706
+
8670
8707
  /**
8671
8708
  * Generate a registry manifest from a dashboard config.
8672
8709
  * Converts the internal .dashboard.json format into the registry
@@ -8728,16 +8765,16 @@ function generateRegistryManifest(dashboardConfig, options = {}) {
8728
8765
  if (dashboardConfig.theme.registryPackage) {
8729
8766
  manifest.theme.registryPackage = dashboardConfig.theme.registryPackage;
8730
8767
  }
8731
- // Extract color values for display
8768
+ // Extract color values for display (convert Tailwind names to hex)
8732
8769
  const td = dashboardConfig.theme.data;
8733
8770
  if (td) {
8734
8771
  const colors = {};
8735
8772
  if (td.primary || td.colors?.primary)
8736
- colors.primary = td.primary || td.colors.primary;
8773
+ colors.primary = toDisplayColor$1(td.primary || td.colors.primary);
8737
8774
  if (td.secondary || td.colors?.secondary)
8738
- colors.secondary = td.secondary || td.colors.secondary;
8775
+ colors.secondary = toDisplayColor$1(td.secondary || td.colors.secondary);
8739
8776
  if (td.tertiary || td.colors?.tertiary)
8740
- colors.tertiary = td.tertiary || td.colors.tertiary;
8777
+ colors.tertiary = toDisplayColor$1(td.tertiary || td.colors.tertiary);
8741
8778
  if (Object.keys(colors).length > 0) {
8742
8779
  manifest.theme.colors = colors;
8743
8780
  }
@@ -10802,9 +10839,48 @@ function generateThemeRegistryManifest(themeData, themeKey, options = {}) {
10802
10839
  };
10803
10840
  }
10804
10841
 
10842
+ // Tailwind color family name → representative hex (500 shade)
10843
+ const TAILWIND_COLORS = {
10844
+ slate: "#64748b",
10845
+ gray: "#6b7280",
10846
+ zinc: "#71717a",
10847
+ neutral: "#737373",
10848
+ stone: "#78716c",
10849
+ red: "#ef4444",
10850
+ orange: "#f97316",
10851
+ amber: "#f59e0b",
10852
+ yellow: "#eab308",
10853
+ lime: "#84cc16",
10854
+ green: "#22c55e",
10855
+ emerald: "#10b981",
10856
+ teal: "#14b8a6",
10857
+ cyan: "#06b6d4",
10858
+ sky: "#0ea5e9",
10859
+ blue: "#3b82f6",
10860
+ indigo: "#6366f1",
10861
+ violet: "#8b5cf6",
10862
+ purple: "#a855f7",
10863
+ fuchsia: "#d946ef",
10864
+ pink: "#ec4899",
10865
+ rose: "#f43f5e",
10866
+ };
10867
+
10868
+ /**
10869
+ * Convert a color value to a CSS-usable color.
10870
+ * If it's a Tailwind family name, map to its hex 500 shade.
10871
+ * If it already looks like a hex/rgb/hsl value, return as-is.
10872
+ */
10873
+ function toDisplayColor(value) {
10874
+ if (!value) return "";
10875
+ const lower = value.toLowerCase().trim();
10876
+ if (TAILWIND_COLORS[lower]) return TAILWIND_COLORS[lower];
10877
+ return value;
10878
+ }
10879
+
10805
10880
  /**
10806
10881
  * Extract primary/secondary/tertiary/neutral colors from a theme object.
10807
10882
  * Theme objects store colors in various structures; this normalizes them.
10883
+ * Converts Tailwind color family names to hex values for display.
10808
10884
  */
10809
10885
  function extractColors(themeData) {
10810
10886
  const colors = {
@@ -10831,6 +10907,12 @@ function extractColors(themeData) {
10831
10907
  if (themeData.colors.neutral) colors.neutral = themeData.colors.neutral;
10832
10908
  }
10833
10909
 
10910
+ // Convert Tailwind names to hex
10911
+ colors.primary = toDisplayColor(colors.primary);
10912
+ colors.secondary = toDisplayColor(colors.secondary);
10913
+ colors.tertiary = toDisplayColor(colors.tertiary);
10914
+ colors.neutral = toDisplayColor(colors.neutral);
10915
+
10834
10916
  return colors;
10835
10917
  }
10836
10918