@synerise/ds-copy-icon 1.2.1 → 1.2.2

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/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.2.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-copy-icon@1.2.1...@synerise/ds-copy-icon@1.2.2) (2026-03-24)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-copy-icon
9
+
6
10
  ## [1.2.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-copy-icon@1.2.0...@synerise/ds-copy-icon@1.2.1) (2026-03-20)
7
11
 
8
12
  **Note:** Version bump only for package @synerise/ds-copy-icon
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type CopyIconProps } from './CopyIcon.types';
1
+ import { default as React } from 'react';
2
+ import { CopyIconProps } from './CopyIcon.types';
3
3
  declare const CopyIcon: ({ copyValue, texts, onMouseEnter, onMouseLeave, icon, placement, onCopy, onClick, ...rest }: CopyIconProps) => React.JSX.Element;
4
4
  export default CopyIcon;
package/dist/CopyIcon.js CHANGED
@@ -1,76 +1,62 @@
1
- var _excluded = ["copyValue", "texts", "onMouseEnter", "onMouseLeave", "icon", "placement", "onCopy", "onClick"];
2
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
- import copy from 'copy-to-clipboard';
5
- import React, { useCallback, useMemo, useState } from 'react';
6
- import { useIntl } from 'react-intl';
7
- import Icon, { CopyClipboardM } from '@synerise/ds-icon';
8
- import Tooltip from '@synerise/ds-tooltip';
9
- import * as S from './CopyIcon.styles';
10
- var CopyIcon = function CopyIcon(_ref) {
11
- var copyValue = _ref.copyValue,
12
- texts = _ref.texts,
13
- onMouseEnter = _ref.onMouseEnter,
14
- onMouseLeave = _ref.onMouseLeave,
15
- icon = _ref.icon,
16
- placement = _ref.placement,
17
- onCopy = _ref.onCopy,
18
- onClick = _ref.onClick,
19
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
20
- var _useIntl = useIntl(),
21
- formatMessage = _useIntl.formatMessage;
22
- var textsObj = useMemo(function () {
23
- return _extends({
24
- copiedTooltip: formatMessage({
25
- id: 'DS.COPY-ICON.COPIED',
26
- defaultMessage: 'Copied!'
27
- }),
28
- copyTooltip: formatMessage({
29
- id: 'DS.COPY-ICON.COPY-VALUE',
30
- defaultMessage: 'Copy'
31
- })
32
- }, texts);
33
- }, [texts, formatMessage]);
34
- var _useState = useState(textsObj.copyTooltip),
35
- tooltipTitle = _useState[0],
36
- setTooltipTitle = _useState[1];
37
- var _useState2 = useState(false),
38
- isCopiedBlock = _useState2[0],
39
- setIsCopiedBlock = _useState2[1];
40
- var handleCopy = useCallback(function (event) {
1
+ import { jsx } from "react/jsx-runtime";
2
+ import copy from "copy-to-clipboard";
3
+ import { useMemo, useState, useCallback } from "react";
4
+ import { useIntl } from "react-intl";
5
+ import Icon, { CopyClipboardM } from "@synerise/ds-icon";
6
+ import Tooltip from "@synerise/ds-tooltip";
7
+ import { CopyIcon as CopyIcon$1 } from "./CopyIcon.styles.js";
8
+ const CopyIcon = ({
9
+ copyValue,
10
+ texts,
11
+ onMouseEnter,
12
+ onMouseLeave,
13
+ icon,
14
+ placement,
15
+ onCopy,
16
+ onClick,
17
+ ...rest
18
+ }) => {
19
+ const {
20
+ formatMessage
21
+ } = useIntl();
22
+ const textsObj = useMemo(() => ({
23
+ copiedTooltip: formatMessage({
24
+ id: "DS.COPY-ICON.COPIED",
25
+ defaultMessage: "Copied!"
26
+ }),
27
+ copyTooltip: formatMessage({
28
+ id: "DS.COPY-ICON.COPY-VALUE",
29
+ defaultMessage: "Copy"
30
+ }),
31
+ ...texts
32
+ }), [texts, formatMessage]);
33
+ const [tooltipTitle, setTooltipTitle] = useState(textsObj.copyTooltip);
34
+ const [isCopiedBlock, setIsCopiedBlock] = useState(false);
35
+ const handleCopy = useCallback((event) => {
41
36
  if (copyValue && copy(copyValue)) {
42
37
  setTooltipTitle(textsObj.copiedTooltip);
43
38
  setIsCopiedBlock(true);
44
- setTimeout(function () {
39
+ setTimeout(() => {
45
40
  setIsCopiedBlock(false);
46
41
  setTooltipTitle(textsObj.copyTooltip);
47
- }, 2000);
42
+ }, 2e3);
48
43
  onCopy && onCopy();
49
44
  }
50
- onClick == null || onClick(event);
45
+ onClick?.(event);
51
46
  }, [copyValue, onClick, textsObj.copiedTooltip, textsObj.copyTooltip, onCopy]);
52
- var handleMouseEnter = useCallback(function (event) {
47
+ const handleMouseEnter = useCallback((event) => {
53
48
  event.stopPropagation();
54
49
  if (!isCopiedBlock) {
55
50
  setTooltipTitle(textsObj.copyTooltip);
56
51
  }
57
52
  onMouseEnter && onMouseEnter(event);
58
53
  }, [isCopiedBlock, textsObj, onMouseEnter]);
59
- var handleMouseLeave = useCallback(function (event) {
54
+ const handleMouseLeave = useCallback((event) => {
60
55
  event.stopPropagation();
61
56
  onMouseLeave && onMouseLeave(event);
62
57
  }, [onMouseLeave]);
63
- return /*#__PURE__*/React.createElement(Tooltip, {
64
- placement: placement,
65
- title: tooltipTitle
66
- }, /*#__PURE__*/React.createElement(S.CopyIcon, _extends({
67
- "data-testid": "ds-copy-icon",
68
- onMouseEnter: handleMouseEnter,
69
- onMouseLeave: handleMouseLeave,
70
- onClick: handleCopy
71
- }, rest), icon || /*#__PURE__*/React.createElement(Icon, {
72
- component: /*#__PURE__*/React.createElement(CopyClipboardM, null),
73
- size: 24
74
- })));
58
+ return /* @__PURE__ */ jsx(Tooltip, { placement, title: tooltipTitle, children: /* @__PURE__ */ jsx(CopyIcon$1, { "data-testid": "ds-copy-icon", onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onClick: handleCopy, ...rest, children: icon || /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(CopyClipboardM, {}), size: 24 }) }) });
59
+ };
60
+ export {
61
+ CopyIcon as default
75
62
  };
76
- export default CopyIcon;
@@ -1 +1 @@
1
- export declare const CopyIcon: import("styled-components").StyledComponent<"div", any, {}, never>;
1
+ export declare const CopyIcon: import('styled-components').StyledComponent<"div", any, {}, never>;
@@ -1,9 +1,8 @@
1
- import styled from 'styled-components';
2
- export var CopyIcon = styled.div.withConfig({
1
+ import styled from "styled-components";
2
+ const CopyIcon = /* @__PURE__ */ styled.div.withConfig({
3
3
  displayName: "CopyIconstyles__CopyIcon",
4
4
  componentId: "sc-1xzoy5o-0"
5
- })(["cursor:pointer;color:", ";&:hover{color:", ";}"], function (props) {
6
- return props.theme.palette['grey-600'];
7
- }, function (props) {
8
- return props.theme.palette['blue-600'];
9
- });
5
+ })(["cursor:pointer;color:", ";&:hover{color:", ";}"], (props) => props.theme.palette["grey-600"], (props) => props.theme.palette["blue-600"]);
6
+ export {
7
+ CopyIcon
8
+ };
@@ -1,6 +1,6 @@
1
- import { type ReactNode } from 'react';
2
- import { type TooltipProps } from '@synerise/ds-tooltip';
3
- import { type WithHTMLAttributes } from '@synerise/ds-utils';
1
+ import { ReactNode } from 'react';
2
+ import { TooltipProps } from '@synerise/ds-tooltip';
3
+ import { WithHTMLAttributes } from '@synerise/ds-utils';
4
4
  export type CopyTooltipTexts = {
5
5
  copyTooltip: ReactNode;
6
6
  copiedTooltip: ReactNode;
@@ -1 +1 @@
1
- export {};
1
+
package/dist/index.js CHANGED
@@ -1 +1,4 @@
1
- export { default } from './CopyIcon';
1
+ import { default as default2 } from "./CopyIcon.js";
2
+ export {
3
+ default2 as default
4
+ };
package/dist/modules.d.js CHANGED
@@ -1 +1 @@
1
- import '@testing-library/jest-dom';
1
+ import "@testing-library/jest-dom";
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-copy-icon",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "CopyIcon UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -16,10 +16,10 @@
16
16
  "access": "public"
17
17
  },
18
18
  "scripts": {
19
- "build": "pnpm run build:js && pnpm run build:css && pnpm run defs",
19
+ "build": "vite build",
20
20
  "build:css": "node ../../../scripts/style/less.js",
21
21
  "build:js": "babel --delete-dir-on-start --root-mode upward src --out-dir dist --extensions '.js,.ts,.tsx'",
22
- "build:watch": "pnpm run build:js -- --watch",
22
+ "build:watch": "vite build --watch",
23
23
  "defs": "tsc --declaration --outDir dist/ --emitDeclarationOnly",
24
24
  "prepublish": "pnpm run build",
25
25
  "types": "tsc --noEmit",
@@ -35,11 +35,11 @@
35
35
  ],
36
36
  "types": "dist/index.d.ts",
37
37
  "dependencies": {
38
- "@synerise/ds-icon": "^1.15.0",
39
- "@synerise/ds-tooltip": "^1.4.9"
38
+ "@synerise/ds-icon": "^1.15.1",
39
+ "@synerise/ds-tooltip": "^1.4.10"
40
40
  },
41
41
  "devDependencies": {
42
- "@synerise/ds-utils": "^1.7.0",
42
+ "@synerise/ds-utils": "^1.7.1",
43
43
  "vitest": "4"
44
44
  },
45
45
  "peerDependencies": {
@@ -49,5 +49,5 @@
49
49
  "react-intl": ">=3.12.0 <= 6.8",
50
50
  "styled-components": "^5.3.3"
51
51
  },
52
- "gitHead": "8efc031fa688c0b87c7b3915bae93546bb63bcac"
52
+ "gitHead": "e4ecca8944fc9b41c1b9d59c8bcad5e5e2013225"
53
53
  }