@koaris/bloom-ui 1.2.1 → 1.2.3

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
- import * as react from 'react';
3
- import { DetailedHTMLProps, HTMLAttributes, ButtonHTMLAttributes, AnchorHTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, ReactNode, FormHTMLAttributes } from 'react';
2
+ import * as React$1 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$1.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
30
39
 
31
40
  /**
32
41
  * Primary UI component for user interaction
@@ -57,19 +66,26 @@ 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';
70
+ interface PasswordValidation {
71
+ hasEightCharacters: boolean;
72
+ hasSpecialCharacters: boolean;
73
+ hasNumber: boolean;
74
+ }
75
+ interface InputProps extends Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, 'type'> {
64
76
  disabled?: boolean;
65
77
  placeholder?: string;
66
78
  value?: string;
67
79
  validated?: boolean;
68
- error: boolean;
80
+ error?: boolean;
69
81
  required?: boolean;
70
- type: 'text' | 'password' | 'date' | 'cpf' | 'phone' | 'cnpj' | 'cep';
82
+ type: InputType;
83
+ errorMessage?: string;
84
+ onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
85
+ label?: string;
86
+ helperText?: string;
71
87
  }
72
- declare const Input: react.ForwardRefExoticComponent<Omit<InputProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
88
+ declare const Input: React$1.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
73
89
 
74
90
  interface TextInputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
75
91
  disabled?: boolean;
@@ -82,7 +98,7 @@ interface TextInputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInput
82
98
  required?: boolean;
83
99
  type: 'text' | 'password' | 'date' | 'cpf' | 'phone' | 'cnpj' | 'cep';
84
100
  }
85
- declare const TextInput: react.ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
101
+ declare const TextInput: React$1.ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
86
102
 
87
103
  interface TextAreaProps extends DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> {
88
104
  disabled?: boolean;
@@ -142,4 +158,83 @@ interface MultiStepProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement
142
158
  }
143
159
  declare const MultiStep: ({ className, size, currentStep }: MultiStepProps) => react_jsx_runtime.JSX.Element;
144
160
 
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 };
161
+ interface ToggleProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
162
+ disabled?: boolean;
163
+ active: boolean;
164
+ label: string;
165
+ setActive: (active: boolean) => void;
166
+ size?: 'sm' | 'md' | 'lg';
167
+ hideLabel?: boolean;
168
+ id?: string;
169
+ }
170
+ declare const Toggle: ({ className, disabled, active, label, setActive, size, hideLabel, id, ...rest }: ToggleProps) => react_jsx_runtime.JSX.Element;
171
+
172
+ interface SkeletonProps {
173
+ width?: string | number;
174
+ height?: string | number;
175
+ rounded?: boolean;
176
+ circle?: boolean;
177
+ animate?: boolean;
178
+ className?: string;
179
+ }
180
+ declare const Skeleton: React__default.FC<SkeletonProps>;
181
+
182
+ type LoadingSize = 'xs' | 'sm' | 'md' | 'lg';
183
+ type LoadingColor = 'primary' | 'secondary' | 'white' | 'black' | 'gray';
184
+ interface LoadingProps {
185
+ size?: LoadingSize;
186
+ color?: LoadingColor;
187
+ withText?: boolean;
188
+ text?: string;
189
+ centered?: boolean;
190
+ className?: string;
191
+ }
192
+ declare const Loading: React__default.FC<LoadingProps>;
193
+
194
+ interface ModalProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
195
+ isOpen: boolean;
196
+ onClose: () => void;
197
+ title?: string;
198
+ size?: 'sm' | 'md' | 'lg' | 'xl';
199
+ children: ReactNode;
200
+ showCloseButton?: boolean;
201
+ closeOnOutsideClick?: boolean;
202
+ closeOnEsc?: boolean;
203
+ footer?: ReactNode;
204
+ }
205
+ declare const Modal: ({ className, isOpen, onClose, title, size, children, showCloseButton, closeOnOutsideClick, closeOnEsc, footer, ...rest }: ModalProps) => react_jsx_runtime.JSX.Element | null;
206
+
207
+ type ToastVariant = 'success' | 'error' | 'warning' | 'info';
208
+ type ToastPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';
209
+ interface ToastProps {
210
+ id: string;
211
+ message: string;
212
+ title?: string;
213
+ variant?: ToastVariant;
214
+ duration?: number;
215
+ showCloseButton?: boolean;
216
+ onDismiss?: (id: string) => void;
217
+ className?: string;
218
+ }
219
+ interface ToastContainerProps {
220
+ position?: ToastPosition;
221
+ className?: string;
222
+ }
223
+ declare const Toast: React__default.FC<ToastProps>;
224
+ declare const ToastContainer: React__default.FC<ToastContainerProps & {
225
+ children?: React__default.ReactNode;
226
+ }>;
227
+ type ToastItem = Omit<ToastProps, 'onDismiss'>;
228
+ interface ToastContextType {
229
+ showToast: (toast: Omit<ToastItem, 'id'>) => string;
230
+ hideToast: (id: string) => void;
231
+ clearToasts: () => void;
232
+ }
233
+ declare const ToastContext: React__default.Context<ToastContextType | undefined>;
234
+ declare const ToastProvider: React__default.FC<{
235
+ position?: ToastPosition;
236
+ children: React__default.ReactNode;
237
+ }>;
238
+ declare const useToast: () => ToastContextType;
239
+
240
+ 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, RadioGroup, type RadioGroupProps, Skeleton, type SkeletonProps, Text, TextArea, type TextAreaProps, TextInput, type TextInputProps, type TextProps, Toast, ToastContainer, type ToastContainerProps, ToastContext, type ToastPosition, type ToastProps, ToastProvider, type ToastVariant, Toggle, type ToggleProps, useToast };
package/dist/index.d.ts CHANGED
@@ -1,32 +1,41 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as react from 'react';
3
- import { DetailedHTMLProps, HTMLAttributes, ButtonHTMLAttributes, AnchorHTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, ReactNode, FormHTMLAttributes } from 'react';
2
+ import * as React$1 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$1.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
30
39
 
31
40
  /**
32
41
  * Primary UI component for user interaction
@@ -57,19 +66,26 @@ 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';
70
+ interface PasswordValidation {
71
+ hasEightCharacters: boolean;
72
+ hasSpecialCharacters: boolean;
73
+ hasNumber: boolean;
74
+ }
75
+ interface InputProps extends Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, 'type'> {
64
76
  disabled?: boolean;
65
77
  placeholder?: string;
66
78
  value?: string;
67
79
  validated?: boolean;
68
- error: boolean;
80
+ error?: boolean;
69
81
  required?: boolean;
70
- type: 'text' | 'password' | 'date' | 'cpf' | 'phone' | 'cnpj' | 'cep';
82
+ type: InputType;
83
+ errorMessage?: string;
84
+ onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
85
+ label?: string;
86
+ helperText?: string;
71
87
  }
72
- declare const Input: react.ForwardRefExoticComponent<Omit<InputProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
88
+ declare const Input: React$1.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
73
89
 
74
90
  interface TextInputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
75
91
  disabled?: boolean;
@@ -82,7 +98,7 @@ interface TextInputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInput
82
98
  required?: boolean;
83
99
  type: 'text' | 'password' | 'date' | 'cpf' | 'phone' | 'cnpj' | 'cep';
84
100
  }
85
- declare const TextInput: react.ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
101
+ declare const TextInput: React$1.ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
86
102
 
87
103
  interface TextAreaProps extends DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> {
88
104
  disabled?: boolean;
@@ -142,4 +158,83 @@ interface MultiStepProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement
142
158
  }
143
159
  declare const MultiStep: ({ className, size, currentStep }: MultiStepProps) => react_jsx_runtime.JSX.Element;
144
160
 
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 };
161
+ interface ToggleProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
162
+ disabled?: boolean;
163
+ active: boolean;
164
+ label: string;
165
+ setActive: (active: boolean) => void;
166
+ size?: 'sm' | 'md' | 'lg';
167
+ hideLabel?: boolean;
168
+ id?: string;
169
+ }
170
+ declare const Toggle: ({ className, disabled, active, label, setActive, size, hideLabel, id, ...rest }: ToggleProps) => react_jsx_runtime.JSX.Element;
171
+
172
+ interface SkeletonProps {
173
+ width?: string | number;
174
+ height?: string | number;
175
+ rounded?: boolean;
176
+ circle?: boolean;
177
+ animate?: boolean;
178
+ className?: string;
179
+ }
180
+ declare const Skeleton: React__default.FC<SkeletonProps>;
181
+
182
+ type LoadingSize = 'xs' | 'sm' | 'md' | 'lg';
183
+ type LoadingColor = 'primary' | 'secondary' | 'white' | 'black' | 'gray';
184
+ interface LoadingProps {
185
+ size?: LoadingSize;
186
+ color?: LoadingColor;
187
+ withText?: boolean;
188
+ text?: string;
189
+ centered?: boolean;
190
+ className?: string;
191
+ }
192
+ declare const Loading: React__default.FC<LoadingProps>;
193
+
194
+ interface ModalProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
195
+ isOpen: boolean;
196
+ onClose: () => void;
197
+ title?: string;
198
+ size?: 'sm' | 'md' | 'lg' | 'xl';
199
+ children: ReactNode;
200
+ showCloseButton?: boolean;
201
+ closeOnOutsideClick?: boolean;
202
+ closeOnEsc?: boolean;
203
+ footer?: ReactNode;
204
+ }
205
+ declare const Modal: ({ className, isOpen, onClose, title, size, children, showCloseButton, closeOnOutsideClick, closeOnEsc, footer, ...rest }: ModalProps) => react_jsx_runtime.JSX.Element | null;
206
+
207
+ type ToastVariant = 'success' | 'error' | 'warning' | 'info';
208
+ type ToastPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';
209
+ interface ToastProps {
210
+ id: string;
211
+ message: string;
212
+ title?: string;
213
+ variant?: ToastVariant;
214
+ duration?: number;
215
+ showCloseButton?: boolean;
216
+ onDismiss?: (id: string) => void;
217
+ className?: string;
218
+ }
219
+ interface ToastContainerProps {
220
+ position?: ToastPosition;
221
+ className?: string;
222
+ }
223
+ declare const Toast: React__default.FC<ToastProps>;
224
+ declare const ToastContainer: React__default.FC<ToastContainerProps & {
225
+ children?: React__default.ReactNode;
226
+ }>;
227
+ type ToastItem = Omit<ToastProps, 'onDismiss'>;
228
+ interface ToastContextType {
229
+ showToast: (toast: Omit<ToastItem, 'id'>) => string;
230
+ hideToast: (id: string) => void;
231
+ clearToasts: () => void;
232
+ }
233
+ declare const ToastContext: React__default.Context<ToastContextType | undefined>;
234
+ declare const ToastProvider: React__default.FC<{
235
+ position?: ToastPosition;
236
+ children: React__default.ReactNode;
237
+ }>;
238
+ declare const useToast: () => ToastContextType;
239
+
240
+ 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, RadioGroup, type RadioGroupProps, Skeleton, type SkeletonProps, Text, TextArea, type TextAreaProps, TextInput, type TextInputProps, type TextProps, Toast, ToastContainer, type ToastContainerProps, ToastContext, type ToastPosition, type ToastProps, ToastProvider, type ToastVariant, Toggle, type ToggleProps, useToast };