@protonradio/proton-ui 0.7.14 → 0.7.16

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/dist/index.d.ts CHANGED
@@ -437,10 +437,12 @@ declare interface PopoverProps extends Omit<AriaPopoverProps, "popoverRef"> {
437
437
 
438
438
  export declare interface ProtonColumnProps<T> extends ColumnProps<T> {
439
439
  align?: "left" | "center" | "right";
440
+ onClick?: (key: string) => void;
440
441
  }
441
442
 
442
443
  export declare interface ProtonRowProps<T = object> extends RowProps<T> {
443
444
  backgroundColor?: string;
445
+ onClick?: (key: string) => void;
444
446
  }
445
447
 
446
448
  export declare interface ProtonTableBodyProps<T = object> extends TableBodyProps<T> {
package/dist/index.es.js CHANGED
@@ -11412,46 +11412,51 @@ function Kh({
11412
11412
  children: e,
11413
11413
  state: n,
11414
11414
  backgroundColor: r,
11415
- showLines: l = !0
11415
+ onClick: l,
11416
+ showLines: i = !0
11416
11417
  }) {
11417
- let i = M(), o = n.selectionManager.isSelected(t.key), { rowProps: a, isPressed: u } = zp(
11418
+ let o = M(), a = n.selectionManager.isSelected(t.key), { rowProps: u, isPressed: s } = zp(
11418
11419
  {
11419
11420
  node: t
11420
11421
  },
11421
11422
  n,
11422
- i
11423
- ), { isFocusVisible: s, focusProps: c } = Xt();
11423
+ o
11424
+ ), { isFocusVisible: c, focusProps: d } = Xt();
11424
11425
  return /* @__PURE__ */ b.jsx(
11425
11426
  "tr",
11426
11427
  {
11427
11428
  className: W(
11428
11429
  "proton-Table__row",
11429
- o ? "proton-Table__row--selected" : null,
11430
- u ? "proton-Table__row--pressed" : null,
11431
- s ? "proton-Table__row--focused" : null,
11432
- l && "proton-Table__row--showLines"
11430
+ a ? "proton-Table__row--selected" : null,
11431
+ s ? "proton-Table__row--pressed" : null,
11432
+ c ? "proton-Table__row--focused" : null,
11433
+ i && "proton-Table__row--showLines",
11434
+ l && "proton-Table__row--clickable"
11433
11435
  ),
11434
11436
  style: r ? { backgroundColor: r } : void 0,
11435
- ...H(a, c),
11436
- ref: i,
11437
+ ...H(u, d),
11438
+ ref: o,
11439
+ onClick: l ? () => l(t.key) : void 0,
11437
11440
  children: e
11438
11441
  }
11439
11442
  );
11440
11443
  }
11441
- function Mh({ cell: t, state: e, width: n }) {
11442
- let r = M(), { gridCellProps: l } = Vp({ node: t }, e, r), { isFocusVisible: i, focusProps: o } = Xt();
11443
- const { align: a = "left" } = t.props;
11444
+ function Mh({ cell: t, state: e, width: n, onClick: r }) {
11445
+ let l = M(), { gridCellProps: i } = Vp({ node: t }, e, l), { isFocusVisible: o, focusProps: a } = Xt();
11446
+ const { align: u = "left" } = t.props;
11444
11447
  return /* @__PURE__ */ b.jsx(
11445
11448
  "td",
11446
11449
  {
11447
- ...H(l, o),
11450
+ ...H(i, a),
11448
11451
  className: W(
11449
11452
  "proton-Table__cell",
11450
- i ? "proton-Table__cell--focused" : null,
11451
- `proton-Table__cell--${a}`
11453
+ o ? "proton-Table__cell--focused" : null,
11454
+ `proton-Table__cell--${u}`,
11455
+ r && "proton-Table--clickable"
11452
11456
  ),
11453
11457
  style: n ? { width: n } : void 0,
11454
- ref: r,
11458
+ ref: l,
11459
+ onClick: r ? () => r(t.key) : void 0,
11455
11460
  children: t.rendered
11456
11461
  }
11457
11462
  );
@@ -11482,7 +11487,17 @@ function f4(t) {
11482
11487
  state: e,
11483
11488
  backgroundColor: o.props.backgroundColor,
11484
11489
  showLines: r.body.props.showLines,
11485
- children: Array.from(r.getChildren(o.key)).map((a) => /* @__PURE__ */ b.jsx(Mh, { cell: a, state: e, width: a.props.width }, a.key))
11490
+ onClick: o.props.onClick,
11491
+ children: Array.from(r.getChildren(o.key)).map((a) => /* @__PURE__ */ b.jsx(
11492
+ Mh,
11493
+ {
11494
+ cell: a,
11495
+ state: e,
11496
+ width: a.props.width,
11497
+ onClick: a.props.onClick
11498
+ },
11499
+ a.key
11500
+ ))
11486
11501
  },
11487
11502
  o.key
11488
11503
  )) })
@@ -11495,25 +11510,22 @@ const p4 = ({
11495
11510
  lines: r = 1,
11496
11511
  title: l,
11497
11512
  "data-testid": i
11498
- }) => {
11499
- const o = l || (typeof t == "string" ? t : void 0);
11500
- return /* @__PURE__ */ b.jsx(
11501
- "div",
11502
- {
11503
- className: W(
11504
- "proton-TextEllipsis",
11505
- n || r === 1 ? "proton-TextEllipsis--single-line" : r > 1 ? "proton-TextEllipsis--multi-line" : ""
11506
- ),
11507
- style: {
11508
- maxWidth: e,
11509
- WebkitLineClamp: r
11510
- },
11511
- title: o,
11512
- "data-testid": i,
11513
- children: t
11514
- }
11515
- );
11516
- };
11513
+ }) => /* @__PURE__ */ b.jsx(
11514
+ "div",
11515
+ {
11516
+ className: W(
11517
+ "proton-TextEllipsis",
11518
+ n || r === 1 ? "proton-TextEllipsis--single-line" : r > 1 ? "proton-TextEllipsis--multi-line" : ""
11519
+ ),
11520
+ style: {
11521
+ maxWidth: e,
11522
+ WebkitLineClamp: r
11523
+ },
11524
+ title: l,
11525
+ "data-testid": i,
11526
+ children: t
11527
+ }
11528
+ );
11517
11529
  function Ih({ children: t, arrow: e, ...n }) {
11518
11530
  const { style: r, className: l } = Ae();
11519
11531
  return /* @__PURE__ */ b.jsxs(