@bitrise/bitkit 9.15.0 → 9.16.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit",
3
3
  "description": "Bitrise React component library",
4
- "version": "9.15.0",
4
+ "version": "9.16.2",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -10,6 +10,6 @@ const Box = forwardRef<BoxProps, 'div'>((props, ref) => {
10
10
  return <ChakraBox {...props} ref={ref} />;
11
11
  });
12
12
 
13
- export { BoxProps } from '@chakra-ui/react';
13
+ export type { BoxProps };
14
14
 
15
15
  export default Box;
@@ -23,6 +23,7 @@ type TextTags =
23
23
  | 'h6'
24
24
  | 'kbd'
25
25
  | 'li'
26
+ | 'label'
26
27
  | 'mark'
27
28
  | 'p'
28
29
  | 'pre'
@@ -43,7 +44,6 @@ export interface TextProps extends ChakraTextProps {
43
44
  */
44
45
  as?: TextTags;
45
46
  className?: string;
46
- color?: 'body' | 'secondary' | string;
47
47
  /**
48
48
  * Font weight
49
49
  */
@@ -53,22 +53,28 @@ export interface TextProps extends ChakraTextProps {
53
53
  */
54
54
  size?: TextSizes;
55
55
  textTransform?: 'capitalize' | 'lowercase' | 'none' | 'uppercase';
56
+ hasEllipsis?: boolean;
56
57
  }
57
58
 
58
59
  /**
59
60
  * `Text` component is the used to render text and paragraphs within an interface. It renders a `<p>` tag by default.
60
61
  */
61
62
  const Text = forwardRef<TextProps, 'p'>((props, ref) => {
62
- const { color, fontWeight, size, textTransform } = props;
63
- const properties: ChakraTextProps = { ...props };
63
+ const { fontWeight, size, textTransform, hasEllipsis, ...rest } = props;
64
+ const properties: ChakraTextProps = { fontWeight, size, textTransform, ...rest };
64
65
  if (size === '1' && (!textTransform || textTransform === 'none')) {
65
66
  properties.textTransform = 'uppercase';
66
67
  }
67
68
  if (!fontWeight && (size === '5' || size === '6' || size === '7' || size === '8')) {
68
69
  properties.fontWeight = 'bold';
69
70
  }
70
- if (color) {
71
- properties.color = `text.${color}`;
71
+ if (hasEllipsis) {
72
+ if (!properties.maxWidth) {
73
+ properties.maxWidth = '100%';
74
+ }
75
+ properties.textOverflow = 'ellipsis';
76
+ properties.whiteSpace = 'nowrap';
77
+ properties.overflow = 'hidden';
72
78
  }
73
79
  return <ChakraText {...properties} ref={ref} />;
74
80
  });
@@ -17,6 +17,13 @@ const typography = {
17
17
  normal: 400,
18
18
  bold: 700,
19
19
  },
20
+ letterSpacings: {
21
+ '1': '0.00625rem',
22
+ '2': '0.009375rem',
23
+ '3': '0.0175rem',
24
+ '4': '0.0375rem',
25
+ '5': '0.05rem',
26
+ },
20
27
  lineHeights: {
21
28
  '1': '1rem',
22
29
  '2': '1.25rem',
package/src/index.ts CHANGED
@@ -29,5 +29,11 @@ export { default as Card } from './Components/Card/Card';
29
29
  export type { CardContentProps } from './Components/Card/CardContent';
30
30
  export { default as CardContent } from './Components/Card/CardContent';
31
31
 
32
+ export type { TextProps } from './Components/Text/Text';
33
+ export { default as Text } from './Components/Text/Text';
34
+
35
+ export type { BoxProps } from './Components/Box/Box';
36
+ export { default as Box } from './Components/Box/Box';
37
+
32
38
  export type { ColorButtonProps } from './Components/ColorButton/ColorButton';
33
39
  export { default as ColorButton } from './Components/ColorButton/ColorButton';
package/src/old.ts CHANGED
@@ -232,12 +232,6 @@ export { default as Tab } from './Old/Tabs/Tab';
232
232
  export type { Props as TabsProps } from './Old/Tabs/Tabs';
233
233
  export { default as Tabs } from './Old/Tabs/Tabs';
234
234
 
235
- export type { Props as TextProps } from './Old/Text/Text';
236
- export type { TypeTextLetterSpacing } from './Old/Text/Text';
237
- export type { TypeTextSize } from './Old/Text/Text';
238
- export type { TypeTextWeight } from './Old/Text/Text';
239
- export { default as Text } from './Old/Text/Text';
240
-
241
235
  export type { Props as TextareaProps } from './Old/Textarea/Textarea';
242
236
  export { default as Textarea } from './Old/Textarea/Textarea';
243
237
 
package/src/tsconfig.json CHANGED
@@ -3,4 +3,4 @@
3
3
  "include": [
4
4
  "**/*"
5
5
  ]
6
- }
6
+ }