@stella-source/stellasource-dsl 0.1.3 → 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 }),
@@ -17881,9 +17883,9 @@ const IconContainer = dt.div `
17881
17883
  `;
17882
17884
 
17883
17885
  const TextFieldContainer = ({ id, label, children, tooltipText, endIcon, className, rightCategory, leftCategory, helperText, dataTestId, helperTextAffectLayout = true, disabled = false, hideLabel = false, isLoading = false, hasError = false, isRequired = false, }) => {
17884
- return (a$i.createElement(Wrapper, { "data-testId": dataTestId },
17886
+ return (a$i.createElement(Wrapper, { "data-testId": dataTestId, className: className },
17885
17887
  a$i.createElement(Label, { tooltipText: tooltipText, required: isRequired, labelValue: label, hideLabel: hideLabel, id: `${id}-label`, htmlFor: `${id}-text-field` }),
17886
- a$i.createElement(TextFieldWrapper, { id: id, className: className, "data-testid": "text-field-wrapper", "$hasError": hasError, "$isDisabled": disabled, "$isLoading": isLoading },
17888
+ a$i.createElement(TextFieldWrapper, { id: id, "$hasError": hasError, "$isDisabled": disabled, "$isLoading": isLoading, "data-testid": "text-input-wrapper" },
17887
17889
  leftCategory && a$i.createElement(Category, null, leftCategory),
17888
17890
  children,
17889
17891
  isLoading && (a$i.createElement(IconContainer, null,