@stella-source/stellasource-dsl 0.1.4 → 0.1.5

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/cjs/index.js CHANGED
@@ -17751,13 +17751,15 @@ const Loader = ({ size = 14, dataTestId, color, className, id, }) => {
17751
17751
  return (a$i.createElement(CustomLoader, { "data-testid": dataTestId, size: size, weight: "bold", color: color ?? "var(--primary)", className: className, id: id }));
17752
17752
  };
17753
17753
 
17754
- const StellaButton = ({ disabled, variant = "primary", label, startIcon, endIcon, isLoading = false, className, id, htmlProps, onClick, }) => {
17754
+ const StellaButton = ({ disabled, variant = "primary", label, startIcon, endIcon, isLoading = false, className, id, htmlProps, onClick, preventDefault = true, type = "button", }) => {
17755
17755
  const getIcon = (iconType, dataTestId) => {
17756
17756
  return a$i.createElement(StellaIcon, { iconName: iconType, dataTestId: dataTestId, size: 14 });
17757
17757
  };
17758
- return (a$i.createElement(ButtonComponent, { "$variant": variant, "$isLoading": isLoading, disabled: disabled, className: className, id: id, onClick: () => {
17759
- onClick();
17760
- }, ...htmlProps },
17758
+ const handleClick = (e) => {
17759
+ preventDefault && e.preventDefault();
17760
+ onClick?.(e);
17761
+ };
17762
+ return (a$i.createElement(ButtonComponent, { "$variant": variant, "$isLoading": isLoading, type: type, disabled: disabled, className: className, id: id, onClick: handleClick, ...htmlProps },
17761
17763
  startIcon && getIcon(startIcon, "start-icon"),
17762
17764
  label.toUpperCase(),
17763
17765
  isLoading && a$i.createElement(Loader, { dataTestId: "loader", size: 14 }),