@sproutsocial/seeds-react-menu 1.12.1 → 1.12.2
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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +13 -0
- package/dist/esm/v3/index.js +191 -56
- package/dist/esm/v3/index.js.map +1 -1
- package/dist/v3/index.d.mts +10 -0
- package/dist/v3/index.d.ts +10 -0
- package/dist/v3/index.js +191 -56
- package/dist/v3/index.js.map +1 -1
- package/package.json +9 -9
- package/src/v3/Common/VirtualizedComboboxList.tsx +29 -2
- package/src/v3/Common/sentinels.ts +13 -0
- package/src/v3/MultiCombobox.stories.tsx +34 -0
- package/src/v3/MultiCombobox.tsx +214 -55
- package/src/v3/MultiSearchableSelect.tsx +6 -1
- package/src/v3/MultiSelect.tsx +3 -1
- package/src/v3/SingleCombobox.tsx +7 -1
- package/src/v3/SingleSearchableSelect.tsx +3 -1
- package/src/v3/SingleSelect.stories.tsx +19 -0
- package/src/v3/SingleSelect.tsx +3 -1
|
@@ -37,6 +37,25 @@ export const Basic: Story = {
|
|
|
37
37
|
),
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
+
export const Empty: Story = {
|
|
41
|
+
name: "Empty",
|
|
42
|
+
render: () => (
|
|
43
|
+
<div style={{ width: "300px" }}>
|
|
44
|
+
<FormField label="Pick a book">
|
|
45
|
+
{({ id }) => (
|
|
46
|
+
<SingleSelect
|
|
47
|
+
id={"placeholder"}
|
|
48
|
+
disabled
|
|
49
|
+
data={[]}
|
|
50
|
+
itemToString={() => ""}
|
|
51
|
+
placeholder=""
|
|
52
|
+
/>
|
|
53
|
+
)}
|
|
54
|
+
</FormField>
|
|
55
|
+
</div>
|
|
56
|
+
),
|
|
57
|
+
};
|
|
58
|
+
|
|
40
59
|
export const Disabled: Story = {
|
|
41
60
|
name: "Disabled",
|
|
42
61
|
render: () => (
|
package/src/v3/SingleSelect.tsx
CHANGED
|
@@ -39,6 +39,7 @@ interface SingleSelectBaseProps {
|
|
|
39
39
|
placeholder?: string;
|
|
40
40
|
includePlaceholderItem?: boolean;
|
|
41
41
|
disabled?: boolean;
|
|
42
|
+
"aria-describedby"?: string;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
interface SingleSelectDataProps<T extends DataWithId>
|
|
@@ -80,6 +81,7 @@ export function SingleSelect<T extends DataWithId>(
|
|
|
80
81
|
props: SingleSelectProps<T>
|
|
81
82
|
) {
|
|
82
83
|
const { id, placeholder, includePlaceholderItem } = props;
|
|
84
|
+
const ariaDescribedBy = props["aria-describedby"];
|
|
83
85
|
|
|
84
86
|
const isChildrenMode = "children" in props && props.children != null;
|
|
85
87
|
|
|
@@ -166,7 +168,7 @@ export function SingleSelect<T extends DataWithId>(
|
|
|
166
168
|
onValueChange={handleValueChange}
|
|
167
169
|
id={id}
|
|
168
170
|
>
|
|
169
|
-
<SelectTrigger>
|
|
171
|
+
<SelectTrigger aria-describedby={ariaDescribedBy}>
|
|
170
172
|
<StyledValue placeholder={placeholder}>
|
|
171
173
|
{renderSelection && selectedItem
|
|
172
174
|
? renderSelection(selectedItem)
|