@yoamigo.com/core 0.4.6 → 0.4.7

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.
Files changed (2) hide show
  1. package/dist/prod.js +8 -2
  2. package/package.json +1 -1
package/dist/prod.js CHANGED
@@ -197,9 +197,9 @@ function StaticLink({ fieldId, href: defaultHref = "#", className, style, as: Co
197
197
  const storeText = getValue(textFieldId);
198
198
  const storeHref = getValue(hrefFieldId);
199
199
  const href = storeHref || defaultHref;
200
+ const isIconMode = children != null && typeof children !== "string";
200
201
  const hasStoreText = Boolean(storeText);
201
202
  const hasStringChildren = typeof children === "string";
202
- const hasReactChildren = children && !hasStringChildren;
203
203
  const handleClick = (e) => {
204
204
  if (href.startsWith("#")) {
205
205
  e.preventDefault();
@@ -233,7 +233,13 @@ function StaticLink({ fieldId, href: defaultHref = "#", className, style, as: Co
233
233
  style,
234
234
  "data-ya-restricted": "true",
235
235
  "data-field-id": fieldId,
236
- children: hasStoreText || hasStringChildren ? /* @__PURE__ */ jsx5(SafeHtml, { content: storeText || children || "", mode }) : hasReactChildren ? children : null
236
+ children: isIconMode ? (
237
+ // Icon mode: render React children directly (SVGs, icons, etc.)
238
+ children
239
+ ) : hasStoreText || hasStringChildren ? (
240
+ // Text mode: render store text or string children via SafeHtml
241
+ /* @__PURE__ */ jsx5(SafeHtml, { content: storeText || children || "", mode })
242
+ ) : null
237
243
  }
238
244
  );
239
245
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoamigo.com/core",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "description": "Core components, router, and utilities for YoAmigo templates",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",