@trops/dash-core 0.1.572 → 0.1.573

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/dist/index.js CHANGED
@@ -35302,24 +35302,20 @@ var ColorTile = function ColorTile(_ref) {
35302
35302
  level: colorLevelName
35303
35303
  }, rest));
35304
35304
 
35305
- // console.log("Color Model Tile ", c);
35306
-
35307
- // const stringColor = colorFromTheme === null ? `bg-${colorName}${shade !== null ? `-${shade}` : ''}` : colorFromTheme;
35308
- // const parts = colorFromTheme !== null ? colorFromTheme.split('-') : null;
35309
-
35310
- // const derivedShade = parts !== null ? parts[parts.length -1] : null;
35311
- // const derivedColorName = parts !== null ? parts[parts.length - 2] : null;
35312
-
35313
- // const stringThemeColorName = '';
35314
- // const objToSend = {
35315
- // colorName: colorName !== null ? colorName : colorFromTheme !== null && derivedColorName,
35316
- // shade: shade !== null ? shade : colorFromTheme !== null && derivedShade,
35317
- // stringColor,
35318
- // ...rest
35319
- // };
35320
-
35305
+ // If the channel value is a hex (custom-color theme — PRD
35306
+ // arbitrary-color-themes.md), `c.class` becomes `bg-#xxx-500`
35307
+ // which isn't a valid Tailwind class and renders as nothing
35308
+ // (the dark page background bleeds through, looking black).
35309
+ // Use inline style for hex backgrounds; named colors continue
35310
+ // through the className path so existing themes are unchanged.
35311
+ var colorIsHex = DashReact.isHexColor(colorName);
35312
+ var inlineStyle = colorIsHex ? {
35313
+ backgroundColor: colorName
35314
+ } : undefined;
35315
+ var bgClass = colorIsHex ? "" : c["class"];
35321
35316
  return /*#__PURE__*/jsxRuntime.jsx("div", {
35322
- className: "flex flex-col rounded-lg cursor-pointer items-center justify-center border-2 text-xs ".concat(selected === true ? "border-yellow-500" : "border-gray-800", " hover:border-yellow-500 border-gray-800 ").concat(c["class"], " ").concat(width, " ").concat(height),
35317
+ className: "flex flex-col rounded-lg cursor-pointer items-center justify-center border-2 text-xs ".concat(selected === true ? "border-yellow-500" : "border-gray-800", " hover:border-yellow-500 border-gray-800 ").concat(bgClass, " ").concat(width, " ").concat(height),
35318
+ style: inlineStyle,
35323
35319
  onClick: function onClick() {
35324
35320
  return _onClick !== null ? _onClick(_objectSpread$F(_objectSpread$F({}, c), rest)) : null;
35325
35321
  },