@indico-data/design-system 3.11.0 → 3.13.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 +1 -21
- package/lib/index.d.ts +1 -21
- 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 +0 -4
- package/src/components/button/types.ts +1 -21
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.
|
|
@@ -17,9 +17,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>((props, ref) =>
|
|
|
17
17
|
onClick,
|
|
18
18
|
type = 'button',
|
|
19
19
|
size = 'md',
|
|
20
|
-
onMouseEnter,
|
|
21
20
|
onMouseExit,
|
|
22
|
-
onKeyDown,
|
|
23
21
|
className,
|
|
24
22
|
href,
|
|
25
23
|
...rest
|
|
@@ -54,9 +52,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>((props, ref) =>
|
|
|
54
52
|
aria-disabled={isLoading || isDisabled}
|
|
55
53
|
aria-busy={isLoading}
|
|
56
54
|
type={type}
|
|
57
|
-
onMouseEnter={onMouseEnter}
|
|
58
55
|
onMouseLeave={onMouseExit}
|
|
59
|
-
onKeyDown={onKeyDown}
|
|
60
56
|
{...rest}
|
|
61
57
|
>
|
|
62
58
|
{/* Loading Icon on the left (default) */}
|
|
@@ -6,35 +6,15 @@ export type ButtonSizes = 'xs' | 'sm' | 'md' | 'lg';
|
|
|
6
6
|
|
|
7
7
|
export type ButtonTypes = 'button' | 'submit' | 'reset';
|
|
8
8
|
|
|
9
|
-
export interface ButtonProps {
|
|
10
|
-
/**
|
|
11
|
-
* The class name to apply to the button
|
|
12
|
-
*/
|
|
13
|
-
className?: string;
|
|
9
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
14
10
|
/**
|
|
15
11
|
* The aria-label to apply to the button
|
|
16
12
|
*/
|
|
17
13
|
ariaLabel: string;
|
|
18
|
-
/**
|
|
19
|
-
* The children to apply to the button
|
|
20
|
-
*/
|
|
21
|
-
children?: React.ReactNode | React.ReactNode[];
|
|
22
|
-
/**
|
|
23
|
-
* The function to call when the mouse enters the button
|
|
24
|
-
*/
|
|
25
|
-
onMouseEnter?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
26
14
|
/**
|
|
27
15
|
* The function to call when the mouse exits the button
|
|
28
16
|
*/
|
|
29
17
|
onMouseExit?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
30
|
-
/**
|
|
31
|
-
* The function to call when the button is clicked
|
|
32
|
-
*/
|
|
33
|
-
onClick?: (...args: any[]) => void;
|
|
34
|
-
/**
|
|
35
|
-
* The function to call when the button is pressed
|
|
36
|
-
*/
|
|
37
|
-
onKeyDown?: (event: React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
38
18
|
/**
|
|
39
19
|
* Determines the visual style and emphasis level of the button
|
|
40
20
|
*/
|