@bigtablet/design-system 1.1.3 → 1.2.2

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/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
+ import * as react_toastify from 'react-toastify';
3
4
 
4
5
  interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
5
6
  shadow?: "none" | "sm" | "md" | "lg";
@@ -8,8 +9,142 @@ interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
8
9
  }
9
10
  declare const Card: ({ shadow, padding, bordered, className, ...props }: CardProps) => react_jsx_runtime.JSX.Element;
10
11
 
12
+ type AlertVariant = "info" | "success" | "warning" | "error";
13
+ type AlertActionsAlign = "left" | "center" | "right";
14
+ interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
15
+ variant?: AlertVariant;
16
+ title?: React.ReactNode;
17
+ icon?: React.ReactNode;
18
+ closable?: boolean;
19
+ onClose?: () => void;
20
+ showActions?: boolean;
21
+ onConfirm?: () => void;
22
+ onCancel?: () => void;
23
+ confirmText?: string;
24
+ cancelText?: string;
25
+ actionsAlign?: AlertActionsAlign;
26
+ }
27
+ /**
28
+ * @deprecated Use useAlert hook with AlertProvider instead
29
+ */
30
+ declare const Alert: ({ variant, title, icon, closable, onClose, showActions, onConfirm, onCancel, confirmText, cancelText, actionsAlign, className, children, ...props }: AlertProps) => react_jsx_runtime.JSX.Element;
31
+
11
32
  declare const Loading: ({ size }: {
12
33
  size?: number;
13
34
  }) => react_jsx_runtime.JSX.Element;
14
35
 
15
- export { Card, Loading };
36
+ declare const ToastProvider: () => react_jsx_runtime.JSX.Element;
37
+
38
+ declare const useToast: () => {
39
+ success: (msg: string) => react_toastify.Id;
40
+ error: (msg: string) => react_toastify.Id;
41
+ warning: (msg: string) => react_toastify.Id;
42
+ info: (msg: string) => react_toastify.Id;
43
+ message: (msg: string) => react_toastify.Id;
44
+ };
45
+
46
+ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
47
+ variant?: "primary" | "secondary" | "ghost";
48
+ size?: "sm" | "md" | "lg";
49
+ style?: React.CSSProperties;
50
+ }
51
+ declare const Button: ({ variant, size, className, style, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
52
+
53
+ interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> {
54
+ label?: React.ReactNode;
55
+ size?: "sm" | "md" | "lg";
56
+ indeterminate?: boolean;
57
+ }
58
+ declare const Checkbox: ({ label, size, indeterminate, className, ...props }: CheckboxProps) => react_jsx_runtime.JSX.Element;
59
+
60
+ interface FileInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
61
+ label?: string;
62
+ onFiles?: (files: FileList | null) => void;
63
+ }
64
+ declare const FileInput: ({ label, onFiles, className, ...props }: FileInputProps) => react_jsx_runtime.JSX.Element;
65
+
66
+ type MarkdownEditorProps = {
67
+ label?: string;
68
+ placeholder?: string;
69
+ value: string;
70
+ onChangeAction: (val: string) => void;
71
+ rows?: number;
72
+ };
73
+ declare const MarkdownEditor: ({ label, placeholder, value, onChangeAction, rows, }: MarkdownEditorProps) => react_jsx_runtime.JSX.Element;
74
+
75
+ interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> {
76
+ label?: React.ReactNode;
77
+ size?: "sm" | "md" | "lg";
78
+ }
79
+ declare const Radio: ({ label, size, className, ...props }: RadioProps) => react_jsx_runtime.JSX.Element;
80
+
81
+ type SelectSize = "sm" | "md" | "lg";
82
+ type SelectVariant = "outline" | "filled" | "ghost";
83
+ interface SelectOption {
84
+ value: string;
85
+ label: string;
86
+ disabled?: boolean;
87
+ }
88
+ interface SelectProps {
89
+ id?: string;
90
+ label?: string;
91
+ placeholder?: string;
92
+ options: SelectOption[];
93
+ value?: string | null;
94
+ onChange?: (value: string | null, option?: SelectOption | null) => void;
95
+ defaultValue?: string | null;
96
+ disabled?: boolean;
97
+ size?: SelectSize;
98
+ variant?: SelectVariant;
99
+ fullWidth?: boolean;
100
+ className?: string;
101
+ }
102
+ declare function Select({ id, label, placeholder, options, value, onChange, defaultValue, disabled, size, variant, fullWidth, className, }: SelectProps): react_jsx_runtime.JSX.Element;
103
+
104
+ interface SwitchProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onChange"> {
105
+ checked?: boolean;
106
+ defaultChecked?: boolean;
107
+ onChange?: (checked: boolean) => void;
108
+ size?: "sm" | "md" | "lg";
109
+ disabled?: boolean;
110
+ }
111
+ declare const Switch: ({ checked, defaultChecked, onChange, size, disabled, className, ...props }: SwitchProps) => react_jsx_runtime.JSX.Element;
112
+
113
+ type TextFieldVariant = "outline" | "filled" | "ghost";
114
+ type TextFieldSize = "sm" | "md" | "lg";
115
+ interface TextFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "onChange"> {
116
+ label?: string;
117
+ helperText?: string;
118
+ error?: boolean;
119
+ success?: boolean;
120
+ variant?: TextFieldVariant;
121
+ size?: TextFieldSize;
122
+ leftIcon?: React.ReactNode;
123
+ rightIcon?: React.ReactNode;
124
+ fullWidth?: boolean;
125
+ onChangeAction?: (e: React.ChangeEvent<HTMLInputElement>) => void;
126
+ }
127
+ declare const TextField: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<HTMLInputElement>>;
128
+
129
+ interface PaginationProps {
130
+ page: number;
131
+ hasNext: boolean;
132
+ size?: number;
133
+ onChange: (page: number) => void;
134
+ }
135
+ declare const Pagination: ({ page, hasNext, onChange }: PaginationProps) => react_jsx_runtime.JSX.Element;
136
+
137
+ interface ModalProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
138
+ open: boolean;
139
+ onClose?: () => void;
140
+ closeOnOverlay?: boolean;
141
+ width?: number | string;
142
+ title?: React.ReactNode;
143
+ }
144
+ declare const Modal: ({ open, onClose, closeOnOverlay, width, title, children, ...props }: ModalProps) => react_jsx_runtime.JSX.Element | null;
145
+
146
+ declare const SkeletonCard: () => react_jsx_runtime.JSX.Element;
147
+
148
+ declare const SkeletonList: () => react_jsx_runtime.JSX.Element;
149
+
150
+ export { Alert, Button, Card, Checkbox, FileInput, Loading, MarkdownEditor, Modal, Pagination, Radio, Select, SkeletonCard, SkeletonList, Switch, TextField, ToastProvider, useToast };