@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.
@@ -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: () => (
@@ -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)