@peculiar/react-components 0.4.9 → 0.5.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.
Files changed (85) hide show
  1. package/dist/cjs/Avatar/avatar.js +9 -2
  2. package/dist/cjs/Avatar/avatar.js.map +1 -1
  3. package/dist/cjs/Backdrop/backdrop.js +4 -1
  4. package/dist/cjs/Backdrop/backdrop.js.map +1 -1
  5. package/dist/cjs/Box/box.js +4 -1
  6. package/dist/cjs/Box/box.js.map +1 -1
  7. package/dist/cjs/Checkbox/checkbox.js +2 -2
  8. package/dist/cjs/Checkbox/checkbox.js.map +1 -1
  9. package/dist/cjs/Chip/chip.js +64 -36
  10. package/dist/cjs/Chip/chip.js.map +1 -1
  11. package/dist/cjs/Dialog/dialog.js +2 -1
  12. package/dist/cjs/Dialog/dialog.js.map +1 -1
  13. package/dist/cjs/LinearProgress/linear_progress.js +1 -1
  14. package/dist/cjs/LinearProgress/linear_progress.js.map +1 -1
  15. package/dist/cjs/Popper/popper.js +12 -1
  16. package/dist/cjs/Popper/popper.js.map +1 -1
  17. package/dist/cjs/Radio/radio.js +1 -1
  18. package/dist/cjs/Radio/radio.js.map +1 -1
  19. package/dist/cjs/Skeleton/skeleton.js +2 -1
  20. package/dist/cjs/Skeleton/skeleton.js.map +1 -1
  21. package/dist/cjs/Tabs/tab.js +1 -1
  22. package/dist/cjs/Tabs/tab.js.map +1 -1
  23. package/dist/cjs/Tooltip/tooltip.js +4 -1
  24. package/dist/cjs/Tooltip/tooltip.js.map +1 -1
  25. package/dist/cjs/Typography/typography.js +2 -2
  26. package/dist/cjs/Typography/typography.js.map +1 -1
  27. package/dist/esm/Avatar/avatar.js +9 -2
  28. package/dist/esm/Avatar/avatar.js.map +1 -1
  29. package/dist/esm/Backdrop/backdrop.js +4 -1
  30. package/dist/esm/Backdrop/backdrop.js.map +1 -1
  31. package/dist/esm/Box/box.js +4 -1
  32. package/dist/esm/Box/box.js.map +1 -1
  33. package/dist/esm/Checkbox/checkbox.js +2 -2
  34. package/dist/esm/Checkbox/checkbox.js.map +1 -1
  35. package/dist/esm/Chip/chip.js +64 -36
  36. package/dist/esm/Chip/chip.js.map +1 -1
  37. package/dist/esm/Dialog/dialog.js +2 -1
  38. package/dist/esm/Dialog/dialog.js.map +1 -1
  39. package/dist/esm/LinearProgress/linear_progress.js +1 -1
  40. package/dist/esm/LinearProgress/linear_progress.js.map +1 -1
  41. package/dist/esm/Popper/popper.js +12 -1
  42. package/dist/esm/Popper/popper.js.map +1 -1
  43. package/dist/esm/Radio/radio.js +1 -1
  44. package/dist/esm/Radio/radio.js.map +1 -1
  45. package/dist/esm/Skeleton/skeleton.js +2 -1
  46. package/dist/esm/Skeleton/skeleton.js.map +1 -1
  47. package/dist/esm/Tabs/tab.js +1 -1
  48. package/dist/esm/Tabs/tab.js.map +1 -1
  49. package/dist/esm/Tooltip/tooltip.js +4 -1
  50. package/dist/esm/Tooltip/tooltip.js.map +1 -1
  51. package/dist/esm/Typography/typography.js +2 -2
  52. package/dist/esm/Typography/typography.js.map +1 -1
  53. package/dist/esnext/Avatar/avatar.js +9 -2
  54. package/dist/esnext/Avatar/avatar.js.map +1 -1
  55. package/dist/esnext/Backdrop/backdrop.js +4 -1
  56. package/dist/esnext/Backdrop/backdrop.js.map +1 -1
  57. package/dist/esnext/Box/box.js +4 -1
  58. package/dist/esnext/Box/box.js.map +1 -1
  59. package/dist/esnext/Checkbox/checkbox.js +2 -2
  60. package/dist/esnext/Checkbox/checkbox.js.map +1 -1
  61. package/dist/esnext/Chip/chip.js +64 -36
  62. package/dist/esnext/Chip/chip.js.map +1 -1
  63. package/dist/esnext/Dialog/dialog.js +2 -1
  64. package/dist/esnext/Dialog/dialog.js.map +1 -1
  65. package/dist/esnext/LinearProgress/linear_progress.js +1 -1
  66. package/dist/esnext/LinearProgress/linear_progress.js.map +1 -1
  67. package/dist/esnext/Popper/popper.js +12 -1
  68. package/dist/esnext/Popper/popper.js.map +1 -1
  69. package/dist/esnext/Radio/radio.js +1 -1
  70. package/dist/esnext/Radio/radio.js.map +1 -1
  71. package/dist/esnext/Skeleton/skeleton.js +2 -1
  72. package/dist/esnext/Skeleton/skeleton.js.map +1 -1
  73. package/dist/esnext/Tabs/tab.js +1 -1
  74. package/dist/esnext/Tabs/tab.js.map +1 -1
  75. package/dist/esnext/Tooltip/tooltip.js +4 -1
  76. package/dist/esnext/Tooltip/tooltip.js.map +1 -1
  77. package/dist/esnext/Typography/typography.js +2 -2
  78. package/dist/esnext/Typography/typography.js.map +1 -1
  79. package/dist/types/Avatar/avatar.d.ts +12 -9
  80. package/dist/types/Checkbox/checkbox.d.ts +8 -4
  81. package/dist/types/Chip/chip.d.ts +1 -1
  82. package/dist/types/Dialog/dialog.d.ts +1 -1
  83. package/dist/types/Popper/popper.d.ts +6 -0
  84. package/dist/types/Radio/radio.d.ts +4 -4
  85. package/package.json +2 -2
@@ -1,9 +1,12 @@
1
1
  import * as React from 'react';
2
2
  import { ColorType } from '../styles';
3
- import { Typography } from '../Typography';
4
3
  /**
5
4
  * Types.
6
5
  */
6
+ declare type AvatarInitialsProps = Pick<AvatarOwnProps, 'children' | 'color'> & {
7
+ role: string;
8
+ 'aria-label': string;
9
+ };
7
10
  declare type AvatarOwnProps = {
8
11
  /**
9
12
  * Used to render badge inside the avatar.
@@ -16,10 +19,6 @@ declare type AvatarOwnProps = {
16
19
  * - If `src` is not loaded, the name will be used to create the initials.
17
20
  */
18
21
  name?: string;
19
- /**
20
- * Function to get the initials to display.
21
- */
22
- getInitials?: (name: string) => string;
23
22
  /**
24
23
  * The `src` attribute for the `img` element.
25
24
  */
@@ -28,10 +27,6 @@ declare type AvatarOwnProps = {
28
27
  * The className of the component.
29
28
  */
30
29
  className?: string;
31
- /**
32
- * Props applied to the `Typography` element.
33
- */
34
- typographyProps?: Partial<React.ComponentProps<typeof Typography>>;
35
30
  /**
36
31
  * The size of the avatar.
37
32
  */
@@ -44,6 +39,14 @@ declare type AvatarOwnProps = {
44
39
  * The color of initials text.
45
40
  */
46
41
  color?: ColorType;
42
+ /**
43
+ * Render the initials element.
44
+ */
45
+ renderInitials?: (props: AvatarInitialsProps) => React.ReactNode;
46
+ /**
47
+ * Function to get the initials to display.
48
+ */
49
+ getInitials?: (name: string) => string;
47
50
  };
48
51
  export declare const Avatar: React.ForwardRefExoticComponent<AvatarOwnProps & Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & React.RefAttributes<HTMLDivElement>>;
49
52
  export {};
@@ -7,15 +7,15 @@ declare type CheckboxOwnProps = {
7
7
  * If `true`, the component is checked.
8
8
  */
9
9
  checked?: boolean;
10
+ /**
11
+ * If `true`, the component is checked by default.
12
+ */
13
+ defaultChecked?: boolean;
10
14
  /**
11
15
  * If `true`, the component appears indeterminate. This does not set the native
12
16
  * input element to indeterminate due to inconsistent behavior across browsers.
13
17
  */
14
18
  indeterminate?: boolean;
15
- /**
16
- * If `true`, the component is checked by default.
17
- */
18
- defaultChecked?: boolean;
19
19
  /**
20
20
  * Attributes applied to the input element.
21
21
  */
@@ -36,6 +36,10 @@ declare type CheckboxOwnProps = {
36
36
  * If `true`, the `input` element will be required.
37
37
  */
38
38
  required?: boolean;
39
+ /**
40
+ * Name attribute of the `input` element.
41
+ */
42
+ name?: string;
39
43
  /**
40
44
  * The icon to display when the component is checked.
41
45
  */
@@ -15,7 +15,7 @@ export interface ChipOwnProps {
15
15
  /**
16
16
  * Override the default delete icon element. Shown only if `onDelete` is set.
17
17
  */
18
- deleteIcon?: React.ReactElement;
18
+ deleteIcon?: React.ElementType<any>;
19
19
  /**
20
20
  * The variant to use.
21
21
  */
@@ -40,7 +40,6 @@ declare type DialogOwnProps = {
40
40
  * The size of the dialog.
41
41
  */
42
42
  size?: ('small' | 'medium' | 'large');
43
- 'data-testid'?: string;
44
43
  /**
45
44
  * If `true`, the dialog will be show CircularProgress component and disable all interactions.
46
45
  */
@@ -49,6 +48,7 @@ declare type DialogOwnProps = {
49
48
  * The color of the CircularProgress component.
50
49
  */
51
50
  loadingColor?: CircularProgressProps['color'];
51
+ 'data-testid'?: string;
52
52
  };
53
53
  /**
54
54
  *
@@ -1,5 +1,8 @@
1
1
  import React from 'react';
2
2
  import { PopperProps as PopperReactProps, Modifier } from 'react-popper';
3
+ /**
4
+ * Types.
5
+ */
3
6
  declare type BaseProps = {
4
7
  /**
5
8
  * If `true`, the popper is visible.
@@ -32,5 +35,8 @@ declare type BaseProps = {
32
35
  modifiers?: Modifier<any>[];
33
36
  };
34
37
  declare type PopperProps = BaseProps & Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>;
38
+ /**
39
+ *
40
+ */
35
41
  export declare const Popper: React.FC<PopperProps>;
36
42
  export {};
@@ -31,14 +31,14 @@ declare type RadioOwnProps = {
31
31
  * If `true`, the `input` element will be required.
32
32
  */
33
33
  required?: boolean;
34
- /**
35
- * The icon to display when the component is checked.
36
- */
37
- checkedIcon?: React.ElementType<any>;
38
34
  /**
39
35
  * Name attribute of the `input` element.
40
36
  */
41
37
  name?: string;
38
+ /**
39
+ * The icon to display when the component is checked.
40
+ */
41
+ checkedIcon?: React.ElementType<any>;
42
42
  /**
43
43
  * Callback fired when the state is changed.
44
44
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@peculiar/react-components",
3
3
  "private": false,
4
- "version": "0.4.9",
4
+ "version": "0.5.0",
5
5
  "author": "PeculiarVentures Team",
6
6
  "description": "A simple and customizable component library to build faster, beautiful, and more accessible React applications.",
7
7
  "keywords": [
@@ -82,5 +82,5 @@
82
82
  "node": ">=12.x"
83
83
  },
84
84
  "license": "MIT",
85
- "gitHead": "c30bd2ebd163c1d614aead8ed6cc5a6223b2851e"
85
+ "gitHead": "0c99e7469346719d6c71c39e375f27e31e42a13e"
86
86
  }