Skip to content

Commit

Permalink
fix button style
Browse files Browse the repository at this point in the history
  • Loading branch information
glassonion1 committed Oct 26, 2023
1 parent f2a4791 commit b3a1361
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 12 deletions.
4 changes: 2 additions & 2 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"preview": "vite preview"
},
"dependencies": {
"@sakura-ui/config": "^0.1.5",
"@sakura-ui/core": "^0.1.18",
"@sakura-ui/config": "workspace:^",
"@sakura-ui/core": "^0.1.20",
"@sakura-ui/forms": "^0.1.5",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
4 changes: 2 additions & 2 deletions examples/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import {
Faq,
Question,
Answer
} from '../../packages/core/src'
// from '@sakura-ui/core'
} from '@sakura-ui/core'
//from '../../packages/core/src'
import {
Checkbox,
CheckboxGroup,
Expand Down
2 changes: 1 addition & 1 deletion packages/config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sakura-ui/config",
"version": "0.1.6",
"version": "0.1.7",
"main": "dist/index.cjs.js",
"types": "dist/index.d.ts",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/config/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ const sakuraPlugin = plugin(
'button-sm': [
'14px',
{
lineHeight: '100%',
lineHeight: '14px',
letterSpacing: '0.04em',
fontWeight: '700'
}
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.1.19",
"version": "0.1.20",
"type": "module",
"main": "dist/index.cjs.js",
"types": "dist/index.d.ts",
Expand Down
12 changes: 11 additions & 1 deletion packages/core/src/components/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ export const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(
antialiased
`

const getLabel = () => {
const language =
(window.navigator.languages && window.navigator.languages[0]) ||
window.navigator.language
if (language === 'ja') {
return '新規タブで開きます'
}
return 'Opens in new tab'
}

if (href.startsWith('http')) {
return (
<a
Expand All @@ -47,7 +57,7 @@ export const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(
ref={ref}
>
<span className={styleUnderLine}>{children}</span>
<span className={cx(styleIcon)} aria-label="新規タブで開きます">
<span className={cx(styleIcon)} aria-label={getLabel()}>
open_in_new
</span>
</a>
Expand Down
9 changes: 6 additions & 3 deletions packages/core/src/components/buttonStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export const base = `
inline-block
text-button
text-center
rounded-lg
cursor-pointer
whitespace-nowrap
outline-offset-2
Expand Down Expand Up @@ -57,28 +56,32 @@ const params: {
py-4
my-0
text-button
rounded-lg
`,
md: `
h-[48px]
px-4
py-3
my-0
text-button
rounded-lg
`,
sm: `
h-[36px]
px-3
py-1.5
my-1
text-button
rounded-md
`,
xs: `
h-[28px]
px-2
py-[7px]
my-2
text-[14px]
leading-[14px]
text-button-sm
!leading-[14px]
rounded
`
}

Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

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

0 comments on commit b3a1361

Please sign in to comment.