Skip to content

Commit 1685b0a

Browse files
authored
Merge pull request #137 from digital-go-jp/v2
merge v2 into main
2 parents 2dbe81e + b22cf49 commit 1685b0a

File tree

18 files changed

+935
-816
lines changed

18 files changed

+935
-816
lines changed

.storybook/globals.css

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@
77

88
@layer base {
99
body {
10-
font-family:
11-
"Noto Sans JP",
12-
system-ui,
13-
-apple-system,
14-
BlinkMacSystemFont,
15-
sans-serif;
16-
17-
@apply text-std-17N-170 text-solid-gray-900;
10+
@apply font-sans text-std-17N-170 text-solid-gray-900;
1811
}
1912
}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"storybook:test": "test-storybook"
4040
},
4141
"dependencies": {
42-
"@digital-go-jp/tailwind-theme-plugin": "^0.2.0",
42+
"@digital-go-jp/tailwind-theme-plugin": "^0.2.1",
4343
"react": "^18.3.1",
4444
"react-dom": "^18.3.1",
4545
"tailwindcss": "^3.4.15"

src/components/EmergencyBanner/parts/Button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const EmergencyBannerButton = (props: Props) => {
88
return (
99
<div
1010
className={`
11-
flex items-center justify-center mx-auto mt-6 mb-1 w-fit min-w-64 p-4 bg-error-1 text-white text-oln-16B-100 leading-snug rounded-lg
11+
flex items-center justify-center mx-auto mt-6 mb-1 w-fit min-w-64 p-4 bg-error-1 text-white text-oln-16B-100 rounded-lg
1212
outline outline-2 outline-error-1 outline-offset-[calc(2/16*1rem)]
1313
desktop:outline-4 desktop:outline-offset-[calc(4/16*1rem)] desktop:mt-8 desktop:mb-2
1414
${className ?? ''}

src/components/Input/Input.stories.tsx

Lines changed: 29 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type Story = StoryObj<typeof meta>;
4343
export const Playground: Story = {
4444
decorators: [
4545
(Story, context) => (
46-
<div className='flex flex-col gap-2'>
46+
<div className='flex flex-col items-start gap-2'>
4747
<Label htmlFor={context.args.id}>
4848
ラベル<RequirementBadge>※必須</RequirementBadge>
4949
</Label>
@@ -61,77 +61,67 @@ export const Playground: Story = {
6161
},
6262
};
6363

64-
export const Example: Story = {
64+
export const Errored: Story = {
6565
render: () => {
6666
const formId = React.useId();
6767

6868
return (
6969
<div className='flex flex-col gap-8'>
7070
<div className='flex flex-col gap-2'>
71-
<Label htmlFor={`${formId}-test`}>ラベル</Label>
72-
<SupportText id='test-support-text'>サポートテキスト</SupportText>
73-
<Input aria-describedby='test-support-text' id={`${formId}-test`} name='test' />
74-
</div>
75-
76-
<div className='flex flex-col gap-2'>
77-
<Label htmlFor={`${formId}-test-filled`}>
78-
ラベル<RequirementBadge>※必須</RequirementBadge>
79-
</Label>
80-
<SupportText id='test-filled-support-text'>サポートテキスト</SupportText>
81-
<Input
82-
aria-describedby='test-filled-support-text'
83-
defaultValue='入力済の内容'
84-
id={`${formId}-test-filled`}
85-
name='test-filled'
86-
required
87-
/>
88-
</div>
89-
90-
<div className='flex flex-col gap-2'>
91-
<Label htmlFor={`${formId}-test-error`}>
71+
<Label htmlFor={`${formId}-error`}>
9272
ラベル<RequirementBadge>※必須</RequirementBadge>
9373
</Label>
94-
<SupportText id='test-error-support-text'>サポートテキスト</SupportText>
74+
<SupportText id='error-support-text'>サポートテキスト</SupportText>
9575
<Input
96-
aria-describedby='test-error-support-text test-error-text'
76+
aria-describedby='error-support-text error-text'
9777
aria-invalid={true}
98-
id={`${formId}-test-error`}
78+
id={`${formId}-error`}
9979
isError={true}
100-
name='test-error'
80+
name='error'
10181
required
10282
defaultValue=''
10383
/>
104-
<ErrorText id='test-error-text'>*エラーテキスト</ErrorText>
84+
<ErrorText id='error-text'>*エラーテキスト</ErrorText>
10585
</div>
10686

10787
<div className='flex flex-col gap-2'>
108-
<Label htmlFor={`${formId}-test-filled-error`}>
88+
<Label htmlFor={`${formId}-filled-error`}>
10989
ラベル<RequirementBadge>※必須</RequirementBadge>
11090
</Label>
111-
<SupportText id='test-filled-error-support-text'>サポートテキスト</SupportText>
91+
<SupportText id='filled-error-support-text'>サポートテキスト</SupportText>
11292
<Input
113-
aria-describedby='test-filled-error-support-text test-filled-error-text'
93+
aria-describedby='filled-error-support-text filled-error-text'
11494
aria-invalid={true}
11595
defaultValue='誤った入力内容'
116-
id={`${formId}-test-filled-error`}
96+
id={`${formId}-filled-error`}
11797
isError={true}
118-
name='test-filled-error'
98+
name='filled-error'
11999
required
120100
/>
121-
<ErrorText id='test-filled-error-text'>*エラーテキスト</ErrorText>
101+
<ErrorText id='filled-error-text'>*エラーテキスト</ErrorText>
122102
</div>
103+
</div>
104+
);
105+
},
106+
};
123107

108+
export const Disabled: Story = {
109+
render: () => {
110+
const formId = React.useId();
111+
112+
return (
113+
<div className='flex flex-col gap-8'>
124114
<div className='flex flex-col gap-2'>
125-
<Label htmlFor={`${formId}-test-disabled`}>ラベル</Label>
126-
<SupportText id='test-disabled-support-text'>
115+
<Label htmlFor={`${formId}-disabled`}>ラベル</Label>
116+
<SupportText id='disabled-support-text'>
127117
〜の理由により、この項目は無効化されています。
128118
</SupportText>
129119
<Input
130-
aria-describedby='test-disabled-support-text'
120+
aria-describedby='disabled-support-text'
131121
aria-disabled={true}
132122
defaultValue='入力テキスト'
133-
id={`${formId}-test-disabled`}
134-
name='test-disabled'
123+
id={`${formId}-disabled`}
124+
name='disabled'
135125
/>
136126
</div>
137127
</div>

src/components/Input/Input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const Input = forwardRef<HTMLInputElement, InputProps>((props, ref) => {
2222
return (
2323
<input
2424
className={`
25-
min-w-80 max-w-full rounded-lg border bg-white px-4 py-3 text-oln-16N-100 text-solid-gray-800
25+
max-w-full rounded-lg border bg-white px-4 py-3 text-oln-16N-100 text-solid-gray-800
2626
${InputBlockSizeStyle[blockSize]}
2727
${isError ? 'border-error-1' : 'border-solid-gray-900'}
2828
focus:outline focus:outline-4 focus:outline-black focus:outline-offset-[calc(2/16*1rem)] focus:ring-[calc(2/16*1rem)] focus:ring-yellow-300

0 commit comments

Comments
 (0)