@bitrise/bitkit 9.12.0-alpha-button-release.4 → 9.13.0-alpha-button-release.2
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 +1 -1
- package/src/Components/Box/Box.tsx +3 -3
- package/src/Components/Button/Button.tsx +5 -5
- package/src/Components/Card/Card.tsx +3 -2
- package/src/Components/IconButton/IconButton.tsx +3 -3
- package/src/Components/Link/Link.tsx +3 -3
- package/src/Components/Text/Text.tsx +3 -3
- package/src/index.ts +1 -0
- package/src/tsconfig.tsbuildinfo +1 -1
- package/src/types/chakra.ts +1 -0
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.
|
|
4
|
+
"version": "9.13.0-alpha-button-release.2",
|
|
5
5
|
"repository": "git@github.com:bitrise-io/bitkit.git",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"license": "UNLICENSED",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { Box as ChakraBox, BoxProps } from '@chakra-ui/react';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box as ChakraBox, BoxProps, forwardRef } from '@chakra-ui/react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Box is the most abstract component on top of which all other components are built. By default, it renders a div element.
|
|
6
6
|
*
|
|
7
7
|
* And this is our CSS-in-JS component, you can use this with style props.
|
|
8
8
|
*/
|
|
9
|
-
const Box = forwardRef<
|
|
9
|
+
const Box = forwardRef<BoxProps, 'div'>((props, ref) => {
|
|
10
10
|
return <ChakraBox {...props} ref={ref} />;
|
|
11
11
|
});
|
|
12
12
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React, { HTMLAttributeAnchorTarget
|
|
2
|
-
import { Button as ChakraButton, ButtonProps as
|
|
1
|
+
import React, { HTMLAttributeAnchorTarget } from 'react';
|
|
2
|
+
import { Button as ChakraButton, ButtonProps as ChakraButtonProps, forwardRef } from '@chakra-ui/react';
|
|
3
3
|
import Icon from '../../Old/Icon/Icon';
|
|
4
4
|
import { TypeIconName } from '../../Old/Icon/tsx';
|
|
5
5
|
|
|
6
|
-
export interface ButtonProps extends
|
|
6
|
+
export interface ButtonProps extends ChakraButtonProps {
|
|
7
7
|
as?: 'a' | 'button';
|
|
8
8
|
href?: string;
|
|
9
9
|
isDanger?: boolean;
|
|
@@ -17,9 +17,9 @@ export interface ButtonProps extends ChackraButtonProps {
|
|
|
17
17
|
/**
|
|
18
18
|
* The Button component is used to trigger an action or event, such as submitting a form, opening a dialog, canceling an action, or performing a delete operation.
|
|
19
19
|
*/
|
|
20
|
-
const Button = forwardRef<
|
|
20
|
+
const Button = forwardRef<ButtonProps, 'button'>((props, ref) => {
|
|
21
21
|
const { as, isDanger, leftIconName, rightIconName, size, variant, ...rest } = props;
|
|
22
|
-
const properties:
|
|
22
|
+
const properties: ChakraButtonProps = {
|
|
23
23
|
as,
|
|
24
24
|
size,
|
|
25
25
|
variant: isDanger ? `${variant}--danger` : variant,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { forwardRef } from '@chakra-ui/react';
|
|
2
3
|
import { Radii } from '../../Foundations/Radii/Radii';
|
|
3
4
|
import { Shadows } from '../../Foundations/Shadows/Shadows';
|
|
4
5
|
import { Sizes } from '../../Foundations/Sizes/Sizes';
|
|
@@ -13,7 +14,7 @@ export interface CardProps extends BoxProps {
|
|
|
13
14
|
/**
|
|
14
15
|
* Basic container element with default box shadow, border radius and padding.
|
|
15
16
|
*/
|
|
16
|
-
const Card = forwardRef<
|
|
17
|
+
const Card = forwardRef<CardProps, 'div'>((props, ref) => {
|
|
17
18
|
return <Box {...props} ref={ref} />;
|
|
18
19
|
});
|
|
19
20
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { IconButton as ChakraIconButton, IconButtonProps } from '@chakra-ui/react';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconButton as ChakraIconButton, IconButtonProps, forwardRef } from '@chakra-ui/react';
|
|
3
3
|
import Icon from '../../Old/Icon/Icon';
|
|
4
4
|
import { TypeIconName } from '../../Old/Icon/tsx';
|
|
5
5
|
|
|
@@ -19,7 +19,7 @@ export interface Props extends IconButtonProps {
|
|
|
19
19
|
* TODO:
|
|
20
20
|
* - Change to Chakra powered Icon component
|
|
21
21
|
*/
|
|
22
|
-
const IconButton = forwardRef<
|
|
22
|
+
const IconButton = forwardRef<Props, 'button'>((props, ref) => {
|
|
23
23
|
const { iconName, isDanger, variant, ...rest } = props;
|
|
24
24
|
const properties: IconButtonProps = {
|
|
25
25
|
icon: <Icon name={iconName} />,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { Link as ChakraLink, LinkProps as ChakraLinkProps } from '@chakra-ui/react';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Link as ChakraLink, LinkProps as ChakraLinkProps, forwardRef } from '@chakra-ui/react';
|
|
3
3
|
import { TextSizes } from '../../Foundations/Typography/Typography';
|
|
4
4
|
|
|
5
5
|
export interface LinkProps extends ChakraLinkProps {
|
|
@@ -12,7 +12,7 @@ export interface LinkProps extends ChakraLinkProps {
|
|
|
12
12
|
/**
|
|
13
13
|
* Links are accessible elements used primarily for navigation.
|
|
14
14
|
*/
|
|
15
|
-
const Link = forwardRef<
|
|
15
|
+
const Link = forwardRef<LinkProps, 'a'>((props, ref) => {
|
|
16
16
|
const { as, isUnderlined, ...rest } = props;
|
|
17
17
|
const properties: ChakraLinkProps = { as, ...rest };
|
|
18
18
|
if (isUnderlined) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { Text as ChakraText, TextProps as ChakraTextProps } from '@chakra-ui/react';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text as ChakraText, TextProps as ChakraTextProps, forwardRef } from '@chakra-ui/react';
|
|
3
3
|
import { TextSizes } from '../../Foundations/Typography/Typography';
|
|
4
4
|
|
|
5
5
|
type TextTags =
|
|
@@ -58,7 +58,7 @@ export interface TextProps extends ChakraTextProps {
|
|
|
58
58
|
/**
|
|
59
59
|
* `Text` component is the used to render text and paragraphs within an interface. It renders a `<p>` tag by default.
|
|
60
60
|
*/
|
|
61
|
-
const Text = forwardRef<
|
|
61
|
+
const Text = forwardRef<TextProps, 'p'>((props, ref) => {
|
|
62
62
|
const { color, fontWeight, size, textTransform } = props;
|
|
63
63
|
const properties: ChakraTextProps = { ...props };
|
|
64
64
|
if (size === '1' && (!textTransform || textTransform === 'none')) {
|