@sproutsocial/seeds-react-menu 1.11.0 → 1.11.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.
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import type { Meta, StoryObj } from "@storybook/react";
3
3
  import { FormField } from "@sproutsocial/seeds-react-form-field";
4
- import SingleSelect from "./SingleSelect";
4
+ import { SingleSelect } from "./SingleSelect";
5
5
  import SelectItem from "./Common/SelectItem";
6
6
  import SelectGroup from "./Common/SelectGroup";
7
7
  import { books, itemToString, renderItem } from "./storyData";
@@ -32,6 +32,25 @@ export const Basic: Story = {
32
32
  ),
33
33
  };
34
34
 
35
+ export const Disabled: Story = {
36
+ name: "Disabled",
37
+ render: () => (
38
+ <div style={{ width: "300px" }}>
39
+ <FormField label="Pick a book">
40
+ {({ id }) => (
41
+ <SingleSelect
42
+ id={id}
43
+ data={books}
44
+ itemToString={itemToString}
45
+ placeholder="Select a book"
46
+ disabled
47
+ />
48
+ )}
49
+ </FormField>
50
+ </div>
51
+ ),
52
+ };
53
+
35
54
  export const IncludePlaceholderItem: Story = {
36
55
  name: "Include placeholder item",
37
56
  render: () => (
@@ -38,6 +38,7 @@ interface SingleSelectBaseProps {
38
38
  id?: string;
39
39
  placeholder?: string;
40
40
  includePlaceholderItem?: boolean;
41
+ disabled?: boolean;
41
42
  }
42
43
 
43
44
  interface SingleSelectDataProps<T extends DataWithId>
@@ -75,7 +76,7 @@ export type SingleSelectProps<T extends DataWithId> =
75
76
 
76
77
  // ─── Component ────────────────────────────────────────────────────────────────
77
78
 
78
- export default function SingleSelect<T extends DataWithId>(
79
+ export function SingleSelect<T extends DataWithId>(
79
80
  props: SingleSelectProps<T>
80
81
  ) {
81
82
  const { id, placeholder, includePlaceholderItem } = props;
@@ -161,6 +162,7 @@ export default function SingleSelect<T extends DataWithId>(
161
162
  <Select.Root
162
163
  items={items}
163
164
  value={value}
165
+ disabled={props.disabled}
164
166
  onValueChange={handleValueChange}
165
167
  id={id}
166
168
  >