@wavv/ui 2.4.4-alpha.2 → 2.4.4-alpha.4
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.
|
@@ -13,12 +13,22 @@ type DialogProps = {
|
|
|
13
13
|
cancelText?: string;
|
|
14
14
|
/** The text of the confirm button */
|
|
15
15
|
confirmText?: string;
|
|
16
|
+
/** The text of the middle button (between cancel and confirm) */
|
|
17
|
+
middleText?: string;
|
|
16
18
|
/** The confirm button will be negative (red) */
|
|
17
19
|
negative?: boolean;
|
|
18
20
|
/** Disables the confirm button */
|
|
19
21
|
confirmDisabled?: boolean;
|
|
22
|
+
/** Shows loading state on the confirm button */
|
|
23
|
+
confirmLoading?: boolean;
|
|
24
|
+
/** Disables the middle button */
|
|
25
|
+
middleDisabled?: boolean;
|
|
26
|
+
/** Shows loading state on the middle button */
|
|
27
|
+
middleLoading?: boolean;
|
|
20
28
|
/** The function called when the confirm button is clicked */
|
|
21
29
|
onConfirm?: () => void;
|
|
30
|
+
/** The function called when the middle button is clicked */
|
|
31
|
+
onMiddle?: () => void;
|
|
22
32
|
/** The function called when the cancel button is clicked */
|
|
23
33
|
onCancel?: () => void;
|
|
24
34
|
/** Controls whether or not the Dialog is open */
|
|
@@ -50,5 +60,5 @@ type DialogProps = {
|
|
|
50
60
|
/** The `aria-label` of the dialog */
|
|
51
61
|
'aria-label'?: string;
|
|
52
62
|
} & WidthHeight & MaxWidthHeight & MinWidthHeight & Padding & DivAttributes;
|
|
53
|
-
declare const Dialog: ({ header, text, children, cancelText, confirmText, negative, confirmDisabled, onConfirm, onCancel, visible, width, height, onClose, closeIcon, preventOverlayClose, overlayBlur, overlayColor, backgroundColor, inert, scopeRef, position, zIndex, ...props }: DialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
63
|
+
declare const Dialog: ({ header, text, children, cancelText, confirmText, middleText, negative, confirmDisabled, confirmLoading, middleDisabled, middleLoading, onConfirm, onMiddle, onCancel, visible, width, height, onClose, closeIcon, preventOverlayClose, overlayBlur, overlayColor, backgroundColor, inert, scopeRef, position, zIndex, ...props }: DialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
54
64
|
export default Dialog;
|
|
@@ -2,10 +2,10 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import styled from "@emotion/styled";
|
|
3
3
|
import { Dialog, Heading, Modal, ModalOverlay } from "react-aria-components";
|
|
4
4
|
import Button from "./Button/index.js";
|
|
5
|
-
import { maxWidthHeightProps, minWidthHeightProps, paddingProps } from "./helpers/styledProps.js";
|
|
5
|
+
import { body1, head3, maxWidthHeightProps, minWidthHeightProps, paddingProps } from "./helpers/styledProps.js";
|
|
6
6
|
import Icon from "./Icon/index.js";
|
|
7
7
|
import PortalScope from "./PortalScope.js";
|
|
8
|
-
const Dialog_Dialog = ({ header, text, children, cancelText = 'Cancel', confirmText = 'Okay', negative, confirmDisabled, onConfirm, onCancel, visible, width, height, onClose, closeIcon, preventOverlayClose, overlayBlur = true, overlayColor, backgroundColor, inert, scopeRef, position, zIndex, ...props })=>{
|
|
8
|
+
const Dialog_Dialog = ({ header, text, children, cancelText = 'Cancel', confirmText = 'Okay', middleText, negative, confirmDisabled, confirmLoading, middleDisabled, middleLoading, onConfirm, onMiddle, onCancel, visible, width, height, onClose, closeIcon, preventOverlayClose, overlayBlur = true, overlayColor, backgroundColor, inert, scopeRef, position, zIndex, ...props })=>{
|
|
9
9
|
const { 'aria-label': ariaLabel, ...rest } = props;
|
|
10
10
|
const handleOpenChange = (open)=>{
|
|
11
11
|
if (!open) onClose();
|
|
@@ -62,9 +62,17 @@ const Dialog_Dialog = ({ header, text, children, cancelText = 'Cancel', confirmT
|
|
|
62
62
|
onClick: onCancel || onClose,
|
|
63
63
|
children: cancelText
|
|
64
64
|
}),
|
|
65
|
+
onMiddle && /*#__PURE__*/ jsx(Button, {
|
|
66
|
+
secondary: true,
|
|
67
|
+
disabled: middleDisabled,
|
|
68
|
+
loading: middleLoading,
|
|
69
|
+
onClick: onMiddle,
|
|
70
|
+
children: middleText
|
|
71
|
+
}),
|
|
65
72
|
/*#__PURE__*/ jsx(Button, {
|
|
66
73
|
negative: negative,
|
|
67
74
|
disabled: confirmDisabled,
|
|
75
|
+
loading: confirmLoading,
|
|
68
76
|
onClick: onConfirm,
|
|
69
77
|
children: confirmText
|
|
70
78
|
})
|
|
@@ -85,21 +93,18 @@ const DialogHeader = styled(Heading)(({ theme })=>({
|
|
|
85
93
|
alignItems: 'center',
|
|
86
94
|
justifyContent: 'space-between',
|
|
87
95
|
color: theme.modal.color.header,
|
|
88
|
-
fontWeight: theme.font.weight.default,
|
|
89
|
-
fontSize: theme.font.size.xl,
|
|
90
96
|
margin: 0,
|
|
91
97
|
padding: 16,
|
|
92
|
-
borderBottom:
|
|
98
|
+
borderBottom: theme.defaultBorder,
|
|
93
99
|
position: 'relative',
|
|
94
100
|
width: '100%',
|
|
95
101
|
boxSizing: 'border-box'
|
|
96
|
-
}));
|
|
102
|
+
}), head3);
|
|
97
103
|
const DialogContent = styled.div(({ theme, hasFooter })=>({
|
|
98
104
|
color: theme.modal.color.body,
|
|
99
|
-
fontSize: theme.font.size.lg,
|
|
100
105
|
padding: hasFooter ? '16px 16px 8px' : 16,
|
|
101
106
|
boxSizing: 'border-box'
|
|
102
|
-
}));
|
|
107
|
+
}), body1);
|
|
103
108
|
const DialogFooter = styled.div({
|
|
104
109
|
display: 'flex',
|
|
105
110
|
alignItems: 'center',
|
|
@@ -6,3 +6,14 @@ export declare const minWidthHeightProps: ({ minWidth, minHeight }: MinWidthHeig
|
|
|
6
6
|
export declare const paddingProps: ({ padding, paddingTop, paddingBottom, paddingRight, paddingLeft, }: Padding) => CSSObject;
|
|
7
7
|
export declare const marginProps: ({ margin, marginTop, marginBottom, marginRight, marginLeft }: Margin) => CSSObject;
|
|
8
8
|
export declare const positionProps: ({ position, top, bottom, right, left }: Position) => CSSObject;
|
|
9
|
+
export declare const head1: () => CSSObject;
|
|
10
|
+
export declare const head2: () => CSSObject;
|
|
11
|
+
export declare const head3: () => CSSObject;
|
|
12
|
+
export declare const body1: () => CSSObject;
|
|
13
|
+
export declare const body1Medium: () => CSSObject;
|
|
14
|
+
export declare const body2: () => CSSObject;
|
|
15
|
+
export declare const body2Medium: () => CSSObject;
|
|
16
|
+
export declare const body3: () => CSSObject;
|
|
17
|
+
export declare const body3Medium: () => CSSObject;
|
|
18
|
+
export declare const body4: () => CSSObject;
|
|
19
|
+
export declare const body4Medium: () => CSSObject;
|
|
@@ -31,4 +31,59 @@ const positionProps = ({ position, top, bottom, right, left })=>({
|
|
|
31
31
|
right,
|
|
32
32
|
left
|
|
33
33
|
});
|
|
34
|
-
|
|
34
|
+
const head1 = ()=>({
|
|
35
|
+
fontSize: 28,
|
|
36
|
+
fontWeight: 500,
|
|
37
|
+
lineHeight: '33px'
|
|
38
|
+
});
|
|
39
|
+
const head2 = ()=>({
|
|
40
|
+
fontSize: 20,
|
|
41
|
+
fontWeight: 500,
|
|
42
|
+
lineHeight: '24px'
|
|
43
|
+
});
|
|
44
|
+
const head3 = ()=>({
|
|
45
|
+
fontSize: 18,
|
|
46
|
+
fontWeight: 400,
|
|
47
|
+
lineHeight: '22px'
|
|
48
|
+
});
|
|
49
|
+
const body1 = ()=>({
|
|
50
|
+
fontSize: 16,
|
|
51
|
+
fontWeight: 400,
|
|
52
|
+
lineHeight: '19px'
|
|
53
|
+
});
|
|
54
|
+
const body1Medium = ()=>({
|
|
55
|
+
fontSize: 16,
|
|
56
|
+
fontWeight: 500,
|
|
57
|
+
lineHeight: '19px'
|
|
58
|
+
});
|
|
59
|
+
const body2 = ()=>({
|
|
60
|
+
fontSize: 14,
|
|
61
|
+
fontWeight: 400,
|
|
62
|
+
lineHeight: '17px'
|
|
63
|
+
});
|
|
64
|
+
const body2Medium = ()=>({
|
|
65
|
+
fontSize: 14,
|
|
66
|
+
fontWeight: 500,
|
|
67
|
+
lineHeight: '17px'
|
|
68
|
+
});
|
|
69
|
+
const body3 = ()=>({
|
|
70
|
+
fontSize: 12,
|
|
71
|
+
fontWeight: 400,
|
|
72
|
+
lineHeight: '15px'
|
|
73
|
+
});
|
|
74
|
+
const body3Medium = ()=>({
|
|
75
|
+
fontSize: 12,
|
|
76
|
+
fontWeight: 500,
|
|
77
|
+
lineHeight: '15px'
|
|
78
|
+
});
|
|
79
|
+
const body4 = ()=>({
|
|
80
|
+
fontSize: 10,
|
|
81
|
+
fontWeight: 400,
|
|
82
|
+
lineHeight: '12px'
|
|
83
|
+
});
|
|
84
|
+
const body4Medium = ()=>({
|
|
85
|
+
fontSize: 10,
|
|
86
|
+
fontWeight: 500,
|
|
87
|
+
lineHeight: '12px'
|
|
88
|
+
});
|
|
89
|
+
export { body1, body1Medium, body2, body2Medium, body3, body3Medium, body4, body4Medium, head1, head2, head3, marginProps, maxWidthHeightProps, minWidthHeightProps, paddingProps, positionProps, widthHeightProps };
|