@synerise/ds-popconfirm 1.3.9 → 1.3.11
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 +8 -0
- package/dist/ConfirmMessage/ConfirmMessage.d.ts +2 -2
- package/dist/ConfirmMessage/ConfirmMessage.js +28 -34
- package/dist/ConfirmMessage/ConfirmMessage.style.d.ts +3 -3
- package/dist/ConfirmMessage/ConfirmMessage.style.js +11 -8
- package/dist/ConfirmMessage/ConfirmMessage.types.d.ts +1 -1
- package/dist/ConfirmMessage/ConfirmMessage.types.js +1 -1
- package/dist/Popconfirm.const.d.ts +1 -1
- package/dist/Popconfirm.const.js +5 -2
- package/dist/Popconfirm.d.ts +1 -2
- package/dist/Popconfirm.js +92 -134
- package/dist/Popconfirm.styles.d.ts +2 -2
- package/dist/Popconfirm.styles.js +47 -55
- package/dist/Popconfirm.types.d.ts +4 -4
- package/dist/Popconfirm.types.js +1 -1
- package/dist/assets/style/index-tn0RQdqM.css +0 -0
- package/dist/index.js +6 -2
- package/dist/modules.d.js +1 -1
- package/dist/modules.d.ts +0 -0
- package/dist/utils/getTransitionConfig.d.ts +1 -1
- package/dist/utils/getTransitionConfig.js +11 -7
- package/package.json +9 -9
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.11](https://github.com/Synerise/synerise-design/compare/@synerise/ds-popconfirm@1.3.10...@synerise/ds-popconfirm@1.3.11) (2026-04-01)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-popconfirm
|
|
9
|
+
|
|
10
|
+
## [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)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @synerise/ds-popconfirm
|
|
13
|
+
|
|
6
14
|
## [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)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @synerise/ds-popconfirm
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
|
18
|
+
return () => {
|
|
21
19
|
clearTimeout(timeout);
|
|
22
20
|
};
|
|
23
21
|
}, [open, displayDuration]);
|
|
24
|
-
|
|
22
|
+
const showMessage = () => {
|
|
25
23
|
setOpen(true);
|
|
26
24
|
};
|
|
27
|
-
|
|
25
|
+
const handleClick = useCallback(() => {
|
|
28
26
|
onClick && onClick(showMessage);
|
|
29
27
|
}, [onClick]);
|
|
30
|
-
|
|
31
|
-
return
|
|
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
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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(
|
|
2
|
-
export declare const ConfirmMessageTitle: import(
|
|
3
|
-
export declare const ConfirmMessage: import(
|
|
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
|
|
2
|
-
import { IconContainer } from
|
|
3
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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;}"],
|
|
15
|
-
|
|
16
|
-
|
|
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 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OffsetConfig } from '@synerise/ds-popover';
|
|
2
2
|
export declare const POPOVER_OFFSET_CONFIG: OffsetConfig;
|
package/dist/Popconfirm.const.js
CHANGED
package/dist/Popconfirm.d.ts
CHANGED
package/dist/Popconfirm.js
CHANGED
|
@@ -1,146 +1,104 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
72
|
-
|
|
54
|
+
const isTriggeredByClick = Array.isArray(trigger) ? trigger.includes("click") : trigger === "click";
|
|
55
|
+
const handleOpenChange = (newState) => {
|
|
73
56
|
setIsOpen(newState);
|
|
74
|
-
onOpenChange
|
|
57
|
+
onOpenChange?.(newState);
|
|
75
58
|
};
|
|
76
|
-
|
|
59
|
+
const handleTriggerClick = () => {
|
|
77
60
|
isTriggeredByClick && setIsOpen(!isOpen);
|
|
78
61
|
};
|
|
79
|
-
return disabled ?
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
|
102
|
+
export {
|
|
103
|
+
Popconfirm as default
|
|
104
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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
|
|
2
|
-
import Button from
|
|
3
|
-
|
|
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:", ";"],
|
|
7
|
-
|
|
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:", ";}}}}"],
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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;"],
|
|
30
|
-
|
|
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
|
-
|
|
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
|
-
|
|
25
|
+
const ButtonWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
41
26
|
displayName: "Popconfirmstyles__ButtonWrapper",
|
|
42
27
|
componentId: "sc-19dzptq-5"
|
|
43
28
|
})(["margin-left:8px;"]);
|
|
44
|
-
|
|
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:", ";"],
|
|
48
|
-
|
|
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
|
-
|
|
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;"],
|
|
60
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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);}"],
|
|
76
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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;"],
|
|
98
|
-
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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;
|
package/dist/Popconfirm.types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
File without changes
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const getTransitionConfig = ({
|
|
2
|
+
placement
|
|
3
|
+
}) => {
|
|
4
|
+
const isTop = placement.indexOf("top");
|
|
4
5
|
return {
|
|
5
6
|
open: {
|
|
6
|
-
transform:
|
|
7
|
+
transform: "scaleY(1)"
|
|
7
8
|
},
|
|
8
9
|
initial: {
|
|
9
|
-
transform:
|
|
10
|
+
transform: "scaleY(0)"
|
|
10
11
|
},
|
|
11
12
|
common: {
|
|
12
|
-
transformOrigin: isTop ?
|
|
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.
|
|
3
|
+
"version": "1.3.11",
|
|
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": "
|
|
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": "
|
|
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.
|
|
39
|
-
"@synerise/ds-icon": "^1.15.
|
|
40
|
-
"@synerise/ds-popover": "^1.5.
|
|
41
|
-
"@synerise/ds-tooltip": "^1.4.
|
|
42
|
-
"@synerise/ds-utils": "^1.7.
|
|
38
|
+
"@synerise/ds-button": "^1.5.19",
|
|
39
|
+
"@synerise/ds-icon": "^1.15.2",
|
|
40
|
+
"@synerise/ds-popover": "^1.5.3",
|
|
41
|
+
"@synerise/ds-tooltip": "^1.4.11",
|
|
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": "
|
|
54
|
+
"gitHead": "c2384982c3533a31eb5e5e0408f8dcecb2b0f399"
|
|
55
55
|
}
|