@clickhouse/click-ui 0.0.44 → 0.0.45

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.
@@ -1,14 +1,17 @@
1
+ import { ReactNode } from "react";
2
+ type AlertType = "default" | "banner";
1
3
  type AlertSize = "small" | "medium";
2
4
  type AlertState = "neutral" | "success" | "warning" | "danger" | "info";
3
5
  export type AlertProps = {
4
6
  state?: AlertState;
5
7
  title?: string;
6
- text: string;
8
+ text: ReactNode;
7
9
  size?: AlertSize;
10
+ type?: AlertType;
8
11
  showIcon?: boolean;
9
12
  dismissible?: boolean;
10
13
  };
11
- declare const Alert: ({ text, title, size, state, showIcon, dismissible, ...delegated }: AlertProps) => import("react/jsx-runtime").JSX.Element | null;
14
+ declare const Alert: ({ text, title, size, state, type, showIcon, dismissible, ...delegated }: AlertProps) => import("react/jsx-runtime").JSX.Element | null;
12
15
  declare const DangerAlert: (props: AlertProps) => import("react/jsx-runtime").JSX.Element;
13
16
  declare const InfoAlert: (props: AlertProps) => import("react/jsx-runtime").JSX.Element;
14
17
  declare const SuccessAlert: (props: AlertProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { IconName } from '../../components';
2
2
  import React from "react";
3
- type ButtonType = "primary" | "secondary" | "danger";
3
+ export type ButtonType = "primary" | "secondary" | "danger";
4
4
  type Alignment = "center" | "left";
5
5
  export interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
6
6
  type?: ButtonType;
@@ -0,0 +1,15 @@
1
+ import { ReactElement, ReactNode } from "react";
2
+ type DialogPrimaryAction = "primary" | "danger";
3
+ export interface ConfirmationDialogProps {
4
+ open?: boolean;
5
+ onOpenChange?: (b: boolean) => void;
6
+ title: string;
7
+ message: string;
8
+ primaryActionType?: DialogPrimaryAction;
9
+ primaryActionLabel?: string;
10
+ secondaryActionLabel?: string;
11
+ onPrimaryActionClick?: (() => void) | (() => Promise<void>);
12
+ children?: ReactNode;
13
+ }
14
+ declare const ConfirmationDialog: ({ open, onOpenChange, title, message, primaryActionType, primaryActionLabel, secondaryActionLabel, onPrimaryActionClick, children, }: ConfirmationDialogProps) => ReactElement;
15
+ export default ConfirmationDialog;
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from "react";
2
2
  import * as RadixDialog from "@radix-ui/react-dialog";
3
+ import { ButtonProps } from '../../components/Button/Button';
3
4
  export declare const Dialog: {
4
5
  ({ children, ...props }: RadixDialog.DialogProps): import("react/jsx-runtime").JSX.Element;
5
6
  Trigger: {
@@ -7,7 +8,7 @@ export declare const Dialog: {
7
8
  displayName: string;
8
9
  };
9
10
  Close: {
10
- ({ label }: DialogCloseProps): import("react/jsx-runtime").JSX.Element;
11
+ ({ label, type, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
11
12
  displayName: string;
12
13
  };
13
14
  Content: {
@@ -15,9 +16,6 @@ export declare const Dialog: {
15
16
  displayName: string;
16
17
  };
17
18
  };
18
- interface DialogCloseProps extends RadixDialog.DialogCloseProps {
19
- label: string;
20
- }
21
19
  export interface DialogContentProps extends RadixDialog.DialogContentProps {
22
20
  title: string;
23
21
  showClose?: boolean;
@@ -27,4 +25,3 @@ export interface DialogContentProps extends RadixDialog.DialogContentProps {
27
25
  onClose?: () => void;
28
26
  showOverlay?: boolean;
29
27
  }
30
- export {};
@@ -1,9 +1,9 @@
1
1
  import { IconName } from '../../components';
2
2
  import { HTMLAttributes } from "react";
3
3
  export interface IconButtonProps extends HTMLAttributes<HTMLButtonElement> {
4
- size?: "sm" | "xs";
4
+ size?: "default" | "sm" | "xs";
5
5
  disabled?: boolean;
6
- type?: "primary" | "secondary" | "ghost";
6
+ type?: "primary" | "secondary" | "ghost" | "danger" | "info";
7
7
  icon: IconName;
8
8
  }
9
9
  export declare const IconButton: import("react").ForwardRefExoticComponent<IconButtonProps & import("react").RefAttributes<HTMLButtonElement>>;