@godxjp/ui 19.2.0 → 19.3.1

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.
Files changed (66) hide show
  1. package/dist/components/data-display/badge.d.ts +18 -2
  2. package/dist/components/data-display/badge.js +18 -4
  3. package/dist/props/components/data-display.prop.d.ts +7 -0
  4. package/dist/props/registry.d.ts +5 -1
  5. package/dist/props/registry.js +12 -1
  6. package/dist/styles/badge-layout.css +15 -0
  7. package/dist/tokens/components/badge.css +8 -0
  8. package/docs/data-display/badge.tsx +36 -0
  9. package/docs/data-display/carousel.tsx +8 -4
  10. package/docs/data-display/data-table/examples/grid-features.tsx +1 -1
  11. package/docs/data-display/permission-matrix.tsx +13 -9
  12. package/docs/data-display/popover.tsx +2 -1
  13. package/docs/data-display/scroll-area.tsx +107 -75
  14. package/docs/data-display/table.tsx +1 -1
  15. package/docs/data-entry/calendar.tsx +1 -1
  16. package/docs/data-entry/checkbox.tsx +1 -1
  17. package/docs/data-entry/country-picker-recipe.tsx +11 -6
  18. package/docs/data-entry/form-field/index.tsx +33 -29
  19. package/docs/data-entry/form-root.tsx +1 -1
  20. package/docs/data-entry/password-input.tsx +1 -5
  21. package/docs/data-entry/select.tsx +7 -7
  22. package/docs/data-entry/textarea.tsx +2 -2
  23. package/docs/feedback/sheet.tsx +112 -102
  24. package/docs/feedback/skeleton.tsx +2 -2
  25. package/docs/foundation/colors.tsx +8 -6
  26. package/docs/foundation/email-tokens.tsx +82 -65
  27. package/docs/foundation/radius-shadow.tsx +13 -11
  28. package/docs/layout/app-shell.tsx +2 -2
  29. package/docs/layout/aspect-ratio.tsx +30 -14
  30. package/docs/layout/flex.tsx +6 -2
  31. package/docs/layout/page-container.tsx +9 -1
  32. package/docs/layout/responsive-grid.tsx +10 -2
  33. package/docs/layout/sidebar.tsx +169 -146
  34. package/docs/layout/split-pane.tsx +44 -27
  35. package/docs/layout/topbar.tsx +17 -15
  36. package/docs/navigation/app-setting-picker.tsx +5 -4
  37. package/docs/navigation/breadcrumb.tsx +12 -5
  38. package/docs/navigation/context-menu.tsx +10 -4
  39. package/docs/navigation/navigation-menu.tsx +89 -96
  40. package/docs/navigation/steps.tsx +12 -10
  41. package/docs/navigation/tabs.tsx +26 -20
  42. package/docs/navigation/toolbar.tsx +15 -15
  43. package/docs/providers/format-date.tsx +2 -2
  44. package/docs/showcase/acme-portal.tsx +41 -27
  45. package/docs/showcase/acme-website.tsx +60 -54
  46. package/docs/showcase/case1-warehouse-dashboard.tsx +46 -30
  47. package/docs/showcase/case2-employee-me.tsx +23 -20
  48. package/docs/showcase/case3-approval-workflow.tsx +34 -32
  49. package/docs/showcase/case4-login.tsx +119 -113
  50. package/docs/showcase/case5-shift-calendar.tsx +3 -3
  51. package/docs/showcase/case6-agency-handy.tsx +340 -299
  52. package/docs/showcase/futurelastic-web.tsx +23 -21
  53. package/docs/showcase/org-switcher.tsx +2 -2
  54. package/docs/showcase/permission-matrix.tsx +7 -4
  55. package/docs/showcase/table-conditional-format.tsx +8 -8
  56. package/docs/showcase/table-crud-list.tsx +3 -3
  57. package/docs/showcase/table-density.tsx +49 -42
  58. package/docs/showcase/table-expandable-rows.tsx +24 -15
  59. package/docs/showcase/table-filter-chips.tsx +2 -7
  60. package/docs/showcase/table-footer-totals.tsx +7 -4
  61. package/docs/showcase/table-grouped-subtotals.tsx +25 -22
  62. package/docs/showcase/table-master-detail.tsx +15 -10
  63. package/docs/showcase/table-pagination.tsx +34 -27
  64. package/docs/showcase/table-states.tsx +8 -5
  65. package/docs/showcase/table-sticky-columns.tsx +8 -5
  66. package/package.json +2 -3
@@ -13,14 +13,14 @@ import {
13
13
  } from "@godxjp/ui/layout";
14
14
  import type { SidebarItemData, SidebarRenderItemProp, SidebarSectionProp } from "@godxjp/ui/layout";
15
15
  import {
16
+ Avatar,
17
+ AvatarFallback,
18
+ Badge,
16
19
  Card,
17
20
  CardContent,
18
21
  CardDescription,
19
22
  CardHeader,
20
23
  CardTitle,
21
- Badge,
22
- Avatar,
23
- AvatarFallback,
24
24
  } from "@godxjp/ui/data-display";
25
25
  import { Button, Text } from "@godxjp/ui/general";
26
26
  import {
@@ -313,30 +313,36 @@ export default function Demo() {
313
313
  </CardDescription>
314
314
  </CardHeader>
315
315
  <CardContent>
316
- <Flex direction="col" className="bg-card h-80 w-64 overflow-hidden rounded-lg border">
317
- <Sidebar
318
- ariaLabel="ブランド例のナビゲーション"
319
- activeId={brandActiveId}
320
- onSelect={setBrandActiveId}
321
- sections={BRAND_SECTIONS}
322
- aria-label="brand プロップ例のナビゲーション"
323
- brand={
324
- <SidebarHeader>
325
- <span className="bg-primary text-primary-foreground grid size-7 shrink-0 place-items-center rounded-md">
326
- <Boxes className="size-4" aria-hidden="true" />
327
- </span>
328
- <span className="flex min-w-0 flex-col">
329
- <Text weight="bold" truncate>
330
- Acme Suite
331
- </Text>
332
- <Text size="xs" tone="muted" truncate>
333
- v7.0 Enterprise
334
- </Text>
335
- </span>
336
- </SidebarHeader>
337
- }
338
- />
339
- </Flex>
316
+ <Card className="h-80 w-64 overflow-hidden">
317
+ <CardContent flush>
318
+ <Flex direction="col">
319
+ <Sidebar
320
+ ariaLabel="ブランド例のナビゲーション"
321
+ activeId={brandActiveId}
322
+ onSelect={setBrandActiveId}
323
+ sections={BRAND_SECTIONS}
324
+ aria-label="brand プロップ例のナビゲーション"
325
+ brand={
326
+ <SidebarHeader>
327
+ <Avatar className="size-7 shrink-0 rounded-md">
328
+ <AvatarFallback className="bg-primary text-primary-foreground">
329
+ <Boxes className="size-4" aria-hidden="true" />
330
+ </AvatarFallback>
331
+ </Avatar>
332
+ <Flex direction="col" gap="xs" className="min-w-0">
333
+ <Text weight="bold" truncate>
334
+ Acme Suite
335
+ </Text>
336
+ <Text size="xs" tone="muted" truncate>
337
+ v7.0 Enterprise
338
+ </Text>
339
+ </Flex>
340
+ </SidebarHeader>
341
+ }
342
+ />
343
+ </Flex>
344
+ </CardContent>
345
+ </Card>
340
346
  </CardContent>
341
347
  </Card>
342
348
 
@@ -356,33 +362,35 @@ export default function Demo() {
356
362
  </CardHeader>
357
363
  <CardContent>
358
364
  <Flex gap="md" wrap>
359
- <Flex
360
- direction="col"
361
- className="bg-card h-72 w-64 overflow-hidden rounded-lg border"
362
- >
363
- <Sidebar
364
- ariaLabel="ルーターリンク行のナビゲーション"
365
- activeId={routedActiveId}
366
- onSelect={setRoutedActiveId}
367
- sections={ROUTED_SECTIONS}
368
- linkComponent={RouterLink}
369
- aria-label="linkComponent プロップ例のナビゲーション(展開)"
370
- />
371
- </Flex>
372
- <Flex
373
- direction="col"
374
- className="bg-card h-72 w-16 overflow-hidden rounded-lg border"
375
- >
376
- <Sidebar
377
- ariaLabel="折りたたみレールのルーターリンク"
378
- activeId={routedActiveId}
379
- onSelect={setRoutedActiveId}
380
- sections={ROUTED_SECTIONS}
381
- linkComponent={RouterLink}
382
- collapsed
383
- aria-label="linkComponent プロップ例のナビゲーション(折りたたみ)"
384
- />
385
- </Flex>
365
+ <Card className="h-72 w-64 overflow-hidden">
366
+ <CardContent flush>
367
+ <Flex direction="col">
368
+ <Sidebar
369
+ ariaLabel="ルーターリンク行のナビゲーション"
370
+ activeId={routedActiveId}
371
+ onSelect={setRoutedActiveId}
372
+ sections={ROUTED_SECTIONS}
373
+ linkComponent={RouterLink}
374
+ aria-label="linkComponent プロップ例のナビゲーション(展開)"
375
+ />
376
+ </Flex>
377
+ </CardContent>
378
+ </Card>
379
+ <Card className="h-72 w-16 overflow-hidden">
380
+ <CardContent flush>
381
+ <Flex direction="col">
382
+ <Sidebar
383
+ ariaLabel="折りたたみレールのルーターリンク"
384
+ activeId={routedActiveId}
385
+ onSelect={setRoutedActiveId}
386
+ sections={ROUTED_SECTIONS}
387
+ linkComponent={RouterLink}
388
+ collapsed
389
+ aria-label="linkComponent プロップ例のナビゲーション(折りたたみ)"
390
+ />
391
+ </Flex>
392
+ </CardContent>
393
+ </Card>
386
394
  </Flex>
387
395
  </CardContent>
388
396
  </Card>
@@ -401,18 +409,22 @@ export default function Demo() {
401
409
  </CardDescription>
402
410
  </CardHeader>
403
411
  <CardContent>
404
- <Flex direction="col" className="bg-card h-72 w-64 overflow-hidden rounded-lg border">
405
- <Sidebar
406
- ariaLabel="カスタム行例のナビゲーション"
407
- activeId={renderActiveId}
408
- onSelect={setRenderActiveId}
409
- sections={FAVOURITE_SECTIONS}
410
- renderItem={(item, rowProps) =>
411
- renderFavouriteRow(item, rowProps, setRenderActiveId)
412
- }
413
- aria-label="renderItem プロップ例のナビゲーション"
414
- />
415
- </Flex>
412
+ <Card className="h-72 w-64 overflow-hidden">
413
+ <CardContent flush>
414
+ <Flex direction="col">
415
+ <Sidebar
416
+ ariaLabel="カスタム行例のナビゲーション"
417
+ activeId={renderActiveId}
418
+ onSelect={setRenderActiveId}
419
+ sections={FAVOURITE_SECTIONS}
420
+ renderItem={(item, rowProps) =>
421
+ renderFavouriteRow(item, rowProps, setRenderActiveId)
422
+ }
423
+ aria-label="renderItem プロップ例のナビゲーション"
424
+ />
425
+ </Flex>
426
+ </CardContent>
427
+ </Card>
416
428
  </CardContent>
417
429
  </Card>
418
430
 
@@ -430,52 +442,54 @@ export default function Demo() {
430
442
  </CardHeader>
431
443
  <CardContent>
432
444
  <Flex gap="md" wrap>
433
- <Flex
434
- direction="col"
435
- className="bg-card h-64 w-64 overflow-hidden rounded-lg border"
436
- >
437
- <Sidebar
438
- ariaLabel="構成可能な例のナビゲーション"
439
- activeId={composedActiveId}
440
- onSelect={setComposedActiveId}
441
- >
442
- <SidebarSection label="お気に入り">
443
- {COMPOSED_ITEMS.map((item) => (
444
- <SidebarItem
445
- key={item.id}
446
- item={item}
447
- active={composedActiveId === item.id}
448
- onActivate={setComposedActiveId}
449
- />
450
- ))}
451
- </SidebarSection>
452
- </Sidebar>
453
- </Flex>
454
- <Flex
455
- direction="col"
456
- className="bg-card h-64 w-64 overflow-hidden rounded-lg border"
457
- >
458
- <Sidebar
459
- ariaLabel="asChild 例のナビゲーション"
460
- activeId={composedActiveId}
461
- onSelect={setComposedActiveId}
462
- aria-label="SidebarItem asChild 例のナビゲーション"
463
- >
464
- <SidebarSection label="お気に入り(asChild)">
465
- {COMPOSED_ITEMS.map((item) => (
466
- <SidebarItem
467
- key={item.id}
468
- item={item}
469
- active={composedActiveId === item.id}
470
- onActivate={setComposedActiveId}
471
- asChild
472
- >
473
- <Link to={item.href ?? "/"} />
474
- </SidebarItem>
475
- ))}
476
- </SidebarSection>
477
- </Sidebar>
478
- </Flex>
445
+ <Card className="h-64 w-64 overflow-hidden">
446
+ <CardContent flush>
447
+ <Flex direction="col">
448
+ <Sidebar
449
+ ariaLabel="構成可能な例のナビゲーション"
450
+ activeId={composedActiveId}
451
+ onSelect={setComposedActiveId}
452
+ >
453
+ <SidebarSection label="お気に入り">
454
+ {COMPOSED_ITEMS.map((item) => (
455
+ <SidebarItem
456
+ key={item.id}
457
+ item={item}
458
+ active={composedActiveId === item.id}
459
+ onActivate={setComposedActiveId}
460
+ />
461
+ ))}
462
+ </SidebarSection>
463
+ </Sidebar>
464
+ </Flex>
465
+ </CardContent>
466
+ </Card>
467
+ <Card className="h-64 w-64 overflow-hidden">
468
+ <CardContent flush>
469
+ <Flex direction="col">
470
+ <Sidebar
471
+ ariaLabel="asChild 例のナビゲーション"
472
+ activeId={composedActiveId}
473
+ onSelect={setComposedActiveId}
474
+ aria-label="SidebarItem asChild 例のナビゲーション"
475
+ >
476
+ <SidebarSection label="お気に入り(asChild)">
477
+ {COMPOSED_ITEMS.map((item) => (
478
+ <SidebarItem
479
+ key={item.id}
480
+ item={item}
481
+ active={composedActiveId === item.id}
482
+ onActivate={setComposedActiveId}
483
+ asChild
484
+ >
485
+ <Link to={item.href ?? "/"} />
486
+ </SidebarItem>
487
+ ))}
488
+ </SidebarSection>
489
+ </Sidebar>
490
+ </Flex>
491
+ </CardContent>
492
+ </Card>
479
493
  </Flex>
480
494
  </CardContent>
481
495
  </Card>
@@ -496,15 +510,19 @@ export default function Demo() {
496
510
  </CardDescription>
497
511
  </CardHeader>
498
512
  <CardContent>
499
- <Flex direction="col" className="bg-card h-64 w-64 overflow-hidden rounded-lg border">
500
- <Sidebar
501
- ariaLabel="チャンネル一覧のナビゲーション"
502
- activeId={mentionActiveId}
503
- onSelect={setMentionActiveId}
504
- sections={MENTION_SECTIONS}
505
- aria-label="badgeTone 例のナビゲーション"
506
- />
507
- </Flex>
513
+ <Card className="h-64 w-64 overflow-hidden">
514
+ <CardContent flush>
515
+ <Flex direction="col">
516
+ <Sidebar
517
+ ariaLabel="チャンネル一覧のナビゲーション"
518
+ activeId={mentionActiveId}
519
+ onSelect={setMentionActiveId}
520
+ sections={MENTION_SECTIONS}
521
+ aria-label="badgeTone 例のナビゲーション"
522
+ />
523
+ </Flex>
524
+ </CardContent>
525
+ </Card>
508
526
  </CardContent>
509
527
  </Card>
510
528
 
@@ -522,31 +540,36 @@ export default function Demo() {
522
540
  </CardHeader>
523
541
  <CardContent>
524
542
  <Flex gap="md" wrap>
525
- <Flex
526
- direction="col"
527
- className="bg-card h-64 w-64 overflow-hidden rounded-lg border"
528
- >
529
- <Sidebar
530
- ariaLabel="既定の配色のナビゲーション"
531
- activeId={tokenActiveId}
532
- onSelect={setTokenActiveId}
533
- sections={FAVOURITE_SECTIONS}
534
- aria-label="既定の配色(アイコンは行の色を継承)"
535
- />
536
- </Flex>
537
- <Flex
538
- direction="col"
539
- className="bg-card h-64 w-64 overflow-hidden rounded-lg border"
540
- style={CANONICAL_NAV_TOKENS}
541
- >
542
- <Sidebar
543
- ariaLabel="アイコンを濃くしたナビゲーション"
544
- activeId={tokenActiveId}
545
- onSelect={setTokenActiveId}
546
- sections={FAVOURITE_SECTIONS}
547
- aria-label="トークン上書き(アイコンのみ --foreground)"
548
- />
549
- </Flex>
543
+ <Card className="h-64 w-64 overflow-hidden">
544
+ <CardContent flush>
545
+ <Flex direction="col">
546
+ <Sidebar
547
+ ariaLabel="既定の配色のナビゲーション"
548
+ activeId={tokenActiveId}
549
+ onSelect={setTokenActiveId}
550
+ sections={FAVOURITE_SECTIONS}
551
+ aria-label="既定の配色(アイコンは行の色を継承)"
552
+ />
553
+ </Flex>
554
+ </CardContent>
555
+ </Card>
556
+ <Card className="h-64 w-64 overflow-hidden">
557
+ <CardContent flush>
558
+ <Flex
559
+ direction="col"
560
+
561
+ style={CANONICAL_NAV_TOKENS}
562
+ >
563
+ <Sidebar
564
+ ariaLabel="アイコンを濃くしたナビゲーション"
565
+ activeId={tokenActiveId}
566
+ onSelect={setTokenActiveId}
567
+ sections={FAVOURITE_SECTIONS}
568
+ aria-label="トークン上書き(アイコンのみ --foreground)"
569
+ />
570
+ </Flex>
571
+ </CardContent>
572
+ </Card>
550
573
  </Flex>
551
574
  </CardContent>
552
575
  </Card>
@@ -1,5 +1,5 @@
1
1
  import { useState } from "react";
2
- import { Flex, PageContainer, ResponsiveGrid, SplitPane } from "@godxjp/ui/layout";
2
+ import { Flex, PageContainer, ResponsiveGrid, Separator, SplitPane } from "@godxjp/ui/layout";
3
3
  import {
4
4
  Card,
5
5
  CardContent,
@@ -188,7 +188,7 @@ export default function Demo() {
188
188
  </CardTitle>
189
189
  </CardHeader>
190
190
  <CardContent>
191
- <Flex direction="col" gap="sm">
191
+ <Flex direction="col" gap="xs">
192
192
  <Flex direction="row" justify="between">
193
193
  <Text tone="muted">小計</Text>
194
194
  <Text tabular>{selected.amount}</Text>
@@ -197,7 +197,8 @@ export default function Demo() {
197
197
  <Text tone="muted">消費税 (10%)</Text>
198
198
  <Text tabular>{yen(base * 0.1)}</Text>
199
199
  </Flex>
200
- <div className="border-border mt-1 border-t pt-2">
200
+ <Separator />
201
+ <div>
201
202
  <Flex direction="row" justify="between">
202
203
  <Text weight="bold">合計</Text>
203
204
  <Text weight="bold" tabular>
@@ -417,31 +418,47 @@ export default function Demo() {
417
418
  <CardContent>
418
419
  <Flex direction="col" gap="md">
419
420
  {/* Narrow embed → stays single column (the container is < 48rem). */}
420
- <div className="max-w-md border p-2">
421
- <Text size="xs" tone="muted">
422
- 28rem のコンテナ → 縦積み
423
- </Text>
424
- <SplitPane
425
- asideLabel="補助パネル(狭い埋め込み)"
426
- asideWidth="sm"
427
- aside={<div className="bg-muted p-4">補助パネル</div>}
428
- >
429
- <div className="bg-muted p-4">メインコンテンツ</div>
430
- </SplitPane>
431
- </div>
421
+ <Card className="max-w-md">
422
+ <CardContent>
423
+ <Text size="xs" tone="muted">
424
+ 約 28rem のコンテナ → 縦積み
425
+ </Text>
426
+ <SplitPane
427
+ asideLabel="補助パネル(狭い埋め込み)"
428
+ asideWidth="sm"
429
+ aside={
430
+ <Card variant="muted">
431
+ <CardContent>補助パネル</CardContent>
432
+ </Card>
433
+ }
434
+ >
435
+ <Card variant="muted">
436
+ <CardContent>メインコンテンツ</CardContent>
437
+ </Card>
438
+ </SplitPane>
439
+ </CardContent>
440
+ </Card>
432
441
  {/* Wide embed → splits into two columns (the container is ≥ 48rem). */}
433
- <div className="max-w-4xl border p-2">
434
- <Text size="xs" tone="muted">
435
- 56rem のコンテナ → 2 カラム
436
- </Text>
437
- <SplitPane
438
- asideLabel="補助パネル(広い埋め込み)"
439
- asideWidth="sm"
440
- aside={<div className="bg-muted p-4">補助パネル</div>}
441
- >
442
- <div className="bg-muted p-4">メインコンテンツ</div>
443
- </SplitPane>
444
- </div>
442
+ <Card className="max-w-4xl">
443
+ <CardContent>
444
+ <Text size="xs" tone="muted">
445
+ 約 56rem のコンテナ → 2 カラム
446
+ </Text>
447
+ <SplitPane
448
+ asideLabel="補助パネル(広い埋め込み)"
449
+ asideWidth="sm"
450
+ aside={
451
+ <Card variant="muted">
452
+ <CardContent>補助パネル</CardContent>
453
+ </Card>
454
+ }
455
+ >
456
+ <Card variant="muted">
457
+ <CardContent>メインコンテンツ</CardContent>
458
+ </Card>
459
+ </SplitPane>
460
+ </CardContent>
461
+ </Card>
445
462
  </Flex>
446
463
  </CardContent>
447
464
  </Card>
@@ -98,7 +98,7 @@ export default function Demo() {
98
98
  {collapsed ? <PanelLeftOpen /> : <PanelLeftClose />}
99
99
  </Button>
100
100
  {/* Decorative mark — hidden below sm so the budget goes to the two real controls. */}
101
- <Avatar className="hidden rounded-md sm:flex">
101
+ <Avatar className="rounded-md">
102
102
  <AvatarFallback className="bg-primary text-primary-foreground font-bold">C</AvatarFallback>
103
103
  </Avatar>
104
104
  <DropdownMenu>
@@ -120,7 +120,7 @@ export default function Demo() {
120
120
  <DropdownMenuSeparator />
121
121
  {ENTITIES.map((e) => (
122
122
  <DropdownMenuItem key={e.id} onSelect={() => setActiveEntity(e)}>
123
- <Building2 className="me-2 size-4" />
123
+ <Building2 className="size-4" />
124
124
  {e.name}
125
125
  {activeEntity.id === e.id ? (
126
126
  <Badge variant="secondary" className="ms-auto text-xs">
@@ -157,7 +157,7 @@ export default function Demo() {
157
157
  budget before it gets a say. At 320 this environment chip alone claimed 93 of the bar's
158
158
  198px, squeezing start to 25px and clipping the entity switcher inside it. An ambient
159
159
  status label is the first thing a compact bar drops, so it appears from sm up. */}
160
- <Badge tone="warning" className="hidden text-xs sm:inline-flex">
160
+ <Badge tone="warning" className="text-xs">
161
161
  ステージング
162
162
  </Badge>
163
163
  <Button
@@ -184,16 +184,16 @@ export default function Demo() {
184
184
  <DropdownMenuLabel>佐藤 花子</DropdownMenuLabel>
185
185
  <DropdownMenuSeparator />
186
186
  <DropdownMenuItem>
187
- <UserRound className="me-2 size-4" />
187
+ <UserRound className="size-4" />
188
188
  プロフィール
189
189
  </DropdownMenuItem>
190
190
  <DropdownMenuItem>
191
- <Settings className="me-2 size-4" />
191
+ <Settings className="size-4" />
192
192
  アカウント設定
193
193
  </DropdownMenuItem>
194
194
  <DropdownMenuSeparator />
195
195
  <DropdownMenuItem>
196
- <LogOut className="me-2 size-4" />
196
+ <LogOut className="size-4" />
197
197
  ログアウト
198
198
  </DropdownMenuItem>
199
199
  </DropdownMenuContent>
@@ -291,9 +291,9 @@ export default function Demo() {
291
291
  { prop: "children", desc: "3 slot を使わず完全カスタムにする場合の逃げ道" },
292
292
  ].map(({ prop, desc }) => (
293
293
  <Flex key={prop} align="start" gap="sm">
294
- <code className="bg-muted shrink-0 rounded px-1.5 py-0.5 font-mono text-xs">
294
+ <Badge variant="secondary" className="shrink-0">
295
295
  {prop}
296
- </code>
296
+ </Badge>
297
297
  <Text tone="muted">{desc}</Text>
298
298
  </Flex>
299
299
  ))}
@@ -331,13 +331,15 @@ export default function Demo() {
331
331
  </CardDescription>
332
332
  </CardHeader>
333
333
  <CardContent>
334
- <div className="max-w-80 overflow-hidden border p-2">
335
- <Topbar
336
- start={<Text weight="medium">株式会社とても長い組織名称</Text>}
337
- center={<Button variant="outline">すべての取引を検索</Button>}
338
- end={<Button variant="ghost">山田 太郎 システム管理者</Button>}
339
- />
340
- </div>
334
+ <Card className="max-w-80 overflow-hidden">
335
+ <CardContent>
336
+ <Topbar
337
+ start={<Text weight="medium">株式会社とても長い組織名称</Text>}
338
+ center={<Button variant="outline">すべての取引を検索</Button>}
339
+ end={<Button variant="ghost">山田 太郎 システム管理者</Button>}
340
+ />
341
+ </CardContent>
342
+ </Card>
341
343
  </CardContent>
342
344
  </Card>
343
345
  </Flex>
@@ -90,9 +90,11 @@ export default function Demo() {
90
90
  </CardDescription>
91
91
  </CardHeader>
92
92
  <CardContent>
93
- <div className="max-w-80 border p-3" lang="ja">
94
- <AppSettingPicker kind="timezone" id="setting-timezone-narrow" />
95
- </div>
93
+ <Card className="max-w-80" lang="ja">
94
+ <CardContent>
95
+ <AppSettingPicker kind="timezone" id="setting-timezone-narrow" />
96
+ </CardContent>
97
+ </Card>
96
98
  </CardContent>
97
99
  </Card>
98
100
 
@@ -106,7 +108,6 @@ export default function Demo() {
106
108
  </CardHeader>
107
109
  <CardContent>
108
110
  <Topbar
109
- className="rounded-md border"
110
111
  start={
111
112
  <Avatar className="rounded-md">
112
113
  <AvatarFallback>G</AvatarFallback>
@@ -1,6 +1,13 @@
1
1
  import { forwardRef } from "react";
2
2
  import type { AnchorHTMLAttributes } from "react";
3
- import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@godxjp/ui/data-display";
3
+ import {
4
+ Card,
5
+ CardContent,
6
+ CardDescription,
7
+ CardHeader,
8
+ CardTitle,
9
+ CodeBlock,
10
+ } from "@godxjp/ui/data-display";
4
11
  import { Text } from "@godxjp/ui/general";
5
12
  import { Breadcrumb } from "@godxjp/ui/layout";
6
13
  import { Flex, PageContainer } from "@godxjp/ui/layout";
@@ -110,15 +117,15 @@ export default function Demo() {
110
117
  {/* tabIndex: the snippet scrolls sideways on a narrow viewport and holds no
111
118
  focusable content, so without its own tab stop a keyboard user cannot reach the
112
119
  clipped end of the line (WCAG 2.1.1). */}
113
- <pre tabIndex={0} className="bg-muted overflow-x-auto rounded p-3 text-xs">
120
+ <CodeBlock size="xs" wrap={false}>
114
121
  {`<Breadcrumb items={[{ label: "ホーム", to: "/" }, { label: "現在ページ" }]} />`}
115
- </pre>
122
+ </CodeBlock>
116
123
  <Text as="p" size="xs" tone="muted">
117
124
  PageContainer / AppShell の breadcrumb プロップに (任意):
118
125
  </Text>
119
- <pre tabIndex={0} className="bg-muted overflow-x-auto rounded p-3 text-xs">
126
+ <CodeBlock size="xs" wrap={false}>
120
127
  {`<PageContainer title="仕訳詳細" breadcrumb={[{ label: "ホーム", to: "/" }, { label: "JE-0042" }]}>`}
121
- </pre>
128
+ </CodeBlock>
122
129
  </Flex>
123
130
  </CardContent>
124
131
  </Card>
@@ -47,8 +47,11 @@ export default function Demo() {
47
47
  </CardHeader>
48
48
  <CardContent>
49
49
  <ContextMenu>
50
- <ContextMenuTrigger className="border-border flex h-36 w-full cursor-context-menu items-center justify-center rounded-md border border-dashed">
51
- <Text tone="muted">ここを右クリックしてください</Text>
50
+ {/* ui-audit-disable-next-line no-hand-rolled-surface the dashed area is the right-click target the demo asks you to use */}
51
+ <ContextMenuTrigger className="border-border h-36 w-full cursor-context-menu rounded-md border border-dashed">
52
+ <Flex align="center" justify="center" gap="xs">
53
+ <Text tone="muted">ここを右クリックしてください</Text>
54
+ </Flex>
52
55
  </ContextMenuTrigger>
53
56
  <ContextMenuContent>
54
57
  <ContextMenuLabel>仕訳操作</ContextMenuLabel>
@@ -89,8 +92,11 @@ export default function Demo() {
89
92
  </CardHeader>
90
93
  <CardContent>
91
94
  <ContextMenu>
92
- <ContextMenuTrigger className="border-border flex h-36 w-full cursor-context-menu items-center justify-center rounded-md border border-dashed">
93
- <Text tone="muted">右クリック · 表示設定</Text>
95
+ {/* ui-audit-disable-next-line no-hand-rolled-surface the dashed area is the right-click target the demo asks you to use */}
96
+ <ContextMenuTrigger className="border-border h-36 w-full cursor-context-menu rounded-md border border-dashed">
97
+ <Flex align="center" justify="center" gap="xs">
98
+ <Text tone="muted">右クリック · 表示設定</Text>
99
+ </Flex>
94
100
  </ContextMenuTrigger>
95
101
  <ContextMenuContent>
96
102
  <ContextMenuLabel>表示オプション</ContextMenuLabel>