@synerise/ds-popconfirm 0.10.54 → 0.10.56

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,25 @@
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
+ ## [0.10.56](https://github.com/Synerise/synerise-design/compare/@synerise/ds-popconfirm@0.10.55...@synerise/ds-popconfirm@0.10.56) (2024-10-28)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **storybook7:** added popconfirm stories ([73b98df](https://github.com/Synerise/synerise-design/commit/73b98dfba801b9d8fd14ee45c92adb761a04241e))
12
+
13
+
14
+
15
+
16
+
17
+ ## [0.10.55](https://github.com/Synerise/synerise-design/compare/@synerise/ds-popconfirm@0.10.54...@synerise/ds-popconfirm@0.10.55) (2024-10-23)
18
+
19
+ **Note:** Version bump only for package @synerise/ds-popconfirm
20
+
21
+
22
+
23
+
24
+
6
25
  ## [0.10.54](https://github.com/Synerise/synerise-design/compare/@synerise/ds-popconfirm@0.10.53...@synerise/ds-popconfirm@0.10.54) (2024-10-01)
7
26
 
8
27
  **Note:** Version bump only for package @synerise/ds-popconfirm
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { ConfirmMessageProps } from './ConfirmMessage.types';
3
- export declare const ConfirmMessage: React.FC<ConfirmMessageProps>;
3
+ export declare const ConfirmMessage: ({ children, placement, title, onClick, displayDuration, icon, }: ConfirmMessageProps) => React.JSX.Element;
4
4
  export default ConfirmMessage;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
2
  import AntdTooltip from 'antd/lib/tooltip';
3
3
  import * as S from './ConfirmMessage.style';
4
4
  export var ConfirmMessage = function ConfirmMessage(_ref) {
@@ -11,11 +11,11 @@ export var ConfirmMessage = function ConfirmMessage(_ref) {
11
11
  displayDuration = _ref$displayDuration === void 0 ? 5000 : _ref$displayDuration,
12
12
  icon = _ref.icon;
13
13
 
14
- var _React$useState = React.useState(false),
15
- visible = _React$useState[0],
16
- setVisible = _React$useState[1];
14
+ var _useState = useState(false),
15
+ visible = _useState[0],
16
+ setVisible = _useState[1];
17
17
 
18
- React.useEffect(function () {
18
+ useEffect(function () {
19
19
  var timeout = setTimeout(function () {
20
20
  setVisible(false);
21
21
  }, displayDuration);
@@ -28,10 +28,10 @@ export var ConfirmMessage = function ConfirmMessage(_ref) {
28
28
  setVisible(true);
29
29
  };
30
30
 
31
- var handleClick = React.useCallback(function () {
31
+ var handleClick = useCallback(function () {
32
32
  onClick && onClick(showMessage);
33
33
  }, [onClick]);
34
- var content = React.useMemo(function () {
34
+ var content = useMemo(function () {
35
35
  return /*#__PURE__*/React.createElement(S.ConfirmMessage, null, icon, /*#__PURE__*/React.createElement(S.ConfirmMessageTitle, null, title));
36
36
  }, [title, icon]);
37
37
  return /*#__PURE__*/React.createElement(S.Message, {
@@ -1,8 +1,9 @@
1
- import React from 'react';
2
- export interface ConfirmMessageProps {
1
+ import { ReactNode } from 'react';
2
+ export type ConfirmMessageProps = {
3
3
  displayDuration?: number;
4
4
  title: string;
5
+ children?: ReactNode;
5
6
  onClick: (callback: () => void) => void;
6
- icon?: React.ReactNode;
7
+ icon?: ReactNode;
7
8
  placement?: 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
8
- }
9
+ };
@@ -4,7 +4,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
4
4
 
5
5
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
6
6
 
7
- import React from 'react';
7
+ import React, { useEffect, useMemo, useRef, useState } from 'react';
8
8
  import '@synerise/ds-core/dist/js/style';
9
9
  import "./style/index.css";
10
10
  import { Carousel } from 'antd';
@@ -35,7 +35,7 @@ var Popconfirm = function Popconfirm(_ref) {
35
35
  buttonsAlign = _ref.buttonsAlign,
36
36
  antdProps = _objectWithoutPropertiesLoose(_ref, _excluded);
37
37
 
38
- var renderImageCarousel = React.useMemo(function () {
38
+ var renderImageCarousel = useMemo(function () {
39
39
  return (images == null ? void 0 : images.length) && /*#__PURE__*/React.createElement(Carousel, {
40
40
  autoplay: imagesAutoplay,
41
41
  autoplaySpeed: imagesAutoplaySpeed,
@@ -47,16 +47,16 @@ var Popconfirm = function Popconfirm(_ref) {
47
47
  });
48
48
  }));
49
49
  }, [images, imagesAutoplay, imagesAutoplaySpeed]);
50
- var popupRef = React.useRef(null);
50
+ var popupRef = useRef(null);
51
51
 
52
- var _React$useState = React.useState(undefined),
53
- visible = _React$useState[0],
54
- setVisible = _React$useState[1];
52
+ var _useState = useState(undefined),
53
+ visible = _useState[0],
54
+ setVisible = _useState[1];
55
55
 
56
56
  useOnClickOutside(popupRef, function () {
57
57
  setVisible(false);
58
58
  });
59
- React.useEffect(function () {
59
+ useEffect(function () {
60
60
  if (!visible && antdProps.visible) {
61
61
  setVisible(antdProps.visible);
62
62
  }
@@ -1,18 +1,21 @@
1
- import React from 'react';
2
- import { PopconfirmProps } from 'antd/lib/popconfirm';
1
+ import { ReactNode, MouseEvent as ReactMouseEvent } from 'react';
2
+ import { PopconfirmProps as AntdPopconfirmProps } from 'antd/lib/popconfirm';
3
3
  import { ConfirmMessageProps } from './ConfirmMessage/ConfirmMessage.types';
4
- export type PopconfirmType = React.FC<Omit<PopconfirmProps, 'okType'> & {
5
- description?: string | React.ReactNode;
4
+ export type PopconfirmProps = Omit<AntdPopconfirmProps, 'okType'> & {
5
+ description?: string | ReactNode;
6
6
  images?: string[];
7
7
  imagesAutoplay?: boolean;
8
8
  imagesAutoplaySpeed?: number;
9
- onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
10
- withLink?: React.ReactNode;
11
- closeIcon?: React.ReactNode;
9
+ onClick?: (event: ReactMouseEvent<HTMLElement, MouseEvent>) => void;
10
+ withLink?: ReactNode;
11
+ closeIcon?: ReactNode;
12
12
  titlePadding?: boolean;
13
- hideButtons?: React.ReactNode;
13
+ hideButtons?: ReactNode;
14
14
  buttonsAlign?: 'left' | 'right';
15
- okType?: PopconfirmProps['okType'] | string;
16
- }> & {
17
- ConfirmMessage: React.FC<ConfirmMessageProps>;
15
+ okType?: AntdPopconfirmProps['okType'] | string;
16
+ children?: ReactNode;
17
+ };
18
+ export type PopconfirmType = {
19
+ (props: PopconfirmProps): JSX.Element;
20
+ ConfirmMessage: (props: ConfirmMessageProps) => JSX.Element;
18
21
  };
package/dist/index.d.ts CHANGED
@@ -1 +1,3 @@
1
1
  export { default } from './Popconfirm';
2
+ export type { PopconfirmProps } from './Popconfirm.types';
3
+ export type { ConfirmMessageProps } from './ConfirmMessage/ConfirmMessage.types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-popconfirm",
3
- "version": "0.10.54",
3
+ "version": "0.10.56",
4
4
  "description": "Popconfirm UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -34,9 +34,9 @@
34
34
  ],
35
35
  "types": "dist/index.d.ts",
36
36
  "dependencies": {
37
- "@synerise/ds-button": "^0.21.13",
38
- "@synerise/ds-icon": "^0.65.8",
39
- "@synerise/ds-utils": "^0.30.0"
37
+ "@synerise/ds-button": "^0.21.15",
38
+ "@synerise/ds-icon": "^0.66.1",
39
+ "@synerise/ds-utils": "^0.30.1"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@synerise/ds-core": "*",
@@ -44,5 +44,5 @@
44
44
  "react": ">=16.9.0 <= 17.0.2",
45
45
  "styled-components": "5.0.1"
46
46
  },
47
- "gitHead": "2389b995aa44e42ec1dd9a177c7ab1f1a0001a70"
47
+ "gitHead": "fbadaa2299668c527b52ecc66d61fc2165528bff"
48
48
  }