@adoptaunabuelo/react-components 0.3.142 → 0.3.143

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,8 +1,9 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
- import react__default, { ComponentPropsWithoutRef, ReactNode, ComponentPropsWithRef, ReactElement, CSSProperties } from 'react';
3
+ import react__default, { ComponentPropsWithoutRef, ReactNode, ComponentPropsWithRef, ReactElement, CSSProperties, ChangeEvent } from 'react';
4
4
  import moment from 'moment';
5
5
  import { ButtonProps as ButtonProps$2 } from '@components/Button/Button';
6
+ import { CheckboxOption as CheckboxOption$1 } from '@components/Checkbox/CheckboxList';
6
7
  import { PaymentMethod } from '@stripe/stripe-js';
7
8
  import { LocationProps as LocationProps$1 } from '@components/Input/Location/InputLocation';
8
9
 
@@ -114,7 +115,9 @@ type InputProps = (InputPrimaryProps | InputSecondaryProps | InputThirdProps) &
114
115
 
115
116
  declare const InputBirthday: ({ error, onChange, containerStyle, ...restProps }: InputBirthdayProps) => react_jsx_runtime.JSX.Element;
116
117
 
117
- type InputBirthdayProps = {} & InputProps;
118
+ type InputBirthdayProps = Omit<InputProps, 'onChange'> & {
119
+ onChange?: (date: Date | ChangeEvent<HTMLInputElement>) => void;
120
+ };
118
121
 
119
122
  declare const InputChat: (props: InputChatProps) => react_jsx_runtime.JSX.Element;
120
123
 
@@ -174,7 +177,7 @@ interface InputImageProps {
174
177
  maxHeight?: number;
175
178
  maxWidth?: number;
176
179
  hideCrop?: boolean;
177
- onChange?: (image: any) => void;
180
+ onChange?: (image: string | ArrayBuffer | null) => void;
178
181
  }
179
182
 
180
183
  declare const InputLocation: ({ isLoaded, isForm, searchTypes, searchFields, onLocationChange, ...restProps }: InputLocationProps) => react_jsx_runtime.JSX.Element;
@@ -201,21 +204,22 @@ interface LocationProps {
201
204
  timeZone?: string;
202
205
  }
203
206
 
207
+ interface CountryProps {
208
+ id?: string;
209
+ countryCode: string;
210
+ prefix: string;
211
+ esCountry: string;
212
+ enCountry: string;
213
+ }
214
+
204
215
  declare const InputPhone: (props: InputPhoneProps) => react_jsx_runtime.JSX.Element;
205
216
 
206
217
  type InputPhoneProps = InputProps & {
207
218
  country?: string;
208
- countryOptions?: {
209
- id: string;
210
- esCountry: string;
211
- enCountry: string;
212
- prefix: string;
213
- countryCode: string;
214
- [key: string]: any;
215
- }[];
219
+ countryOptions?: CountryProps[];
216
220
  onPhoneChange?: (item: {
217
221
  country: string;
218
- value?: any;
222
+ value?: string | number;
219
223
  isValid: boolean;
220
224
  }) => void;
221
225
  };
@@ -233,7 +237,11 @@ interface InputRangeProps extends ComponentPropsWithoutRef<"input"> {
233
237
  hideLabels?: boolean;
234
238
  presents?: {
235
239
  value: number;
236
- icon: any;
240
+ icon: React.ComponentType<{
241
+ height?: number;
242
+ width?: number;
243
+ color?: string;
244
+ }>;
237
245
  color: string;
238
246
  colorSuccess: string;
239
247
  onClick?: () => void;
@@ -263,13 +271,13 @@ type InputPriceProps = {
263
271
 
264
272
  declare const Select: (props: Props$e) => react_jsx_runtime.JSX.Element;
265
273
 
266
- interface Props$e extends ComponentPropsWithoutRef<"div"> {
274
+ interface Props$e extends Omit<ComponentPropsWithoutRef<"div">, "onChange"> {
267
275
  id: string;
268
276
  optionStyle?: CSSProperties;
269
277
  hideTitle?: boolean;
270
278
  options: Array<OptionProps$5>;
271
279
  selectedItem?: OptionProps$5;
272
- onChange?: (option: any) => void;
280
+ onChange?: (option: OptionProps$5) => void;
273
281
  }
274
282
  interface OptionProps$5 {
275
283
  icon?: React.ReactElement;
@@ -335,7 +343,7 @@ interface OptionsProps {
335
343
  id: string;
336
344
  label: string;
337
345
  labelColor?: string;
338
- icon?: any;
346
+ icon?: React.ReactElement;
339
347
  }
340
348
  interface MenuRef {
341
349
  close: () => void;
@@ -355,12 +363,12 @@ interface Props$c extends ComponentPropsWithoutRef<"div"> {
355
363
 
356
364
  declare const Avatar: (props: Props$b) => react_jsx_runtime.JSX.Element;
357
365
 
358
- interface Props$b extends ComponentPropsWithoutRef<"div"> {
366
+ interface Props$b extends Omit<ComponentPropsWithoutRef<"div">, "onChange"> {
359
367
  icon?: string;
360
368
  name?: string;
361
369
  editable?: boolean;
362
370
  clickable?: boolean;
363
- onChange?: (file: any) => void;
371
+ onChange?: (file: string | ArrayBuffer | null) => void;
364
372
  }
365
373
 
366
374
  interface FilterDefaultProps {
@@ -380,6 +388,7 @@ interface FilterDefaultProps {
380
388
  onSave?: () => void;
381
389
  }
382
390
 
391
+ type OptionWithDynamicProps = CheckboxOption$1;
383
392
  interface FilterCheckboxProps extends FilterDefaultProps {
384
393
  type: "single" | "multiple";
385
394
  shape?: "circle" | "square";
@@ -388,14 +397,8 @@ interface FilterCheckboxProps extends FilterDefaultProps {
388
397
  label: string;
389
398
  sublabel?: string;
390
399
  }>;
391
- selectedOptions?: Array<{
392
- id: string;
393
- [key: string]: any;
394
- }>;
395
- onChange?: (r: Array<{
396
- id: string;
397
- [key: string]: any;
398
- }>) => void;
400
+ selectedOptions?: OptionWithDynamicProps[];
401
+ onChange?: (r: OptionWithDynamicProps[]) => void;
399
402
  }
400
403
  interface FilterCheckboxRef {
401
404
  clean: () => void;
@@ -444,26 +447,25 @@ declare const Filter: react.ForwardRefExoticComponent<(FilterCheckboxProps | Fil
444
447
 
445
448
  declare const CheckboxList: (props: Props$a) => react_jsx_runtime.JSX.Element;
446
449
 
450
+ type CheckboxOption = {
451
+ id: string;
452
+ label?: string;
453
+ sublabel?: string;
454
+ Element?: React.ReactElement;
455
+ error?: boolean;
456
+ [key: string]: string | React.ReactElement | boolean | undefined;
457
+ };
447
458
  interface Props$a {
448
459
  style?: CSSProperties;
449
460
  elementStyle?: CSSProperties;
450
- options: Array<{
451
- id: string;
452
- label?: string;
453
- sublabel?: string;
454
- Element?: React.ReactElement;
455
- error?: boolean;
456
- }>;
461
+ options: Array<CheckboxOption>;
457
462
  selectedOptions?: Array<{
458
463
  id: string;
459
464
  }>;
460
465
  height?: number;
461
466
  width?: number;
462
467
  type: "single" | "multiple";
463
- onChange?: (result: Array<{
464
- id: string;
465
- [key: string]: any;
466
- }>) => void;
468
+ onChange?: (result: Array<CheckboxOption>) => void;
467
469
  position?: "left" | "right";
468
470
  avatarEnabled?: boolean;
469
471
  shape?: "circle" | "square";
@@ -598,7 +600,7 @@ interface Props$5 {
598
600
  }>;
599
601
  onChange?: (option: {
600
602
  id: string;
601
- icon: any;
603
+ icon: react__default.ReactElement;
602
604
  }) => void;
603
605
  }
604
606
 
@@ -624,7 +626,7 @@ declare const TagSelector: (props: Props$2) => react_jsx_runtime.JSX.Element;
624
626
 
625
627
  interface Props$2 {
626
628
  type?: "multiple" | "single";
627
- style?: any;
629
+ style?: CSSProperties;
628
630
  options: Array<OptionProps>;
629
631
  optionsSelected?: Array<OptionProps>;
630
632
  onChange?: (selection: Array<OptionProps>) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adoptaunabuelo/react-components",
3
- "version": "0.3.142",
3
+ "version": "0.3.143",
4
4
  "homepage": "https://github.com/Adopta-Un-Abuelo/react-components",
5
5
  "author": "Guillermo Angeles <guilleangeles94@gmail.com>",
6
6
  "private": false,