Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(TabBar): TabItemの高さ固定をpaddingの積み上げに修正 #4683

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/smarthr-ui/src/components/TabBar/TabBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import { Reel } from '../Layout'
const tabBar = tv({
slots: {
wrapper: ['smarthr-ui-TabBar'],
inner: ['shr-grow', 'shr-m-0.25'],
inner: [
'shr-grow',
// フォーカスリングの表示領域を確保するためのmargin
'shr-m-0.25',
],
},
variants: {
bordered: {
Expand Down
5 changes: 2 additions & 3 deletions packages/smarthr-ui/src/components/TabBar/TabItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import { UnstyledButton } from '../Button'
const tabItem = tv({
base: [
'smarthr-ui-TabItem',
'shr-cursor-pointer shr-appearance-none shr-border-none shr-bg-transparent shr-px-1 shr-py-0 shr-font-bold hover:shr-bg-column hover:shr-text-black [&]:shr-box-border [&]:shr-text-grey',
'shr-h-[43px]', // TODO 高さを指定しないようにする
'shr-cursor-pointer shr-appearance-none shr-border-none shr-bg-transparent shr-px-1 shr-pt-[6.5px] shr-pb-[9.5px] shr-font-bold hover:shr-bg-column hover:shr-text-black [&]:shr-box-border [&]:shr-text-grey',
'disabled:shr-cursor-not-allowed disabled:shr-bg-transparent disabled:shr-text-grey/50',
'aria-selected:shr-border-b-shorthand aria-selected:shr-relative aria-selected:shr-border-b-[3px] aria-selected:shr-border-main aria-selected:shr-text-black',
'aria-selected:shr-h-[40px]', // TODO 高さを指定しないようにする
'aria-selected:shr-pb-[6.5px]',
],
variants: {
isTouchDevice: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ exports[`TabBar should be match snapshot 1`] = `
>
<button
aria-selected={false}
className="shr-box-content shr-inline shr-cursor-auto shr-select-auto shr-appearance-none shr-items-stretch shr-overflow-visible shr-border-none shr-border-current shr-bg-transparent shr-bg-none shr-bg-origin-padding shr-p-0 shr-text-left shr-font-inherit shr-text-inherit focus-visible:shr-focus-indicator smarthr-ui-TabItem shr-cursor-pointer shr-appearance-none shr-border-none shr-bg-transparent shr-px-1 shr-py-0 shr-font-bold hover:shr-bg-column hover:shr-text-black [&]:shr-box-border [&]:shr-text-grey shr-h-[43px] disabled:shr-cursor-not-allowed disabled:shr-bg-transparent disabled:shr-text-grey/50 aria-selected:shr-border-b-shorthand aria-selected:shr-relative aria-selected:shr-border-b-[3px] aria-selected:shr-border-main aria-selected:shr-text-black aria-selected:shr-h-[40px] shr-transition-colors"
className="shr-box-content shr-inline shr-cursor-auto shr-select-auto shr-appearance-none shr-items-stretch shr-overflow-visible shr-border-none shr-border-current shr-bg-transparent shr-bg-none shr-bg-origin-padding shr-p-0 shr-text-left shr-font-inherit shr-text-inherit focus-visible:shr-focus-indicator smarthr-ui-TabItem shr-cursor-pointer shr-appearance-none shr-border-none shr-bg-transparent shr-px-1 shr-pt-[6.5px] shr-pb-[9.5px] shr-font-bold hover:shr-bg-column hover:shr-text-black [&]:shr-box-border [&]:shr-text-grey disabled:shr-cursor-not-allowed disabled:shr-bg-transparent disabled:shr-text-grey/50 aria-selected:shr-border-b-shorthand aria-selected:shr-relative aria-selected:shr-border-b-[3px] aria-selected:shr-border-main aria-selected:shr-text-black aria-selected:shr-pb-[6.5px] shr-transition-colors"
disabled={false}
id="1"
onClick={[Function]}
Expand All @@ -21,7 +21,7 @@ exports[`TabBar should be match snapshot 1`] = `
</button>
<button
aria-selected={true}
className="shr-box-content shr-inline shr-cursor-auto shr-select-auto shr-appearance-none shr-items-stretch shr-overflow-visible shr-border-none shr-border-current shr-bg-transparent shr-bg-none shr-bg-origin-padding shr-p-0 shr-text-left shr-font-inherit shr-text-inherit focus-visible:shr-focus-indicator smarthr-ui-TabItem shr-cursor-pointer shr-appearance-none shr-border-none shr-bg-transparent shr-px-1 shr-py-0 shr-font-bold hover:shr-bg-column hover:shr-text-black [&]:shr-box-border [&]:shr-text-grey shr-h-[43px] disabled:shr-cursor-not-allowed disabled:shr-bg-transparent disabled:shr-text-grey/50 aria-selected:shr-border-b-shorthand aria-selected:shr-relative aria-selected:shr-border-b-[3px] aria-selected:shr-border-main aria-selected:shr-text-black aria-selected:shr-h-[40px] shr-transition-colors"
className="shr-box-content shr-inline shr-cursor-auto shr-select-auto shr-appearance-none shr-items-stretch shr-overflow-visible shr-border-none shr-border-current shr-bg-transparent shr-bg-none shr-bg-origin-padding shr-p-0 shr-text-left shr-font-inherit shr-text-inherit focus-visible:shr-focus-indicator smarthr-ui-TabItem shr-cursor-pointer shr-appearance-none shr-border-none shr-bg-transparent shr-px-1 shr-pt-[6.5px] shr-pb-[9.5px] shr-font-bold hover:shr-bg-column hover:shr-text-black [&]:shr-box-border [&]:shr-text-grey disabled:shr-cursor-not-allowed disabled:shr-bg-transparent disabled:shr-text-grey/50 aria-selected:shr-border-b-shorthand aria-selected:shr-relative aria-selected:shr-border-b-[3px] aria-selected:shr-border-main aria-selected:shr-text-black aria-selected:shr-pb-[6.5px] shr-transition-colors"
disabled={false}
id="2"
onClick={[Function]}
Expand All @@ -32,7 +32,7 @@ exports[`TabBar should be match snapshot 1`] = `
</button>
<button
aria-selected={false}
className="shr-box-content shr-inline shr-cursor-auto shr-select-auto shr-appearance-none shr-items-stretch shr-overflow-visible shr-border-none shr-border-current shr-bg-transparent shr-bg-none shr-bg-origin-padding shr-p-0 shr-text-left shr-font-inherit shr-text-inherit focus-visible:shr-focus-indicator smarthr-ui-TabItem shr-cursor-pointer shr-appearance-none shr-border-none shr-bg-transparent shr-px-1 shr-py-0 shr-font-bold hover:shr-bg-column hover:shr-text-black [&]:shr-box-border [&]:shr-text-grey shr-h-[43px] disabled:shr-cursor-not-allowed disabled:shr-bg-transparent disabled:shr-text-grey/50 aria-selected:shr-border-b-shorthand aria-selected:shr-relative aria-selected:shr-border-b-[3px] aria-selected:shr-border-main aria-selected:shr-text-black aria-selected:shr-h-[40px] shr-transition-colors"
className="shr-box-content shr-inline shr-cursor-auto shr-select-auto shr-appearance-none shr-items-stretch shr-overflow-visible shr-border-none shr-border-current shr-bg-transparent shr-bg-none shr-bg-origin-padding shr-p-0 shr-text-left shr-font-inherit shr-text-inherit focus-visible:shr-focus-indicator smarthr-ui-TabItem shr-cursor-pointer shr-appearance-none shr-border-none shr-bg-transparent shr-px-1 shr-pt-[6.5px] shr-pb-[9.5px] shr-font-bold hover:shr-bg-column hover:shr-text-black [&]:shr-box-border [&]:shr-text-grey disabled:shr-cursor-not-allowed disabled:shr-bg-transparent disabled:shr-text-grey/50 aria-selected:shr-border-b-shorthand aria-selected:shr-relative aria-selected:shr-border-b-[3px] aria-selected:shr-border-main aria-selected:shr-text-black aria-selected:shr-pb-[6.5px] shr-transition-colors"
disabled={true}
id="3"
onClick={[Function]}
Expand Down