Skip to content

Commit ee54d50

Browse files
committed
FIX STORIES
1 parent f1b9a91 commit ee54d50

File tree

9 files changed

+51
-29
lines changed

9 files changed

+51
-29
lines changed

packages/docs/src/pages/components/Dropdown/DropdownBasicDropdown.mdx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import { Meta } from "@storybook/blocks";
22
import * as DropdownBasicDropdownStories from "./DropdownBasicDropdown.stories";
3+
import basicSelectDo1 from "./assets/basicSelectDo1.png";
4+
import basicSelectDont1 from "./assets/basicSelectDont1.png";
5+
import basicSelectDo2 from "./assets/basicSelectDo2.png";
6+
import basicSelectDont2 from "./assets/basicSelectDont2.png";
7+
import dont1 from "./assets/dont1.png";
8+
import { StorybookLink } from "vibe-storybook-components";
39

410
<Meta of={DropdownBasicDropdownStories} />
511

@@ -86,6 +92,39 @@ The Dropdown component supports multi select option that display as chips. The s
8692

8793
<Canvas of={DropdownBasicDropdownStories.DropdownWithIconOrAvatar} />
8894

95+
## Do's and Don'ts
96+
97+
<ComponentRules
98+
rules={[
99+
{
100+
positive: {
101+
component: <img src={basicSelectDo1} alt="do1" style={{ width: "300px" }} />,
102+
description: "Use the searchable option when having a long list of options."
103+
},
104+
negative: {
105+
component: <img src={basicSelectDont1} alt="dont1" style={{ width: "300px" }} />,
106+
description: <>Use a searchable select when the list is short. Use the select as is.</>
107+
}
108+
},
109+
{
110+
positive: {
111+
component: <img src={basicSelectDo2} alt="do2" style={{ width: "300px" }} />,
112+
description:
113+
"Use the select as a closed component. Users should normally be allowed only to click on the items; search is not recommended, though possible."
114+
},
115+
negative: {
116+
component: <img src={basicSelectDont2} alt="dont2" style={{ width: "300px" }} />,
117+
description: (
118+
<>
119+
Keep the select component in open mode as permanent state. If this is a design requirement consider use the
120+
box mode instead <StorybookLink page="Components/Dropdown">box mode</StorybookLink> instead.
121+
</>
122+
)
123+
}
124+
}
125+
]}
126+
/>
127+
89128
## Use cases and examples
90129

91130
### Searchable dropdown

packages/docs/src/pages/components/Dropdown/DropdownBasicDropdown.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export const Sizes: Story = {
8282
[]
8383
);
8484
return (
85-
<Flex direction="column" gap="medium">
85+
<Flex gap="medium">
8686
<div style={{ width: "300px" }}>
8787
<Dropdown
8888
id="sizes-large"

packages/docs/src/pages/components/Dropdown/DropdownBoxMode.mdx

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { Meta } from "@storybook/blocks";
22
import * as DropdownBoxModeStories from "./DropdownBoxMode.stories";
3+
import boxModeDo from "./assets/boxModeDo.png";
4+
import boxModeDont from "./assets/boxModeDont.png";
35

46
<Meta of={DropdownBoxModeStories} />
57

@@ -64,36 +66,17 @@ The box mode supports multi select option that display as chips. The selected it
6466
rules={[
6567
{
6668
positive: {
67-
component: (
68-
<div style={{ width: "200px", padding: "16px", background: "#f5f5f5" }}>
69-
<div style={{ background: "white", padding: "12px", borderRadius: "8px" }}>
70-
<div style={{ marginBottom: "8px", fontWeight: "bold" }}>Tooltip</div>
71-
<div style={{ marginBottom: "4px" }}>Chip</div>
72-
<div>Button</div>
73-
<div style={{ marginTop: "8px", fontSize: "12px", color: "#666" }}>Helper text</div>
74-
</div>
75-
</div>
76-
),
77-
description: "Use when there's need for a dropdown that displays the list in a persistent, always-open panel."
69+
component: <img src={boxModeDo} alt="do1" style={{ width: "300px" }} />,
70+
description: "Use when there’s a need for a select that displays the list in a persistent, always-open panel."
7871
},
7972
negative: {
80-
component: (
81-
<div style={{ width: "300px", padding: "16px", background: "#f5f5f5" }}>
82-
<div style={{ background: "white", padding: "12px", borderRadius: "8px" }}>
83-
<input
84-
type="text"
85-
placeholder="Search menu"
86-
style={{ width: "100%", padding: "8px", border: "1px solid #ddd", borderRadius: "4px" }}
87-
autoFocus={false}
88-
tabIndex={-1}
89-
/>
90-
<div style={{ marginTop: "8px" }}>Category 1</div>
91-
<div>Option 1</div>
92-
<div>Option 2</div>
93-
</div>
94-
</div>
95-
),
96-
description: "Use when there's need for a searchable menu, for navigation. Use a menu instead"
73+
component: <img src={boxModeDont} alt="dont1" style={{ width: "300px" }} />,
74+
description: (
75+
<>
76+
Use when there's need for a searchable menu, for navigation. Use a{" "}
77+
<StorybookLink page="Components/Menu">menu</StorybookLink> instead
78+
</>
79+
)
9780
}
9881
}
9982
]}
93 KB
Loading
9.06 KB
Loading
89.9 KB
Loading
84.3 KB
Loading
185 KB
Loading
189 KB
Loading

0 commit comments

Comments
 (0)