Skip to content

Commit

Permalink
Improvements to FileTabs (#312)
Browse files Browse the repository at this point in the history
* Improvements to FileTabs

* Removing unecessessary css

* Improving story example.
  • Loading branch information
gjones authored Jan 18, 2024
1 parent 76cc0d3 commit ff54a39
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/components/FileTabs/FileTabs.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const FileTabs = ({
const [tabs, setTabs] = useState(options);

return (
<div style={{ display: "flex" }}>
<div style={{ display: "flex", height: "4rem" }}>
<FileTabElement icon="home" />
<CUIFileTabs
onReorderTab={() => null}
Expand Down
20 changes: 10 additions & 10 deletions src/components/FileTabs/FileTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,21 +206,16 @@ const TabElement = styled.div<{
max-width: fill-available;
max-width: stretch;
border: none;
cursor: pointer;
height: 100%;
height: -webkit-fill-available;
height: fill-available;
height: stretch;
${({ theme, $active, $preview, $dismissable, $fixedTabElement }) => `
width:${$fixedTabElement ? "auto" : "100%"};
grid-template-columns: 1fr ${
$dismissable ? theme.click.tabs.fileTabs.icon.size.width : ""
};
${
$dismissable
? `
height: 100%;
height: -webkit-fill-available;
height: fill-available;
height: stretch;
`
: ""
}
padding: ${theme.click.tabs.fileTabs.space.y} ${theme.click.tabs.fileTabs.space.x};
gap: ${theme.click.tabs.fileTabs.space.gap};
border-radius: ${theme.click.tabs.fileTabs.radii.all};
Expand Down Expand Up @@ -304,6 +299,11 @@ const TabContentText = styled.span`

const EmptyButton = styled.button`
padding: 0;
${({ theme }) => theme.click.tabs.fileTabs.color.closeButton.background.default};
&:hover {
background: ${({ theme }) =>
theme.click.tabs.fileTabs.color.closeButton.background.hover};
}
`;

const Tab = ({
Expand Down
6 changes: 6 additions & 0 deletions src/styles/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2283,6 +2283,12 @@
"default": string,
"hover": string,
"active": string
},
"closeButton": {
"background": {
"default": string,
"hover": string
}
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/styles/variables.dark.json
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,12 @@
"default": "lch(27.5 0 0 / 0.3)",
"hover": "lch(27.5 0 0 / 0.3)",
"active": "lch(27.5 0 0 / 0.3)"
},
"closeButton": {
"background": {
"default": "rgba(0,0,0,0)",
"hover": "#414141"
}
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/styles/variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -2282,6 +2282,12 @@
"default": "lch(91.6 1.1 266)",
"hover": "lch(91.6 1.1 266)",
"active": "lch(91.6 1.1 266)"
},
"closeButton": {
"background": {
"default": "rgba(0,0,0,0)",
"hover": "#e6e7e9"
}
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/styles/variables.light.json
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,12 @@
"default": "lch(91.6 1.1 266)",
"hover": "lch(91.6 1.1 266)",
"active": "lch(91.6 1.1 266)"
},
"closeButton": {
"background": {
"default": "rgba(0,0,0,0)",
"hover": "#e6e7e9"
}
}
}
}
Expand Down

1 comment on commit ff54a39

@vercel
Copy link

@vercel vercel bot commented on ff54a39 Jan 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

click-ui – ./

click-ui.vercel.app
click-ui-clickhouse.vercel.app
click-ui-git-main-clickhouse.vercel.app

Please sign in to comment.