asma-ui-core 3.54.2 → 3.54.3

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.
@@ -1,32 +1,35 @@
1
1
  import { ContentCopyIcon as c } from "../../icons/content-copy-icon/ContentCopyIcon.js";
2
2
  import { StyledTooltip as d } from "../../data-display/tooltip/StyledTooltip.js";
3
3
  import { StyledButton as m } from "../../inputs/button/StyledButton.js";
4
- import { useMobileMediaQuery as s } from "../../../hooks/useMediaQuery.hook.js";
4
+ import { useMobileMediaQuery as h } from "../../../hooks/useMediaQuery.hook.js";
5
5
  import "react";
6
6
  import { jsx as t } from "react/jsx-runtime";
7
- var v = ({ className: e, contentToCopy: n, locale: i, messageInfo: p, text: r }) => {
8
- const o = i === "en" ? "Copy" : "Kopier", l = s();
7
+ var g = ({ className: n, contentToCopy: p, locale: r, messageInfo: a, text: e }) => {
8
+ const i = r === "en" ? "Copy" : "Kopier", l = h();
9
9
  return /* @__PURE__ */ t(d, {
10
- title: o,
10
+ title: i,
11
11
  children: /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(m, {
12
12
  dataTest: "copy-button",
13
- "aria-label": r ?? o,
14
- className: e,
13
+ "aria-label": e ?? i,
14
+ className: n,
15
15
  size: "small",
16
16
  variant: "text",
17
17
  startIcon: /* @__PURE__ */ t(c, {
18
18
  width: 20,
19
19
  height: 20
20
20
  }),
21
- onClick: () => {
22
- navigator.clipboard.writeText(n).then(() => {
23
- p(i === "no" ? "Kopiert til utklippstavle" : "Copied to clipboard");
24
- }).catch((a) => console.error("Copying failed with this: ", a));
21
+ onMouseDown: (o) => {
22
+ o.stopPropagation();
25
23
  },
26
- children: !l && (r ?? o)
24
+ onClick: (o) => {
25
+ o.preventDefault(), o.stopPropagation(), navigator.clipboard.writeText(p).then(() => {
26
+ a(r === "no" ? "Kopiert til utklippstavle" : "Copied to clipboard");
27
+ }).catch((s) => console.error("Copying failed with this: ", s));
28
+ },
29
+ children: !l && (e ?? i)
27
30
  }) })
28
31
  });
29
32
  };
30
33
  export {
31
- v as CopyButton
34
+ g as CopyButton
32
35
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.54.2",
6
+ "version": "3.54.3",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",