@wavv/ui 2.4.4-alpha.3 → 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;
@@ -5,7 +5,7 @@ import Button from "./Button/index.js";
5
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
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavv/ui",
3
- "version": "2.4.4-alpha.3",
3
+ "version": "2.4.4-alpha.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {