@spaced-out/ui-design-system 0.6.33 → 0.6.34

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
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.6.34](https://github.com/spaced-out/ui-design-system/compare/v0.6.33...v0.6.34) (2026-09-16)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * truncated text with tooltip issues ([#507](https://github.com/spaced-out/ui-design-system/issues/507)) ([8dd98b9](https://github.com/spaced-out/ui-design-system/commit/8dd98b903010b1fccf2e42cd3d370c56a5ab21be))
11
+
5
12
  ### [0.6.33](https://github.com/spaced-out/ui-design-system/compare/v0.6.32...v0.6.33) (2026-09-15)
6
13
 
7
14
 
@@ -1 +1 @@
1
- {"version":3,"file":"TruncatedTextWithTooltip.d.ts","sourceRoot":"","sources":["../../../src/components/TruncatedTextWithTooltip/TruncatedTextWithTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AAM7D,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC;AAEH,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAYD,eAAO,MAAM,wBAAwB,GAAI,uEAQtC,6BAA6B,sBAkG/B,CAAC"}
1
+ {"version":3,"file":"TruncatedTextWithTooltip.d.ts","sourceRoot":"","sources":["../../../src/components/TruncatedTextWithTooltip/TruncatedTextWithTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AAM7D,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC;AAEH,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,wBAAwB,GAAI,uEAQtC,6BAA6B,sBAiH/B,CAAC"}
@@ -8,16 +8,11 @@ var React = _interopRequireWildcard(require("react"));
8
8
  var _debounce = _interopRequireDefault(require("lodash/debounce"));
9
9
  var _classify = _interopRequireDefault(require("../../utils/classify"));
10
10
  var _qa = require("../../utils/qa");
11
- var _ConditionalWrapper = require("../ConditionalWrapper");
12
11
  var _Tooltip = require("../Tooltip");
13
12
  var _TruncatedTextWithTooltipModule = _interopRequireDefault(require("./TruncatedTextWithTooltip.module.css"));
14
13
  var _jsxRuntime = require("react/jsx-runtime");
15
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
15
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
17
- // Define the expected props for the child element that can be cloned
18
-
19
- // Type for a child element that can be cloned
20
-
21
16
  const TruncatedTextWithTooltip = _ref => {
22
17
  let {
23
18
  classNames,
@@ -41,6 +36,15 @@ const TruncatedTextWithTooltip = _ref => {
41
36
  }), [truncatedNode, wrapText]);
42
37
  React.useEffect(() => {
43
38
  checkIfTextOverflowing();
39
+ // Cancel the outgoing debounce instance's pending trailing-edge call.
40
+ // checkIfTextOverflowing is recreated whenever truncatedNode changes
41
+ // (e.g. once on mount, null -> real node). Without this cancel, the
42
+ // stale instance's trailing call still fires ~200ms later using its
43
+ // frozen closure (truncatedNode as it was when THAT instance was
44
+ // created) and can stomp a correct value the new instance already set.
45
+ return () => {
46
+ checkIfTextOverflowing.cancel();
47
+ };
44
48
  }, [line, children, wrapText, checkIfTextOverflowing]);
45
49
  React.useEffect(() => {
46
50
  if (!truncatedNode) {
@@ -58,57 +62,66 @@ const TruncatedTextWithTooltip = _ref => {
58
62
  '--line-clamp': wrapText ? 'unset' : line,
59
63
  '--word-break': wordBreak
60
64
  };
61
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ConditionalWrapper.ConditionalWrapper, {
62
- condition: Boolean(showMouseTip),
63
- wrapper: children => {
64
- const child = React.Children.only(children);
65
65
 
66
- // Type guard to ensure child is a ReactElement
67
- if (! /*#__PURE__*/React.isValidElement(child)) {
68
- return child;
69
- }
70
-
71
- // Cast to our typed child element
72
- const childElement = child;
73
- const childProps = childElement.props;
66
+ // Always render the same <span>, always wrapped in the same <Tooltip>,
67
+ // toggling only Tooltip's `hidden` prop. Previously a ConditionalWrapper
68
+ // swapped between a bare <span> and <Tooltip><div>{span}</div></Tooltip>
69
+ // based on showMouseTip — changing the element type at this tree position
70
+ // forces React to unmount/remount the span every time showMouseTip
71
+ // toggles. The remounted span (now a flex child of an extra wrapper div)
72
+ // measures different scrollHeight/clientHeight than the bare span, so the
73
+ // ResizeObserver above sees its own self-inflicted resize and flips
74
+ // showMouseTip again — an infinite loop where the tooltip never
75
+ // stabilizes. Tooltip clones its trigger prop onto the same element (no
76
+ // wrapper element inserted), so keeping the span's identity stable here
77
+ // means toggling showMouseTip no longer causes a remount.
78
+ const truncatedSpan = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
79
+ className: (0, _classify.default)(_TruncatedTextWithTooltipModule.default.truncateLineClamp, classNames?.wrapper),
80
+ style: styles,
81
+ ref: setTruncatedNode,
82
+ "data-testid": (0, _qa.generateTestId)({
83
+ base: testId,
84
+ slot: 'text'
85
+ }),
86
+ children: children
87
+ });
74
88
 
75
- //Vivek: This children in tooltip body is modified to remove line clamp style
76
- const modifiedChild = /*#__PURE__*/React.cloneElement(childElement, {
77
- ...childProps,
78
- style: {
79
- ...childProps.style,
80
- '--line-clamp': tooltip?.bodyMaxLines || line,
81
- '--word-break': wordBreak
82
- }
83
- });
84
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.Tooltip, {
85
- ...tooltip,
86
- body: tooltip?.body || modifiedChild,
87
- elevation: tooltip?.elevation ?? 'toast',
88
- testId: (0, _qa.generateTestId)({
89
- base: testId,
90
- slot: 'tooltip'
91
- }),
92
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
93
- className: _TruncatedTextWithTooltipModule.default.childrenWrapper,
94
- "data-testid": (0, _qa.generateTestId)({
95
- base: testId,
96
- slot: 'wrapper'
97
- }),
98
- children: children
99
- })
100
- });
101
- },
102
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
103
- className: (0, _classify.default)(_TruncatedTextWithTooltipModule.default.truncateLineClamp, classNames?.wrapper),
104
- style: styles,
105
- ref: setTruncatedNode,
106
- "data-testid": (0, _qa.generateTestId)({
107
- base: testId,
108
- slot: 'text'
109
- }),
110
- children: children
89
+ // `ref: null` is required here: React.cloneElement inherits the source
90
+ // element's ref unless explicitly overridden. Without this, this
91
+ // body-only clone (rendered separately inside Tooltip's floating panel,
92
+ // gated by `hidden`) would share the trigger span's ref. Mounting/
93
+ // unmounting this clone as `hidden` toggles would hijack truncatedNode
94
+ // away from the actual trigger, eventually losing the ref to the real
95
+ // trigger permanently once this clone unmounts.
96
+ //
97
+ // No className/style here (rather than trying to override --line-clamp):
98
+ // Tooltip already wraps body in <Truncate line={bodyMaxLines}>, which puts
99
+ // its own webkit-box line-clamp on the containing div. Keeping
100
+ // css.truncateLineClamp on this span would make it a second, nested
101
+ // webkit-box with its own --word-break (this component's `wordBreak` prop,
102
+ // meant for the single-line trigger) — since that inner box is what
103
+ // actually renders the text, it silently wins over the outer div's
104
+ // word-break even when both clamp to the same line count. Dropping the
105
+ // class/style lets the outer div be the only clamp in the chain.
106
+ const modifiedChild = /*#__PURE__*/React.cloneElement(truncatedSpan, {
107
+ ref: null,
108
+ className: undefined,
109
+ style: undefined,
110
+ 'data-testid': (0, _qa.generateTestId)({
111
+ base: testId,
112
+ slot: 'body-text'
111
113
  })
112
114
  });
115
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.Tooltip, {
116
+ ...tooltip,
117
+ hidden: tooltip?.hidden ?? !showMouseTip,
118
+ body: tooltip?.body || modifiedChild,
119
+ elevation: tooltip?.elevation ?? 'toast',
120
+ testId: (0, _qa.generateTestId)({
121
+ base: testId,
122
+ slot: 'tooltip'
123
+ }),
124
+ children: truncatedSpan
125
+ });
113
126
  };
114
127
  exports.TruncatedTextWithTooltip = TruncatedTextWithTooltip;
@@ -2,6 +2,3 @@
2
2
  composes: truncate from '../../styles/typography.module.css';
3
3
  white-space: normal;
4
4
  }
5
- .childrenWrapper {
6
- display: flex;
7
- }
package/mcp/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spaced-out/genesis-mcp",
3
- "version": "1.0.45",
3
+ "version": "1.0.46",
4
4
  "description": "MCP server for Genesis UI Design System - provides AI assistants with access to components, hooks, and design tokens",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spaced-out/ui-design-system",
3
- "version": "0.6.33",
3
+ "version": "0.6.34",
4
4
  "description": "Sense UI components library",
5
5
  "author": {
6
6
  "name": "Spaced Out"