@chayns-components/core 5.4.8-alpha.0 → 5.4.13-alpha.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 (36) hide show
  1. package/lib/cjs/components/radio-button/RadioButton.styles.js +1 -1
  2. package/lib/cjs/components/radio-button/RadioButton.styles.js.map +1 -1
  3. package/lib/cjs/components/search-box/SearchBox.js +69 -20
  4. package/lib/cjs/components/search-box/SearchBox.js.map +1 -1
  5. package/lib/cjs/components/search-box/search-box-body/SearchBoxBody.js +3 -1
  6. package/lib/cjs/components/search-box/search-box-body/SearchBoxBody.js.map +1 -1
  7. package/lib/cjs/components/search-box/search-box-body/SearchBoxBody.styles.js +6 -4
  8. package/lib/cjs/components/search-box/search-box-body/SearchBoxBody.styles.js.map +1 -1
  9. package/lib/cjs/components/search-box/search-box-item/SearchBoxItem.js +3 -1
  10. package/lib/cjs/components/search-box/search-box-item/SearchBoxItem.js.map +1 -1
  11. package/lib/cjs/components/search-box/search-box-item/SearchBoxItem.styles.js +6 -1
  12. package/lib/cjs/components/search-box/search-box-item/SearchBoxItem.styles.js.map +1 -1
  13. package/lib/cjs/utils/searchBox.js +22 -12
  14. package/lib/cjs/utils/searchBox.js.map +1 -1
  15. package/lib/esm/components/radio-button/RadioButton.styles.js +1 -1
  16. package/lib/esm/components/radio-button/RadioButton.styles.js.map +1 -1
  17. package/lib/esm/components/search-box/SearchBox.js +70 -21
  18. package/lib/esm/components/search-box/SearchBox.js.map +1 -1
  19. package/lib/esm/components/search-box/search-box-body/SearchBoxBody.js +3 -1
  20. package/lib/esm/components/search-box/search-box-body/SearchBoxBody.js.map +1 -1
  21. package/lib/esm/components/search-box/search-box-body/SearchBoxBody.styles.js +6 -4
  22. package/lib/esm/components/search-box/search-box-body/SearchBoxBody.styles.js.map +1 -1
  23. package/lib/esm/components/search-box/search-box-item/SearchBoxItem.js +3 -1
  24. package/lib/esm/components/search-box/search-box-item/SearchBoxItem.js.map +1 -1
  25. package/lib/esm/components/search-box/search-box-item/SearchBoxItem.styles.js +6 -1
  26. package/lib/esm/components/search-box/search-box-item/SearchBoxItem.styles.js.map +1 -1
  27. package/lib/esm/utils/searchBox.js +20 -11
  28. package/lib/esm/utils/searchBox.js.map +1 -1
  29. package/lib/types/components/radio-button/RadioButton.styles.d.ts +2 -2
  30. package/lib/types/components/search-box/SearchBox.d.ts +16 -0
  31. package/lib/types/components/search-box/search-box-body/SearchBoxBody.d.ts +1 -0
  32. package/lib/types/components/search-box/search-box-body/SearchBoxBody.styles.d.ts +4 -2
  33. package/lib/types/components/search-box/search-box-item/SearchBoxItem.d.ts +1 -0
  34. package/lib/types/components/search-box/search-box-item/SearchBoxItem.styles.d.ts +6 -2
  35. package/lib/types/utils/searchBox.d.ts +1 -0
  36. package/package.json +2 -2
@@ -20,6 +20,10 @@ export type SearchBoxProps = {
20
20
  * An optional callback function to filter the elements to be displayed
21
21
  */
22
22
  customFilter?: (item: ISearchBoxItem) => boolean;
23
+ /**
24
+ * If true, the custom filter replaces the built-in text search instead of narrowing its results.
25
+ */
26
+ shouldUseCustomFilterOnly?: boolean;
23
27
  /**
24
28
  * The direction in which the dropdown should be displayed. By default, it is displayed below the input.
25
29
  */
@@ -36,6 +40,10 @@ export type SearchBoxProps = {
36
40
  * List of groups with items that can be searched. It is possible to give only one list; if multiple lists are provided, the 'group name' parameter becomes mandatory.
37
41
  */
38
42
  lists: ISearchBoxItems[];
43
+ /**
44
+ * The maximum height of the dropdown body in pixels.
45
+ */
46
+ maxHeight?: number;
39
47
  /**
40
48
  * Function to be executed when the input lost focus.
41
49
  */
@@ -64,6 +72,10 @@ export type SearchBoxProps = {
64
72
  * Control the selected item. If you use this prop, make sure to update it when the user selects an item.
65
73
  */
66
74
  selectedId?: string;
75
+ /**
76
+ * If true, the selected item keeps its original position in the dropdown list.
77
+ */
78
+ shouldKeepSelectedItemPosition?: boolean;
67
79
  /**
68
80
  * If true, the value in the Input is displayed in the list.
69
81
  */
@@ -76,6 +88,10 @@ export type SearchBoxProps = {
76
88
  * Whether the full list of items should be displayed if the input is empty.
77
89
  */
78
90
  shouldShowContentOnEmptyInput?: boolean;
91
+ /**
92
+ * If true, the dropdown items are displayed more compactly.
93
+ */
94
+ shouldShowSmallItems?: boolean;
79
95
  /**
80
96
  * If true, the images of the items are displayed in a round shape.
81
97
  */
@@ -5,6 +5,7 @@ export type SearchBoxBodyProps = {
5
5
  filterButtons?: IFilterButtonItem[];
6
6
  selectedGroups?: string[];
7
7
  height: number;
8
+ maxHeight?: number;
8
9
  onGroupSelect?: (keys: string[]) => void;
9
10
  shouldHideFilterButtons?: boolean;
10
11
  shouldShow: boolean;
@@ -15,14 +15,16 @@ export declare const StyledSearchBoxBodyHeadGroupName: import("styled-components
15
15
  }, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "theme"> & {
16
16
  theme: import("../../color-scheme-provider/ColorSchemeProvider").Theme;
17
17
  }, never>>> & string;
18
- export declare const StyledSearchBoxBodyContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "theme" | "$height" | "$headHeight"> & {
18
+ export declare const StyledSearchBoxBodyContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "theme" | "$maxHeight" | "$height" | "$headHeight"> & {
19
19
  $height: number;
20
20
  $headHeight: number;
21
+ $maxHeight: number;
21
22
  } & {
22
23
  theme: import("../../color-scheme-provider/ColorSchemeProvider").Theme;
23
- }, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "theme" | "$height" | "$headHeight"> & {
24
+ }, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "theme" | "$maxHeight" | "$height" | "$headHeight"> & {
24
25
  $height: number;
25
26
  $headHeight: number;
27
+ $maxHeight: number;
26
28
  } & {
27
29
  theme: import("../../color-scheme-provider/ColorSchemeProvider").Theme;
28
30
  }, never>>> & string;
@@ -5,6 +5,7 @@ export type SearchBoxItemProps = {
5
5
  id: ISearchBoxItem['id'];
6
6
  text: ISearchBoxItem['text'];
7
7
  imageUrl?: ISearchBoxItem['imageUrl'];
8
+ shouldShowSmallItems?: boolean;
8
9
  shouldShowRoundImage?: boolean;
9
10
  groupName?: ISearchBoxItems['groupName'];
10
11
  tabIndex: number;
@@ -12,8 +12,12 @@ export declare const StyledSearchBoxItemImage: import("styled-components/dist/ty
12
12
  } & {
13
13
  theme: import("../../color-scheme-provider/ColorSchemeProvider").Theme;
14
14
  }, never>>> & string;
15
- export declare const StyledSearchBoxItemText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "theme"> & {
15
+ export declare const StyledSearchBoxItemText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "theme" | "$shouldShowSmallItems"> & {
16
+ $shouldShowSmallItems?: boolean;
17
+ } & {
16
18
  theme: import("../../color-scheme-provider/ColorSchemeProvider").Theme;
17
- }, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "theme"> & {
19
+ }, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "theme" | "$shouldShowSmallItems"> & {
20
+ $shouldShowSmallItems?: boolean;
21
+ } & {
18
22
  theme: import("../../color-scheme-provider/ColorSchemeProvider").Theme;
19
23
  }, never>>> & string;
@@ -4,5 +4,6 @@ interface SearchListOptions {
4
4
  items: ISearchBoxItem[];
5
5
  searchString: string;
6
6
  }
7
+ export declare const sortSearchBoxItems: ({ searchString, items }: SearchListOptions) => ISearchBoxItem[];
7
8
  export declare const searchList: ({ searchString, items }: SearchListOptions) => ISearchBoxItem[];
8
9
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chayns-components/core",
3
- "version": "5.4.8-alpha.0",
3
+ "version": "5.4.13-alpha.0",
4
4
  "description": "A set of beautiful React components for developing your own applications with chayns.",
5
5
  "sideEffects": false,
6
6
  "browserslist": [
@@ -88,5 +88,5 @@
88
88
  "publishConfig": {
89
89
  "access": "public"
90
90
  },
91
- "gitHead": "684a9cabab0ea61dbe77d15d7be0f0d0bce98209"
91
+ "gitHead": "d865a29f61b8f875fa7582a2b5fd9023de2dee9f"
92
92
  }