@bitrise/bitkit 13.304.0 → 13.306.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit",
3
3
  "description": "Bitrise React component library",
4
- "version": "13.304.0",
4
+ "version": "13.306.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
@@ -16,6 +16,7 @@ const LinkTheme = {
16
16
  },
17
17
  _hover: {
18
18
  color: hover,
19
+ textDecoration: 'underline',
19
20
  },
20
21
  color,
21
22
  fontSize: textStyle ? undefined : 'inherit',
@@ -0,0 +1,39 @@
1
+ import { defineStyle, defineStyleConfig } from 'chakra-ui-2--styled-system';
2
+
3
+ const baseStyle = defineStyle(() => {
4
+ return {
5
+ display: 'inline-flex',
6
+ alignItems: 'center',
7
+ gap: '4',
8
+ color: 'text/link',
9
+ _active: {
10
+ color: 'text/primary',
11
+ backgroundColor: `transparent`,
12
+ },
13
+ _hover: {
14
+ color: 'text/link-hover',
15
+ backgroundColor: `transparent`,
16
+ },
17
+ _disabled: {
18
+ color: 'text/disabled',
19
+ cursor: 'not-allowed',
20
+ },
21
+ };
22
+ });
23
+
24
+ const linkButtonTheme = defineStyleConfig({
25
+ baseStyle,
26
+ sizes: {
27
+ lg: {
28
+ textStyle: 'body/lg/regular',
29
+ },
30
+ md: {
31
+ textStyle: 'body/md/regular',
32
+ },
33
+ sm: {
34
+ textStyle: 'body/sm/regular',
35
+ },
36
+ },
37
+ });
38
+
39
+ export default linkButtonTheme;
@@ -0,0 +1,24 @@
1
+ import { forwardRef, useStyleConfig } from 'chakra-ui-2--react';
2
+ import Icon, { TypeIconName } from '../Icon/Icon';
3
+ import Box, { BoxProps } from '../Box/Box';
4
+
5
+ export interface LinkButtonProps extends BoxProps {
6
+ isDisabled?: boolean;
7
+ rightIconName?: TypeIconName;
8
+ size?: 'sm' | 'md' | 'lg';
9
+ }
10
+
11
+ const LinkButton = forwardRef<LinkButtonProps, 'div'>((props, ref) => {
12
+ const { rightIconName, isDisabled = false, size = 'lg', children, ...rest } = props;
13
+
14
+ const styles = useStyleConfig('LinkButton', { size, ...rest });
15
+
16
+ return (
17
+ <Box as="button" disabled={isDisabled} ref={ref} _css={styles} {...rest}>
18
+ {children}
19
+ {rightIconName && <Icon name={rightIconName} size="16" />}
20
+ </Box>
21
+ );
22
+ });
23
+
24
+ export default LinkButton;
@@ -14,6 +14,7 @@ import Divider from './Divider/Divider.theme';
14
14
  import Drawer from './Drawer/Drawer.theme';
15
15
  import EmptyState from './EmptyState/EmptyState.theme';
16
16
  import Link from './Link/Link.theme';
17
+ import LinkButton from './LinkButton/LinkButton.theme';
17
18
  import List from './List/List.theme';
18
19
  import Menu from './Menu/Menu.theme';
19
20
  import Radio from './Form/Radio/Radio.theme';
@@ -80,6 +81,7 @@ const components = {
80
81
  Filter,
81
82
  Input,
82
83
  Link,
84
+ LinkButton,
83
85
  List,
84
86
  Menu,
85
87
  Modal: Dialog,