Skip to content

Commit

Permalink
update lang selector
Browse files Browse the repository at this point in the history
  • Loading branch information
glassonion1 committed Nov 3, 2024
1 parent 60fb625 commit bcdaeb4
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 17 deletions.
2 changes: 1 addition & 1 deletion examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"preview": "vite preview"
},
"dependencies": {
"@sakura-ui/core": "^0.2.11",
"@sakura-ui/core": "^0.2.14",
"@sakura-ui/forms": "^0.2.1",
"@sakura-ui/tailwind-theme-plugin": "^0.2.1",
"react": "^18.3.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sakura-ui/core",
"version": "0.2.11",
"version": "0.2.14",
"description": "",
"keywords": [
"react",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/components/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export const Icon = React.forwardRef<HTMLElement, IconProps>((props, ref) => {
font-light
inline-block
leading-4
whitespace-nowrap
align-middle
whitespace-nowrap
`

return (
Expand Down
17 changes: 11 additions & 6 deletions packages/core/src/components/LangSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ export const LangSelector = ({
`

const styleButton = `
flex
w-fit
items-center
sm:gap-1
sm:py-3
text-base
leading-4
leading-snug
${styleClickable}
${styleFocusRoundedWithBg}
${styleAnchorName}
Expand Down Expand Up @@ -90,7 +91,11 @@ export const LangSelector = ({
fucus(index)
break
case 'Tab':
menuRef.current?.hidePopover()
index = e.shiftKey ? currentIndex - 1 : currentIndex + 1
setCurrentIndex(index)
if (index === -1 || index === langs.length) {
menuRef.current?.hidePopover()
}
break
}
}
Expand All @@ -111,11 +116,11 @@ export const LangSelector = ({
language
</Icon>
<span
className={cx('hidden sm:inline-block mb-0.5', styleHoverUnderline)}
className={cx('hidden sm:mx-1 sm:inline-block', styleHoverUnderline)}
>
Language
</span>
<IconLanguageMobile className="sm:hidden" />
<IconLanguageMobile className="inline-block sm:hidden" />
<Icon
opticalSize={20}
className="group-[:has(:popover-open)]:rotate-180"
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/components/buttonStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,25 +81,25 @@ const params: { [key in ButtonSize]: string } = {
lg: `
p-4
text-button
rounded-lg
leading-snug
rounded-lg
`,
// 12(py-3) * 2 + 22(text-button * leading-snug) + boader * 2 = 48px
md: `
px-4
py-3
text-button
rounded-lg
leading-snug
rounded-lg
`,
// 6(py-1.5) * 2 + 22(text-button * leading-snug) + boader * 2 = 36px
sm: `
px-3
py-1.5
my-1
text-button
rounded-md
leading-snug
rounded-md
`,
// 6(py-1.5) * 2 + 14(text-button-sm) + boader * 2 = 28p
xs: `
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bcdaeb4

Please sign in to comment.