Skip to content

Commit

Permalink
Merge pull request #31 from scheduleonce/pythons/storybook-fix
Browse files Browse the repository at this point in the history
fix: Single Select dropdown fix in storybook
  • Loading branch information
so-kaushal authored Jul 17, 2024
2 parents 788aa2a + 0b3ff3b commit 5b644e5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@oncehub/ui-react",
"private": false,
"version": "1.4.13",
"version": "1.4.14",
"repository": {
"type": "git",
"url": "https://github.com/scheduleonce/once-ui-react"
Expand Down
49 changes: 24 additions & 25 deletions src/lib/components/select/select.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,31 +53,30 @@ const options: IOption[] = [

const handleSelectionChange = () => {};

const children = () => {
return (
<SelectOptions setQuery={() => {}}>
{options.map((option) => (
<SelectOption
disable={false}
key={option.value}
className={({ active }: { active: boolean }) =>
`tw-relative tw-cursor-default tw-select-none tw-py-2 tw-pl-4 tw-pr-4 ${
active ? 'tw-bg-[#EEEEEE] tw-text-[#333333]' : ''
}`
}
value={option}
>
{({ selected, active }: { selected: boolean; active: boolean }) => (
<div className="tw-flex tw-items-center">
<span className={`tw-block ${selected ? 'tw-font-medium' : 'tw-font-normal'}`}>{option.label}</span>
</div>
)}
</SelectOption>
))}
</SelectOptions>
);
};

const children = (
<SelectOptions setQuery={() => {}}>
{options.map((option) => (
<SelectOption
disable={false}
key={option.value}
className={({ active }: { active: boolean }) =>
`tw-relative tw-cursor-default tw-select-none tw-py-2 tw-pl-4 tw-pr-4 ${
active ? 'tw-bg-[#EEEEEE] tw-text-[#333333]' : ''
}`
}
value={option}
>
{({ selected, active }: { selected: boolean; active: boolean }) => (
<div className="tw-flex tw-items-center">
<span className={`tw-block tw-truncate ${selected ? 'tw-font-medium' : 'tw-font-normal'}`}>
{option.label}
</span>
</div>
)}
</SelectOption>
))}
</SelectOptions>
);
export const WithoutTheme: Story = {
args: {
selected: options[2],
Expand Down

0 comments on commit 5b644e5

Please sign in to comment.