@inf-monkeys-tech/monkeys-design 2.0.23 → 2.0.24

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.
@@ -2911,6 +2911,12 @@ var LAYOUT_MODE_CLASSES = {
2911
2911
  };
2912
2912
  var ALIGN_CLASSES = { start: "items-start", center: "items-center", end: "items-end", stretch: "items-stretch" };
2913
2913
  var JUSTIFY_CLASSES = { start: "justify-start", center: "justify-center", end: "justify-end", between: "justify-between", around: "justify-around" };
2914
+ var tokenPathToCssVariable = (value) => {
2915
+ const path = value.slice(1).trim();
2916
+ if (!/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/i.test(path)) throw new TypeError(`Invalid Design Token path ${value}.`);
2917
+ return `var(--monkeys-${path.replace(/\./g, "-").replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase()})`;
2918
+ };
2919
+ var resolveRenderNodeStyle = (style) => style ? Object.fromEntries(Object.entries(style).map(([property, value]) => [property, typeof value === "string" && value.startsWith("$") ? tokenPathToCssVariable(value) : value])) : void 0;
2914
2920
  var getRenderLayoutClassName = (layout) => cn(
2915
2921
  LAYOUT_MODE_CLASSES[layout.mode],
2916
2922
  layout.mode === "flex" && (layout.direction === "row" ? "flex-row" : "flex-col"),
@@ -3061,6 +3067,7 @@ var RenderNodeHost = forwardRef(function RenderNodeHost2({
3061
3067
  className: cn((!unframed || resolvedLayout.mode !== "contents") && getRenderLayoutClassName(resolvedLayout), className),
3062
3068
  style: {
3063
3069
  ...resolvedLayout.mode === "grid" && resolvedLayout.columns ? { gridTemplateColumns: `repeat(${resolvedLayout.columns}, minmax(0, 1fr))` } : {},
3070
+ ...resolveRenderNodeStyle(node.style),
3064
3071
  ...props.style
3065
3072
  },
3066
3073
  hidden: hidden || !policyState.visible || void 0,