Skip to content

Commit ae3060d

Browse files
committed
chore(typography): create test page for CJK typography
1 parent 046e13e commit ae3060d

File tree

3 files changed

+115
-0
lines changed

3 files changed

+115
-0
lines changed

.storybook/main.js

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ export default {
2424
files: "**/*.@(stories.js|mdx)",
2525
titlePrefix: "Deprecated",
2626
},
27+
{
28+
directory: "./testing",
29+
files: "**/*.@(stories.js|mdx)",
30+
titlePrefix: "Testing",
31+
},
2732
],
2833
rootDir: "../",
2934
staticDirs: ["./assets", "./assets/images"],

.storybook/testing/cjk-typography.mdx

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { Meta, Canvas } from "@storybook/blocks";
2+
3+
import { Button, Toast, Tag, AssetCard, Typography } from "./cjk.stories.js";
4+
5+
<Meta title="Testing CJK Typography" />
6+
7+
# Testing CJK Typography
8+
9+
Most changes - if incorporated at all - are to line-height, and not all of those components are listed here.
10+
11+
Typography changes based on font size/weight are not currently extended into components, ex. body size small is not applied through to buttons size small.
12+
13+
## Button
14+
15+
No lang specific overrides applied.
16+
17+
<Canvas of={Button} />
18+
19+
## Toast
20+
21+
Lang specific override on message line-height only.
22+
23+
<Canvas of={Toast} />
24+
25+
## Tag
26+
27+
No lang specific overrides applied.
28+
29+
<Canvas of={Tag} />
30+
31+
## Asset Card
32+
33+
Full font style lang overrides for header, content, and title slots.
34+
35+
<Canvas of={AssetCard} />
36+
37+
## Calendar
38+
39+
[See on Calendar page](/?path=/docs/components-calendar--docs&globals=lang:ja), font-size is changed for days of the week.
40+
41+
(_Error loading the story on this page_)
42+
43+
## Typography
44+
45+
All are size medium.
46+
47+
<Canvas of={Typography} />

.storybook/testing/cjk.stories.js

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
2+
import { Template as AssetCardTemplate } from "../../components/assetcard/stories/template.js";
3+
import { ButtonsWithIconOptions } from "../../components/button/stories/template.js";
4+
import { TagGroups } from "../../components/tag/stories//tag.test.js";
5+
import { ToastGroup } from "../../components/toast/stories/toast.test.js";
6+
import { TypographyGroup } from "../../components/typography/stories/typography.test.js";
7+
8+
const longPhrase = "無料で作りましょう"; // Let's make it for free
9+
const shortPhrase = "買う"; // Purchase
10+
11+
export default {
12+
title: "CJK Stories",
13+
tags: ["!autodocs"],
14+
}
15+
16+
export const Button = ButtonsWithIconOptions.bind({});
17+
Button.args = {
18+
label: longPhrase,
19+
};
20+
Button.parameters = {
21+
chromatic: { disableSnapshot: true },
22+
};
23+
24+
export const Toast = ToastGroup.bind({});
25+
Toast.args = {
26+
message: longPhrase,
27+
inlineButtonLabel: shortPhrase,
28+
variant: "neutral"
29+
};
30+
31+
export const Tag = TagGroups.bind({});
32+
Tag.args = {label: shortPhrase};
33+
34+
export const AssetCard = AssetCardTemplate.bind({});
35+
AssetCard.args = {
36+
title: 'Instagram ' + longPhrase,
37+
headerContent: "39:02",
38+
exampleImage: "square",
39+
};
40+
41+
42+
export const Typography = TypographyGroup.bind({});
43+
Typography.args = {
44+
content: [
45+
{
46+
semantics: "heading",
47+
content: ['Heading ' + longPhrase],
48+
},
49+
{
50+
semantics: "code",
51+
content: ['Code ' + longPhrase],
52+
},
53+
{
54+
semantics: "detail",
55+
content: ['detail ' + longPhrase],
56+
},
57+
{
58+
semantics: "body",
59+
content: [
60+
'Body ' + longPhrase ],
61+
},
62+
],
63+
};

0 commit comments

Comments
 (0)