@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.
@@ -2944,6 +2944,12 @@ var LAYOUT_MODE_CLASSES = {
2944
2944
  };
2945
2945
  var ALIGN_CLASSES = { start: "items-start", center: "items-center", end: "items-end", stretch: "items-stretch" };
2946
2946
  var JUSTIFY_CLASSES = { start: "justify-start", center: "justify-center", end: "justify-end", between: "justify-between", around: "justify-around" };
2947
+ var tokenPathToCssVariable = (value) => {
2948
+ const path = value.slice(1).trim();
2949
+ if (!/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/i.test(path)) throw new TypeError(`Invalid Design Token path ${value}.`);
2950
+ return `var(--monkeys-${path.replace(/\./g, "-").replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase()})`;
2951
+ };
2952
+ var resolveRenderNodeStyle = (style) => style ? Object.fromEntries(Object.entries(style).map(([property, value]) => [property, typeof value === "string" && value.startsWith("$") ? tokenPathToCssVariable(value) : value])) : void 0;
2947
2953
  var getRenderLayoutClassName = (layout) => cn(
2948
2954
  LAYOUT_MODE_CLASSES[layout.mode],
2949
2955
  layout.mode === "flex" && (layout.direction === "row" ? "flex-row" : "flex-col"),
@@ -3094,6 +3100,7 @@ var RenderNodeHost = React5.forwardRef(function RenderNodeHost2({
3094
3100
  className: cn((!unframed || resolvedLayout.mode !== "contents") && getRenderLayoutClassName(resolvedLayout), className),
3095
3101
  style: {
3096
3102
  ...resolvedLayout.mode === "grid" && resolvedLayout.columns ? { gridTemplateColumns: `repeat(${resolvedLayout.columns}, minmax(0, 1fr))` } : {},
3103
+ ...resolveRenderNodeStyle(node.style),
3097
3104
  ...props.style
3098
3105
  },
3099
3106
  hidden: hidden || !policyState.visible || void 0,