@homebound/beam 2.203.0 → 2.205.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.
@@ -37,6 +37,8 @@ export declare type GridTableApi<R extends Kinded> = {
37
37
  setActiveCellId: (id: string | undefined) => void;
38
38
  /** Set selected state of a row by id */
39
39
  selectRow: (id: string, selected?: boolean) => void;
40
+ /** Toggle collapse state of a row by id */
41
+ toggleCollapsedRow: (id: string) => void;
40
42
  };
41
43
  export declare class GridTableApiImpl<R extends Kinded> implements GridTableApi<R> {
42
44
  readonly tableState: TableState;
@@ -50,4 +52,5 @@ export declare class GridTableApiImpl<R extends Kinded> implements GridTableApi<
50
52
  setActiveRowId(id: string | undefined): void;
51
53
  setActiveCellId(id: string | undefined): void;
52
54
  selectRow(id: string, selected?: boolean): void;
55
+ toggleCollapsedRow(id: string): void;
53
56
  }
@@ -65,5 +65,8 @@ class GridTableApiImpl {
65
65
  selectRow(id, selected = true) {
66
66
  this.tableState.selectRow(id, selected);
67
67
  }
68
+ toggleCollapsedRow(id) {
69
+ this.tableState.toggleCollapsed(id);
70
+ }
68
71
  }
69
72
  exports.GridTableApiImpl = GridTableApiImpl;
@@ -1,3 +1,4 @@
1
+ import { IconKey } from "./";
1
2
  import { Margin, Only, Xss } from "../Css";
2
3
  declare type TagXss = Margin;
3
4
  export declare type TagType = "info" | "caution" | "warning" | "success" | "neutral";
@@ -5,6 +6,7 @@ interface TagProps<X> {
5
6
  text: string;
6
7
  type?: TagType;
7
8
  xss?: X;
9
+ icon?: IconKey;
8
10
  }
9
11
  /** Tag used for indicating a status */
10
12
  export declare function Tag<X extends Only<Xss<TagXss>, X>>({ text, type, xss, ...otherProps }: TagProps<X>): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -2,25 +2,26 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Tag = void 0;
4
4
  const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
5
+ const components_1 = require("./");
5
6
  const Css_1 = require("../Css");
6
7
  const utils_1 = require("../utils");
7
8
  /** Tag used for indicating a status */
8
9
  function Tag({ text, type, xss, ...otherProps }) {
9
10
  const typeStyles = getStyles(type);
10
11
  const tid = (0, utils_1.useTestIds)(otherProps);
11
- return ((0, jsx_runtime_1.jsx)("span", Object.assign({}, tid, { css: { ...Css_1.Css.dib.tinySb.ttu.px1.pyPx(4).gray900.br4.$, ...typeStyles, ...xss }, title: text }, { children: (0, jsx_runtime_1.jsx)("span", Object.assign({ css: Css_1.Css.lineClamp1.breakAll.$ }, { children: text }), void 0) }), void 0));
12
+ return ((0, jsx_runtime_1.jsxs)("span", Object.assign({}, tid, { css: { ...Css_1.Css.dif.tinySb.ttu.aic.gapPx(4).pxPx(6).pyPx(2).gray900.br4.$, ...typeStyles, ...xss }, title: text }, { children: [otherProps.icon && ((0, jsx_runtime_1.jsx)("span", Object.assign({ css: Css_1.Css.fs0.$ }, { children: (0, jsx_runtime_1.jsx)(components_1.Icon, { icon: otherProps.icon, inc: 1.5 }, void 0) }), void 0)), (0, jsx_runtime_1.jsx)("span", Object.assign({ css: Css_1.Css.lineClamp1.breakAll.$ }, { children: text }), void 0)] }), void 0));
12
13
  }
13
14
  exports.Tag = Tag;
14
15
  function getStyles(type) {
15
16
  switch (type) {
16
17
  case "info":
17
- return Css_1.Css.bgLightBlue200.$;
18
+ return Css_1.Css.bgLightBlue100.$;
18
19
  case "caution":
19
- return Css_1.Css.bgYellow600.$;
20
+ return Css_1.Css.bgYellow200.$;
20
21
  case "warning":
21
22
  return Css_1.Css.bgRed100.$;
22
23
  case "success":
23
- return Css_1.Css.bgGreen300.$;
24
+ return Css_1.Css.bgGreen100.$;
24
25
  default:
25
26
  // Neutral case
26
27
  return Css_1.Css.bgGray200.$;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.203.0",
3
+ "version": "2.205.0",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",