@alto-avios/alto-ui 1.2.1-alpha.2 → 1.2.1-alpha.4

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.
@@ -1,4 +1,4 @@
1
- import { ElementType } from 'react';
1
+ import { ComponentType, ElementType } from 'react';
2
2
  import { AriaButtonProps, PressEvent } from 'react-aria';
3
3
  export type NewButtonSize = 'lg' | 'md' | 'sm';
4
4
  export interface NewButtonProps<T extends ElementType> extends AriaButtonProps<T> {
@@ -77,6 +77,7 @@ export interface NewButtonProps<T extends ElementType> extends AriaButtonProps<T
77
77
  * What type of focus style to apply to the button.
78
78
  */
79
79
  focusStyle?: 'default' | 'white';
80
+ passthroughProps?: Partial<T extends ComponentType<infer P> ? P : T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T] : never>;
80
81
  }
81
- export declare const NewButton: <T extends ElementType = "button">({ as, styleType, emphasis, size, hasLeadingIcon, leadingIconName, hasTrailingIcon, trailingIconName, isDisabled, href, target, children, fullWidth, onClick, focusStyle, ...props }: NewButtonProps<T>) => import("react/jsx-runtime").JSX.Element;
82
+ export declare const NewButton: <T extends ElementType = "button">({ as, styleType, emphasis, size, hasLeadingIcon, leadingIconName, hasTrailingIcon, trailingIconName, isDisabled, href, target, children, fullWidth, onClick, focusStyle, passthroughProps, ...props }: NewButtonProps<T>) => import("react/jsx-runtime").JSX.Element;
82
83
  export default NewButton;
@@ -1401,6 +1401,7 @@ const NewButton = ({
1401
1401
  fullWidth: fullWidth2,
1402
1402
  onClick,
1403
1403
  focusStyle = "default",
1404
+ passthroughProps,
1404
1405
  ...props
1405
1406
  }) => {
1406
1407
  const ref = useRef(null);
@@ -1411,10 +1412,6 @@ const NewButton = ({
1411
1412
  buttonProps
1412
1413
  } = $701a24aa0da5b062$export$ea18c227d4417cc3({
1413
1414
  elementType: as,
1414
- onPress: onClick,
1415
- href: as === "a" ? href : void 0,
1416
- target: as === "a" ? target : void 0,
1417
- isDisabled,
1418
1415
  onFocus: (e) => {
1419
1416
  setIsFocused(true);
1420
1417
  if (props.onFocus) props.onFocus(e);
@@ -1454,7 +1451,7 @@ const NewButton = ({
1454
1451
  const Component = as;
1455
1452
  return /* @__PURE__ */ jsx(Component, { className: `${className} ${focusStyleVariants({
1456
1453
  focusStyle
1457
- })}`, ref, "data-focused": isFocused ? true : void 0, "data-hovered": isHovered ? true : void 0, "data-pressed": isPressed ? true : void 0, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ...filteredButtonProps, children: /* @__PURE__ */ jsxs(Fragment, { children: [
1454
+ })}`, ref, "data-focused": isFocused ? true : void 0, "data-hovered": isHovered ? true : void 0, "data-pressed": isPressed ? true : void 0, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ...filteredButtonProps, ...passthroughProps, children: /* @__PURE__ */ jsxs(Fragment, { children: [
1458
1455
  hasLeadingIcon && leadingIconName ? /* @__PURE__ */ jsx(Icon, { iconName: leadingIconName || "" }) : null,
1459
1456
  children,
1460
1457
  hasTrailingIcon && trailingIconName ? /* @__PURE__ */ jsx(Icon, { iconName: trailingIconName || "" }) : null
@@ -1 +1 @@
1
- {"version":3,"file":"NewButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alto-avios/alto-ui",
3
- "version": "1.2.1-alpha.2",
3
+ "version": "1.2.1-alpha.4",
4
4
  "description": "A react component library for Alto Design System",
5
5
  "author": "Ian Caldwell IAGL",
6
6
  "license": "MIT",