@contentful/f36-multiselect 4.19.1-4 → 4.19.1-5

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 (2) hide show
  1. package/dist/index.d.ts +93 -0
  2. package/package.json +1 -1
@@ -0,0 +1,93 @@
1
+ import React from 'react';
2
+ import { CommonProps } from '@contentful/f36-core';
3
+ import { PopoverProps } from '@contentful/f36-popover';
4
+
5
+ interface MultiselectOptionProps {
6
+ label: string;
7
+ value: string;
8
+ itemId: string;
9
+ searchValue?: string;
10
+ onSelectItem: (event: React.ChangeEvent<HTMLInputElement>) => void;
11
+ isChecked?: boolean;
12
+ isDisabled?: boolean;
13
+ }
14
+ declare const MultiselectOption: ({ label, value, itemId, onSelectItem, searchValue, isChecked, isDisabled, ...rest }: MultiselectOptionProps) => JSX.Element;
15
+
16
+ interface MultiselectProps extends CommonProps {
17
+ /** Select Options */
18
+ children?: React.ReactNode;
19
+ /**
20
+ * Set a custom icon for the text input
21
+ */
22
+ startIcon?: React.ReactElement;
23
+ /**
24
+ * Placeholder shown before selecting any elements. Defaults to 'Select one or more items'
25
+ */
26
+ placeholder?: string;
27
+ /**
28
+ * current Selected items, to be shown on the trigger button
29
+ */
30
+ currentSelection?: Array<string>;
31
+ /**
32
+ * Function called whenever the search input value changes
33
+ */
34
+ onSearchValueChange?: (event: React.ChangeEvent<HTMLInputElement>) => void | undefined;
35
+ /**
36
+ * This is the value will be passed to the `placeholder` prop of the input.
37
+ * @default "Search"
38
+ */
39
+ searchPlaceholder?: string;
40
+ /**
41
+ * A message that will be shown when it is not possible to find any option that matches the input value
42
+ * @default "No matches"
43
+ */
44
+ noMatchesMessage?: string;
45
+ /**
46
+ * Use this prop to get a ref to the input element of the component
47
+ */
48
+ searchInputRef?: React.Ref<HTMLInputElement>;
49
+ /**
50
+ * Pass a form name to the search text input
51
+ */
52
+ searchInputName?: string;
53
+ /**
54
+ * Sets the list to show its loading state
55
+ * @default false
56
+ */
57
+ isLoading?: boolean;
58
+ /**
59
+ * Use this prop to get a ref to the toggle button of the component
60
+ */
61
+ toggleRef?: React.Ref<HTMLButtonElement>;
62
+ /**
63
+ * Props to pass to the Popover (Dropdown) component
64
+ */
65
+ popoverProps?: Partial<PopoverProps> & {
66
+ /**
67
+ * It sets the max-height, in pixels, of the list
68
+ * The default value is the height of 5 single line items
69
+ * @default 180
70
+ */
71
+ listMaxHeight?: number;
72
+ /**
73
+ * Use this prop to get a ref to the list of items of the component
74
+ */
75
+ listRef?: React.Ref<HTMLUListElement>;
76
+ };
77
+ /**
78
+ * Function called when the popover loses its focus.
79
+ */
80
+ onBlur?: () => void;
81
+ }
82
+ /**
83
+ * The Multiselect is a component that will allow a user to select multiple items.
84
+ * It has an optional
85
+ */
86
+ declare const Multiselect$1: React.ForwardRefExoticComponent<MultiselectProps & React.RefAttributes<HTMLDivElement>>;
87
+
88
+ declare type CompoundMultiselect = typeof Multiselect$1 & {
89
+ Option: typeof MultiselectOption;
90
+ };
91
+ declare const Multiselect: CompoundMultiselect;
92
+
93
+ export { Multiselect, MultiselectOption, MultiselectOptionProps, MultiselectProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/f36-multiselect",
3
- "version": "4.19.1-4",
3
+ "version": "4.19.1-5",
4
4
  "description": "Forma 36: Multiselect Component",
5
5
  "scripts": {
6
6
  "build": "tsup"