@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.
package/dist/index.js CHANGED
@@ -35894,6 +35894,12 @@ var LAYOUT_MODE_CLASSES = {
35894
35894
  };
35895
35895
  var ALIGN_CLASSES = { start: "items-start", center: "items-center", end: "items-end", stretch: "items-stretch" };
35896
35896
  var JUSTIFY_CLASSES = { start: "justify-start", center: "justify-center", end: "justify-end", between: "justify-between", around: "justify-around" };
35897
+ var tokenPathToCssVariable = (value) => {
35898
+ const path = value.slice(1).trim();
35899
+ if (!/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/i.test(path)) throw new TypeError(`Invalid Design Token path ${value}.`);
35900
+ return `var(--monkeys-${path.replace(/\./g, "-").replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase()})`;
35901
+ };
35902
+ var resolveRenderNodeStyle = (style) => style ? Object.fromEntries(Object.entries(style).map(([property, value]) => [property, typeof value === "string" && value.startsWith("$") ? tokenPathToCssVariable(value) : value])) : void 0;
35897
35903
  var getRenderLayoutClassName = (layout) => cn(
35898
35904
  LAYOUT_MODE_CLASSES[layout.mode],
35899
35905
  layout.mode === "flex" && (layout.direction === "row" ? "flex-row" : "flex-col"),
@@ -36044,6 +36050,7 @@ var RenderNodeHost = React4.forwardRef(function RenderNodeHost2({
36044
36050
  className: cn((!unframed || resolvedLayout.mode !== "contents") && getRenderLayoutClassName(resolvedLayout), className),
36045
36051
  style: {
36046
36052
  ...resolvedLayout.mode === "grid" && resolvedLayout.columns ? { gridTemplateColumns: `repeat(${resolvedLayout.columns}, minmax(0, 1fr))` } : {},
36053
+ ...resolveRenderNodeStyle(node.style),
36047
36054
  ...props.style
36048
36055
  },
36049
36056
  hidden: hidden || !policyState.visible || void 0,