@koaris/bloom-ui 1.2.2 → 1.2.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.
package/dist/index.d.cts CHANGED
@@ -1,32 +1,41 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
- import { DetailedHTMLProps, HTMLAttributes, ButtonHTMLAttributes, AnchorHTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, ReactNode, FormHTMLAttributes } from 'react';
3
+ import react__default, { DetailedHTMLProps, HTMLAttributes, ReactNode, ButtonHTMLAttributes, AnchorHTMLAttributes, InputHTMLAttributes, ChangeEvent, TextareaHTMLAttributes, FormHTMLAttributes } from 'react';
4
4
 
5
- /**
6
- * Primary UI component for user interaction
7
- */
8
- interface CardProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, // Change the type to HTMLDivElement
9
- HTMLDivElement> {
5
+ type CardSize = 'small' | 'medium' | 'large' | 'full';
6
+ type CardDirection = 'row' | 'col';
7
+ interface CardProps extends Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'title' | 'content'> {
10
8
  selected?: boolean;
11
9
  disabled?: boolean;
12
- direction?: string;
13
- size?: string;
14
- imageSize: string;
10
+ direction?: CardDirection;
11
+ size?: CardSize;
15
12
  image?: string;
13
+ imageSize?: string;
14
+ imageAlt?: string;
15
+ title?: ReactNode;
16
+ content?: ReactNode;
16
17
  onClick?: () => void;
18
+ footer?: ReactNode;
19
+ hoverable?: boolean;
17
20
  }
18
- declare const Card: ({ className, selected, direction, size, disabled, imageSize, onClick, ...rest }: CardProps) => react_jsx_runtime.JSX.Element;
21
+ declare const Card: {
22
+ ({ className, selected, direction, size, disabled, image, imageSize, imageAlt, title, content, onClick, footer, hoverable, ...rest }: CardProps): react_jsx_runtime.JSX.Element;
23
+ displayName: string;
24
+ };
19
25
 
20
- /**
21
- * Primary UI component for user interaction
22
- */
26
+ type ButtonSize = 'xs' | 'sm' | 'md' | 'lg';
27
+ type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'link';
23
28
  interface ButtonProps extends DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
24
- size?: 'sm' | 'md';
25
- variant?: 'primary' | 'secondary';
29
+ size?: ButtonSize;
30
+ variant?: ButtonVariant;
26
31
  disabled?: boolean;
27
- children: string | JSX.Element;
32
+ loading?: boolean;
33
+ startIcon?: ReactNode;
34
+ endIcon?: ReactNode;
35
+ fullWidth?: boolean;
36
+ children: ReactNode;
28
37
  }
29
- declare const Button: ({ className, variant, size, disabled, onClick, ...rest }: ButtonProps) => react_jsx_runtime.JSX.Element;
38
+ declare const Button: react.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
30
39
 
31
40
  /**
32
41
  * Primary UI component for user interaction
@@ -57,17 +66,29 @@ interface CheckboxProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>
57
66
  }
58
67
  declare const Checkbox: ({ className, required, disabled }: CheckboxProps) => react_jsx_runtime.JSX.Element;
59
68
 
60
- /**
61
- * Primary UI component for user interaction
62
- */
63
- interface InputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
69
+ type InputType = 'text' | 'password' | 'date' | 'cpf' | 'phone' | 'cnpj' | 'cep' | 'email';
70
+ interface PasswordValidation {
71
+ hasEightCharacters: boolean;
72
+ hasSpecialCharacters: boolean;
73
+ hasNumber: boolean;
74
+ }
75
+ interface PhoneFormat {
76
+ countryCode: string;
77
+ format: string;
78
+ }
79
+ interface InputProps extends Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, 'type'> {
64
80
  disabled?: boolean;
65
81
  placeholder?: string;
66
82
  value?: string;
67
83
  validated?: boolean;
68
- error: boolean;
84
+ error?: boolean;
69
85
  required?: boolean;
70
- type: 'text' | 'password' | 'date' | 'cpf' | 'phone' | 'cnpj' | 'cep';
86
+ type: InputType;
87
+ errorMessage?: string;
88
+ onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
89
+ label?: string;
90
+ helperText?: string;
91
+ countryCode?: string;
71
92
  }
72
93
  declare const Input: react.ForwardRefExoticComponent<Omit<InputProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
73
94
 
@@ -142,4 +163,92 @@ interface MultiStepProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement
142
163
  }
143
164
  declare const MultiStep: ({ className, size, currentStep }: MultiStepProps) => react_jsx_runtime.JSX.Element;
144
165
 
145
- export { Avatar, type AvatarProps, Box, type BoxProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, Form, type FormProps, Heading, type HeadingProps, Input, type InputProps, Link, type LinkProps, MultiStep, type MultiStepProps, RadioGroup, type RadioGroupProps, Text, TextArea, type TextAreaProps, TextInput, type TextInputProps, type TextProps };
166
+ interface ToggleProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
167
+ disabled?: boolean;
168
+ active: boolean;
169
+ label: string;
170
+ setActive: (active: boolean) => void;
171
+ size?: 'sm' | 'md' | 'lg';
172
+ hideLabel?: boolean;
173
+ id?: string;
174
+ }
175
+ declare const Toggle: ({ className, disabled, active, label, setActive, size, hideLabel, id, ...rest }: ToggleProps) => react_jsx_runtime.JSX.Element;
176
+
177
+ interface SkeletonProps {
178
+ width?: string | number;
179
+ height?: string | number;
180
+ rounded?: boolean;
181
+ circle?: boolean;
182
+ animate?: boolean;
183
+ className?: string;
184
+ }
185
+ declare const Skeleton: react__default.FC<SkeletonProps>;
186
+
187
+ type LoadingSize = 'xs' | 'sm' | 'md' | 'lg';
188
+ type LoadingColor = 'primary' | 'secondary' | 'white' | 'black' | 'gray';
189
+ interface LoadingProps {
190
+ size?: LoadingSize;
191
+ color?: LoadingColor;
192
+ withText?: boolean;
193
+ text?: string;
194
+ centered?: boolean;
195
+ className?: string;
196
+ }
197
+ declare const Loading: react__default.FC<LoadingProps>;
198
+
199
+ interface ModalProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
200
+ isOpen: boolean;
201
+ onClose: () => void;
202
+ title?: string;
203
+ size?: 'sm' | 'md' | 'lg' | 'xl';
204
+ children: ReactNode;
205
+ showCloseButton?: boolean;
206
+ closeOnOutsideClick?: boolean;
207
+ closeOnEsc?: boolean;
208
+ footer?: ReactNode;
209
+ }
210
+ declare const Modal: ({ className, isOpen, onClose, title, size, children, showCloseButton, closeOnOutsideClick, closeOnEsc, footer, ...rest }: ModalProps) => react_jsx_runtime.JSX.Element | null;
211
+
212
+ type ToastVariant = 'success' | 'error' | 'warning' | 'info';
213
+ type ToastPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';
214
+ interface ToastProps {
215
+ id: string;
216
+ message: string;
217
+ title?: string;
218
+ variant?: ToastVariant;
219
+ duration?: number;
220
+ showCloseButton?: boolean;
221
+ onDismiss?: (id: string) => void;
222
+ className?: string;
223
+ }
224
+ interface ToastContainerProps {
225
+ position?: ToastPosition;
226
+ className?: string;
227
+ }
228
+ declare class ToastService {
229
+ private static instance;
230
+ private listeners;
231
+ private toasts;
232
+ private constructor();
233
+ static getInstance(): ToastService;
234
+ subscribe(listener: (toasts: ToastProps[]) => void): () => void;
235
+ private notify;
236
+ showToast(toast: Omit<ToastProps, 'id' | 'onDismiss'>): string;
237
+ hideToast(id: string): void;
238
+ clearToasts(): void;
239
+ getToasts(): ToastProps[];
240
+ }
241
+ declare const toastService: ToastService;
242
+ declare const Toast: react__default.FC<ToastProps>;
243
+ declare const ToastContainer: react__default.FC<ToastContainerProps>;
244
+ declare const useToast: () => {
245
+ showToast: (toast: Omit<ToastProps, "id" | "onDismiss">) => string;
246
+ hideToast: (id: string) => void;
247
+ clearToasts: () => void;
248
+ };
249
+ declare const ToastProvider: react__default.FC<{
250
+ position?: ToastPosition;
251
+ children: react__default.ReactNode;
252
+ }>;
253
+
254
+ export { Avatar, type AvatarProps, Box, type BoxProps, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardDirection, type CardProps, type CardSize, Checkbox, type CheckboxProps, Form, type FormProps, Heading, type HeadingProps, Input, type InputProps, type InputType, Link, type LinkProps, Loading, type LoadingColor, type LoadingProps, type LoadingSize, Modal, type ModalProps, MultiStep, type MultiStepProps, type PasswordValidation, type PhoneFormat, RadioGroup, type RadioGroupProps, Skeleton, type SkeletonProps, Text, TextArea, type TextAreaProps, TextInput, type TextInputProps, type TextProps, Toast, ToastContainer, type ToastContainerProps, type ToastPosition, type ToastProps, ToastProvider, type ToastVariant, Toggle, type ToggleProps, toastService, useToast };
package/dist/index.d.ts CHANGED
@@ -1,32 +1,41 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
- import { DetailedHTMLProps, HTMLAttributes, ButtonHTMLAttributes, AnchorHTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, ReactNode, FormHTMLAttributes } from 'react';
3
+ import react__default, { DetailedHTMLProps, HTMLAttributes, ReactNode, ButtonHTMLAttributes, AnchorHTMLAttributes, InputHTMLAttributes, ChangeEvent, TextareaHTMLAttributes, FormHTMLAttributes } from 'react';
4
4
 
5
- /**
6
- * Primary UI component for user interaction
7
- */
8
- interface CardProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, // Change the type to HTMLDivElement
9
- HTMLDivElement> {
5
+ type CardSize = 'small' | 'medium' | 'large' | 'full';
6
+ type CardDirection = 'row' | 'col';
7
+ interface CardProps extends Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'title' | 'content'> {
10
8
  selected?: boolean;
11
9
  disabled?: boolean;
12
- direction?: string;
13
- size?: string;
14
- imageSize: string;
10
+ direction?: CardDirection;
11
+ size?: CardSize;
15
12
  image?: string;
13
+ imageSize?: string;
14
+ imageAlt?: string;
15
+ title?: ReactNode;
16
+ content?: ReactNode;
16
17
  onClick?: () => void;
18
+ footer?: ReactNode;
19
+ hoverable?: boolean;
17
20
  }
18
- declare const Card: ({ className, selected, direction, size, disabled, imageSize, onClick, ...rest }: CardProps) => react_jsx_runtime.JSX.Element;
21
+ declare const Card: {
22
+ ({ className, selected, direction, size, disabled, image, imageSize, imageAlt, title, content, onClick, footer, hoverable, ...rest }: CardProps): react_jsx_runtime.JSX.Element;
23
+ displayName: string;
24
+ };
19
25
 
20
- /**
21
- * Primary UI component for user interaction
22
- */
26
+ type ButtonSize = 'xs' | 'sm' | 'md' | 'lg';
27
+ type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'link';
23
28
  interface ButtonProps extends DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
24
- size?: 'sm' | 'md';
25
- variant?: 'primary' | 'secondary';
29
+ size?: ButtonSize;
30
+ variant?: ButtonVariant;
26
31
  disabled?: boolean;
27
- children: string | JSX.Element;
32
+ loading?: boolean;
33
+ startIcon?: ReactNode;
34
+ endIcon?: ReactNode;
35
+ fullWidth?: boolean;
36
+ children: ReactNode;
28
37
  }
29
- declare const Button: ({ className, variant, size, disabled, onClick, ...rest }: ButtonProps) => react_jsx_runtime.JSX.Element;
38
+ declare const Button: react.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
30
39
 
31
40
  /**
32
41
  * Primary UI component for user interaction
@@ -57,17 +66,29 @@ interface CheckboxProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>
57
66
  }
58
67
  declare const Checkbox: ({ className, required, disabled }: CheckboxProps) => react_jsx_runtime.JSX.Element;
59
68
 
60
- /**
61
- * Primary UI component for user interaction
62
- */
63
- interface InputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
69
+ type InputType = 'text' | 'password' | 'date' | 'cpf' | 'phone' | 'cnpj' | 'cep' | 'email';
70
+ interface PasswordValidation {
71
+ hasEightCharacters: boolean;
72
+ hasSpecialCharacters: boolean;
73
+ hasNumber: boolean;
74
+ }
75
+ interface PhoneFormat {
76
+ countryCode: string;
77
+ format: string;
78
+ }
79
+ interface InputProps extends Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, 'type'> {
64
80
  disabled?: boolean;
65
81
  placeholder?: string;
66
82
  value?: string;
67
83
  validated?: boolean;
68
- error: boolean;
84
+ error?: boolean;
69
85
  required?: boolean;
70
- type: 'text' | 'password' | 'date' | 'cpf' | 'phone' | 'cnpj' | 'cep';
86
+ type: InputType;
87
+ errorMessage?: string;
88
+ onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
89
+ label?: string;
90
+ helperText?: string;
91
+ countryCode?: string;
71
92
  }
72
93
  declare const Input: react.ForwardRefExoticComponent<Omit<InputProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
73
94
 
@@ -142,4 +163,92 @@ interface MultiStepProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement
142
163
  }
143
164
  declare const MultiStep: ({ className, size, currentStep }: MultiStepProps) => react_jsx_runtime.JSX.Element;
144
165
 
145
- export { Avatar, type AvatarProps, Box, type BoxProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, Form, type FormProps, Heading, type HeadingProps, Input, type InputProps, Link, type LinkProps, MultiStep, type MultiStepProps, RadioGroup, type RadioGroupProps, Text, TextArea, type TextAreaProps, TextInput, type TextInputProps, type TextProps };
166
+ interface ToggleProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
167
+ disabled?: boolean;
168
+ active: boolean;
169
+ label: string;
170
+ setActive: (active: boolean) => void;
171
+ size?: 'sm' | 'md' | 'lg';
172
+ hideLabel?: boolean;
173
+ id?: string;
174
+ }
175
+ declare const Toggle: ({ className, disabled, active, label, setActive, size, hideLabel, id, ...rest }: ToggleProps) => react_jsx_runtime.JSX.Element;
176
+
177
+ interface SkeletonProps {
178
+ width?: string | number;
179
+ height?: string | number;
180
+ rounded?: boolean;
181
+ circle?: boolean;
182
+ animate?: boolean;
183
+ className?: string;
184
+ }
185
+ declare const Skeleton: react__default.FC<SkeletonProps>;
186
+
187
+ type LoadingSize = 'xs' | 'sm' | 'md' | 'lg';
188
+ type LoadingColor = 'primary' | 'secondary' | 'white' | 'black' | 'gray';
189
+ interface LoadingProps {
190
+ size?: LoadingSize;
191
+ color?: LoadingColor;
192
+ withText?: boolean;
193
+ text?: string;
194
+ centered?: boolean;
195
+ className?: string;
196
+ }
197
+ declare const Loading: react__default.FC<LoadingProps>;
198
+
199
+ interface ModalProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
200
+ isOpen: boolean;
201
+ onClose: () => void;
202
+ title?: string;
203
+ size?: 'sm' | 'md' | 'lg' | 'xl';
204
+ children: ReactNode;
205
+ showCloseButton?: boolean;
206
+ closeOnOutsideClick?: boolean;
207
+ closeOnEsc?: boolean;
208
+ footer?: ReactNode;
209
+ }
210
+ declare const Modal: ({ className, isOpen, onClose, title, size, children, showCloseButton, closeOnOutsideClick, closeOnEsc, footer, ...rest }: ModalProps) => react_jsx_runtime.JSX.Element | null;
211
+
212
+ type ToastVariant = 'success' | 'error' | 'warning' | 'info';
213
+ type ToastPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';
214
+ interface ToastProps {
215
+ id: string;
216
+ message: string;
217
+ title?: string;
218
+ variant?: ToastVariant;
219
+ duration?: number;
220
+ showCloseButton?: boolean;
221
+ onDismiss?: (id: string) => void;
222
+ className?: string;
223
+ }
224
+ interface ToastContainerProps {
225
+ position?: ToastPosition;
226
+ className?: string;
227
+ }
228
+ declare class ToastService {
229
+ private static instance;
230
+ private listeners;
231
+ private toasts;
232
+ private constructor();
233
+ static getInstance(): ToastService;
234
+ subscribe(listener: (toasts: ToastProps[]) => void): () => void;
235
+ private notify;
236
+ showToast(toast: Omit<ToastProps, 'id' | 'onDismiss'>): string;
237
+ hideToast(id: string): void;
238
+ clearToasts(): void;
239
+ getToasts(): ToastProps[];
240
+ }
241
+ declare const toastService: ToastService;
242
+ declare const Toast: react__default.FC<ToastProps>;
243
+ declare const ToastContainer: react__default.FC<ToastContainerProps>;
244
+ declare const useToast: () => {
245
+ showToast: (toast: Omit<ToastProps, "id" | "onDismiss">) => string;
246
+ hideToast: (id: string) => void;
247
+ clearToasts: () => void;
248
+ };
249
+ declare const ToastProvider: react__default.FC<{
250
+ position?: ToastPosition;
251
+ children: react__default.ReactNode;
252
+ }>;
253
+
254
+ export { Avatar, type AvatarProps, Box, type BoxProps, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardDirection, type CardProps, type CardSize, Checkbox, type CheckboxProps, Form, type FormProps, Heading, type HeadingProps, Input, type InputProps, type InputType, Link, type LinkProps, Loading, type LoadingColor, type LoadingProps, type LoadingSize, Modal, type ModalProps, MultiStep, type MultiStepProps, type PasswordValidation, type PhoneFormat, RadioGroup, type RadioGroupProps, Skeleton, type SkeletonProps, Text, TextArea, type TextAreaProps, TextInput, type TextInputProps, type TextProps, Toast, ToastContainer, type ToastContainerProps, type ToastPosition, type ToastProps, ToastProvider, type ToastVariant, Toggle, type ToggleProps, toastService, useToast };