@indico-data/design-system 3.11.0 → 3.12.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.
- package/lib/components/button/types.d.ts +4 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.esm.js +2 -2
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/button/Button.mdx +4 -0
- package/src/components/button/Button.stories.tsx +4 -0
- package/src/components/button/Button.tsx +2 -0
- package/src/components/button/types.ts +4 -0
package/package.json
CHANGED
|
@@ -14,6 +14,10 @@ The Button component is one of the most versitile components we can use in our D
|
|
|
14
14
|
|
|
15
15
|
<Controls of={ButtonStories.Default} />
|
|
16
16
|
|
|
17
|
+
## Event Handlers
|
|
18
|
+
|
|
19
|
+
Use the event props to respond to interactions, including `onBlur` for focus loss, `onClick` for activation, `onMouseEnter`/`onMouseExit` for hover changes, and `onKeyDown` for keyboard support.
|
|
20
|
+
|
|
17
21
|
## Sizes
|
|
18
22
|
|
|
19
23
|
The Sizes available are small (`xs`), medium (`sm`), large (`md`), and extra large (`lg`). The default size is medium.
|
|
@@ -20,6 +20,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>((props, ref) =>
|
|
|
20
20
|
onMouseEnter,
|
|
21
21
|
onMouseExit,
|
|
22
22
|
onKeyDown,
|
|
23
|
+
onBlur,
|
|
23
24
|
className,
|
|
24
25
|
href,
|
|
25
26
|
...rest
|
|
@@ -57,6 +58,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>((props, ref) =>
|
|
|
57
58
|
onMouseEnter={onMouseEnter}
|
|
58
59
|
onMouseLeave={onMouseExit}
|
|
59
60
|
onKeyDown={onKeyDown}
|
|
61
|
+
onBlur={onBlur}
|
|
60
62
|
{...rest}
|
|
61
63
|
>
|
|
62
64
|
{/* Loading Icon on the left (default) */}
|
|
@@ -27,6 +27,10 @@ export interface ButtonProps {
|
|
|
27
27
|
* The function to call when the mouse exits the button
|
|
28
28
|
*/
|
|
29
29
|
onMouseExit?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
30
|
+
/**
|
|
31
|
+
* The function to call when the button loses focus
|
|
32
|
+
*/
|
|
33
|
+
onBlur?: (event: React.FocusEvent<HTMLButtonElement>) => void;
|
|
30
34
|
/**
|
|
31
35
|
* The function to call when the button is clicked
|
|
32
36
|
*/
|