@godxjp/ui 28.6.0 → 28.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/data-display/data-table.d.ts +10 -2
- package/dist/components/data-display/data-table.js +12 -5
- package/dist/components/data-display/index.d.ts +2 -0
- package/dist/components/data-display/index.js +2 -0
- package/dist/components/data-display/marquee.d.ts +16 -0
- package/dist/components/data-display/marquee.js +155 -0
- package/dist/components/data-display/scroll-area.js +16 -2
- package/dist/components/data-display/service-launcher-card.d.ts +25 -0
- package/dist/components/data-display/table.d.ts +38 -1
- package/dist/components/data-display/table.js +57 -39
- package/dist/components/data-entry/form-field.js +29 -12
- package/dist/components/general/reveal.d.ts +23 -2
- package/dist/components/general/reveal.js +37 -7
- package/dist/components/general/typography.d.ts +4 -1
- package/dist/components/general/typography.js +14 -1
- package/dist/components/layout/affix.d.ts +86 -0
- package/dist/components/layout/affix.js +187 -0
- package/dist/components/layout/index.d.ts +4 -0
- package/dist/components/layout/index.js +4 -0
- package/dist/components/layout/legal-document-shell.js +4 -3
- package/dist/components/layout/masonry.d.ts +74 -0
- package/dist/components/layout/masonry.js +214 -0
- package/dist/components/layout/page-container.js +5 -20
- package/dist/components/navigation/anchor.d.ts +64 -0
- package/dist/components/navigation/anchor.js +284 -0
- package/dist/components/navigation/app-setting-picker.js +20 -3
- package/dist/components/navigation/index.d.ts +4 -0
- package/dist/components/navigation/index.js +4 -0
- package/dist/components/navigation/mega-menu.d.ts +21 -0
- package/dist/components/navigation/mega-menu.js +526 -0
- package/dist/components/ui/table.js +1 -0
- package/dist/contracts/measurement.json +1 -1
- package/dist/i18n/messages/en.json +522 -1
- package/dist/i18n/messages/ja.json +518 -1
- package/dist/i18n/messages/vi.json +518 -1
- package/dist/lib/hooks.d.ts +91 -0
- package/dist/lib/hooks.js +79 -0
- package/dist/lib/platform.d.ts +14 -0
- package/dist/lib/platform.js +10 -1
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.js +3 -2
- package/dist/props/components/data-display.prop.d.ts +109 -1
- package/dist/props/components/general.prop.d.ts +47 -3
- package/dist/props/components/layout.prop.d.ts +194 -0
- package/dist/props/components/navigation.prop.d.ts +263 -0
- package/dist/props/registry.d.ts +360 -5
- package/dist/props/registry.js +474 -4
- package/dist/props/vocabulary/index.d.ts +1 -1
- package/dist/props/vocabulary/interaction.prop.d.ts +39 -2
- package/dist/styles/control.css +5 -6
- package/dist/styles/data-display-layout.css +2 -1
- package/dist/styles/density.css +4 -0
- package/dist/styles/form-layout.css +22 -0
- package/dist/styles/layout.css +79 -1
- package/dist/styles/motion.css +121 -1
- package/dist/styles/navigation-layout.css +415 -20
- package/dist/styles/shell-layout.css +3 -0
- package/dist/styles/text-layout.css +52 -4
- package/dist/tokens/base.css +5 -0
- package/dist/tokens/components/affix.css +7 -0
- package/dist/tokens/components/anchor.css +17 -0
- package/dist/tokens/components/control.css +3 -3
- package/dist/tokens/components/form.css +3 -1
- package/dist/tokens/components/marquee.css +7 -0
- package/dist/tokens/components/masonry.css +6 -0
- package/dist/tokens/components/mega-menu.css +62 -0
- package/dist/tokens/components/navigation.css +2 -0
- package/dist/tokens/components/shell.css +3 -0
- package/dist/tokens/foundation.css +11 -0
- package/dist/tokens/semantic/layout.css +7 -0
- package/docs/COMPOSITION-VS-COMPONENT.md +21 -0
- package/docs/DESIGN-AUTHORITY.md +124 -23
- package/docs/FRAME-COVERAGE-REPORT.md +7 -2
- package/docs/data-display/marquee.tsx +254 -0
- package/docs/data-display/scroll-area.tsx +31 -0
- package/docs/data-display/service-launcher-card.tsx +275 -115
- package/docs/foundation/_theme-editor-scope.ts +222 -0
- package/docs/foundation/density.tsx +12 -2
- package/docs/foundation/spacing.tsx +5 -0
- package/docs/foundation/theme-editor.tsx +645 -0
- package/docs/general/activity.tsx +65 -0
- package/docs/general/reveal.tsx +290 -22
- package/docs/general/typography.tsx +91 -1
- package/docs/layout/affix.tsx +209 -0
- package/docs/layout/masonry.tsx +291 -0
- package/docs/navigation/anchor.tsx +285 -0
- package/docs/navigation/mega-menu-panel.tsx +86 -0
- package/docs/navigation/mega-menu.tsx +254 -0
- package/docs/roadmap/website-components.md +779 -0
- package/docs/showcase/acme-website.tsx +75 -39
- package/docs/showcase/futurelastic-web.tsx +91 -49
- package/docs/showcase/marketing-page.tsx +885 -0
- package/docs/showcase/table-footer-totals.tsx +12 -2
- package/docs/showcase/theme-customization.tsx +1259 -0
- package/package.json +8 -5
- package/scripts/brand-accent.generated.mjs +27 -0
- package/scripts/ui-audit.mjs +66 -0
- package/scripts/visual-audit-rules.mjs +46 -2
- package/scripts/visual-audit.mjs +29 -1
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Badge,
|
|
5
|
+
Card,
|
|
6
|
+
CardContent,
|
|
7
|
+
CardDescription,
|
|
8
|
+
CardHeader,
|
|
9
|
+
CardTitle,
|
|
10
|
+
Marquee,
|
|
11
|
+
} from "@godxjp/ui/data-display";
|
|
12
|
+
import { Switch } from "@godxjp/ui/data-entry";
|
|
13
|
+
import { Heading, Link, Text } from "@godxjp/ui/general";
|
|
14
|
+
import { Flex, PageContainer, Separator } from "@godxjp/ui/layout";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Marquee · a track of content that travels continuously, and the WCAG 2.2.2 pause control that
|
|
18
|
+
* makes that legal.
|
|
19
|
+
*
|
|
20
|
+
* Every card on this page is an EDGE, because the tidy demo is the one that hides the defects this
|
|
21
|
+
* component actually has:
|
|
22
|
+
* · ONE item in a full-width track, which is the case that needs the most clones;
|
|
23
|
+
* · FORTY items, which is the case that proves the pace is measured and not per-cycle;
|
|
24
|
+
* · a 71-character unbreakable string, wider than a phone;
|
|
25
|
+
* · a track NARROWER than one item, where there is nothing to clone into;
|
|
26
|
+
* · CJK beside Latin beside Vietnamese, at three different optical widths;
|
|
27
|
+
* · the paused state, which is where the content has to stay readable;
|
|
28
|
+
* · a controlled "stop all motion" switch driving two tracks at once.
|
|
29
|
+
*
|
|
30
|
+
* Composed only from real @godxjp/ui components. All copy is consumer-owned and localized.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
const PARTNERS = [
|
|
34
|
+
"フジワラ運輸",
|
|
35
|
+
"Meridian Foods",
|
|
36
|
+
"Công ty Đại Việt",
|
|
37
|
+
"北陸電機",
|
|
38
|
+
"Halden Systems",
|
|
39
|
+
"三和商会",
|
|
40
|
+
"Vinh Phat Logistics",
|
|
41
|
+
"東海システム",
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
/** Forty items · the case a per-cycle duration would send across the screen forty times too fast. */
|
|
45
|
+
const FORTY = Array.from({ length: 40 }, (_, index) => `SKU-${String(index + 1).padStart(4, "0")}`);
|
|
46
|
+
|
|
47
|
+
/** 71 characters, no break opportunity anywhere in it. */
|
|
48
|
+
const UNBREAKABLE = "SUPPLYCHAINRECONCILIATIONBATCHIDENTIFIER2026Q3NOBREAKOPPORTUNITY0000001";
|
|
49
|
+
|
|
50
|
+
export default function MarqueeDoc() {
|
|
51
|
+
const [motion, setMotion] = useState(true);
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<PageContainer title="Marquee" subtitle="連続して流れるトラックと、それを止める操作">
|
|
55
|
+
<Flex direction="col" gap="lg">
|
|
56
|
+
<Card>
|
|
57
|
+
<CardHeader>
|
|
58
|
+
<CardTitle level={2}>ロゴウォール · 既定のかたち</CardTitle>
|
|
59
|
+
<CardDescription>
|
|
60
|
+
`fade` で両端をマスクし、`pauseOnHover` を足した 8 件。コピー数は測って決まる(内容幅
|
|
61
|
+
÷ 表示幅 + 1)ので、ウィンドウを横に伸ばせばクローンが増える。停止ボタンは常にあり、
|
|
62
|
+
Tab で到達できる。各社名はリンクなので、トラック内にフォーカスが入ると自動で止まる
|
|
63
|
+
(動いているリンクは押せないため)。クローン側のリンクは Tab の順路に出てこない。
|
|
64
|
+
</CardDescription>
|
|
65
|
+
</CardHeader>
|
|
66
|
+
<CardContent>
|
|
67
|
+
<Marquee fade pauseOnHover label="取引先ロゴ">
|
|
68
|
+
{PARTNERS.map((name) => (
|
|
69
|
+
<Link key={name} href={`#partner-${encodeURIComponent(name)}`}>
|
|
70
|
+
{name}
|
|
71
|
+
</Link>
|
|
72
|
+
))}
|
|
73
|
+
</Marquee>
|
|
74
|
+
</CardContent>
|
|
75
|
+
</Card>
|
|
76
|
+
|
|
77
|
+
<Card>
|
|
78
|
+
<CardHeader>
|
|
79
|
+
<CardTitle level={2}>1 件 と 40 件 · 速度は件数で変わらない</CardTitle>
|
|
80
|
+
<CardDescription>
|
|
81
|
+
1 周の所要時間ではなく「1 画面ぶんを流れる時間」が `--marquee-interval` なので、1
|
|
82
|
+
件でも 40 件でも見た目の速さは同じ。1 件のトラックはクローンが最も多く、 40
|
|
83
|
+
件のトラックはクローンが 1 枚で足りる。
|
|
84
|
+
</CardDescription>
|
|
85
|
+
</CardHeader>
|
|
86
|
+
<CardContent>
|
|
87
|
+
<Flex direction="col" gap="md">
|
|
88
|
+
<Heading level={3}>1 件</Heading>
|
|
89
|
+
<Marquee label="在庫同期の状態">
|
|
90
|
+
<Badge tone="info">在庫同期 · 実行中</Badge>
|
|
91
|
+
</Marquee>
|
|
92
|
+
<Separator />
|
|
93
|
+
<Heading level={3}>40 件</Heading>
|
|
94
|
+
<Marquee label="処理中の SKU">
|
|
95
|
+
{FORTY.map((sku) => (
|
|
96
|
+
<Text key={sku} size="xs" tone="muted">
|
|
97
|
+
{sku}
|
|
98
|
+
</Text>
|
|
99
|
+
))}
|
|
100
|
+
</Marquee>
|
|
101
|
+
</Flex>
|
|
102
|
+
</CardContent>
|
|
103
|
+
</Card>
|
|
104
|
+
|
|
105
|
+
<Card>
|
|
106
|
+
<CardHeader>
|
|
107
|
+
<CardTitle level={2}>折り返せない 71 文字と、1 件より狭いトラック</CardTitle>
|
|
108
|
+
<CardDescription>
|
|
109
|
+
分割点のない 71 文字は電話の画面より広い。狭い枠に入れると「表示幅 ÷ 内容幅」は 1
|
|
110
|
+
を下回るので、クローンは最小の 1 枚になり、それでも継ぎ目なく回る。
|
|
111
|
+
</CardDescription>
|
|
112
|
+
</CardHeader>
|
|
113
|
+
<CardContent>
|
|
114
|
+
<Flex direction="col" gap="md">
|
|
115
|
+
<Heading level={3}>全幅</Heading>
|
|
116
|
+
<Marquee label="照合バッチ識別子">
|
|
117
|
+
<Text size="sm">{UNBREAKABLE}</Text>
|
|
118
|
+
</Marquee>
|
|
119
|
+
<Separator />
|
|
120
|
+
<Heading level={3}>幅 14rem · 1 件より狭い枠</Heading>
|
|
121
|
+
<div style={{ inlineSize: "14rem", maxInlineSize: "100%" }}>
|
|
122
|
+
<Marquee label="照合バッチ識別子・狭い枠">
|
|
123
|
+
<Text size="sm">{UNBREAKABLE}</Text>
|
|
124
|
+
</Marquee>
|
|
125
|
+
</div>
|
|
126
|
+
</Flex>
|
|
127
|
+
</CardContent>
|
|
128
|
+
</Card>
|
|
129
|
+
|
|
130
|
+
<Card>
|
|
131
|
+
<CardHeader>
|
|
132
|
+
<CardTitle level={2}>日本語 · Latin · Tiếng Việt が同じ行に並ぶ</CardTitle>
|
|
133
|
+
<CardDescription>
|
|
134
|
+
全角の仮名漢字、欧文、そしてダイアクリティカルの付いたベトナム語は 1 文字あたりの幅も
|
|
135
|
+
行の高さも違う。同じトラックに置いたときの継ぎ目とベースラインはここで見る。
|
|
136
|
+
`direction="end"` は読み方向の逆に流れる版で、`dir="rtl"` では両方が反転する。
|
|
137
|
+
</CardDescription>
|
|
138
|
+
</CardHeader>
|
|
139
|
+
<CardContent>
|
|
140
|
+
<Flex direction="col" gap="md">
|
|
141
|
+
<Marquee gap={6} speed="slow" label="多言語の見出し">
|
|
142
|
+
<Text size="sm">品質保証部 · 月次レビュー</Text>
|
|
143
|
+
<Text size="sm">Quality Assurance · Monthly review</Text>
|
|
144
|
+
<Text size="sm">Đảm bảo chất lượng · Đánh giá hàng tháng</Text>
|
|
145
|
+
</Marquee>
|
|
146
|
+
<Separator />
|
|
147
|
+
<Marquee gap={6} speed="fast" direction="end" label="多言語の見出し・逆方向">
|
|
148
|
+
<Text size="sm">品質保証部 · 月次レビュー</Text>
|
|
149
|
+
<Text size="sm">Quality Assurance · Monthly review</Text>
|
|
150
|
+
<Text size="sm">Đảm bảo chất lượng · Đánh giá hàng tháng</Text>
|
|
151
|
+
</Marquee>
|
|
152
|
+
</Flex>
|
|
153
|
+
</CardContent>
|
|
154
|
+
</Card>
|
|
155
|
+
|
|
156
|
+
<Card>
|
|
157
|
+
<CardHeader>
|
|
158
|
+
<CardTitle level={2}>止まった状態 · WebAIM の推奨する既定</CardTitle>
|
|
159
|
+
<CardDescription>
|
|
160
|
+
`defaultPlay={false}` で始めると、内容は止まったまま読める。停止中もリンクは Tab
|
|
161
|
+
で辿れて、押せる。動いている最中にトラック内へフォーカスが入った場合も自動で止まる
|
|
162
|
+
(動いているリンクは押せないため)。ボタンの名前は「次に起きること」を言う。
|
|
163
|
+
</CardDescription>
|
|
164
|
+
</CardHeader>
|
|
165
|
+
<CardContent>
|
|
166
|
+
<Marquee defaultPlay={false} fade label="社内のお知らせ">
|
|
167
|
+
<Text size="sm">2026-10-01 · 社内システム定期メンテナンス</Text>
|
|
168
|
+
<Link href="#maintenance">詳細</Link>
|
|
169
|
+
<Text size="sm">2026-10-14 · 新しい経費申請フォームに切替</Text>
|
|
170
|
+
<Link href="#expense">申請の手順</Link>
|
|
171
|
+
</Marquee>
|
|
172
|
+
</CardContent>
|
|
173
|
+
</Card>
|
|
174
|
+
|
|
175
|
+
<Card>
|
|
176
|
+
<CardHeader>
|
|
177
|
+
<CardTitle level={2}>`play` で外から止める</CardTitle>
|
|
178
|
+
<CardDescription>
|
|
179
|
+
制御された `play` / `onPlayChange` は、画面全体の「動きを止める」1
|
|
180
|
+
つのスイッチから複数のトラックを同時に止めるためにある。各トラックの停止ボタンは
|
|
181
|
+
そのまま残る(2.2.2 の要件は個々の操作で満たす)。
|
|
182
|
+
</CardDescription>
|
|
183
|
+
</CardHeader>
|
|
184
|
+
<CardContent>
|
|
185
|
+
<Flex direction="col" gap="md">
|
|
186
|
+
<Flex align="center" gap="sm">
|
|
187
|
+
<Switch
|
|
188
|
+
id="stop-all-motion"
|
|
189
|
+
checked={motion}
|
|
190
|
+
onCheckedChange={setMotion}
|
|
191
|
+
aria-label="このページの動きを有効にする"
|
|
192
|
+
/>
|
|
193
|
+
<Text size="sm">
|
|
194
|
+
{motion ? "このページの動きは有効" : "このページの動きは停止中"}
|
|
195
|
+
</Text>
|
|
196
|
+
</Flex>
|
|
197
|
+
<Marquee play={motion} onPlayChange={setMotion} label="取引先ロゴ・上段">
|
|
198
|
+
{PARTNERS.slice(0, 4).map((name) => (
|
|
199
|
+
<Text key={name} size="sm" tone="muted">
|
|
200
|
+
{name}
|
|
201
|
+
</Text>
|
|
202
|
+
))}
|
|
203
|
+
</Marquee>
|
|
204
|
+
<Marquee
|
|
205
|
+
play={motion}
|
|
206
|
+
onPlayChange={setMotion}
|
|
207
|
+
direction="end"
|
|
208
|
+
label="取引先ロゴ・下段"
|
|
209
|
+
>
|
|
210
|
+
{PARTNERS.slice(4).map((name) => (
|
|
211
|
+
<Text key={name} size="sm" tone="muted">
|
|
212
|
+
{name}
|
|
213
|
+
</Text>
|
|
214
|
+
))}
|
|
215
|
+
</Marquee>
|
|
216
|
+
</Flex>
|
|
217
|
+
</CardContent>
|
|
218
|
+
</Card>
|
|
219
|
+
|
|
220
|
+
<Card>
|
|
221
|
+
<CardHeader>
|
|
222
|
+
<CardTitle level={2}>使う前に読むこと</CardTitle>
|
|
223
|
+
</CardHeader>
|
|
224
|
+
<CardContent>
|
|
225
|
+
<Flex direction="col" gap="sm">
|
|
226
|
+
<Heading level={3}>止められる動きでも、止まっている方が良いことは多い</Heading>
|
|
227
|
+
<Text tone="muted">
|
|
228
|
+
自動で流れる内容は Nielsen Norman Group も WebAIM も勧めていない。NN/g
|
|
229
|
+
は「ユーザーが操作していないのに画面が動くのは不快で、読み終える前に消える」と書き、
|
|
230
|
+
WebAIM は「アニメーションは既定で止めておくことを勧める」と書いている。この
|
|
231
|
+
コンポーネントはその判断を奪わない。止める操作は必ず付いてくるし、`defaultPlay=
|
|
232
|
+
{"{false}"}` は 1 つのプロパティで済む。動かす理由が言えないなら、静止した `Flex
|
|
233
|
+
wrap` や `ResponsiveGrid` のロゴウォールの方が良い。
|
|
234
|
+
</Text>
|
|
235
|
+
<Heading level={3}>OS のモーション低減設定では一切動かない</Heading>
|
|
236
|
+
<Text tone="muted">
|
|
237
|
+
`prefers-reduced-motion: reduce` のとき、クローンも停止ボタンも作らず、1
|
|
238
|
+
件ぶんの内容を横スクロールできる領域として出す。横方向の平行移動は前庭系の
|
|
239
|
+
トリガーそのもので、控えめにする版というものが無いため(WCAG 2.2 SC 2.2.2 / SC
|
|
240
|
+
2.3.3)。
|
|
241
|
+
</Text>
|
|
242
|
+
<Heading level={3}>テーマ側のつまみ</Heading>
|
|
243
|
+
<Text tone="muted">
|
|
244
|
+
--marquee-interval · --marquee-interval-slow · --marquee-interval-fast ·
|
|
245
|
+
--marquee-gap-inline · --marquee-mask-width。時間はモーション層
|
|
246
|
+
(foundation.css)に、幾何はコンポーネント層(tokens/components/marquee.css)にある。
|
|
247
|
+
</Text>
|
|
248
|
+
</Flex>
|
|
249
|
+
</CardContent>
|
|
250
|
+
</Card>
|
|
251
|
+
</Flex>
|
|
252
|
+
</PageContainer>
|
|
253
|
+
);
|
|
254
|
+
}
|
|
@@ -355,6 +355,37 @@ export default function Demo() {
|
|
|
355
355
|
</CardContent>
|
|
356
356
|
</Card>
|
|
357
357
|
|
|
358
|
+
<Card>
|
|
359
|
+
<CardHeader>
|
|
360
|
+
<CardTitle level={2}>スクロール領域に名前を付ける(label)</CardTitle>
|
|
361
|
+
<CardDescription>
|
|
362
|
+
溢れている間、ビューポートは Tab
|
|
363
|
+
で止まる(キーボードだけで中身を送るために必要)。その停止点は名前を持つ。既定は
|
|
364
|
+
「スクロール可能な領域」の翻訳で、画面がその領域を呼べるときは label
|
|
365
|
+
で「監査ログ」と名乗る。ロールはランドマークの region ではなく group
|
|
366
|
+
にしてある。同じ名前のランドマークが一画面に並ぶと axe landmark-unique
|
|
367
|
+
に触れるため。溢れていなければ停止点も role も名前も出ない(gh#821)。
|
|
368
|
+
</CardDescription>
|
|
369
|
+
</CardHeader>
|
|
370
|
+
<CardContent>
|
|
371
|
+
<Card variant="outline" className="w-full">
|
|
372
|
+
<CardContent flush>
|
|
373
|
+
<ScrollArea className="h-40" label="監査ログ">
|
|
374
|
+
<CardContent>
|
|
375
|
+
<Flex direction="col" gap="xs">
|
|
376
|
+
{entries.map((e) => (
|
|
377
|
+
<div key={e} className="text-sm tabular-nums">
|
|
378
|
+
{e}
|
|
379
|
+
</div>
|
|
380
|
+
))}
|
|
381
|
+
</Flex>
|
|
382
|
+
</CardContent>
|
|
383
|
+
</ScrollArea>
|
|
384
|
+
</CardContent>
|
|
385
|
+
</Card>
|
|
386
|
+
</CardContent>
|
|
387
|
+
</Card>
|
|
388
|
+
|
|
358
389
|
<Card>
|
|
359
390
|
<CardHeader>
|
|
360
391
|
<CardTitle level={2}>内容が収まる場合(バー非表示)</CardTitle>
|