@octaviaflow/core 3.0.7 → 3.0.9

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
@@ -645,10 +645,14 @@ function Button({
645
645
  className,
646
646
  children,
647
647
  type,
648
+ cursor,
649
+ style,
648
650
  ...props
649
651
  }) {
650
652
  const ref = useRef3(null);
651
653
  const isDisabled = disabled || loading;
654
+ const hasAction = Boolean(props.onClick) || type === "submit" || type === "reset" || Boolean(props.href);
655
+ const resolvedCursor = cursor ?? (disabled ? "not-allowed" : loading ? "progress" : hasAction ? "pointer" : "default");
652
656
  const resolvedType = type ?? "button";
653
657
  const hasVisibleText = typeof children === "string" ? children.trim().length > 0 : Boolean(children);
654
658
  const needsAriaName = !hasVisibleText;
@@ -693,6 +697,7 @@ function Button({
693
697
  fullWidth && "ods-btn--full",
694
698
  className
695
699
  ),
700
+ style: { cursor: resolvedCursor, ...style },
696
701
  "data-loading": loading || void 0,
697
702
  whileTap: isDisabled ? void 0 : { scale: 0.97 },
698
703
  transition: { duration: 0.1 },