@synerise/ds-typography 0.13.2 → 0.13.3

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.3](https://github.com/synerise/synerise-design/compare/@synerise/ds-typography@0.13.2...@synerise/ds-typography@0.13.3) (2023-11-09)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **table:** avatarlabel cell renderer ([d93ca75](https://github.com/synerise/synerise-design/commit/d93ca7586633a698b6a26923d8618c104276845b))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [0.13.2](https://github.com/synerise/synerise-design/compare/@synerise/ds-typography@0.13.1...@synerise/ds-typography@0.13.2) (2023-10-11)
7
18
 
8
19
  **Note:** Version bump only for package @synerise/ds-typography
@@ -115,4 +115,4 @@ export var H7 = styled.h6.withConfig({
115
115
  export var EllipsisText = styled.div.withConfig({
116
116
  displayName: "CommonElements__EllipsisText",
117
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);
118
+ })(["display:block;white-space:nowrap;text-overflow:ellipsis;max-width:100%;overflow:hidden;", ",", ",", ",", ",", ",", ",", "{display:inline;}"], H1, H2, H3, H4, H5, H6, H7);
package/dist/Ellipsis.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import React, { useRef, useEffect, useState } from 'react';
2
+ import { debounce } from 'lodash';
2
3
  import Tooltip from '@synerise/ds-tooltip';
3
4
  import { EllipsisText } from './CommonElements';
4
5
  export var Ellipsis = function Ellipsis(_ref) {
@@ -10,11 +11,26 @@ export var Ellipsis = function Ellipsis(_ref) {
10
11
  truncated = _useState[0],
11
12
  setTruncated = _useState[1];
12
13
 
14
+ var debouncedResize = useRef(debounce(function () {
15
+ if (textComponentRef && textComponentRef.current) {
16
+ setTruncated(textComponentRef.current.offsetWidth < textComponentRef.current.scrollWidth);
17
+ }
18
+ }, 100, {
19
+ leading: true,
20
+ trailing: true
21
+ })).current;
22
+ var resizeObserver = useRef(new window.ResizeObserver(debouncedResize)).current;
13
23
  useEffect(function () {
14
- if (textComponentRef != null && textComponentRef.current) {
15
- setTruncated((textComponentRef == null ? void 0 : textComponentRef.current.offsetWidth) < (textComponentRef == null ? void 0 : textComponentRef.current.scrollWidth));
24
+ if (textComponentRef.current) {
25
+ resizeObserver.observe(textComponentRef.current);
26
+ resizeObserver.observe(document.body);
16
27
  }
17
- }, [children]);
28
+
29
+ return function () {
30
+ resizeObserver.disconnect();
31
+ debouncedResize.cancel();
32
+ };
33
+ }, [resizeObserver, debouncedResize]);
18
34
  return /*#__PURE__*/React.createElement(Tooltip, {
19
35
  title: truncated ? tooltip : undefined
20
36
  }, /*#__PURE__*/React.createElement(EllipsisText, {
package/dist/Text.d.ts CHANGED
@@ -7,4 +7,4 @@ type TextProps = {
7
7
  children?: ReactNode;
8
8
  };
9
9
  export declare const Text: ({ size, children, ellipsis }: TextProps) => JSX.Element;
10
- export {};
10
+ export default Text;
package/dist/Text.js CHANGED
@@ -5,8 +5,7 @@ var MapSizeToComponent = {
5
5
  medium: MediumText,
6
6
  small: SmallText,
7
7
  xsmall: XSmallText
8
- }; // eslint-disable-next-line import/prefer-default-export
9
-
8
+ };
10
9
  export var Text = function Text(_ref) {
11
10
  var _ref$size = _ref.size,
12
11
  size = _ref$size === void 0 ? 'medium' : _ref$size,
@@ -22,4 +21,5 @@ export var Text = function Text(_ref) {
22
21
  }
23
22
 
24
23
  return /*#__PURE__*/React.createElement(Ellipsis, ellipsis, content);
25
- };
24
+ };
25
+ export default Text;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-typography",
3
- "version": "0.13.2",
3
+ "version": "0.13.3",
4
4
  "description": "Typography UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "synerise/synerise-design",
@@ -34,7 +34,8 @@
34
34
  "types": "dist/index.d.ts",
35
35
  "dependencies": {
36
36
  "@synerise/ds-tooltip": "0.14.2",
37
- "classnames": "2.3.2"
37
+ "classnames": "2.3.2",
38
+ "lodash": "^4.17.20"
38
39
  },
39
40
  "peerDependencies": {
40
41
  "@synerise/ds-core": "*",
@@ -45,5 +46,5 @@
45
46
  "devDependencies": {
46
47
  "enzyme": "3.11.0"
47
48
  },
48
- "gitHead": "8eb4a3e304406a8dbb9258803c48952461fc5a55"
49
+ "gitHead": "88f117b388bae43df3daf3be6ca725ff0355e54b"
49
50
  }