Skip to content

Commit

Permalink
Merge pull request #680 from pixiv/backport/abcang/hint-text-overflow…
Browse files Browse the repository at this point in the history
…-wrap-break-word

fix(react-sandbox): (v3 backport)分割可能でない単語がHintTextに含まれていたときにあふれないようにする
  • Loading branch information
yue4u authored Dec 24, 2024
2 parents 99245ab + 6c8b00e commit d4f894d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
39 changes: 39 additions & 0 deletions packages/react-sandbox/src/components/HintText/index.story.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { Meta, StoryObj } from '@storybook/react'
import HintText from '.'

export default {
title: 'react-sandbox/HintText',
component: HintText,
parameters: {
layout: 'centered',
},
argTypes: {
children: { type: 'string' },
context: {
control: {
type: 'select',
options: ['page', 'section'],
},
},
},
} as Meta<typeof HintText>

export const Default: StoryObj<typeof HintText> = {
args: {
children: 'HintText',
context: 'section',
},
render: (props) => <HintText {...props} />,
}

export const NarrowWidth: StoryObj<typeof HintText> = {
args: {
children: 'LongLongLongLongLongLongLongLongLongText',
context: 'section',
},
render: (props) => (
<div style={{ width: 200 }}>
<HintText {...props} />
</div>
),
}
2 changes: 2 additions & 0 deletions packages/react-sandbox/src/components/HintText/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ const IconWrap = styled.div`
const Text = styled.p`
${theme((o) => [o.font.text2, o.typography(14)])}
margin: 0;
min-width: 0;
overflow-wrap: break-word;
`

function styledProps(props: Props) {
Expand Down

0 comments on commit d4f894d

Please sign in to comment.