@synerise/ds-typography 0.12.10 → 0.13.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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.13.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-typography@0.12.10...@synerise/ds-typography@0.13.0) (2023-09-26)
7
+
8
+
9
+ ### Features
10
+
11
+ * **typography:** ellipsis with conditional tooltip ([4448c30](https://github.com/synerise/synerise-design/commit/4448c304837bf8a04d5009ffcb47f67421003738))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [0.12.10](https://github.com/synerise/synerise-design/compare/@synerise/ds-typography@0.12.9...@synerise/ds-typography@0.12.10) (2023-09-08)
7
18
 
8
19
 
@@ -1,7 +1,6 @@
1
1
  export declare const Description: import("styled-components").StyledComponent<"div", any, {
2
2
  disabled?: boolean | undefined;
3
3
  }, never>;
4
- export declare const EllipsisText: import("styled-components").StyledComponent<"div", any, {}, never>;
5
4
  export declare const ErrorText: import("styled-components").StyledComponent<"div", any, {}, never>;
6
5
  export declare const Label: import("styled-components").StyledComponent<"label", any, {}, never>;
7
6
  export declare const MediumText: import("styled-components").StyledComponent<"span", any, {}, never>;
@@ -31,3 +30,4 @@ export declare const H6: import("styled-components").StyledComponent<"h6", any,
31
30
  export declare const H7: import("styled-components").StyledComponent<"h6", any, {
32
31
  withoutMargin: boolean;
33
32
  }, never>;
33
+ export declare const EllipsisText: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -8,61 +8,57 @@ export var Description = styled.div.withConfig({
8
8
  }, function (props) {
9
9
  return props.disabled ? "opacity: 0.4;" : '';
10
10
  });
11
- export var EllipsisText = styled.div.withConfig({
12
- displayName: "CommonElements__EllipsisText",
13
- componentId: "sc-102d2aw-1"
14
- })(["display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;"]);
15
11
  export var ErrorText = styled.div.withConfig({
16
12
  displayName: "CommonElements__ErrorText",
17
- componentId: "sc-102d2aw-2"
13
+ componentId: "sc-102d2aw-1"
18
14
  })(["color:", ";margin-bottom:4px;"], function (props) {
19
15
  return props.theme.palette['red-600'];
20
16
  });
21
17
  export var Label = styled.label.withConfig({
22
18
  displayName: "CommonElements__Label",
23
- componentId: "sc-102d2aw-3"
19
+ componentId: "sc-102d2aw-2"
24
20
  })(["color:", ";font-weight:500;display:block;cursor:pointer;"], function (props) {
25
21
  return props.theme.palette['grey-800'];
26
22
  });
27
23
  export var MediumText = styled.span.withConfig({
28
24
  displayName: "CommonElements__MediumText",
29
- componentId: "sc-102d2aw-4"
25
+ componentId: "sc-102d2aw-3"
30
26
  })(["", ""], function () {
31
27
  return css(["", ";"], medium);
32
28
  });
33
29
  export var SmallText = styled.span.withConfig({
34
30
  displayName: "CommonElements__SmallText",
35
- componentId: "sc-102d2aw-5"
31
+ componentId: "sc-102d2aw-4"
36
32
  })(["", ""], function () {
37
33
  return css(["", ";"], small);
38
34
  });
39
35
  export var XSmallText = styled.span.withConfig({
40
36
  displayName: "CommonElements__XSmallText",
41
- componentId: "sc-102d2aw-6"
37
+ componentId: "sc-102d2aw-5"
42
38
  })(["", ""], function () {
43
39
  return css(["", ";"], xsmall);
44
40
  });
45
41
  export var MediumParagraph = styled.span.withConfig({
46
42
  displayName: "CommonElements__MediumParagraph",
47
- componentId: "sc-102d2aw-7"
43
+ componentId: "sc-102d2aw-6"
48
44
  })(["", ""], function () {
49
45
  return css(["", ";"], medium);
50
46
  });
51
47
  export var SmallParagraph = styled.span.withConfig({
52
48
  displayName: "CommonElements__SmallParagraph",
53
- componentId: "sc-102d2aw-8"
49
+ componentId: "sc-102d2aw-7"
54
50
  })(["", ""], function () {
55
51
  return css(["", ";"], small);
56
52
  });
57
53
  export var XSmallParagraph = styled.span.withConfig({
58
54
  displayName: "CommonElements__XSmallParagraph",
59
- componentId: "sc-102d2aw-9"
55
+ componentId: "sc-102d2aw-8"
60
56
  })(["", ""], function () {
61
57
  return css(["", ";"], xsmall);
62
58
  });
63
59
  export var H1 = styled.h1.withConfig({
64
60
  displayName: "CommonElements__H1",
65
- componentId: "sc-102d2aw-10"
61
+ componentId: "sc-102d2aw-9"
66
62
  })(["", " ", ""], function () {
67
63
  return css(["", ";"], h700);
68
64
  }, function (props) {
@@ -70,7 +66,7 @@ export var H1 = styled.h1.withConfig({
70
66
  });
71
67
  export var H2 = styled.h2.withConfig({
72
68
  displayName: "CommonElements__H2",
73
- componentId: "sc-102d2aw-11"
69
+ componentId: "sc-102d2aw-10"
74
70
  })(["", " ", ""], function () {
75
71
  return css(["", ";"], h600);
76
72
  }, function (props) {
@@ -78,7 +74,7 @@ export var H2 = styled.h2.withConfig({
78
74
  });
79
75
  export var H3 = styled.h3.withConfig({
80
76
  displayName: "CommonElements__H3",
81
- componentId: "sc-102d2aw-12"
77
+ componentId: "sc-102d2aw-11"
82
78
  })(["", " ", ""], function () {
83
79
  return css(["", ";"], h500);
84
80
  }, function (props) {
@@ -86,7 +82,7 @@ export var H3 = styled.h3.withConfig({
86
82
  });
87
83
  export var H4 = styled.h4.withConfig({
88
84
  displayName: "CommonElements__H4",
89
- componentId: "sc-102d2aw-13"
85
+ componentId: "sc-102d2aw-12"
90
86
  })(["", " ", ""], function () {
91
87
  return css(["", ";"], h400);
92
88
  }, function (props) {
@@ -94,7 +90,7 @@ export var H4 = styled.h4.withConfig({
94
90
  });
95
91
  export var H5 = styled.h5.withConfig({
96
92
  displayName: "CommonElements__H5",
97
- componentId: "sc-102d2aw-14"
93
+ componentId: "sc-102d2aw-13"
98
94
  })(["", " ", ""], function () {
99
95
  return css(["", ";"], h300);
100
96
  }, function (props) {
@@ -102,7 +98,7 @@ export var H5 = styled.h5.withConfig({
102
98
  });
103
99
  export var H6 = styled.h6.withConfig({
104
100
  displayName: "CommonElements__H6",
105
- componentId: "sc-102d2aw-15"
101
+ componentId: "sc-102d2aw-14"
106
102
  })(["", " ", ""], function () {
107
103
  return css(["", ";"], h200);
108
104
  }, function (props) {
@@ -110,9 +106,13 @@ export var H6 = styled.h6.withConfig({
110
106
  });
111
107
  export var H7 = styled.h6.withConfig({
112
108
  displayName: "CommonElements__H7",
113
- componentId: "sc-102d2aw-16"
109
+ componentId: "sc-102d2aw-15"
114
110
  })(["", " ", ""], function () {
115
111
  return css(["", ";"], h100);
116
112
  }, function (props) {
117
113
  return props.withoutMargin && css(["margin-bottom:0;"]);
118
- });
114
+ });
115
+ export var EllipsisText = styled.div.withConfig({
116
+ displayName: "CommonElements__EllipsisText",
117
+ componentId: "sc-102d2aw-16"
118
+ })(["display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;", ",", ",", ",", ",", ",", ",", "{display:inline;}"], H1, H2, H3, H4, H5, H6, H7);
package/dist/Title.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ /// <reference types="react" />
2
2
  import { Props } from './Title.types';
3
- declare const Title: React.FC<Props>;
3
+ declare const Title: ({ level, withoutMargin, children, className, ellipsis }: Props) => JSX.Element;
4
4
  export default Title;
package/dist/Title.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import classNames from 'classnames';
3
3
  import { H1, H2, H3, H4, H5, H6, H7 } from './CommonElements';
4
+ import { Ellipsis } from './Ellipsis';
4
5
  var StyledElements = {
5
6
  1: H1,
6
7
  2: H2,
@@ -16,15 +17,20 @@ var Title = function Title(_ref) {
16
17
  level = _ref$level === void 0 ? 1 : _ref$level,
17
18
  withoutMargin = _ref.withoutMargin,
18
19
  children = _ref.children,
19
- className = _ref.className;
20
- var TitleElement = React.useMemo(function () {
21
- return StyledElements[level];
22
- }, [level]);
20
+ className = _ref.className,
21
+ ellipsis = _ref.ellipsis;
22
+ var TitleElement = StyledElements[level];
23
23
  var elementClassName = classNames('ds-title', className);
24
- return /*#__PURE__*/React.createElement(TitleElement, {
24
+ var content = /*#__PURE__*/React.createElement(TitleElement, {
25
25
  className: elementClassName,
26
26
  withoutMargin: Boolean(withoutMargin)
27
27
  }, children);
28
+
29
+ if (ellipsis === undefined) {
30
+ return content;
31
+ }
32
+
33
+ return /*#__PURE__*/React.createElement(Ellipsis, ellipsis, content);
28
34
  };
29
35
 
30
36
  export default Title;
@@ -1,5 +1,7 @@
1
1
  import { TitleProps } from 'antd/es/typography/Title';
2
- export interface Props extends Omit<TitleProps, 'level'> {
2
+ import type { EllipsisProps } from './Ellipsis';
3
+ export interface Props extends Omit<TitleProps, 'level' | 'ellipsis'> {
3
4
  level: 1 | 2 | 3 | 4 | 5 | 6 | 7;
4
5
  withoutMargin?: boolean;
6
+ ellipsis?: EllipsisProps;
5
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-typography",
3
- "version": "0.12.10",
3
+ "version": "0.13.0",
4
4
  "description": "Typography UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "synerise/synerise-design",
@@ -44,5 +44,5 @@
44
44
  "devDependencies": {
45
45
  "enzyme": "3.11.0"
46
46
  },
47
- "gitHead": "955a885f58b3fca4caa4f879deb147fe5b9dc6d8"
47
+ "gitHead": "f1f520c4c5ef9f90bacb5d5e0b2e778ceb8fdf79"
48
48
  }