@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.
- package/.turbo/turbo-build.log +16 -16
- package/CHANGELOG.md +13 -0
- package/dist/esm/v3/index.js +1385 -2
- package/dist/esm/v3/index.js.map +1 -1
- package/dist/v3/index.d.mts +14 -2
- package/dist/v3/index.d.ts +14 -2
- package/dist/v3/index.js +1391 -2
- package/dist/v3/index.js.map +1 -1
- package/package.json +3 -3
- package/src/v3/Common/ComboboxItem.tsx +1 -0
- package/src/v3/Common/ComboboxStyles.tsx +28 -0
- package/src/v3/Common/SelectItem.tsx +5 -1
- package/src/v3/Common/SelectStyles.tsx +5 -0
- package/src/v3/ModalStories.stories.tsx +6 -6
- package/src/v3/MultiCombobox.stories.tsx +1 -1
- package/src/v3/MultiCombobox.tsx +3 -1
- package/src/v3/MultiSearchableSelect.stories.tsx +1 -1
- package/src/v3/MultiSearchableSelect.tsx +3 -1
- package/src/v3/MultiSelect.stories.tsx +53 -53
- package/src/v3/MultiSelect.tsx +3 -222
- package/src/v3/SingleCombobox.stories.tsx +1 -1
- package/src/v3/SingleCombobox.tsx +3 -1
- package/src/v3/SingleSearchableSelect.stories.tsx +1 -1
- package/src/v3/SingleSearchableSelect.tsx +3 -1
- package/src/v3/SingleSelect.stories.tsx +20 -1
- package/src/v3/SingleSelect.tsx +3 -1
|
@@ -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: () => (
|
package/src/v3/SingleSelect.tsx
CHANGED
|
@@ -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
|
|
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
|
>
|