@trackunit/react-components 7.0.9 → 8.0.0

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.
@@ -85,6 +85,6 @@ export interface ButtonProps extends MappedOmit<ButtonCommonProps, "size">, Refa
85
85
  * @returns {ReactElement} Button component
86
86
  */
87
87
  export declare const Button: {
88
- ({ onClick, children, loading, disabled, className, fullWidth, prefix, suffix, variant, type, size, square, "data-testid": dataTestId, title, ariaLabel, ariaLabelledBy, ariaDescribedBy, ariaHidden, role, tabIndex, asChild, ref, ...rest }: ButtonProps): ReactElement;
88
+ ({ onClick, children, loading, disabled, className, fullWidth, prefix, suffix, variant, type, size, square, "data-testid": dataTestId, title, ariaLabel, ariaLabelledBy, ariaDescribedBy, ariaHidden, role, tabIndex, asChild, keepFocus, onMouseDown, ref, ...rest }: ButtonProps): ReactElement;
89
89
  displayName: string;
90
90
  };
@@ -10,6 +10,10 @@ export interface ButtonCommonProps extends CommonProps, Styleable, AriaProps {
10
10
  * An onClick handler
11
11
  */
12
12
  onClick?: MouseEventHandler<HTMLButtonElement>;
13
+ /**
14
+ * A MouseDown handler function
15
+ */
16
+ onMouseDown?: MouseEventHandler<HTMLButtonElement>;
13
17
  /**
14
18
  * A MouseEnter handler function
15
19
  */
@@ -22,6 +26,13 @@ export interface ButtonCommonProps extends CommonProps, Styleable, AriaProps {
22
26
  * A Blur handler function
23
27
  */
24
28
  onBlur?: FocusEventHandler<HTMLButtonElement>;
29
+ /**
30
+ * Set `keepFocus` when the button belongs to an input, like a clear button in a search field,
31
+ * so clicking it doesn't move focus away. Keyboard focus and Tab order are unaffected.
32
+ *
33
+ * @default false
34
+ */
35
+ keepFocus?: boolean;
25
36
  /**
26
37
  * Whether the button is loading.
27
38
  */