tailwind-styled-v4 5.1.19 → 5.1.21

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.mjs CHANGED
@@ -684,16 +684,19 @@ function parseSubKey(key) {
684
684
  function createSubComponentAccessor(parentDisplayName, name, classes, tag = "span", asChild = false) {
685
685
  const SubComponent = ({
686
686
  children,
687
- className
687
+ className,
688
+ ...rest
689
+ // tangkap semua native HTML props (href, onClick, src, alt, dll)
688
690
  }) => {
689
691
  const mergedClass = className ? `${classes} ${className}` : classes;
690
692
  if (asChild && React.isValidElement(children)) {
691
693
  const child = React.Children.only(children);
692
694
  return React.cloneElement(child, {
695
+ ...rest,
693
696
  className: child.props.className ? `${mergedClass} ${child.props.className}` : mergedClass
694
697
  });
695
698
  }
696
- return React.createElement(tag, { className: mergedClass }, children);
699
+ return React.createElement(tag, { ...rest, className: mergedClass }, children);
697
700
  };
698
701
  SubComponent.displayName = `${parentDisplayName}[${name}]`;
699
702
  return SubComponent;
@@ -969,8 +972,9 @@ function wrapWithSubProxy(component, tagLabel) {
969
972
  if (SKIP_PROXY_KEYS.has(prop)) return value;
970
973
  const Fallback = ({
971
974
  children,
972
- className
973
- }) => React.createElement("span", { className }, children);
975
+ className,
976
+ ...rest
977
+ }) => React.createElement("span", { ...rest, className }, children);
974
978
  Fallback.displayName = `tw.${tagLabel}.${prop}(fallback)`;
975
979
  return Fallback;
976
980
  }