Skip to content

Commit

Permalink
⬆️ Bump to v1.5.1 (stable)
Browse files Browse the repository at this point in the history
  • Loading branch information
yashsehgal committed Jan 20, 2024
1 parent 9bef944 commit 4af1cff
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "craftbook",
"private": false,
"version": "1.5.0",
"version": "1.5.1",
"author": "Yash Sehgal <[email protected]>",
"type": "module",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion src/components/tab-menu/tab-menu.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ export const TabMenuDefaultWithStretch: Story = {
options: ['Timeline', 'Members', 'Inititives', 'Calendar'],
stretch: true,
},
};
};
15 changes: 11 additions & 4 deletions src/components/tab-menu/tab-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,26 @@ interface TabMenuOptionProps
}

const TabMenu = forwardRef<HTMLDivElement, TabMenuProps>(
({ className, options, currentOption = '', stretch = false, ...props }, ref) => {
(
{ className, options, currentOption = '', stretch = false, ...props },
ref,
) => {
const [selectedOption, setSelectedOption] = useState<string>(
currentOption || options[0],
);

return (
<Box className={cn("border-b", stretch && "flex flex-row items-center justify-center")}>
<Box
className={cn(
'border-b',
stretch && 'flex flex-row items-center justify-center',
)}>
<Grid
ref={ref}
className={cn('w-fit', className)}
cols={options.length}
alignItems="center"
justifyContent='center'
justifyContent="center"
{...props}>
{options.map((option, index) => {
return (
Expand Down Expand Up @@ -58,7 +65,7 @@ const TabMenuOption = forwardRef<HTMLButtonElement, TabMenuOptionProps>(
'tab-menu-option px-3 py-1.5 transition-all w-fit',
!isSelected && 'hover:border-b-2 hover:border-black/10',
isSelected &&
'border-b-2 border-b-black drop-shadow-lg before:outline-none',
'border-b-2 border-b-black drop-shadow-lg before:outline-none',
className,
)}
aria-label={label}
Expand Down

0 comments on commit 4af1cff

Please sign in to comment.