-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎨 Add design system for Select (#yoginth/eng-26-add-design-system-for…
…-select) Summary: Added a design system for the `Select` component. Highlights: • Created `SelectDesign.tsx` to showcase different `Select` component variations. • Integrated `SelectDesign` into the main design system index. • Demonstrated `Select` with simple, searchable, and icon options. Read more: https://pierre.co/hey/hey/yoginth/eng-26-add-design-system-for-select
- Loading branch information
Yoginth
authored and
Pierre
committed
Sep 29, 2024
1 parent
e30f1dc
commit bdb1bb0
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { Card, CardHeader, Select } from "@hey/ui"; | ||
import type { FC } from "react"; | ||
|
||
const SelectDesign: FC = () => { | ||
const options = [ | ||
{ | ||
htmlLabel: "Simple Label", | ||
label: "Simple Label", | ||
value: "simple-label", | ||
selected: true | ||
}, | ||
{ htmlLabel: <b>HTML Label</b>, label: "HTML Label", value: "html-label" } | ||
]; | ||
|
||
const optionsWithIcon = [ | ||
{ | ||
label: "Option 1", | ||
value: "1", | ||
icon: "https://hey-assets.b-cdn.net/images/app-icon/0.png", | ||
selected: true | ||
}, | ||
{ | ||
label: "Option 2", | ||
value: "2", | ||
icon: "https://hey-assets.b-cdn.net/images/app-icon/2.png" | ||
}, | ||
{ | ||
label: "Option 3", | ||
value: "3", | ||
icon: "https://hey-assets.b-cdn.net/images/app-icon/3.png" | ||
}, | ||
{ | ||
label: "Option 4", | ||
value: "4", | ||
icon: "https://hey-assets.b-cdn.net/images/app-icon/4.png" | ||
} | ||
]; | ||
|
||
return ( | ||
<Card> | ||
<CardHeader title="Select" /> | ||
<div className="m-5 flex flex-col items-start gap-5"> | ||
<div className="w-2/6"> | ||
<div className="label">Simple Select</div> | ||
<Select onChange={() => {}} options={options} /> | ||
</div> | ||
<div className="w-2/6"> | ||
<div className="label">Select with Search</div> | ||
<Select onChange={() => {}} options={options} showSearch /> | ||
</div> | ||
<div className="w-2/6"> | ||
<div className="label">Select with Icon</div> | ||
<Select | ||
onChange={() => {}} | ||
options={optionsWithIcon} | ||
iconClassName="size-4" | ||
/> | ||
</div> | ||
</div> | ||
</Card> | ||
); | ||
}; | ||
|
||
export default SelectDesign; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters