@komensal/ui 0.9.1 → 0.11.0
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/README.md +6 -5
- package/dist/index.d.ts +27 -7
- package/dist/index.js +486 -348
- package/dist/index.js.map +1 -1
- package/dist/locales/index.d.ts +1 -0
- package/dist/locales/index.js +2 -1
- package/dist/locales/index.js.map +1 -1
- package/package.json +11 -13
package/README.md
CHANGED
|
@@ -16,9 +16,10 @@ El paquete las espera instaladas en el proyecto consumidor:
|
|
|
16
16
|
|---|---|
|
|
17
17
|
| `react` | `^19.0.0` |
|
|
18
18
|
| `react-dom` | `^19.0.0` |
|
|
19
|
-
| `react-hook-form` | `^7.
|
|
20
|
-
| `react-i18next` | `^16.
|
|
21
|
-
|
|
19
|
+
| `react-hook-form` | `^7.71.0` |
|
|
20
|
+
| `react-i18next` | `^16.5.0` |
|
|
21
|
+
|
|
22
|
+
`i18next` no es peer dependency: el paquete trae su propia instancia autocontenida (ver sección de i18n abajo), empaquetada en el propio `dist/index.js`.
|
|
22
23
|
|
|
23
24
|
## Uso
|
|
24
25
|
|
|
@@ -67,9 +68,9 @@ Si un texto interno no te sirve, podés pasarlo por prop al componente; gana el
|
|
|
67
68
|
## Componentes disponibles
|
|
68
69
|
|
|
69
70
|
- **Acciones:** `Button`
|
|
70
|
-
- **Formularios (React Hook Form):** `Input`, `SelectInput`, `
|
|
71
|
+
- **Formularios (React Hook Form):** `Input`, `SelectInput`, `OTPInput`, `Form`, `InputField`, `LabelField`, `SelectField`, `OtpField`, `MapPickerField`, `Label`, `PasswordChecklist`
|
|
71
72
|
- **Overlays:** `Dialog`, `Popover`, `Tooltip`, `Command`
|
|
72
|
-
- **Feedback / estado:** `Alert`, `Toast` + `ToastProvider`, `Spinner
|
|
73
|
+
- **Feedback / estado:** `Alert`, `Toast` + `ToastProvider`, `Spinner`
|
|
73
74
|
- **Layout:** `AuthHeader`, `StepHeader`, `Stepper`, `Wrapper`
|
|
74
75
|
- **Mapas:** `GoogleMapPicker`
|
|
75
76
|
- **Utils:** `cn`, `inputBase`, `inputFocus`, `inputDisabled`, `inputPlaceholder`, `toast`, `registerToastEmitter`
|
package/dist/index.d.ts
CHANGED
|
@@ -9,11 +9,18 @@ import { FieldValues, FieldPath, ControllerProps, Control, Path, FieldError, Noo
|
|
|
9
9
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
10
10
|
import { OTPInput } from 'input-otp';
|
|
11
11
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
12
|
+
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
12
13
|
import { $NormalizeIntoArray } from './typescript/helpers.js';
|
|
13
14
|
import { DefaultNamespace, FlatNamespace, InitOptions, InterpolationOptions, Resource, FormatFunction, ResourceKey, ResourceLanguage, TOptions, Namespace, TypeOptions } from './typescript/options.js';
|
|
14
15
|
import { TFunction, SelectorKey, KeyPrefixSelector, KeyPrefix } from './typescript/t.js';
|
|
15
16
|
import { ClassValue } from 'clsx';
|
|
16
17
|
|
|
18
|
+
interface AddTileProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
19
|
+
icon: React.ReactNode;
|
|
20
|
+
label: string;
|
|
21
|
+
}
|
|
22
|
+
declare const AddTile: React.ForwardRefExoticComponent<AddTileProps & React.RefAttributes<HTMLButtonElement>>;
|
|
23
|
+
|
|
17
24
|
interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
18
25
|
variant?: AlertVariant;
|
|
19
26
|
}
|
|
@@ -31,7 +38,7 @@ declare const AuthHeader: ({ children, desktopLogoSrc, logoAlt, mobileClassName,
|
|
|
31
38
|
|
|
32
39
|
declare const buttonVariants: (props?: ({
|
|
33
40
|
hoverStyle?: "none" | "highlight" | "shine" | null | undefined;
|
|
34
|
-
size?: "
|
|
41
|
+
size?: "icon" | "lg" | "sm" | "default" | null | undefined;
|
|
35
42
|
variant?: "destructive" | "link" | "primary" | "ghost" | "invisible" | "outline" | "subtle" | "tertiary" | "underline" | null | undefined;
|
|
36
43
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
37
44
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
@@ -47,6 +54,13 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, Var
|
|
|
47
54
|
}
|
|
48
55
|
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
49
56
|
|
|
57
|
+
declare const chipVariants: (props?: ({
|
|
58
|
+
active?: boolean | null | undefined;
|
|
59
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
60
|
+
interface ChipProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof chipVariants> {
|
|
61
|
+
}
|
|
62
|
+
declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLButtonElement>>;
|
|
63
|
+
|
|
50
64
|
declare const Command: React.ForwardRefExoticComponent<Omit<{
|
|
51
65
|
children?: React.ReactNode;
|
|
52
66
|
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
@@ -70,7 +84,7 @@ declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<
|
|
|
70
84
|
ref?: React.Ref<HTMLInputElement>;
|
|
71
85
|
} & {
|
|
72
86
|
asChild?: boolean;
|
|
73
|
-
}, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "type" | "
|
|
87
|
+
}, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "type" | "value" | "onChange"> & {
|
|
74
88
|
value?: string;
|
|
75
89
|
onValueChange?: (search: string) => void;
|
|
76
90
|
} & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -96,7 +110,7 @@ declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
|
|
|
96
110
|
ref?: React.Ref<HTMLDivElement>;
|
|
97
111
|
} & {
|
|
98
112
|
asChild?: boolean;
|
|
99
|
-
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "
|
|
113
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "value" | "heading"> & {
|
|
100
114
|
heading?: React.ReactNode;
|
|
101
115
|
value?: string;
|
|
102
116
|
forceMount?: boolean;
|
|
@@ -114,7 +128,7 @@ declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
|
|
|
114
128
|
ref?: React.Ref<HTMLDivElement>;
|
|
115
129
|
} & {
|
|
116
130
|
asChild?: boolean;
|
|
117
|
-
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "
|
|
131
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "disabled" | "value" | "onSelect"> & {
|
|
118
132
|
disabled?: boolean;
|
|
119
133
|
onSelect?: (value: string) => void;
|
|
120
134
|
value?: string;
|
|
@@ -209,6 +223,7 @@ interface ResolvedAddress {
|
|
|
209
223
|
lng: null | number;
|
|
210
224
|
}
|
|
211
225
|
interface GoogleMapPickerProps {
|
|
226
|
+
apiKey?: string;
|
|
212
227
|
centerOn?: google.maps.LatLngLiteral;
|
|
213
228
|
countryCode?: string;
|
|
214
229
|
disabled?: boolean;
|
|
@@ -216,8 +231,10 @@ interface GoogleMapPickerProps {
|
|
|
216
231
|
initialPosition?: google.maps.LatLngLiteral;
|
|
217
232
|
locationQuery?: string;
|
|
218
233
|
locationZoom?: number;
|
|
234
|
+
mapId?: string;
|
|
219
235
|
onAddressResolved?: (resolved: ResolvedAddress) => void;
|
|
220
236
|
onChange: (address: string) => void;
|
|
237
|
+
onError?: (error: unknown) => void;
|
|
221
238
|
placeholder?: string;
|
|
222
239
|
value: string;
|
|
223
240
|
}
|
|
@@ -243,8 +260,9 @@ interface OtpInputFormFieldProps<TFieldValues extends FieldValues = FieldValues,
|
|
|
243
260
|
labelClassName?: string;
|
|
244
261
|
name: TName;
|
|
245
262
|
otpLength?: number;
|
|
263
|
+
visualRequired?: boolean;
|
|
246
264
|
}
|
|
247
|
-
declare function OTPField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ autoFocus, className, containerClassName, control, disabled, label, labelClassName, name, otpLength }: OtpInputFormFieldProps<TFieldValues, TName>): React__default.JSX.Element;
|
|
265
|
+
declare function OTPField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ autoFocus, className, containerClassName, control, disabled, label, labelClassName, name, otpLength, visualRequired }: OtpInputFormFieldProps<TFieldValues, TName>): React__default.JSX.Element;
|
|
248
266
|
|
|
249
267
|
interface Options {
|
|
250
268
|
label: string;
|
|
@@ -265,7 +283,7 @@ interface SelectFieldProps<T extends FieldValues = FieldValues> {
|
|
|
265
283
|
search?: boolean;
|
|
266
284
|
visualRequired?: boolean;
|
|
267
285
|
}
|
|
268
|
-
declare const SelectField: <T extends FieldValues = FieldValues>({ ableDeleteOption, className, control, disabled, label, labelClassName, mainClassName, name, options, placeholder, search, visualRequired }: SelectFieldProps<T>) => React.JSX.Element;
|
|
286
|
+
declare const SelectField: <T extends FieldValues = FieldValues>({ ableDeleteOption, className, control, disabled, label, labelClassName, mainClassName, name, onChange, options, placeholder, search, visualRequired }: SelectFieldProps<T>) => React.JSX.Element;
|
|
269
287
|
|
|
270
288
|
type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
|
|
271
289
|
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -368,6 +386,8 @@ interface StepperProps {
|
|
|
368
386
|
}
|
|
369
387
|
declare const Stepper: ({ activeIndex, className, intermediate, steps }: StepperProps) => React.JSX.Element;
|
|
370
388
|
|
|
389
|
+
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitive.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
390
|
+
|
|
371
391
|
interface ToastOptions {
|
|
372
392
|
duration?: number;
|
|
373
393
|
position?: ToastPosition;
|
|
@@ -947,4 +967,4 @@ declare const toast: {
|
|
|
947
967
|
};
|
|
948
968
|
declare function registerToastEmitter(fn: ToastEmitter): void;
|
|
949
969
|
|
|
950
|
-
export { Alert, AuthHeader, Button, type ButtonProps, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Form, FormControl, FormField, FormItem, FormMessage, GoogleMapPicker, type GoogleMapPickerProps, Input, InputField, InputOTP, InputOTPGroup, InputOTPSlot, type InputProps, Label, LabelField, MapPickerField, OTPField, type Options, PasswordChecklist, type PasswordRule, type PasswordRulesConfig, Popover, PopoverContent, PopoverTrigger, type ResolvedAddress, SelectField, SelectInput, Spinner, type SpinnerProps, StepHeader, Stepper, type StepperStep, Toast, type ToastOptions, type ToastPosition, ToastProvider, type ToastType, Tooltip, Wrapper, type WrapperProps, buttonVariants, cn, inputBase, inputCompact, inputDisabled, inputFocus, inputPlaceholder, registerToastEmitter, setUiLanguage, toast, uiI18n, useFormField };
|
|
970
|
+
export { AddTile, type AddTileProps, Alert, AuthHeader, Button, type ButtonProps, Chip, type ChipProps, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Form, FormControl, FormField, FormItem, FormMessage, GoogleMapPicker, type GoogleMapPickerProps, Input, InputField, InputOTP, InputOTPGroup, InputOTPSlot, type InputProps, Label, LabelField, MapPickerField, OTPField, type Options, PasswordChecklist, type PasswordRule, type PasswordRulesConfig, Popover, PopoverContent, PopoverTrigger, type ResolvedAddress, SelectField, SelectInput, Spinner, type SpinnerProps, StepHeader, Stepper, type StepperStep, Switch, Toast, type ToastOptions, type ToastPosition, ToastProvider, type ToastType, Tooltip, Wrapper, type WrapperProps, buttonVariants, chipVariants, cn, inputBase, inputCompact, inputDisabled, inputFocus, inputPlaceholder, registerToastEmitter, setUiLanguage, toast, uiI18n, useFormField };
|