@protonradio/proton-ui 0.4.0 → 0.4.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.
@@ -340,11 +340,11 @@ export { TableHeader }
340
340
  declare type TableProps = AriaTableProps & TableStateProps<object>;
341
341
 
342
342
  export declare const TextEmphasis: {
343
- ({ to, children }: TextEmphasisProps): JSX_2.Element;
344
- Tooltip: ({ to, children, tooltipProps, }: TextEmphasisTooltipProps) => JSX_2.Element;
343
+ ({ to, children, ...props }: TextEmphasisProps): JSX_2.Element;
344
+ Tooltip: ({ to, children, tooltipProps, ...props }: TextEmphasisTooltipProps) => JSX_2.Element;
345
345
  };
346
346
 
347
- declare interface TextEmphasisProps {
347
+ declare interface TextEmphasisProps extends React.HTMLAttributes<HTMLSpanElement> {
348
348
  to?: string;
349
349
  onClick?: () => void;
350
350
  children: string;
@@ -7270,14 +7270,8 @@ const tf = (t) => {
7270
7270
  const e = window.location.hostname, n = tf(t);
7271
7271
  return e !== n;
7272
7272
  }, rf = (t, e) => {
7273
- if (t.metaKey || t.altKey || t.ctrlKey || t.shiftKey) {
7274
- console.log("modifier keys pressed");
7273
+ if (t.metaKey || t.altKey || t.ctrlKey || t.shiftKey || t.button && t.button !== 0)
7275
7274
  return;
7276
- }
7277
- if (t.button && t.button !== 0) {
7278
- console.log("middle or right click");
7279
- return;
7280
- }
7281
7275
  t.preventDefault();
7282
7276
  const n = e.startsWith("/") ? e : `/${e}`;
7283
7277
  window.history.pushState({}, "", n), window.dispatchEvent(new PopStateEvent("popstate"));
@@ -9447,58 +9441,58 @@ const Sp = {
9447
9441
  }
9448
9442
  );
9449
9443
  };
9450
- const sp = ({ to: t, children: e }) => {
9451
- const { className: n } = st();
9452
- return t ? /* @__PURE__ */ C.jsx($a, { to: t, children: e }) : /* @__PURE__ */ C.jsx(
9444
+ const sp = ({ to: t, children: e, ...n }) => {
9445
+ const { className: r } = st();
9446
+ return t ? /* @__PURE__ */ C.jsx($a, { to: t, "data-testid": n["data-testid"], children: e }) : /* @__PURE__ */ C.jsx(
9453
9447
  "span",
9454
9448
  {
9455
- className: ee(
9456
- "proton-TextEmphasis",
9457
- "proton-TextEmphasis--title",
9458
- n
9459
- ),
9449
+ className: ee("proton-TextEmphasis", r),
9450
+ "data-testid": n["data-testid"],
9460
9451
  children: e
9461
9452
  }
9462
9453
  );
9463
9454
  }, $a = ({
9464
9455
  to: t,
9465
9456
  className: e,
9466
- children: n
9457
+ children: n,
9458
+ ...r
9467
9459
  }) => {
9468
- const { className: r } = st(), l = nf(t);
9469
- return /* @__PURE__ */ C.jsx(
9470
- "span",
9460
+ const { className: l } = st(), i = nf(t);
9461
+ return /* @__PURE__ */ C.jsx("span", { className: ee("proton-TextEmphasis", l, e), children: /* @__PURE__ */ C.jsx(
9462
+ "a",
9471
9463
  {
9472
- className: ee(
9473
- "proton-TextEmphasis ",
9474
- "proton-TextEmphasis--title",
9475
- r,
9476
- e
9477
- ),
9478
- children: /* @__PURE__ */ C.jsx(
9479
- "a",
9480
- {
9481
- href: t,
9482
- onClick: l ? void 0 : (i) => rf(i, t),
9483
- children: n
9484
- }
9485
- )
9486
- }
9487
- );
9464
+ "data-testid": r["data-testid"],
9465
+ href: t,
9466
+ target: i ? "_blank" : void 0,
9467
+ rel: i ? "noopener noreferrer" : void 0,
9468
+ onClick: i ? void 0 : (o) => rf(o, t),
9469
+ children: n
9470
+ }
9471
+ ) });
9488
9472
  }, cp = ({
9489
9473
  to: t,
9490
9474
  children: e,
9491
- tooltipProps: n
9475
+ tooltipProps: n,
9476
+ ...r
9492
9477
  }) => {
9493
- const { className: r } = st();
9494
- return t ? /* @__PURE__ */ C.jsx($a, { to: t, className: "proton-TextEmphasis--tooltip", children: /* @__PURE__ */ C.jsx(Sl, { tooltipProps: n, children: e }) }) : /* @__PURE__ */ C.jsx(
9478
+ const { className: l } = st();
9479
+ return t ? /* @__PURE__ */ C.jsx(
9480
+ $a,
9481
+ {
9482
+ to: t,
9483
+ className: "proton-TextEmphasis--tooltip",
9484
+ "data-testid": r["data-testid"],
9485
+ children: /* @__PURE__ */ C.jsx(Sl, { tooltipProps: n, children: e })
9486
+ }
9487
+ ) : /* @__PURE__ */ C.jsx(
9495
9488
  "span",
9496
9489
  {
9497
9490
  className: ee(
9498
9491
  "proton-TextEmphasis",
9499
9492
  "proton-TextEmphasis--tooltip",
9500
- r
9493
+ l
9501
9494
  ),
9495
+ "data-testid": r["data-testid"],
9502
9496
  children: /* @__PURE__ */ C.jsx(Sl, { tooltipProps: n, children: e })
9503
9497
  }
9504
9498
  );