@homebound/beam 2.212.0 → 2.212.1

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.
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Chip = exports.ChipTypes = void 0;
4
4
  const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
5
5
  const PresentationContext_1 = require("./PresentationContext");
6
+ const Tooltip_1 = require("./Tooltip");
6
7
  const Css_1 = require("../Css");
7
8
  const useTestIds_1 = require("../utils/useTestIds");
8
9
  // exporting for using in type prop as constant - this could be moved and become a global list for colors
@@ -17,13 +18,17 @@ exports.ChipTypes = {
17
18
  /** Kinda like a chip, but read-only, so no `onClick` or `hover`. */
18
19
  function Chip({ type = exports.ChipTypes.neutral, ...props }) {
19
20
  const { fieldProps } = (0, PresentationContext_1.usePresentationContext)();
20
- const { text, title = text, xss = {}, compact = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.compact } = props;
21
+ const { text, title, xss = {}, compact = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.compact } = props;
21
22
  const tid = (0, useTestIds_1.useTestIds)(props, "chip");
22
- return ((0, jsx_runtime_1.jsx)("span", Object.assign({ css: {
23
- ...Css_1.Css[compact ? "xs" : "sm"].dif.aic.br16.pl1.px1.pyPx(2).gray900.$,
24
- ...typeStyles[type],
25
- ...xss,
26
- } }, tid, { title: title }, { children: (0, jsx_runtime_1.jsx)("span", Object.assign({ css: Css_1.Css.lineClamp1.breakAll.$ }, { children: text }), void 0) }), void 0));
23
+ return (0, Tooltip_1.maybeTooltip)({
24
+ title,
25
+ placement: "top",
26
+ children: ((0, jsx_runtime_1.jsx)("span", Object.assign({ css: {
27
+ ...Css_1.Css[compact ? "xs" : "sm"].dif.aic.br16.pl1.px1.pyPx(2).gray900.$,
28
+ ...typeStyles[type],
29
+ ...xss,
30
+ } }, tid, { children: (0, jsx_runtime_1.jsx)("span", Object.assign({ css: Css_1.Css.lineClamp1.breakAll.$ }, { children: text }), void 0) }), void 0)),
31
+ });
27
32
  }
28
33
  exports.Chip = Chip;
29
34
  const typeStyles = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.212.0",
3
+ "version": "2.212.1",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",