@peculiar/react-components 0.0.2-alpha.268 → 0.0.2-alpha.272

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 (56) hide show
  1. package/dist/cjs/Autocomplete/autocomplete.js +23 -4
  2. package/dist/cjs/Autocomplete/autocomplete.js.map +1 -1
  3. package/dist/cjs/Chip/chip.js +20 -2
  4. package/dist/cjs/Chip/chip.js.map +1 -1
  5. package/dist/cjs/hooks/use_autocomplete.js +1 -0
  6. package/dist/cjs/hooks/use_autocomplete.js.map +1 -1
  7. package/dist/cjs/styles/colors/additional.js +0 -1
  8. package/dist/cjs/styles/colors/additional.js.map +1 -1
  9. package/dist/cjs/styles/colors/attention.js +24 -0
  10. package/dist/cjs/styles/colors/attention.js.map +1 -0
  11. package/dist/cjs/styles/colors/index.js +4 -1
  12. package/dist/cjs/styles/colors/index.js.map +1 -1
  13. package/dist/cjs/styles/default_theme.js +1 -1
  14. package/dist/cjs/styles/default_theme.js.map +1 -1
  15. package/dist/cjs/styles/utils.js +3 -2
  16. package/dist/cjs/styles/utils.js.map +1 -1
  17. package/dist/esm/Autocomplete/autocomplete.js +24 -5
  18. package/dist/esm/Autocomplete/autocomplete.js.map +1 -1
  19. package/dist/esm/Chip/chip.js +20 -2
  20. package/dist/esm/Chip/chip.js.map +1 -1
  21. package/dist/esm/hooks/use_autocomplete.js +1 -0
  22. package/dist/esm/hooks/use_autocomplete.js.map +1 -1
  23. package/dist/esm/styles/colors/additional.js +0 -1
  24. package/dist/esm/styles/colors/additional.js.map +1 -1
  25. package/dist/esm/styles/colors/attention.js +20 -0
  26. package/dist/esm/styles/colors/attention.js.map +1 -0
  27. package/dist/esm/styles/colors/index.js +1 -0
  28. package/dist/esm/styles/colors/index.js.map +1 -1
  29. package/dist/esm/styles/default_theme.js +2 -2
  30. package/dist/esm/styles/default_theme.js.map +1 -1
  31. package/dist/esm/styles/utils.js +4 -3
  32. package/dist/esm/styles/utils.js.map +1 -1
  33. package/dist/esnext/Autocomplete/autocomplete.js +24 -5
  34. package/dist/esnext/Autocomplete/autocomplete.js.map +1 -1
  35. package/dist/esnext/Chip/chip.js +20 -2
  36. package/dist/esnext/Chip/chip.js.map +1 -1
  37. package/dist/esnext/hooks/use_autocomplete.js +1 -0
  38. package/dist/esnext/hooks/use_autocomplete.js.map +1 -1
  39. package/dist/esnext/styles/colors/additional.js +0 -1
  40. package/dist/esnext/styles/colors/additional.js.map +1 -1
  41. package/dist/esnext/styles/colors/attention.js +19 -0
  42. package/dist/esnext/styles/colors/attention.js.map +1 -0
  43. package/dist/esnext/styles/colors/index.js +1 -0
  44. package/dist/esnext/styles/colors/index.js.map +1 -1
  45. package/dist/esnext/styles/default_theme.js +7 -3
  46. package/dist/esnext/styles/default_theme.js.map +1 -1
  47. package/dist/esnext/styles/utils.js +3 -1
  48. package/dist/esnext/styles/utils.js.map +1 -1
  49. package/dist/types/Autocomplete/autocomplete.d.ts +16 -2
  50. package/dist/types/Chip/chip.d.ts +14 -0
  51. package/dist/types/hooks/use_autocomplete.d.ts +4 -3
  52. package/dist/types/styles/colors/additional.d.ts +0 -1
  53. package/dist/types/styles/colors/attention.d.ts +26 -0
  54. package/dist/types/styles/colors/index.d.ts +1 -0
  55. package/dist/types/styles/types.d.ts +1 -1
  56. package/package.json +3 -3
@@ -8,7 +8,7 @@ export declare type AutocompleteRenderGroupParams = {
8
8
  group: string;
9
9
  children?: React.ReactNode;
10
10
  };
11
- export declare type AutocompleteProps<T, Multiple extends boolean | undefined> = UseAutocompleteProps<T, Multiple> & {
11
+ export declare type AutocompleteProps<T, Multiple extends boolean | undefined = undefined> = UseAutocompleteProps<T, Multiple> & {
12
12
  /**
13
13
  * The short hint displayed in the `input` before the user enters a value.
14
14
  */
@@ -43,6 +43,14 @@ export declare type AutocompleteProps<T, Multiple extends boolean | undefined> =
43
43
  * If `true`, the `input` element is required.
44
44
  */
45
45
  required?: boolean;
46
+ /**
47
+ * Text to display when in the create button element.
48
+ */
49
+ createOptionText?: string;
50
+ /**
51
+ * If `true`, the create button element will be shown.
52
+ */
53
+ allowCreateOption?: boolean;
46
54
  /**
47
55
  * Render the root element.
48
56
  */
@@ -55,11 +63,15 @@ export declare type AutocompleteProps<T, Multiple extends boolean | undefined> =
55
63
  * The label to display when the tags are truncated (`limitTags`).
56
64
  */
57
65
  getLimitTagsText?: (more: number) => string;
66
+ /**
67
+ * Callback fired when the create button clicked.
68
+ */
69
+ onCreate?: (event: React.SyntheticEvent, value: string) => void;
58
70
  };
59
71
  /**
60
72
  *
61
73
  */
62
- export declare function Autocomplete<T, Multiple extends boolean | undefined>(props: AutocompleteProps<T, Multiple>): JSX.Element;
74
+ export declare function Autocomplete<T, Multiple extends boolean | undefined = undefined>(props: AutocompleteProps<T, Multiple>): JSX.Element;
63
75
  export declare namespace Autocomplete {
64
76
  var defaultProps: {
65
77
  disableSearch: boolean;
@@ -68,5 +80,7 @@ export declare namespace Autocomplete {
68
80
  loadingText: string;
69
81
  limitTags: number;
70
82
  required: boolean;
83
+ allowCreateOption: boolean;
84
+ createOptionText: string;
71
85
  };
72
86
  }
@@ -1,4 +1,7 @@
1
1
  import * as React from 'react';
2
+ /**
3
+ * Types.
4
+ */
2
5
  declare type BaseProps = {
3
6
  /**
4
7
  * The content of the component.
@@ -24,6 +27,14 @@ declare type BaseProps = {
24
27
  * The className of the component.
25
28
  */
26
29
  className?: string;
30
+ /**
31
+ * Element placed before the children.
32
+ */
33
+ startContent?: React.ReactElement;
34
+ /**
35
+ * The component used for the root node.
36
+ */
37
+ component?: React.ElementType;
27
38
  /**
28
39
  * Callback function fired when the delete icon is clicked. If set, the delete icon will be shown.
29
40
  */
@@ -34,5 +45,8 @@ declare type BaseProps = {
34
45
  onClick?: React.MouseEventHandler<HTMLElement>;
35
46
  'data-testid'?: string;
36
47
  };
48
+ /**
49
+ *
50
+ */
37
51
  export declare const Chip: React.ForwardRefExoticComponent<BaseProps & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
38
52
  export {};
@@ -14,7 +14,7 @@ export declare type AutocompleteGroupedOption<T> = {
14
14
  group: string;
15
15
  options: T[];
16
16
  };
17
- export declare type UseAutocompleteProps<T, Multiple extends boolean | undefined> = {
17
+ export declare type UseAutocompleteProps<T, Multiple extends boolean | undefined = undefined> = {
18
18
  /**
19
19
  * This prop is used to help implement the accessibility logic.
20
20
  * If you don't provide an id it will fall back to a randomly generated one.
@@ -69,9 +69,10 @@ export declare type UseAutocompleteProps<T, Multiple extends boolean | undefined
69
69
  */
70
70
  onInputChange?: (event: React.SyntheticEvent, value: string) => void;
71
71
  };
72
- export declare type UseAutocompleteReturnType<T, Multiple extends boolean | undefined> = {
72
+ export declare type UseAutocompleteReturnType<T, Multiple extends boolean | undefined = undefined> = {
73
73
  groupedOptions: T[] | AutocompleteGroupedOption<T>[];
74
74
  value: AutocompleteValue<T, Multiple>;
75
+ searchValue: string;
75
76
  popupOpen: boolean;
76
77
  id: string;
77
78
  getOptionProps: (option: T, index: number) => React.HTMLAttributes<HTMLLIElement>;
@@ -87,4 +88,4 @@ export declare type UseAutocompleteReturnType<T, Multiple extends boolean | unde
87
88
  };
88
89
  getOptionLabel?: (option: T) => string;
89
90
  };
90
- export declare function useAutocomplete<T, Multiple extends boolean | undefined>(props: UseAutocompleteProps<T, Multiple>): UseAutocompleteReturnType<T, Multiple>;
91
+ export declare function useAutocomplete<T, Multiple extends boolean | undefined = undefined>(props: UseAutocompleteProps<T, Multiple>): UseAutocompleteReturnType<T, Multiple>;
@@ -1,6 +1,5 @@
1
1
  export declare const additional: {
2
2
  success: string;
3
- attention: string;
4
3
  'extra-1': string;
5
4
  'extra-2': string;
6
5
  };
@@ -0,0 +1,26 @@
1
+ export declare const generateAttentionColors: (hex?: string) => {
2
+ 'attention-tint-5': string;
3
+ 'attention-tint-4': string;
4
+ 'attention-tint-3': string;
5
+ 'attention-tint-2': string;
6
+ 'attention-tint-1': string;
7
+ attention: string;
8
+ 'attention-shade-1': string;
9
+ 'attention-shade-2': string;
10
+ 'attention-shade-3': string;
11
+ 'attention-shade-4': string;
12
+ 'attention-shade-5': string;
13
+ };
14
+ export declare const attention: {
15
+ 'attention-tint-5': string;
16
+ 'attention-tint-4': string;
17
+ 'attention-tint-3': string;
18
+ 'attention-tint-2': string;
19
+ 'attention-tint-1': string;
20
+ attention: string;
21
+ 'attention-shade-1': string;
22
+ 'attention-shade-2': string;
23
+ 'attention-shade-3': string;
24
+ 'attention-shade-4': string;
25
+ 'attention-shade-5': string;
26
+ };
@@ -2,4 +2,5 @@ export { grayscale } from './grayscale';
2
2
  export { primary, generatePrimaryColors } from './primary';
3
3
  export { secondary, generateSecondaryColors } from './secondary';
4
4
  export { wrong, generateWrongColors } from './wrong';
5
+ export { attention, generateAttentionColors } from './attention';
5
6
  export { additional } from './additional';
@@ -1,4 +1,4 @@
1
- export declare type ColorType = ('primary-tint-5' | 'primary-tint-4' | 'primary-tint-3' | 'primary-tint-2' | 'primary-tint-1' | 'primary' | 'primary-shade-1' | 'primary-shade-2' | 'primary-shade-3' | 'primary-shade-4' | 'primary-shade-5' | 'secondary-tint-5' | 'secondary-tint-4' | 'secondary-tint-3' | 'secondary-tint-2' | 'secondary-tint-1' | 'secondary' | 'secondary-shade-1' | 'secondary-shade-2' | 'secondary-shade-3' | 'secondary-shade-4' | 'secondary-shade-5' | 'wrong-tint-5' | 'wrong-tint-4' | 'wrong-tint-3' | 'wrong-tint-2' | 'wrong-tint-1' | 'wrong' | 'wrong-shade-1' | 'wrong-shade-2' | 'wrong-shade-3' | 'wrong-shade-4' | 'wrong-shade-5' | 'success' | 'attention' | 'extra-1' | 'extra-2' | 'black' | 'gray-10' | 'gray-9' | 'gray-8' | 'gray-7' | 'gray-6' | 'gray-5' | 'gray-4' | 'gray-3' | 'gray-2' | 'gray-1' | 'white' | 'primary-contrast' | 'secondary-contrast' | 'wrong-contrast');
1
+ export declare type ColorType = ('primary-tint-5' | 'primary-tint-4' | 'primary-tint-3' | 'primary-tint-2' | 'primary-tint-1' | 'primary' | 'primary-shade-1' | 'primary-shade-2' | 'primary-shade-3' | 'primary-shade-4' | 'primary-shade-5' | 'primary-contrast' | 'secondary-tint-5' | 'secondary-tint-4' | 'secondary-tint-3' | 'secondary-tint-2' | 'secondary-tint-1' | 'secondary' | 'secondary-shade-1' | 'secondary-shade-2' | 'secondary-shade-3' | 'secondary-shade-4' | 'secondary-shade-5' | 'secondary-contrast' | 'wrong-tint-5' | 'wrong-tint-4' | 'wrong-tint-3' | 'wrong-tint-2' | 'wrong-tint-1' | 'wrong' | 'wrong-shade-1' | 'wrong-shade-2' | 'wrong-shade-3' | 'wrong-shade-4' | 'wrong-shade-5' | 'wrong-contrast' | 'attention-tint-5' | 'attention-tint-4' | 'attention-tint-3' | 'attention-tint-2' | 'attention-tint-1' | 'attention' | 'attention-shade-1' | 'attention-shade-2' | 'attention-shade-3' | 'attention-shade-4' | 'attention-shade-5' | 'black' | 'gray-10' | 'gray-9' | 'gray-8' | 'gray-7' | 'gray-6' | 'gray-5' | 'gray-4' | 'gray-3' | 'gray-2' | 'gray-1' | 'white' | 'success' | 'extra-1' | 'extra-2');
2
2
  export declare type ShadowType = ('light-low' | 'light-medium' | 'light-hight' | 'dark-medium' | 'dark-hight');
3
3
  export declare type TypographyPropertiesType = {
4
4
  weight: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@peculiar/react-components",
3
3
  "private": false,
4
- "version": "0.0.2-alpha.268+12499cf",
4
+ "version": "0.0.2-alpha.272+5f0f16a",
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": [
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "@emotion/core": "^10.1.1",
43
43
  "@emotion/css": "^11.7.1",
44
- "@peculiar/color": "^0.0.2-alpha.268+12499cf",
44
+ "@peculiar/color": "^0.0.2-alpha.272+5f0f16a",
45
45
  "@popperjs/core": "^2.11.2",
46
46
  "@types/flat": "^5.0.2",
47
47
  "@types/react-transition-group": "^4.4.4",
@@ -84,5 +84,5 @@
84
84
  "node": ">=12.x"
85
85
  },
86
86
  "license": "MIT",
87
- "gitHead": "12499cf9659fc2b9ef6d29296a24c2b5876c47fc"
87
+ "gitHead": "5f0f16a50e6f2513a902ccae1fb1e3fa25c6d5a4"
88
88
  }