Skip to content

Commit

Permalink
Merge pull request #68 from solved-ac/release/v0.6.1
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
shiftpsh authored Nov 27, 2023
2 parents 844f1a0 + d428ab6 commit 9c1aba2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions example/src/stories/Tab/Tab.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ export default {
control: 'color',
description: 'The accent color of the tab',
},
accentHintColor: {
control: 'color',
description: 'The accent hint color of the tab',
},
as: {
control: { type: 'select', options: ['div', 'span', 'button', 'a'] },
description: 'The element to render the item as',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@solved-ac/ui-react",
"version": "0.6.0",
"version": "0.6.1",
"description": "React component library used by solved.ac",
"author": "shiftpsh",
"license": "MIT",
Expand Down
6 changes: 5 additions & 1 deletion src/components/$Tab/Tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const { vars, v, styles } = cssVariables(
{
...transparentHoverTemplate,
accentColor: (theme) => theme.color.background.table.header,
accentHintColor: (theme) => 'transparent',
},
'tab'
)
Expand Down Expand Up @@ -40,7 +41,7 @@ const TabContainer = styled.button<TabContainerProps>`
text-align: center;
user-select: none;
border: none;
border-bottom: 2px solid transparent;
border-bottom: 2px solid ${v.accentHintColor};
transition: background-color 0.3s ease, color 0.3s ease,
border-color 0.3s ease;
background: ${v.backgroundColor};
Expand All @@ -61,6 +62,7 @@ export interface TabProps {
backgroundColor?: string
hoverColor?: string
accentColor?: string
accentHintColor?: string
}

export const Tab: PC<'a', TabProps> = forwardRefWithGenerics(
Expand All @@ -73,6 +75,7 @@ export const Tab: PC<'a', TabProps> = forwardRefWithGenerics(
disabled = false,
hoverColor,
accentColor,
accentHintColor,
style,
as = 'a',
...rest
Expand Down Expand Up @@ -102,6 +105,7 @@ export const Tab: PC<'a', TabProps> = forwardRefWithGenerics(
computedHoverColor &&
readableColor(computedHoverColor, solvedTheme),
[vars.accentColor]: computedAccentColor,
[vars.accentHintColor]: accentHintColor,
...style,
}}
{...rest}
Expand Down

0 comments on commit 9c1aba2

Please sign in to comment.