@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 +1 -1
- package/src/Components/Box/Box.tsx +1 -1
- package/src/Components/Text/Text.tsx +11 -5
- package/src/Foundations/Typography/Typography.ts +7 -0
- package/src/index.ts +6 -0
- package/src/old.ts +0 -6
- package/src/tsconfig.json +1 -1
- package/src/tsconfig.tsbuildinfo +1 -1
- package/tsconfig.json +1 -0
package/package.json
CHANGED
|
@@ -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 {
|
|
63
|
-
const properties: ChakraTextProps = { ...
|
|
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 (
|
|
71
|
-
properties.
|
|
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
|
});
|
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