@bitrise/bitkit 9.3.0-alpha.2 → 9.3.0-alpha.3

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit",
3
3
  "description": "Bitrise React component library",
4
- "version": "9.3.0-alpha.2",
4
+ "version": "9.3.0-alpha.3",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "lib/cjs/index.js",
7
7
  "esnext": "lib/esn/index.js",
@@ -34,14 +34,14 @@
34
34
  <>
35
35
  <Base margin="x12">
36
36
  <Buttons alignChildrenVertical="end" margin="x3">
37
- <Button2 as="a" href="https://www.bitrise.io" size="small" target="_blank">Primary</Button2>
37
+ <Button2 as="a" href="https://www.bitrise.io" onClick={ (e) => console.log(e) } size="small" target="_blank">Primary</Button2>
38
38
  <Button2 disabled size="small" variant="primary">Disabled</Button2>
39
- <Button2 size="medium" variant="primary">Primary</Button2>
39
+ <Button2 size="medium" type="submit" variant="primary">Primary</Button2>
40
40
  <Button2 disabled size="medium" variant="primary">Disabled</Button2>
41
41
  </Buttons>
42
42
 
43
43
  <Buttons alignChildrenVertical="end" margin="x3">
44
- <Button2 size="small" variant="secondary">Secondary</Button2>
44
+ <Button2 onClick={ () => alert('onClick') } size="small" variant="secondary">Secondary</Button2>
45
45
  <Button2 disabled size="small" variant="secondary">Disabled</Button2>
46
46
  <Button2 size="medium" variant="secondary">Secondary</Button2>
47
47
  <Button2 disabled size="medium" variant="secondary">Disabled</Button2>
@@ -5,19 +5,12 @@ import { Button as ChakraButton, ButtonProps } from '@chakra-ui/react';
5
5
  interface Props extends Pick<ButtonProps, 'as' | 'disabled' | 'leftIcon' | 'rightIcon' |'sx'> {
6
6
  children: ButtonProps['children'];
7
7
  href?: string;
8
- /**
9
- * Allows the Button to fill the container space rather than shrinking
10
- * down to the content
11
- */
12
- variant?: 'primary' | 'secondary' | 'tertiary' | 'dangerPrimary' | 'dangerSecondary';
13
- /**
14
- * Sets the size of the Button. Small allows the Button to fit
15
- * into smaller spaces, while large will help the button stand
16
- * out on a page with lots of space.
17
- */
8
+ onClick?: (e: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement, MouseEvent>) => void;
18
9
  size?: 'small' | 'medium';
19
10
  target?: '_blank' | '_parent' | '_self' | '_top';
20
- }
11
+ type?: ButtonProps['type'];
12
+ variant?: 'primary' | 'secondary' | 'tertiary' | 'dangerPrimary' | 'dangerSecondary';
13
+ }
21
14
 
22
15
  const Button2 = (props: Props) => {
23
16
  const defaults = {