@adoptaunabuelo/react-components 0.3.141 → 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,11 @@
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
+ import { ButtonProps as ButtonProps$2 } from '@components/Button/Button';
6
+ import { CheckboxOption as CheckboxOption$1 } from '@components/Checkbox/CheckboxList';
5
7
  import { PaymentMethod } from '@stripe/stripe-js';
8
+ import { LocationProps as LocationProps$1 } from '@components/Input/Location/InputLocation';
6
9
 
7
10
  declare const BreadCrumb: ({ steps, selectedStep, ...restProps }: Props$g) => react_jsx_runtime.JSX.Element;
8
11
 
@@ -112,7 +115,9 @@ type InputProps = (InputPrimaryProps | InputSecondaryProps | InputThirdProps) &
112
115
 
113
116
  declare const InputBirthday: ({ error, onChange, containerStyle, ...restProps }: InputBirthdayProps) => react_jsx_runtime.JSX.Element;
114
117
 
115
- type InputBirthdayProps = {} & InputProps;
118
+ type InputBirthdayProps = Omit<InputProps, 'onChange'> & {
119
+ onChange?: (date: Date | ChangeEvent<HTMLInputElement>) => void;
120
+ };
116
121
 
117
122
  declare const InputChat: (props: InputChatProps) => react_jsx_runtime.JSX.Element;
118
123
 
@@ -172,7 +177,7 @@ interface InputImageProps {
172
177
  maxHeight?: number;
173
178
  maxWidth?: number;
174
179
  hideCrop?: boolean;
175
- onChange?: (image: any) => void;
180
+ onChange?: (image: string | ArrayBuffer | null) => void;
176
181
  }
177
182
 
178
183
  declare const InputLocation: ({ isLoaded, isForm, searchTypes, searchFields, onLocationChange, ...restProps }: InputLocationProps) => react_jsx_runtime.JSX.Element;
@@ -199,21 +204,22 @@ interface LocationProps {
199
204
  timeZone?: string;
200
205
  }
201
206
 
207
+ interface CountryProps {
208
+ id?: string;
209
+ countryCode: string;
210
+ prefix: string;
211
+ esCountry: string;
212
+ enCountry: string;
213
+ }
214
+
202
215
  declare const InputPhone: (props: InputPhoneProps) => react_jsx_runtime.JSX.Element;
203
216
 
204
217
  type InputPhoneProps = InputProps & {
205
218
  country?: string;
206
- countryOptions?: {
207
- id: string;
208
- esCountry: string;
209
- enCountry: string;
210
- prefix: string;
211
- countryCode: string;
212
- [key: string]: any;
213
- }[];
219
+ countryOptions?: CountryProps[];
214
220
  onPhoneChange?: (item: {
215
221
  country: string;
216
- value?: any;
222
+ value?: string | number;
217
223
  isValid: boolean;
218
224
  }) => void;
219
225
  };
@@ -231,7 +237,11 @@ interface InputRangeProps extends ComponentPropsWithoutRef<"input"> {
231
237
  hideLabels?: boolean;
232
238
  presents?: {
233
239
  value: number;
234
- icon: any;
240
+ icon: React.ComponentType<{
241
+ height?: number;
242
+ width?: number;
243
+ color?: string;
244
+ }>;
235
245
  color: string;
236
246
  colorSuccess: string;
237
247
  onClick?: () => void;
@@ -261,13 +271,13 @@ type InputPriceProps = {
261
271
 
262
272
  declare const Select: (props: Props$e) => react_jsx_runtime.JSX.Element;
263
273
 
264
- interface Props$e extends ComponentPropsWithoutRef<"div"> {
274
+ interface Props$e extends Omit<ComponentPropsWithoutRef<"div">, "onChange"> {
265
275
  id: string;
266
276
  optionStyle?: CSSProperties;
267
277
  hideTitle?: boolean;
268
278
  options: Array<OptionProps$5>;
269
279
  selectedItem?: OptionProps$5;
270
- onChange?: (option: any) => void;
280
+ onChange?: (option: OptionProps$5) => void;
271
281
  }
272
282
  interface OptionProps$5 {
273
283
  icon?: React.ReactElement;
@@ -293,7 +303,7 @@ interface ModalPrimaryProps extends ComponentPropsWithoutRef<"div"> {
293
303
  contentStyle?: CSSProperties;
294
304
  Header?: ReactElement;
295
305
  Bottom?: ReactElement;
296
- buttonProps?: ButtonProps;
306
+ buttonProps?: ButtonProps$2;
297
307
  footerStyle?: CSSProperties;
298
308
  onClose: () => void;
299
309
  shouldCloseOnOverlayClick?: boolean;
@@ -333,7 +343,7 @@ interface OptionsProps {
333
343
  id: string;
334
344
  label: string;
335
345
  labelColor?: string;
336
- icon?: any;
346
+ icon?: React.ReactElement;
337
347
  }
338
348
  interface MenuRef {
339
349
  close: () => void;
@@ -353,12 +363,12 @@ interface Props$c extends ComponentPropsWithoutRef<"div"> {
353
363
 
354
364
  declare const Avatar: (props: Props$b) => react_jsx_runtime.JSX.Element;
355
365
 
356
- interface Props$b extends ComponentPropsWithoutRef<"div"> {
366
+ interface Props$b extends Omit<ComponentPropsWithoutRef<"div">, "onChange"> {
357
367
  icon?: string;
358
368
  name?: string;
359
369
  editable?: boolean;
360
370
  clickable?: boolean;
361
- onChange?: (file: any) => void;
371
+ onChange?: (file: string | ArrayBuffer | null) => void;
362
372
  }
363
373
 
364
374
  interface FilterDefaultProps {
@@ -378,6 +388,7 @@ interface FilterDefaultProps {
378
388
  onSave?: () => void;
379
389
  }
380
390
 
391
+ type OptionWithDynamicProps = CheckboxOption$1;
381
392
  interface FilterCheckboxProps extends FilterDefaultProps {
382
393
  type: "single" | "multiple";
383
394
  shape?: "circle" | "square";
@@ -386,14 +397,8 @@ interface FilterCheckboxProps extends FilterDefaultProps {
386
397
  label: string;
387
398
  sublabel?: string;
388
399
  }>;
389
- selectedOptions?: Array<{
390
- id: string;
391
- [key: string]: any;
392
- }>;
393
- onChange?: (r: Array<{
394
- id: string;
395
- [key: string]: any;
396
- }>) => void;
400
+ selectedOptions?: OptionWithDynamicProps[];
401
+ onChange?: (r: OptionWithDynamicProps[]) => void;
397
402
  }
398
403
  interface FilterCheckboxRef {
399
404
  clean: () => void;
@@ -442,26 +447,25 @@ declare const Filter: react.ForwardRefExoticComponent<(FilterCheckboxProps | Fil
442
447
 
443
448
  declare const CheckboxList: (props: Props$a) => react_jsx_runtime.JSX.Element;
444
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
+ };
445
458
  interface Props$a {
446
459
  style?: CSSProperties;
447
460
  elementStyle?: CSSProperties;
448
- options: Array<{
449
- id: string;
450
- label?: string;
451
- sublabel?: string;
452
- Element?: React.ReactElement;
453
- error?: boolean;
454
- }>;
461
+ options: Array<CheckboxOption>;
455
462
  selectedOptions?: Array<{
456
463
  id: string;
457
464
  }>;
458
465
  height?: number;
459
466
  width?: number;
460
467
  type: "single" | "multiple";
461
- onChange?: (result: Array<{
462
- id: string;
463
- [key: string]: any;
464
- }>) => void;
468
+ onChange?: (result: Array<CheckboxOption>) => void;
465
469
  position?: "left" | "right";
466
470
  avatarEnabled?: boolean;
467
471
  shape?: "circle" | "square";
@@ -596,7 +600,7 @@ interface Props$5 {
596
600
  }>;
597
601
  onChange?: (option: {
598
602
  id: string;
599
- icon: any;
603
+ icon: react__default.ReactElement;
600
604
  }) => void;
601
605
  }
602
606
 
@@ -622,7 +626,7 @@ declare const TagSelector: (props: Props$2) => react_jsx_runtime.JSX.Element;
622
626
 
623
627
  interface Props$2 {
624
628
  type?: "multiple" | "single";
625
- style?: any;
629
+ style?: CSSProperties;
626
630
  options: Array<OptionProps>;
627
631
  optionsSelected?: Array<OptionProps>;
628
632
  onChange?: (selection: Array<OptionProps>) => void;
@@ -727,10 +731,10 @@ interface LocationFormProps {
727
731
  type: "location";
728
732
  design?: "primary" | "secondary" | "third";
729
733
  placeholder?: string;
730
- defaultLocation?: LocationProps;
734
+ defaultLocation?: LocationProps$1;
731
735
  isLoaded: boolean;
732
736
  onSubmit: (result: {
733
- data?: LocationProps;
737
+ data?: LocationProps$1;
734
738
  error?: string;
735
739
  }) => void;
736
740
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adoptaunabuelo/react-components",
3
- "version": "0.3.141",
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,
@@ -59,17 +59,17 @@
59
59
  "styled-media-query": "^2.1.2"
60
60
  },
61
61
  "devDependencies": {
62
- "@chromatic-com/storybook": "^4.1.3",
62
+ "@chromatic-com/storybook": "^5.0.0",
63
63
  "@rollup/plugin-commonjs": "^29.0.0",
64
64
  "@rollup/plugin-json": "^6.1.0",
65
65
  "@rollup/plugin-node-resolve": "^16.0.3",
66
66
  "@rollup/plugin-replace": "^6.0.3",
67
67
  "@rollup/plugin-typescript": "^8.5.0",
68
- "@storybook/addon-a11y": "^10.1.5",
69
- "@storybook/addon-docs": "^10.1.5",
70
- "@storybook/addon-links": "^10.1.5",
71
- "@storybook/addon-onboarding": "^10.1.5",
72
- "@storybook/nextjs": "^10.1.5",
68
+ "@storybook/addon-a11y": "^10.2.0",
69
+ "@storybook/addon-docs": "^10.2.0",
70
+ "@storybook/addon-links": "^10.2.0",
71
+ "@storybook/addon-onboarding": "^10.2.0",
72
+ "@storybook/nextjs": "^10.2.0",
73
73
  "@svgr/rollup": "^8.1.0",
74
74
  "@types/draftjs-to-html": "^0.8.4",
75
75
  "@types/google-libphonenumber": "^7.4.30",
@@ -84,7 +84,7 @@
84
84
  "ajv": "^8.17.1",
85
85
  "eslint": "^9.39.1",
86
86
  "eslint-config-next": "^16.0.8",
87
- "eslint-plugin-storybook": "^10.1.5",
87
+ "eslint-plugin-storybook": "^10.2.0",
88
88
  "rollup": "^2.77.2",
89
89
  "rollup-plugin-dts": "^6.3.0",
90
90
  "rollup-plugin-import-css": "^4.1.2",
@@ -93,7 +93,8 @@
93
93
  "rollup-plugin-styles": "^4.0.0",
94
94
  "rollup-plugin-svg": "^2.0.0",
95
95
  "rollup-plugin-terser": "^7.0.2",
96
- "storybook": "^10.1.5",
96
+ "rollup-plugin-typescript-paths": "^1.5.0",
97
+ "storybook": "^10.2.0",
97
98
  "typescript": "^5"
98
99
  },
99
100
  "overrides": {