@synerise/ds-popconfirm 1.3.8 → 1.3.10

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,14 @@
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.3.10](https://github.com/Synerise/synerise-design/compare/@synerise/ds-popconfirm@1.3.9...@synerise/ds-popconfirm@1.3.10) (2026-03-24)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-popconfirm
9
+
10
+ ## [1.3.9](https://github.com/Synerise/synerise-design/compare/@synerise/ds-popconfirm@1.3.8...@synerise/ds-popconfirm@1.3.9) (2026-03-20)
11
+
12
+ **Note:** Version bump only for package @synerise/ds-popconfirm
13
+
6
14
  ## [1.3.8](https://github.com/Synerise/synerise-design/compare/@synerise/ds-popconfirm@1.3.7...@synerise/ds-popconfirm@1.3.8) (2026-03-09)
7
15
 
8
16
  **Note:** Version bump only for package @synerise/ds-popconfirm
package/README.md CHANGED
@@ -33,28 +33,36 @@ import Popconfirm from '@synerise/ds-popconfirm';
33
33
 
34
34
  ## API
35
35
 
36
- | Property | Description | Type | Default |
37
- | ------------------- | -------------------------------------- | ---------------------------- | ------------------------------------ |
38
- | cancelText | Text of the Cancel button | string | `Cancel` |
39
- | okText | Text of the Confirm button | string | `OK` |
40
- | okType | Button type of the Confirm button | string | `primary` |
41
- | title | Title of the confirmation box | string / React.ReactNode | - |
42
- | description | Description of the confirmation box | string / React.ReactNode | - |
43
- | images | Urls of images displayed as a carousel | string[] | `[]` |
44
- | imagesAutoplay | Whether to autoplay images | boolean | `false` |
45
- | imagesAutoplaySpeed | Speed of autoplay [ms] | number | `5000` |
46
- | onCancel | Callback of cancel | (e: Event) => void | - |
47
- | onConfirm | Callback of confirmation | (e: Event) => void | - |
48
- | icon | Customize icon of confirmation | React.ReactNode | `<Icon type="exclamation-circle" />` |
49
- | disabled | Whether component is disabled | boolean | `false` |
50
- | withLink | Text with highlited text | React.ReactNode | - |
51
- | closeIcon | Icon to close popconfirm | React.ReactNode | - |
52
- | hideButtons | prop to hide buttons | React.ReactNode | - |
53
- | titlePadding | prop to set padding | boolean | `false` |
54
- | buttonsAlign | Sets footer buttons align | 'right' / 'left' / undefined | `'right'` |
55
- | staticVisible | stay open even after click outside | boolean | `false` |
56
-
57
- # Popcofirm.ConfirmMessage
36
+ | Property | Description | Type | Default |
37
+ | ------------------- | -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | --------- |
38
+ | cancelText | Text of the Cancel button | React.ReactNode | - |
39
+ | okText | Text of the Confirm button | React.ReactNode | - |
40
+ | okType | Button type of the Confirm button | ButtonProps['type'] | `primary` |
41
+ | title | Title of the confirmation box | React.ReactNode | - |
42
+ | description | Description of the confirmation box | React.ReactNode | - |
43
+ | images | Urls of images displayed as a carousel | string[] | - |
44
+ | imagesAutoplay | Whether to autoplay images | boolean | - |
45
+ | imagesAutoplaySpeed | Speed of autoplay [ms] | number | `5000` |
46
+ | onCancel | Callback of cancel | (event?: MouseEvent\<HTMLElement\>) => void | - |
47
+ | onConfirm | Callback of confirmation | (event?: MouseEvent\<HTMLElement\>) => void | - |
48
+ | icon | Icon displayed left of the title | React.ReactNode | - |
49
+ | disabled | When true renders only children with no popover | boolean | - |
50
+ | withLink | Link node rendered below description | React.ReactNode | - |
51
+ | closeIcon | Icon rendered as a close button | React.ReactNode | - |
52
+ | hideButtons | Truthy value hides the button row | React.ReactNode | - |
53
+ | titlePadding | Adjusts close icon margin and description spacing | boolean | - |
54
+ | buttonsAlign | Sets footer buttons align | 'right' / 'left' | - |
55
+ | staticVisible | Stay open even after click outside | boolean | - |
56
+ | placement | Popover placement | 'top' / 'topLeft' / 'topCenter' / 'topRight' / 'bottom' / 'bottomLeft' / 'bottomCenter' / 'bottomRight' / 'left' / 'leftTop' / 'leftBottom' / 'right' / 'rightTop' / 'rightBottom' | `top` |
57
+ | trigger | Open trigger | 'click' / 'hover' / array | `click` |
58
+ | open | Controlled open state | boolean | - |
59
+ | onOpenChange | Callback when open state changes | (open: boolean) => void | - |
60
+ | asChild | Merge trigger props onto child element | boolean | `true` |
61
+ | zIndex | Z-index override | number | `theme.variables['zindex-popconfirm']` |
62
+ | overlayClassName | Class applied to popconfirm container | string | - |
63
+ | overlayStyle | Inline styles for popconfirm container | CSSProperties | - |
64
+
65
+ # Popconfirm.ConfirmMessage
58
66
 
59
67
  ## Usage
60
68
 
@@ -88,5 +96,5 @@ import Popconfirm from '@synerise/ds-popconfirm';
88
96
  | title | text confirm message | string | - |
89
97
  | icon | icon component | React.ReactNode | - |
90
98
  | displayDuration | confirm message display time in ms | number | 5000 |
91
- | placement | position of confirm message `left`, `top`, `right`, `bottom`, `topLeft`, `topRight`, `bottomLeft`, `bottomRight`, `leftTop`, `leftBottom,`, `rightTop`, `rightBottom` | string | `topLeft` |
99
+ | placement | Position of confirm message | 'top' / 'left' / 'right' / 'bottom' / 'topLeft' / 'topRight' / 'bottomLeft' / 'bottomRight' | `topLeft` |
92
100
  | onClick | method which returns a showConfirmMessage callback | (showConfirmMessage: () => void) => void | - |
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type ConfirmMessageProps } from './ConfirmMessage.types';
1
+ import { default as React } from 'react';
2
+ import { ConfirmMessageProps } from './ConfirmMessage.types';
3
3
  export declare const ConfirmMessage: ({ children, placement, title, onClick, displayDuration, icon, }: ConfirmMessageProps) => React.JSX.Element;
4
4
  export default ConfirmMessage;
@@ -1,45 +1,39 @@
1
- import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
- import Tooltip from '@synerise/ds-tooltip';
3
- import * as S from './ConfirmMessage.style';
4
- export var ConfirmMessage = function ConfirmMessage(_ref) {
5
- var children = _ref.children,
6
- _ref$placement = _ref.placement,
7
- placement = _ref$placement === void 0 ? 'topLeft' : _ref$placement,
8
- title = _ref.title,
9
- onClick = _ref.onClick,
10
- _ref$displayDuration = _ref.displayDuration,
11
- displayDuration = _ref$displayDuration === void 0 ? 5000 : _ref$displayDuration,
12
- icon = _ref.icon;
13
- var _useState = useState(false),
14
- open = _useState[0],
15
- setOpen = _useState[1];
16
- useEffect(function () {
17
- var timeout = setTimeout(function () {
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useState, useEffect, useCallback, useMemo } from "react";
3
+ import Tooltip from "@synerise/ds-tooltip";
4
+ import { ConfirmMessage as ConfirmMessage$1, ConfirmMessageTitle, Message } from "./ConfirmMessage.style.js";
5
+ const ConfirmMessage = ({
6
+ children,
7
+ placement = "topLeft",
8
+ title,
9
+ onClick,
10
+ displayDuration = 5e3,
11
+ icon
12
+ }) => {
13
+ const [open, setOpen] = useState(false);
14
+ useEffect(() => {
15
+ const timeout = setTimeout(() => {
18
16
  setOpen(false);
19
17
  }, displayDuration);
20
- return function () {
18
+ return () => {
21
19
  clearTimeout(timeout);
22
20
  };
23
21
  }, [open, displayDuration]);
24
- var showMessage = function showMessage() {
22
+ const showMessage = () => {
25
23
  setOpen(true);
26
24
  };
27
- var handleClick = useCallback(function () {
25
+ const handleClick = useCallback(() => {
28
26
  onClick && onClick(showMessage);
29
27
  }, [onClick]);
30
- var content = useMemo(function () {
31
- return /*#__PURE__*/React.createElement(S.ConfirmMessage, null, icon, /*#__PURE__*/React.createElement(S.ConfirmMessageTitle, null, title));
28
+ const content = useMemo(() => {
29
+ return /* @__PURE__ */ jsxs(ConfirmMessage$1, { children: [
30
+ icon,
31
+ /* @__PURE__ */ jsx(ConfirmMessageTitle, { children: title })
32
+ ] });
32
33
  }, [title, icon]);
33
- return /*#__PURE__*/React.createElement(S.Message, {
34
- onClick: handleClick,
35
- "data-testid": "confirm-message"
36
- }, /*#__PURE__*/React.createElement(Tooltip, {
37
- trigger: "click",
38
- render: function render() {
39
- return content;
40
- },
41
- open: open,
42
- placement: placement
43
- }, children));
34
+ return /* @__PURE__ */ jsx(Message, { onClick: handleClick, "data-testid": "confirm-message", children: /* @__PURE__ */ jsx(Tooltip, { trigger: "click", render: () => content, open, placement, children }) });
35
+ };
36
+ export {
37
+ ConfirmMessage,
38
+ ConfirmMessage as default
44
39
  };
45
- export default ConfirmMessage;
@@ -1,3 +1,3 @@
1
- export declare const Message: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export declare const ConfirmMessageTitle: import("styled-components").StyledComponent<"span", any, {}, never>;
3
- export declare const ConfirmMessage: import("styled-components").StyledComponent<"div", any, {}, never>;
1
+ export declare const Message: import('styled-components').StyledComponent<"div", any, {}, never>;
2
+ export declare const ConfirmMessageTitle: import('styled-components').StyledComponent<"span", any, {}, never>;
3
+ export declare const ConfirmMessage: import('styled-components').StyledComponent<"div", any, {}, never>;
@@ -1,16 +1,19 @@
1
- import styled from 'styled-components';
2
- import { IconContainer } from '@synerise/ds-icon';
3
- export var Message = styled.div.withConfig({
1
+ import styled from "styled-components";
2
+ import { IconContainer } from "@synerise/ds-icon";
3
+ const Message = /* @__PURE__ */ styled.div.withConfig({
4
4
  displayName: "ConfirmMessagestyle__Message",
5
5
  componentId: "sc-6dbwo9-0"
6
6
  })([""]);
7
- export var ConfirmMessageTitle = styled.span.withConfig({
7
+ const ConfirmMessageTitle = /* @__PURE__ */ styled.span.withConfig({
8
8
  displayName: "ConfirmMessagestyle__ConfirmMessageTitle",
9
9
  componentId: "sc-6dbwo9-1"
10
10
  })(["font-size:14px;line-height:1.43;color:#404c5a;"]);
11
- export var ConfirmMessage = styled.div.withConfig({
11
+ const ConfirmMessage = /* @__PURE__ */ styled.div.withConfig({
12
12
  displayName: "ConfirmMessagestyle__ConfirmMessage",
13
13
  componentId: "sc-6dbwo9-2"
14
- })(["display:flex;align-items:center;justify-content:center;background-color:", ";padding:16px;border-radius:3px;box-shadow:0 16px 32px 0 rgba(35,41,54,0.1);", "{margin-right:8px;}"], function (props) {
15
- return props.theme.palette.white;
16
- }, IconContainer);
14
+ })(["display:flex;align-items:center;justify-content:center;background-color:", ";padding:16px;border-radius:3px;box-shadow:0 16px 32px 0 rgba(35,41,54,0.1);", "{margin-right:8px;}"], (props) => props.theme.palette.white, IconContainer);
15
+ export {
16
+ ConfirmMessage,
17
+ ConfirmMessageTitle,
18
+ Message
19
+ };
@@ -1,4 +1,4 @@
1
- import { type ReactNode } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  export type ConfirmMessageProps = {
3
3
  displayDuration?: number;
4
4
  title: string;
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,2 +1,2 @@
1
- import { type OffsetConfig } from '@synerise/ds-popover';
1
+ import { OffsetConfig } from '@synerise/ds-popover';
2
2
  export declare const POPOVER_OFFSET_CONFIG: OffsetConfig;
@@ -1,3 +1,6 @@
1
- export var POPOVER_OFFSET_CONFIG = {
1
+ const POPOVER_OFFSET_CONFIG = {
2
2
  mainAxis: 16
3
- };
3
+ };
4
+ export {
5
+ POPOVER_OFFSET_CONFIG
6
+ };
@@ -1,4 +1,3 @@
1
- import { type PopconfirmType } from './Popconfirm.types';
2
- import './style/index.less';
1
+ import { PopconfirmType } from './Popconfirm.types';
3
2
  declare const Popconfirm: PopconfirmType;
4
3
  export default Popconfirm;
@@ -1,146 +1,104 @@
1
- var _excluded = ["icon", "title", "description", "images", "imagesAutoplay", "imagesAutoplaySpeed", "withLink", "closeIcon", "titlePadding", "onCancel", "cancelButtonProps", "onConfirm", "okButtonProps", "okType", "hideButtons", "cancelText", "okText", "buttonsAlign", "disabled", "staticVisible", "children", "open", "onOpenChange", "trigger", "asChild", "placement", "overlayClassName", "overlayStyle", "zIndex"];
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 { Carousel } from 'antd';
5
- import React, { forwardRef, useEffect, useMemo, useState } from 'react';
6
- import { useTheme } from '@synerise/ds-core';
7
- import { Popover, PopoverArrow, PopoverContent, PopoverTrigger, getPlacement } from '@synerise/ds-popover';
8
- import ConfirmMessage from './ConfirmMessage/ConfirmMessage';
9
- import { POPOVER_OFFSET_CONFIG } from './Popconfirm.const';
10
- import * as S from './Popconfirm.styles';
1
+ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
+ import { Carousel } from "antd";
3
+ import { forwardRef, useMemo, useState, useEffect } from "react";
4
+ import { useTheme } from "@synerise/ds-core";
5
+ import { getPlacement, Popover, PopoverTrigger, PopoverContent, PopoverArrow } from "@synerise/ds-popover";
6
+ import { ConfirmMessage } from "./ConfirmMessage/ConfirmMessage.js";
7
+ import { POPOVER_OFFSET_CONFIG } from "./Popconfirm.const.js";
8
+ import { PopconfirmImage, PopconfirmContainer, PopconfirmContent, PopconfirmWrapper, PopconfirmContentWrapper, PopconfirmHeaderWrapper, PopconfirmIcon, PopconfirmTitle, PopconfirmTextWrapper, PopconfirmDescription, LinkWrapper, PopconfirmCloseIcon, PopconfirmButtonWrapper, PopconfirmButton, PopconfirmArrowWrapper, PopconfirmArrow } from "./Popconfirm.styles.js";
9
+ import { getTransitionConfig } from "./utils/getTransitionConfig.js";
11
10
  import "./style/index.css";
12
- import { getTransitionConfig } from './utils/getTransitionConfig';
13
- var Popconfirm = /*#__PURE__*/forwardRef(function (_ref, ref) {
14
- var icon = _ref.icon,
15
- title = _ref.title,
16
- description = _ref.description,
17
- images = _ref.images,
18
- imagesAutoplay = _ref.imagesAutoplay,
19
- _ref$imagesAutoplaySp = _ref.imagesAutoplaySpeed,
20
- imagesAutoplaySpeed = _ref$imagesAutoplaySp === void 0 ? 5000 : _ref$imagesAutoplaySp,
21
- withLink = _ref.withLink,
22
- closeIcon = _ref.closeIcon,
23
- titlePadding = _ref.titlePadding,
24
- onCancel = _ref.onCancel,
25
- cancelButtonProps = _ref.cancelButtonProps,
26
- onConfirm = _ref.onConfirm,
27
- okButtonProps = _ref.okButtonProps,
28
- _ref$okType = _ref.okType,
29
- okType = _ref$okType === void 0 ? 'primary' : _ref$okType,
30
- hideButtons = _ref.hideButtons,
31
- cancelText = _ref.cancelText,
32
- okText = _ref.okText,
33
- buttonsAlign = _ref.buttonsAlign,
34
- disabled = _ref.disabled,
35
- staticVisible = _ref.staticVisible,
36
- children = _ref.children,
37
- open = _ref.open,
38
- onOpenChange = _ref.onOpenChange,
39
- _ref$trigger = _ref.trigger,
40
- trigger = _ref$trigger === void 0 ? 'click' : _ref$trigger,
41
- _ref$asChild = _ref.asChild,
42
- asChild = _ref$asChild === void 0 ? true : _ref$asChild,
43
- _ref$placement = _ref.placement,
44
- placement = _ref$placement === void 0 ? 'top' : _ref$placement,
45
- overlayClassName = _ref.overlayClassName,
46
- overlayStyle = _ref.overlayStyle,
47
- zIndex = _ref.zIndex,
48
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
49
- var theme = useTheme();
50
- var renderImageCarousel = useMemo(function () {
51
- return (images == null ? void 0 : images.length) && /*#__PURE__*/React.createElement(Carousel, {
52
- autoplay: imagesAutoplay,
53
- autoplaySpeed: imagesAutoplaySpeed,
54
- effect: "fade"
55
- }, images.map(function (image) {
56
- return /*#__PURE__*/React.createElement(S.PopconfirmImage, {
57
- key: image,
58
- src: image
59
- });
60
- }));
11
+ const Popconfirm = forwardRef(({
12
+ icon,
13
+ title,
14
+ description,
15
+ images,
16
+ imagesAutoplay,
17
+ imagesAutoplaySpeed = 5e3,
18
+ withLink,
19
+ closeIcon,
20
+ titlePadding,
21
+ onCancel,
22
+ cancelButtonProps,
23
+ onConfirm,
24
+ okButtonProps,
25
+ okType = "primary",
26
+ hideButtons,
27
+ cancelText,
28
+ okText,
29
+ buttonsAlign,
30
+ disabled,
31
+ staticVisible,
32
+ children,
33
+ open,
34
+ onOpenChange,
35
+ trigger = "click",
36
+ asChild = true,
37
+ placement = "top",
38
+ overlayClassName,
39
+ overlayStyle,
40
+ zIndex,
41
+ ...rest
42
+ }, ref) => {
43
+ const theme = useTheme();
44
+ const renderImageCarousel = useMemo(() => {
45
+ return images?.length && /* @__PURE__ */ jsx(Carousel, { autoplay: imagesAutoplay, autoplaySpeed: imagesAutoplaySpeed, effect: "fade", children: images.map((image) => /* @__PURE__ */ jsx(PopconfirmImage, { src: image }, image)) });
61
46
  }, [images, imagesAutoplay, imagesAutoplaySpeed]);
62
- var _useState = useState(undefined),
63
- isOpen = _useState[0],
64
- setIsOpen = _useState[1];
65
- var floatingPlacement = getPlacement(placement);
66
- useEffect(function () {
47
+ const [isOpen, setIsOpen] = useState(void 0);
48
+ const floatingPlacement = getPlacement(placement);
49
+ useEffect(() => {
67
50
  if (!isOpen && open) {
68
51
  setIsOpen(open);
69
52
  }
70
53
  }, [isOpen, open]);
71
- var isTriggeredByClick = Array.isArray(trigger) ? trigger.includes('click') : trigger === 'click';
72
- var handleOpenChange = function handleOpenChange(newState) {
54
+ const isTriggeredByClick = Array.isArray(trigger) ? trigger.includes("click") : trigger === "click";
55
+ const handleOpenChange = (newState) => {
73
56
  setIsOpen(newState);
74
- onOpenChange == null || onOpenChange(newState);
57
+ onOpenChange?.(newState);
75
58
  };
76
- var handleTriggerClick = function handleTriggerClick() {
59
+ const handleTriggerClick = () => {
77
60
  isTriggeredByClick && setIsOpen(!isOpen);
78
61
  };
79
- return disabled ? /*#__PURE__*/React.createElement(React.Fragment, null, children) : /*#__PURE__*/React.createElement(Popover, _extends({
80
- placement: floatingPlacement,
81
- trigger: trigger,
82
- modal: false,
83
- open: isOpen,
84
- onOpenChange: handleOpenChange,
85
- autoUpdate: true,
86
- dismissConfig: {
87
- enabled: !staticVisible
88
- },
89
- arrowConfig: {
90
- padding: 20
91
- },
92
- zIndex: zIndex != null ? zIndex : parseInt(theme.variables['zindex-popconfirm']),
93
- offsetConfig: POPOVER_OFFSET_CONFIG,
94
- getTransitionConfig: getTransitionConfig,
95
- testId: "popconfirm"
96
- }, rest), /*#__PURE__*/React.createElement(PopoverTrigger, {
97
- ref: ref,
98
- asChild: asChild,
99
- onClick: handleTriggerClick
100
- }, children), /*#__PURE__*/React.createElement(PopoverContent, null, /*#__PURE__*/React.createElement(S.PopconfirmContainer, {
101
- className: overlayClassName,
102
- style: overlayStyle
103
- }, /*#__PURE__*/React.createElement(S.PopconfirmContent, {
104
- buttonsAlign: buttonsAlign
105
- }, /*#__PURE__*/React.createElement(S.PopconfirmWrapper, null, /*#__PURE__*/React.createElement(S.PopconfirmContentWrapper, null, /*#__PURE__*/React.createElement(S.PopconfirmHeaderWrapper, null, icon && /*#__PURE__*/React.createElement(S.PopconfirmIcon, null, icon), /*#__PURE__*/React.createElement(S.PopconfirmTitle, null, /*#__PURE__*/React.createElement(React.Fragment, null, title))), /*#__PURE__*/React.createElement(S.PopconfirmTextWrapper, null, description && /*#__PURE__*/React.createElement(S.PopconfirmDescription, {
106
- titlePadding: !titlePadding
107
- }, description), withLink && /*#__PURE__*/React.createElement(S.LinkWrapper, null, withLink))), closeIcon && /*#__PURE__*/React.createElement(S.PopconfirmCloseIcon, {
108
- onClick: function onClick() {
109
- return setIsOpen(false);
110
- },
111
- titlePadding: titlePadding
112
- }, closeIcon)), renderImageCarousel, !hideButtons && /*#__PURE__*/React.createElement(S.PopconfirmButtonWrapper, null, /*#__PURE__*/React.createElement(S.PopconfirmButton, _extends({
113
- type: "secondary"
114
- }, cancelButtonProps, {
115
- onClick: function onClick(event) {
116
- onCancel && onCancel(event);
117
- setIsOpen(false);
118
- (cancelButtonProps == null ? void 0 : cancelButtonProps.onClick) && cancelButtonProps.onClick(event);
119
- }
120
- }), cancelText), /*#__PURE__*/React.createElement(S.PopconfirmButton, _extends({
121
- type: okType
122
- }, okButtonProps, {
123
- onClick: function onClick(event) {
124
- onConfirm && onConfirm(event);
125
- setIsOpen(false);
126
- (okButtonProps == null ? void 0 : okButtonProps.onClick) && okButtonProps.onClick(event);
127
- }
128
- }), okText)))), /*#__PURE__*/React.createElement(PopoverArrow, null, /*#__PURE__*/React.createElement(S.PopconfirmArrowWrapper, null, /*#__PURE__*/React.createElement(S.PopconfirmArrow, {
129
- width: "15",
130
- height: "7",
131
- viewBox: "0 0 15 7",
132
- fill: "none",
133
- xmlns: "http://www.w3.org/2000/svg"
134
- }, /*#__PURE__*/React.createElement("path", {
135
- d: "M7.49919 7L2.15928e-05 5.96025e-07L15 1.90737e-06L7.49919 7Z",
136
- fill: "currentColor"
137
- }))))));
62
+ return disabled ? /* @__PURE__ */ jsx(Fragment, { children }) : /* @__PURE__ */ jsxs(Popover, { placement: floatingPlacement, trigger, modal: false, open: isOpen, onOpenChange: handleOpenChange, autoUpdate: true, dismissConfig: {
63
+ enabled: !staticVisible
64
+ }, arrowConfig: {
65
+ padding: 20
66
+ }, zIndex: zIndex ?? parseInt(theme.variables["zindex-popconfirm"]), offsetConfig: POPOVER_OFFSET_CONFIG, getTransitionConfig, testId: "popconfirm", ...rest, children: [
67
+ /* @__PURE__ */ jsx(PopoverTrigger, { ref, asChild, onClick: handleTriggerClick, children }),
68
+ /* @__PURE__ */ jsxs(PopoverContent, { children: [
69
+ /* @__PURE__ */ jsx(PopconfirmContainer, { className: overlayClassName, style: overlayStyle, children: /* @__PURE__ */ jsxs(PopconfirmContent, { buttonsAlign, children: [
70
+ /* @__PURE__ */ jsxs(PopconfirmWrapper, { children: [
71
+ /* @__PURE__ */ jsxs(PopconfirmContentWrapper, { children: [
72
+ /* @__PURE__ */ jsxs(PopconfirmHeaderWrapper, { children: [
73
+ icon && /* @__PURE__ */ jsx(PopconfirmIcon, { children: icon }),
74
+ /* @__PURE__ */ jsx(PopconfirmTitle, { children: /* @__PURE__ */ jsx(Fragment, { children: title }) })
75
+ ] }),
76
+ /* @__PURE__ */ jsxs(PopconfirmTextWrapper, { children: [
77
+ description && /* @__PURE__ */ jsx(PopconfirmDescription, { titlePadding: !titlePadding, children: description }),
78
+ withLink && /* @__PURE__ */ jsx(LinkWrapper, { children: withLink })
79
+ ] })
80
+ ] }),
81
+ closeIcon && /* @__PURE__ */ jsx(PopconfirmCloseIcon, { onClick: () => setIsOpen(false), titlePadding, children: closeIcon })
82
+ ] }),
83
+ renderImageCarousel,
84
+ !hideButtons && /* @__PURE__ */ jsxs(PopconfirmButtonWrapper, { children: [
85
+ /* @__PURE__ */ jsx(PopconfirmButton, { type: "secondary", ...cancelButtonProps, onClick: (event) => {
86
+ onCancel && onCancel(event);
87
+ setIsOpen(false);
88
+ cancelButtonProps?.onClick && cancelButtonProps.onClick(event);
89
+ }, children: cancelText }),
90
+ /* @__PURE__ */ jsx(PopconfirmButton, { type: okType, ...okButtonProps, onClick: (event) => {
91
+ onConfirm && onConfirm(event);
92
+ setIsOpen(false);
93
+ okButtonProps?.onClick && okButtonProps.onClick(event);
94
+ }, children: okText })
95
+ ] })
96
+ ] }) }),
97
+ /* @__PURE__ */ jsx(PopoverArrow, { children: /* @__PURE__ */ jsx(PopconfirmArrowWrapper, { children: /* @__PURE__ */ jsx(PopconfirmArrow, { width: "15", height: "7", viewBox: "0 0 15 7", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("path", { d: "M7.49919 7L2.15928e-05 5.96025e-07L15 1.90737e-06L7.49919 7Z", fill: "currentColor" }) }) }) })
98
+ ] })
99
+ ] });
138
100
  });
139
-
140
- /**
141
- * @deprecated - use named import instead
142
- *
143
- * import { ConfirmMessage } from @synerise/ds-popconfirm
144
- */
145
101
  Popconfirm.ConfirmMessage = ConfirmMessage;
146
- export default Popconfirm;
102
+ export {
103
+ Popconfirm as default
104
+ };
@@ -1,5 +1,5 @@
1
- import { type StyledComponent } from 'styled-components';
2
- import { type ButtonProps } from '@synerise/ds-button';
1
+ import { StyledComponent } from 'styled-components';
2
+ import { ButtonProps } from '@synerise/ds-button';
3
3
  export declare const PopconfirmContainer: StyledComponent<"div", any, {}, never>;
4
4
  export declare const PopconfirmContent: StyledComponent<"div", any, {
5
5
  buttonsAlign?: "left" | "right";
@@ -1,99 +1,91 @@
1
- import styled from 'styled-components';
2
- import Button from '@synerise/ds-button';
3
- export var PopconfirmContainer = styled.div.withConfig({
1
+ import styled from "styled-components";
2
+ import Button from "@synerise/ds-button";
3
+ const PopconfirmContainer = /* @__PURE__ */ styled.div.withConfig({
4
4
  displayName: "Popconfirmstyles__PopconfirmContainer",
5
5
  componentId: "sc-19dzptq-0"
6
- })(["box-shadow:", ";max-width:288px;padding:16px;position:relative;z-index:1;border-radius:3px;background-color:", ";"], function (props) {
7
- return props.theme.variables['box-shadow-2'];
8
- }, function (props) {
9
- return props.theme.palette.white;
10
- });
11
- export var PopconfirmContent = styled.div.withConfig({
6
+ })(["box-shadow:", ";max-width:288px;padding:16px;position:relative;z-index:1;border-radius:3px;background-color:", ";"], (props) => props.theme.variables["box-shadow-2"], (props) => props.theme.palette.white);
7
+ const PopconfirmContent = /* @__PURE__ */ styled.div.withConfig({
12
8
  displayName: "Popconfirmstyles__PopconfirmContent",
13
9
  componentId: "sc-19dzptq-1"
14
- })(["display:flex;flex-direction:column;align-items:", ";justify-content:flex-start;margin:0px;.ant-carousel{position:relative;width:100%;margin-top:24px;.slick-track{width:100%;}.slick-dots-bottom{position:relative;bottom:0;display:flex;flex-direction:row;align-items:center;justify-content:center;padding:24px 0 0;margin:0;li{width:8px;height:8px;border-radius:50%;margin:0 8px 0 0;display:flex;align-items:center;justify-content:center;button{box-sizing:content-box;background-color:", ";border:2px solid ", ";height:4px;width:4px;border-radius:50%;opacity:1;}}li.slick-active{button{border:2px solid ", ";background-color:", ";}}}}"], function (_ref) {
15
- var buttonsAlign = _ref.buttonsAlign;
16
- return buttonsAlign === 'left' ? 'flex-start' : 'flex-end';
17
- }, function (props) {
18
- return props.theme.palette['grey-600'];
19
- }, function (props) {
20
- return props.theme.palette.white;
21
- }, function (props) {
22
- return props.theme.palette['green-600'];
23
- }, function (props) {
24
- return "" + props.theme.palette.white;
25
- });
26
- export var PopconfirmTitle = styled.div.withConfig({
10
+ })(["display:flex;flex-direction:column;align-items:", ";justify-content:flex-start;margin:0px;.ant-carousel{position:relative;width:100%;margin-top:24px;.slick-track{width:100%;}.slick-dots-bottom{position:relative;bottom:0;display:flex;flex-direction:row;align-items:center;justify-content:center;padding:24px 0 0;margin:0;li{width:8px;height:8px;border-radius:50%;margin:0 8px 0 0;display:flex;align-items:center;justify-content:center;button{box-sizing:content-box;background-color:", ";border:2px solid ", ";height:4px;width:4px;border-radius:50%;opacity:1;}}li.slick-active{button{border:2px solid ", ";background-color:", ";}}}}"], ({
11
+ buttonsAlign
12
+ }) => buttonsAlign === "left" ? "flex-start" : "flex-end", (props) => props.theme.palette["grey-600"], (props) => props.theme.palette.white, (props) => props.theme.palette["green-600"], (props) => `${props.theme.palette.white}`);
13
+ const PopconfirmTitle = /* @__PURE__ */ styled.div.withConfig({
27
14
  displayName: "Popconfirmstyles__PopconfirmTitle",
28
15
  componentId: "sc-19dzptq-2"
29
- })(["font-size:14px;line-height:1.43;color:", ";font-weight:500;padding-top:2px;text-overflow:ellipsis;overflow:hidden;"], function (props) {
30
- return props.theme.palette['grey-800'];
31
- });
32
- export var PopconfirmButton = styled(Button).withConfig({
16
+ })(["font-size:14px;line-height:1.43;color:", ";font-weight:500;padding-top:2px;text-overflow:ellipsis;overflow:hidden;"], (props) => props.theme.palette["grey-800"]);
17
+ const PopconfirmButton = /* @__PURE__ */ styled(Button).withConfig({
33
18
  displayName: "Popconfirmstyles__PopconfirmButton",
34
19
  componentId: "sc-19dzptq-3"
35
20
  })(["&&{height:32px;}"]);
36
- export var PopconfirmButtonWrapper = styled.div.withConfig({
21
+ const PopconfirmButtonWrapper = /* @__PURE__ */ styled.div.withConfig({
37
22
  displayName: "Popconfirmstyles__PopconfirmButtonWrapper",
38
23
  componentId: "sc-19dzptq-4"
39
24
  })(["display:flex;padding-top:16px;align-items:center;justify-content:flex-start;", ":not(:first-of-type){margin-left:8px;}"], PopconfirmButton);
40
- export var ButtonWrapper = styled.div.withConfig({
25
+ const ButtonWrapper = /* @__PURE__ */ styled.div.withConfig({
41
26
  displayName: "Popconfirmstyles__ButtonWrapper",
42
27
  componentId: "sc-19dzptq-5"
43
28
  })(["margin-left:8px;"]);
44
- export var PopconfirmDescription = styled.div.withConfig({
29
+ const PopconfirmDescription = /* @__PURE__ */ styled.div.withConfig({
45
30
  displayName: "Popconfirmstyles__PopconfirmDescription",
46
31
  componentId: "sc-19dzptq-6"
47
- })(["font-size:13px;line-height:1.38;font-weight:400;margin-top:", ";color:", ";"], function (props) {
48
- return props.titlePadding ? '6px' : 'none';
49
- }, function (props) {
50
- return props.theme.palette['grey-800'];
51
- });
52
- export var PopconfirmIcon = styled.div.withConfig({
32
+ })(["font-size:13px;line-height:1.38;font-weight:400;margin-top:", ";color:", ";"], (props) => props.titlePadding ? "6px" : "none", (props) => props.theme.palette["grey-800"]);
33
+ const PopconfirmIcon = /* @__PURE__ */ styled.div.withConfig({
53
34
  displayName: "Popconfirmstyles__PopconfirmIcon",
54
35
  componentId: "sc-19dzptq-7"
55
36
  })(["margin-right:8px;"]);
56
- export var PopconfirmCloseIcon = styled.div.withConfig({
37
+ const PopconfirmCloseIcon = /* @__PURE__ */ styled.div.withConfig({
57
38
  displayName: "Popconfirmstyles__PopconfirmCloseIcon",
58
39
  componentId: "sc-19dzptq-8"
59
- })(["margin-left:", ";color:", ";cursor:pointer;border-radius:3px;"], function (props) {
60
- return props.titlePadding ? '8px' : '6px';
61
- }, function (props) {
62
- return props.theme.palette['grey-600'];
63
- });
64
- export var PopconfirmWrapper = styled.div.withConfig({
40
+ })(["margin-left:", ";color:", ";cursor:pointer;border-radius:3px;"], (props) => props.titlePadding ? "8px" : "6px", (props) => props.theme.palette["grey-600"]);
41
+ const PopconfirmWrapper = /* @__PURE__ */ styled.div.withConfig({
65
42
  displayName: "Popconfirmstyles__PopconfirmWrapper",
66
43
  componentId: "sc-19dzptq-9"
67
44
  })(["display:flex;flex-direction:row;width:100%;justify-content:space-between;"]);
68
- export var PopconfirmArrow = styled.svg.withConfig({
45
+ const PopconfirmArrow = /* @__PURE__ */ styled.svg.withConfig({
69
46
  displayName: "Popconfirmstyles__PopconfirmArrow",
70
47
  componentId: "sc-19dzptq-10"
71
48
  })(["position:absolute;transform:translate(-50%,0);"]);
72
- export var PopconfirmArrowWrapper = styled.div.withConfig({
49
+ const PopconfirmArrowWrapper = /* @__PURE__ */ styled.div.withConfig({
73
50
  displayName: "Popconfirmstyles__PopconfirmArrowWrapper",
74
51
  componentId: "sc-19dzptq-11"
75
- })(["width:0;height:0;position:absolute;z-index:2;color:", ";&.ds-popover-arrow-bottom,&.ds-popover-arrow-bottom-end,&.ds-popover-arrow-bottom-start{top:0;transform:rotate(180deg);}&.ds-popover-arrow-top,&.ds-popover-arrow-top-end,&.ds-popover-arrow-top-start{bottom:0;}&.ds-popover-arrow-left,&.ds-popover-arrow-left-end,&.ds-popover-arrow-left-start{right:0;transform:rotate(-90deg);}&.ds-popover-arrow-right,&.ds-popover-arrow-right-end,&.ds-popover-arrow-right-start{left:0;transform:rotate(90deg);}"], function (props) {
76
- return props.theme.palette['white'];
77
- });
78
- export var PopconfirmContentWrapper = styled.div.withConfig({
52
+ })(["width:0;height:0;position:absolute;z-index:2;color:", ";&.ds-popover-arrow-bottom,&.ds-popover-arrow-bottom-end,&.ds-popover-arrow-bottom-start{top:0;transform:rotate(180deg);}&.ds-popover-arrow-top,&.ds-popover-arrow-top-end,&.ds-popover-arrow-top-start{bottom:0;}&.ds-popover-arrow-left,&.ds-popover-arrow-left-end,&.ds-popover-arrow-left-start{right:0;transform:rotate(-90deg);}&.ds-popover-arrow-right,&.ds-popover-arrow-right-end,&.ds-popover-arrow-right-start{left:0;transform:rotate(90deg);}"], (props) => props.theme.palette["white"]);
53
+ const PopconfirmContentWrapper = /* @__PURE__ */ styled.div.withConfig({
79
54
  displayName: "Popconfirmstyles__PopconfirmContentWrapper",
80
55
  componentId: "sc-19dzptq-12"
81
56
  })(["display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;"]);
82
- export var PopconfirmHeaderWrapper = styled.div.withConfig({
57
+ const PopconfirmHeaderWrapper = /* @__PURE__ */ styled.div.withConfig({
83
58
  displayName: "Popconfirmstyles__PopconfirmHeaderWrapper",
84
59
  componentId: "sc-19dzptq-13"
85
60
  })(["display:flex;flex-direction:row;justify-content:flex-start;"]);
86
- export var PopconfirmTextWrapper = styled.div.withConfig({
61
+ const PopconfirmTextWrapper = /* @__PURE__ */ styled.div.withConfig({
87
62
  displayName: "Popconfirmstyles__PopconfirmTextWrapper",
88
63
  componentId: "sc-19dzptq-14"
89
64
  })(["display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;"]);
90
- export var PopconfirmImage = styled.img.withConfig({
65
+ const PopconfirmImage = /* @__PURE__ */ styled.img.withConfig({
91
66
  displayName: "Popconfirmstyles__PopconfirmImage",
92
67
  componentId: "sc-19dzptq-15"
93
68
  })(["display:flex;width:100%;height:auto;border-radius:8px;& > *{max-width:100%;}"]);
94
- export var LinkWrapper = styled.span.withConfig({
69
+ const LinkWrapper = /* @__PURE__ */ styled.span.withConfig({
95
70
  displayName: "Popconfirmstyles__LinkWrapper",
96
71
  componentId: "sc-19dzptq-16"
97
- })(["font-size:13px;line-height:1.5;font-weight:400;color:", ";text-decoration:underline;cursor:pointer;max-width:200px;text-overflow:ellipsis;overflow:hidden;"], function (props) {
98
- return props.theme.palette['grey-700'];
99
- });
72
+ })(["font-size:13px;line-height:1.5;font-weight:400;color:", ";text-decoration:underline;cursor:pointer;max-width:200px;text-overflow:ellipsis;overflow:hidden;"], (props) => props.theme.palette["grey-700"]);
73
+ export {
74
+ ButtonWrapper,
75
+ LinkWrapper,
76
+ PopconfirmArrow,
77
+ PopconfirmArrowWrapper,
78
+ PopconfirmButton,
79
+ PopconfirmButtonWrapper,
80
+ PopconfirmCloseIcon,
81
+ PopconfirmContainer,
82
+ PopconfirmContent,
83
+ PopconfirmContentWrapper,
84
+ PopconfirmDescription,
85
+ PopconfirmHeaderWrapper,
86
+ PopconfirmIcon,
87
+ PopconfirmImage,
88
+ PopconfirmTextWrapper,
89
+ PopconfirmTitle,
90
+ PopconfirmWrapper
91
+ };
@@ -1,7 +1,7 @@
1
- import { type CSSProperties, type ForwardRefExoticComponent, type MouseEvent, type ReactNode, type RefAttributes } from 'react';
2
- import { type ButtonProps } from '@synerise/ds-button';
3
- import { type LegacyPopconfirmPlacement, type PopoverOptions } from '@synerise/ds-popover';
4
- import { type ConfirmMessageProps } from './ConfirmMessage/ConfirmMessage.types';
1
+ import { CSSProperties, ForwardRefExoticComponent, MouseEvent, ReactNode, RefAttributes } from 'react';
2
+ import { ButtonProps } from '@synerise/ds-button';
3
+ import { LegacyPopconfirmPlacement, PopoverOptions } from '@synerise/ds-popover';
4
+ import { ConfirmMessageProps } from './ConfirmMessage/ConfirmMessage.types';
5
5
  export type PopconfirmTexts = Pick<PopconfirmProps, 'okText' | 'description' | 'title' | 'cancelText'>;
6
6
  export type PopconfirmProps = {
7
7
  description?: ReactNode;
@@ -1 +1 @@
1
- export {};
1
+
File without changes
package/dist/index.js CHANGED
@@ -1,2 +1,6 @@
1
- export { default } from './Popconfirm';
2
- export { default as ConfirmMessage } from './ConfirmMessage/ConfirmMessage';
1
+ import { default as default2 } from "./Popconfirm.js";
2
+ import { ConfirmMessage } from "./ConfirmMessage/ConfirmMessage.js";
3
+ export {
4
+ ConfirmMessage,
5
+ default2 as default
6
+ };
package/dist/modules.d.js CHANGED
@@ -1 +1 @@
1
- import '@testing-library/jest-dom';
1
+ import "@testing-library/jest-dom";
File without changes
@@ -1,4 +1,4 @@
1
- import { type Placement, type UseTransitionStylesProps } from '@floating-ui/react';
1
+ import { Placement, UseTransitionStylesProps } from '@floating-ui/react';
2
2
  export declare const getTransitionConfig: ({ placement, }: {
3
3
  placement: Placement;
4
4
  }) => Partial<UseTransitionStylesProps>;
@@ -1,15 +1,19 @@
1
- export var getTransitionConfig = function getTransitionConfig(_ref) {
2
- var placement = _ref.placement;
3
- var isTop = placement.indexOf('top');
1
+ const getTransitionConfig = ({
2
+ placement
3
+ }) => {
4
+ const isTop = placement.indexOf("top");
4
5
  return {
5
6
  open: {
6
- transform: 'scaleY(1)'
7
+ transform: "scaleY(1)"
7
8
  },
8
9
  initial: {
9
- transform: 'scaleY(0)'
10
+ transform: "scaleY(0)"
10
11
  },
11
12
  common: {
12
- transformOrigin: isTop ? 'top' : 'bottom'
13
+ transformOrigin: isTop ? "top" : "bottom"
13
14
  }
14
15
  };
15
- };
16
+ };
17
+ export {
18
+ getTransitionConfig
19
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-popconfirm",
3
- "version": "1.3.8",
3
+ "version": "1.3.10",
4
4
  "description": "Popconfirm 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
  "pack:ci": "pnpm pack --pack-destination ../../storybook/storybook-static/static",
25
25
  "prepublish": "pnpm run build",
@@ -35,11 +35,11 @@
35
35
  ],
36
36
  "types": "dist/index.d.ts",
37
37
  "dependencies": {
38
- "@synerise/ds-button": "^1.5.16",
39
- "@synerise/ds-icon": "^1.14.1",
40
- "@synerise/ds-popover": "^1.5.1",
41
- "@synerise/ds-tooltip": "^1.4.8",
42
- "@synerise/ds-utils": "^1.6.0"
38
+ "@synerise/ds-button": "^1.5.18",
39
+ "@synerise/ds-icon": "^1.15.1",
40
+ "@synerise/ds-popover": "^1.5.3",
41
+ "@synerise/ds-tooltip": "^1.4.10",
42
+ "@synerise/ds-utils": "^1.7.1"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@floating-ui/react": "^0.27.16",
@@ -51,5 +51,5 @@
51
51
  "react": ">=16.9.0 <= 18.3.1",
52
52
  "styled-components": "^5.3.3"
53
53
  },
54
- "gitHead": "8dfafc5d7278f09d430f1e7499782d05c76b47c0"
54
+ "gitHead": "e4ecca8944fc9b41c1b9d59c8bcad5e5e2013225"
55
55
  }