@adoptaunabuelo/react-components 0.3.142 → 0.3.144
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/LICENSE +1 -1
- package/README.md +26 -3
- package/dist/esm/components/Avatar/Avatar.d.ts +2 -2
- package/dist/esm/components/Button/ButtonEditor.d.ts +6 -4
- package/dist/esm/components/Checkbox/CheckboxList.d.ts +10 -11
- package/dist/esm/components/Filter/FilterCheckbox.d.ts +4 -8
- package/dist/esm/components/Input/Basic/InputStyled.d.ts +1 -1
- package/dist/esm/components/Input/Birthday/InputBirthday.d.ts +4 -1
- package/dist/esm/components/Input/Image/InputImage.d.ts +1 -1
- package/dist/esm/components/Input/Phone/InputPhone.d.ts +3 -9
- package/dist/esm/components/Input/Phone/SelectPhone.d.ts +5 -4
- package/dist/esm/components/Input/Range/InputRange.d.ts +5 -1
- package/dist/esm/components/Menu/Menu.d.ts +1 -1
- package/dist/esm/components/Select/Select.d.ts +2 -2
- package/dist/esm/components/SwitchTag/SwitchTag.d.ts +1 -1
- package/dist/esm/components/TagSelector/TagSelector.d.ts +2 -2
- package/dist/esm/index.js +212 -212
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +41 -39
- package/package.json +55 -19
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2026 Fundación Adopta Un Abuelo.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -14,15 +14,38 @@ React Components is available as an [npm package](https://www.npmjs.com/package/
|
|
|
14
14
|
**npm:**
|
|
15
15
|
|
|
16
16
|
```sh
|
|
17
|
-
npm install @adoptaunabuelo/react-components
|
|
17
|
+
npm install @adoptaunabuelo/react-components react react-dom styled-components
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
**yarn:**
|
|
21
21
|
|
|
22
22
|
```sh
|
|
23
|
-
yarn add @adoptaunabuelo/react-components
|
|
23
|
+
yarn add @adoptaunabuelo/react-components react react-dom styled-components
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
+
### Peer Dependencies
|
|
27
|
+
|
|
28
|
+
This library requires the following peer dependencies to be installed in your project:
|
|
29
|
+
|
|
30
|
+
| Package | Version | Required |
|
|
31
|
+
|---------|---------|----------|
|
|
32
|
+
| `react` | ^18.0.0 \|\| ^19.0.0 | ✅ Yes |
|
|
33
|
+
| `react-dom` | ^18.0.0 \|\| ^19.0.0 | ✅ Yes |
|
|
34
|
+
| `styled-components` | ^5.0.0 \|\| ^6.0.0 | ✅ Yes |
|
|
35
|
+
|
|
36
|
+
### Optional Dependencies (Required for Specific Components)
|
|
37
|
+
|
|
38
|
+
Some components require additional dependencies. Install only what you need:
|
|
39
|
+
|
|
40
|
+
| Component(s) | Package(s) | Installation |
|
|
41
|
+
|--------------|-----------|--------------|
|
|
42
|
+
| `InputLocation` | `@react-google-maps/api` | `npm install @react-google-maps/api` |
|
|
43
|
+
| `Payout` | `@stripe/react-stripe-js` `@stripe/stripe-js` | `npm install @stripe/react-stripe-js @stripe/stripe-js` |
|
|
44
|
+
| `TextArea` (Rich Text) | `@tiptap/react` `@tiptap/starter-kit` `@tiptap/extension-text-align` `@tiptap/extension-text-style` `@tiptap/extensions` | `npm install @tiptap/react @tiptap/starter-kit @tiptap/extension-text-align @tiptap/extension-text-style @tiptap/extensions` |
|
|
45
|
+
| `Button` (Loading animations) | `@lottiefiles/react-lottie-player` | `npm install @lottiefiles/react-lottie-player` |
|
|
46
|
+
| `InputImage` | `react-webcam` | `npm install react-webcam` |
|
|
47
|
+
| Styled Components | `@emotion/is-prop-valid` | `npm install @emotion/is-prop-valid` |
|
|
48
|
+
|
|
26
49
|
## Getting started with React Components
|
|
27
50
|
|
|
28
51
|
Here is an example of a basic app using React Components `ProgressBar` component:
|
|
@@ -58,7 +81,7 @@ You can checkout all the library Components and its docs in our storybook
|
|
|
58
81
|
|
|
59
82
|
## Changelog
|
|
60
83
|
|
|
61
|
-
The [changelog](https://github.com/
|
|
84
|
+
The [changelog](https://github.com/Adopta-Un-Abuelo/react-components/releases) is regularly updated to reflect what's changed in each new release.
|
|
62
85
|
|
|
63
86
|
## License
|
|
64
87
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef } from "react";
|
|
2
2
|
declare const Avatar: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Avatar;
|
|
4
|
-
export interface Props extends ComponentPropsWithoutRef<"div"> {
|
|
4
|
+
export interface Props extends Omit<ComponentPropsWithoutRef<"div">, "onChange"> {
|
|
5
5
|
icon?: string;
|
|
6
6
|
name?: string;
|
|
7
7
|
editable?: boolean;
|
|
8
8
|
clickable?: boolean;
|
|
9
|
-
onChange?: (file:
|
|
9
|
+
onChange?: (file: string | ArrayBuffer | null) => void;
|
|
10
10
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { EditorState } from "draft-js";
|
|
2
|
+
import { CSSProperties } from "react";
|
|
1
3
|
export declare const ButtonEditor: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
2
4
|
export default ButtonEditor;
|
|
3
5
|
export interface Props {
|
|
4
|
-
style?:
|
|
6
|
+
style?: CSSProperties;
|
|
5
7
|
text: string;
|
|
6
8
|
design?: "primary" | "secondary";
|
|
7
9
|
type: {
|
|
8
10
|
control: string;
|
|
9
|
-
value:
|
|
11
|
+
value: string;
|
|
10
12
|
};
|
|
11
|
-
editorState
|
|
12
|
-
onChange?:
|
|
13
|
+
editorState: EditorState;
|
|
14
|
+
onChange?: (editorState: EditorState) => void;
|
|
13
15
|
}
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import { CSSProperties } from "react";
|
|
2
2
|
declare const CheckboxList: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default CheckboxList;
|
|
4
|
+
export type CheckboxOption = {
|
|
5
|
+
id: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
sublabel?: string;
|
|
8
|
+
Element?: React.ReactElement;
|
|
9
|
+
error?: boolean;
|
|
10
|
+
[key: string]: string | React.ReactElement | boolean | undefined;
|
|
11
|
+
};
|
|
4
12
|
export interface Props {
|
|
5
13
|
style?: CSSProperties;
|
|
6
14
|
elementStyle?: CSSProperties;
|
|
7
|
-
options: Array<
|
|
8
|
-
id: string;
|
|
9
|
-
label?: string;
|
|
10
|
-
sublabel?: string;
|
|
11
|
-
Element?: React.ReactElement;
|
|
12
|
-
error?: boolean;
|
|
13
|
-
}>;
|
|
15
|
+
options: Array<CheckboxOption>;
|
|
14
16
|
selectedOptions?: Array<{
|
|
15
17
|
id: string;
|
|
16
18
|
}>;
|
|
17
19
|
height?: number;
|
|
18
20
|
width?: number;
|
|
19
21
|
type: "single" | "multiple";
|
|
20
|
-
onChange?: (result: Array<
|
|
21
|
-
id: string;
|
|
22
|
-
[key: string]: any;
|
|
23
|
-
}>) => void;
|
|
22
|
+
onChange?: (result: Array<CheckboxOption>) => void;
|
|
24
23
|
position?: "left" | "right";
|
|
25
24
|
avatarEnabled?: boolean;
|
|
26
25
|
shape?: "circle" | "square";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { FilterDefaultProps } from "./FilterDefault";
|
|
2
|
+
import { CheckboxOption } from "@components/Checkbox/CheckboxList";
|
|
3
|
+
type OptionWithDynamicProps = CheckboxOption;
|
|
2
4
|
declare const FilterCheckbox: import("react").ForwardRefExoticComponent<FilterCheckboxProps & import("react").RefAttributes<FilterCheckboxRef>>;
|
|
3
5
|
export default FilterCheckbox;
|
|
4
6
|
export interface FilterCheckboxProps extends FilterDefaultProps {
|
|
@@ -9,14 +11,8 @@ export interface FilterCheckboxProps extends FilterDefaultProps {
|
|
|
9
11
|
label: string;
|
|
10
12
|
sublabel?: string;
|
|
11
13
|
}>;
|
|
12
|
-
selectedOptions?:
|
|
13
|
-
|
|
14
|
-
[key: string]: any;
|
|
15
|
-
}>;
|
|
16
|
-
onChange?: (r: Array<{
|
|
17
|
-
id: string;
|
|
18
|
-
[key: string]: any;
|
|
19
|
-
}>) => void;
|
|
14
|
+
selectedOptions?: OptionWithDynamicProps[];
|
|
15
|
+
onChange?: (r: OptionWithDynamicProps[]) => void;
|
|
20
16
|
}
|
|
21
17
|
export interface FilterCheckboxRef {
|
|
22
18
|
clean: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithRef } from "react";
|
|
2
|
-
declare const InputStyled: import("react").ForwardRefExoticComponent<Omit<InputStyledProps, "ref"> & import("react").RefAttributes<
|
|
2
|
+
declare const InputStyled: import("react").ForwardRefExoticComponent<Omit<InputStyledProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
3
3
|
export default InputStyled;
|
|
4
4
|
export interface InputStyledProps extends ComponentPropsWithRef<"input"> {
|
|
5
5
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { ChangeEvent } from "react";
|
|
1
2
|
import { InputProps } from "../Basic/Input";
|
|
2
3
|
declare const InputBirthday: ({ error, onChange, containerStyle, ...restProps }: InputBirthdayProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
4
|
export default InputBirthday;
|
|
4
|
-
export type InputBirthdayProps =
|
|
5
|
+
export type InputBirthdayProps = Omit<InputProps, 'onChange'> & {
|
|
6
|
+
onChange?: (date: Date | ChangeEvent<HTMLInputElement>) => void;
|
|
7
|
+
};
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
+
import { CountryProps } from "./SelectPhone";
|
|
1
2
|
import { InputProps } from "../Basic/Input";
|
|
2
3
|
declare const InputPhone: (props: InputPhoneProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
4
|
export default InputPhone;
|
|
4
5
|
export type InputPhoneProps = InputProps & {
|
|
5
6
|
country?: string;
|
|
6
|
-
countryOptions?:
|
|
7
|
-
id: string;
|
|
8
|
-
esCountry: string;
|
|
9
|
-
enCountry: string;
|
|
10
|
-
prefix: string;
|
|
11
|
-
countryCode: string;
|
|
12
|
-
[key: string]: any;
|
|
13
|
-
}[];
|
|
7
|
+
countryOptions?: CountryProps[];
|
|
14
8
|
onPhoneChange?: (item: {
|
|
15
9
|
country: string;
|
|
16
|
-
value?:
|
|
10
|
+
value?: string | number;
|
|
17
11
|
isValid: boolean;
|
|
18
12
|
}) => void;
|
|
19
13
|
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef } from "react";
|
|
1
|
+
import { ComponentPropsWithoutRef, CSSProperties } from "react";
|
|
2
2
|
declare const Select: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Select;
|
|
4
|
-
export interface Props extends ComponentPropsWithoutRef<"div"> {
|
|
4
|
+
export interface Props extends Omit<ComponentPropsWithoutRef<"div">, "onChange"> {
|
|
5
5
|
id: string;
|
|
6
|
-
optionStyle?:
|
|
6
|
+
optionStyle?: CSSProperties;
|
|
7
7
|
showMenu?: boolean;
|
|
8
8
|
options: Array<CountryProps>;
|
|
9
9
|
selectedItem?: CountryProps;
|
|
10
10
|
focus: boolean;
|
|
11
|
-
onChange?: (
|
|
11
|
+
onChange?: (country: CountryProps) => void;
|
|
12
12
|
}
|
|
13
13
|
export interface CountryProps {
|
|
14
|
+
id?: string;
|
|
14
15
|
countryCode: string;
|
|
15
16
|
prefix: string;
|
|
16
17
|
esCountry: string;
|
|
@@ -12,7 +12,11 @@ export interface InputRangeProps extends ComponentPropsWithoutRef<"input"> {
|
|
|
12
12
|
hideLabels?: boolean;
|
|
13
13
|
presents?: {
|
|
14
14
|
value: number;
|
|
15
|
-
icon:
|
|
15
|
+
icon: React.ComponentType<{
|
|
16
|
+
height?: number;
|
|
17
|
+
width?: number;
|
|
18
|
+
color?: string;
|
|
19
|
+
}>;
|
|
16
20
|
color: string;
|
|
17
21
|
colorSuccess: string;
|
|
18
22
|
onClick?: () => void;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, CSSProperties } from "react";
|
|
2
2
|
declare const Select: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Select;
|
|
4
|
-
export interface Props extends ComponentPropsWithoutRef<"div"> {
|
|
4
|
+
export interface Props extends Omit<ComponentPropsWithoutRef<"div">, "onChange"> {
|
|
5
5
|
id: string;
|
|
6
6
|
optionStyle?: CSSProperties;
|
|
7
7
|
hideTitle?: boolean;
|
|
8
8
|
options: Array<OptionProps>;
|
|
9
9
|
selectedItem?: OptionProps;
|
|
10
|
-
onChange?: (option:
|
|
10
|
+
onChange?: (option: OptionProps) => void;
|
|
11
11
|
}
|
|
12
12
|
interface OptionProps {
|
|
13
13
|
icon?: React.ReactElement;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { CSSProperties } from "react";
|
|
2
2
|
declare const TagSelector: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default TagSelector;
|
|
4
4
|
export interface Props {
|
|
5
5
|
type?: "multiple" | "single";
|
|
6
|
-
style?:
|
|
6
|
+
style?: CSSProperties;
|
|
7
7
|
options: Array<OptionProps>;
|
|
8
8
|
optionsSelected?: Array<OptionProps>;
|
|
9
9
|
onChange?: (selection: Array<OptionProps>) => void;
|