@unlayer/react-elements 0.1.15 → 0.1.16

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
@@ -408,6 +408,16 @@ function mapSemanticProps(props, defaultValues, componentType) {
408
408
  if (Object.keys(collected).length > 0) {
409
409
  final.border = { ...final.border || {}, ...collected };
410
410
  }
411
+ if (final.border && typeof final.border === "object") {
412
+ const b = { ...final.border };
413
+ for (const key of Object.keys(b)) {
414
+ if (!/Width$/.test(key)) continue;
415
+ const v = b[key];
416
+ if (typeof v === "number") b[key] = `${v}px`;
417
+ else if (typeof v === "string" && /^\d+(?:\.\d+)?$/.test(v.trim())) b[key] = `${v.trim()}px`;
418
+ }
419
+ final.border = b;
420
+ }
411
421
  }
412
422
  return final;
413
423
  }
@@ -1223,10 +1233,17 @@ var Row = (props) => {
1223
1233
  ...semanticProps
1224
1234
  } = props;
1225
1235
  const mode = modeProp ?? _config?.mode ?? "web";
1226
- let cells = propsCells || [1];
1236
+ let cells;
1227
1237
  if (layout) {
1228
1238
  validateColumnLayout(layout, React.Children.count(children));
1229
1239
  cells = layout.cells;
1240
+ } else if (propsCells) {
1241
+ cells = propsCells;
1242
+ } else {
1243
+ const columnCount = React.Children.toArray(children).filter(
1244
+ (c) => React.isValidElement(c) && /^Column$/.test(c.type?.displayName || c.type?.name || "")
1245
+ ).length;
1246
+ cells = Array(Math.max(1, columnCount)).fill(1);
1230
1247
  }
1231
1248
  const safeBodyValues = { ...DEFAULT_BODY_VALUES, ...bodyValues };
1232
1249
  const values = mapSemanticProps(