@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
@@ -8,7 +8,7 @@ import {
8
8
  NavigationMenuTrigger,
9
9
  NavigationMenuViewport,
10
10
  } from "@godxjp/ui/navigation";
11
- import { Flex, PageContainer } from "@godxjp/ui/layout";
11
+ import { Flex, PageContainer, ResponsiveGrid } from "@godxjp/ui/layout";
12
12
  import { Text } from "@godxjp/ui/general";
13
13
 
14
14
  /**
@@ -38,60 +38,56 @@ export default function Demo() {
38
38
  <NavigationMenuTrigger>会計</NavigationMenuTrigger>
39
39
  <NavigationMenuContent>
40
40
  {/* ui-audit-disable-next-line no-arbitrary-size — NavigationMenu flyout panel width (demo layout) */}
41
- <ul className="grid gap-2 p-4 md:w-[400px] md:grid-cols-2">
42
- <li>
43
- <NavigationMenuLink
44
- href="#"
45
- className="hover:bg-accent block rounded-md p-3"
46
- >
47
- <Text as="div" weight="medium">
48
- 仕訳入力
49
- </Text>
50
- <Text as="p" size="xs" tone="muted" className="mt-1">
51
- 借方・貸方を直接入力して仕訳を作成します。
52
- </Text>
53
- </NavigationMenuLink>
54
- </li>
55
- <li>
56
- <NavigationMenuLink
57
- href="#"
58
- className="hover:bg-accent block rounded-md p-3"
59
- >
60
- <Text as="div" weight="medium">
61
- 仕訳帳
62
- </Text>
63
- <Text as="p" size="xs" tone="muted" className="mt-1">
64
- 全仕訳の一覧・検索・フィルタリング。
65
- </Text>
66
- </NavigationMenuLink>
67
- </li>
68
- <li>
69
- <NavigationMenuLink
70
- href="#"
71
- className="hover:bg-accent block rounded-md p-3"
72
- >
73
- <Text as="div" weight="medium">
74
- 総勘定元帳
75
- </Text>
76
- <Text as="p" size="xs" tone="muted" className="mt-1">
77
- 勘定科目ごとの残高・取引履歴。
78
- </Text>
79
- </NavigationMenuLink>
80
- </li>
81
- <li>
82
- <NavigationMenuLink
83
- href="#"
84
- className="hover:bg-accent block rounded-md p-3"
85
- >
86
- <Text as="div" weight="medium">
87
- 試算表
88
- </Text>
89
- <Text as="p" size="xs" tone="muted" className="mt-1">
90
- 期間指定で借方・貸方の合計を確認。
91
- </Text>
92
- </NavigationMenuLink>
93
- </li>
94
- </ul>
41
+ <ResponsiveGrid columns={{ sm: 1, md: 2 }} gap="sm" className="md:w-[400px]">
42
+ <NavigationMenuLink href="#" className="hover:bg-accent block rounded-md">
43
+ <CardContent>
44
+ <Flex direction="col" gap="xs">
45
+ <Text as="div" weight="medium">
46
+ 仕訳入力
47
+ </Text>
48
+ <Text as="p" size="xs" tone="muted">
49
+ 借方・貸方を直接入力して仕訳を作成します。
50
+ </Text>
51
+ </Flex>
52
+ </CardContent>
53
+ </NavigationMenuLink>
54
+ <NavigationMenuLink href="#" className="hover:bg-accent block rounded-md">
55
+ <CardContent>
56
+ <Flex direction="col" gap="xs">
57
+ <Text as="div" weight="medium">
58
+ 仕訳帳
59
+ </Text>
60
+ <Text as="p" size="xs" tone="muted">
61
+ 全仕訳の一覧・検索・フィルタリング。
62
+ </Text>
63
+ </Flex>
64
+ </CardContent>
65
+ </NavigationMenuLink>
66
+ <NavigationMenuLink href="#" className="hover:bg-accent block rounded-md">
67
+ <CardContent>
68
+ <Flex direction="col" gap="xs">
69
+ <Text as="div" weight="medium">
70
+ 総勘定元帳
71
+ </Text>
72
+ <Text as="p" size="xs" tone="muted">
73
+ 勘定科目ごとの残高・取引履歴。
74
+ </Text>
75
+ </Flex>
76
+ </CardContent>
77
+ </NavigationMenuLink>
78
+ <NavigationMenuLink href="#" className="hover:bg-accent block rounded-md">
79
+ <CardContent>
80
+ <Flex direction="col" gap="xs">
81
+ <Text as="div" weight="medium">
82
+ 試算表
83
+ </Text>
84
+ <Text as="p" size="xs" tone="muted">
85
+ 期間指定で借方・貸方の合計を確認。
86
+ </Text>
87
+ </Flex>
88
+ </CardContent>
89
+ </NavigationMenuLink>
90
+ </ResponsiveGrid>
95
91
  </NavigationMenuContent>
96
92
  </NavigationMenuItem>
97
93
 
@@ -99,47 +95,44 @@ export default function Demo() {
99
95
  <NavigationMenuTrigger>レポート</NavigationMenuTrigger>
100
96
  <NavigationMenuContent>
101
97
  {/* ui-audit-disable-next-line no-arbitrary-size — NavigationMenu flyout panel width (demo layout) */}
102
- <ul className="grid gap-2 p-4 md:w-[360px]">
103
- <li>
104
- <NavigationMenuLink
105
- href="#"
106
- className="hover:bg-accent block rounded-md p-3"
107
- >
108
- <Text as="div" weight="medium">
109
- 貸借対照表
110
- </Text>
111
- <Text as="p" size="xs" tone="muted" className="mt-1">
112
- 特定日時点の資産・負債・純資産。
113
- </Text>
114
- </NavigationMenuLink>
115
- </li>
116
- <li>
117
- <NavigationMenuLink
118
- href="#"
119
- className="hover:bg-accent block rounded-md p-3"
120
- >
121
- <Text as="div" weight="medium">
122
- 損益計算書
123
- </Text>
124
- <Text as="p" size="xs" tone="muted" className="mt-1">
125
- 期間中の収益・費用・利益の要約。
126
- </Text>
127
- </NavigationMenuLink>
128
- </li>
129
- <li>
130
- <NavigationMenuLink
131
- href="#"
132
- className="hover:bg-accent block rounded-md p-3"
133
- >
134
- <Text as="div" weight="medium">
135
- キャッシュフロー計算書
136
- </Text>
137
- <Text as="p" size="xs" tone="muted" className="mt-1">
138
- 営業・投資・財務活動別の資金移動。
139
- </Text>
140
- </NavigationMenuLink>
141
- </li>
142
- </ul>
98
+ <ResponsiveGrid columns={1} gap="sm" className="md:w-[360px]">
99
+ <NavigationMenuLink href="#" className="hover:bg-accent block rounded-md">
100
+ <CardContent>
101
+ <Flex direction="col" gap="xs">
102
+ <Text as="div" weight="medium">
103
+ 貸借対照表
104
+ </Text>
105
+ <Text as="p" size="xs" tone="muted">
106
+ 特定日時点の資産・負債・純資産。
107
+ </Text>
108
+ </Flex>
109
+ </CardContent>
110
+ </NavigationMenuLink>
111
+ <NavigationMenuLink href="#" className="hover:bg-accent block rounded-md">
112
+ <CardContent>
113
+ <Flex direction="col" gap="xs">
114
+ <Text as="div" weight="medium">
115
+ 損益計算書
116
+ </Text>
117
+ <Text as="p" size="xs" tone="muted">
118
+ 期間中の収益・費用・利益の要約。
119
+ </Text>
120
+ </Flex>
121
+ </CardContent>
122
+ </NavigationMenuLink>
123
+ <NavigationMenuLink href="#" className="hover:bg-accent block rounded-md">
124
+ <CardContent>
125
+ <Flex direction="col" gap="xs">
126
+ <Text as="div" weight="medium">
127
+ キャッシュフロー計算書
128
+ </Text>
129
+ <Text as="p" size="xs" tone="muted">
130
+ 営業・投資・財務活動別の資金移動。
131
+ </Text>
132
+ </Flex>
133
+ </CardContent>
134
+ </NavigationMenuLink>
135
+ </ResponsiveGrid>
143
136
  </NavigationMenuContent>
144
137
  </NavigationMenuItem>
145
138
 
@@ -187,16 +187,18 @@ export default function Demo() {
187
187
  </CardDescription>
188
188
  </CardHeader>
189
189
  <CardContent>
190
- <div className="max-w-80 border p-2">
191
- <Steps
192
- value={1}
193
- items={[
194
- { title: "会社情報の入力", description: "法人番号と所在地" },
195
- { title: "本人確認書類のアップロード", description: "代表者の確認" },
196
- { title: "申請内容の最終確認", description: "送信前の確認" },
197
- ]}
198
- />
199
- </div>
190
+ <Card className="max-w-80">
191
+ <CardContent>
192
+ <Steps
193
+ value={1}
194
+ items={[
195
+ { title: "会社情報の入力", description: "法人番号と所在地" },
196
+ { title: "本人確認書類のアップロード", description: "代表者の確認" },
197
+ { title: "申請内容の最終確認", description: "送信前の確認" },
198
+ ]}
199
+ />
200
+ </CardContent>
201
+ </Card>
200
202
  </CardContent>
201
203
  </Card>
202
204
 
@@ -111,25 +111,31 @@ export default function Demo() {
111
111
  </CardDescription>
112
112
  </CardHeader>
113
113
  <CardContent>
114
- <div className="max-w-80 border p-2">
115
- <Tabs
116
- defaultValue="methods"
117
- variant="line"
118
- items={[
119
- {
120
- value: "methods",
121
- label: "サインイン方法とパスワード",
122
- content: <Text>方法</Text>,
123
- },
124
- {
125
- value: "two-factor",
126
- label: "二要素認証の設定",
127
- content: <Text>二要素認証</Text>,
128
- },
129
- { value: "recovery", label: "アカウントの復旧方法", content: <Text>復旧</Text> },
130
- ]}
131
- />
132
- </div>
114
+ <Card className="max-w-80">
115
+ <CardContent>
116
+ <Tabs
117
+ defaultValue="methods"
118
+ variant="line"
119
+ items={[
120
+ {
121
+ value: "methods",
122
+ label: "サインイン方法とパスワード",
123
+ content: <Text>方法</Text>,
124
+ },
125
+ {
126
+ value: "two-factor",
127
+ label: "二要素認証の設定",
128
+ content: <Text>二要素認証</Text>,
129
+ },
130
+ {
131
+ value: "recovery",
132
+ label: "アカウントの復旧方法",
133
+ content: <Text>復旧</Text>,
134
+ },
135
+ ]}
136
+ />
137
+ </CardContent>
138
+ </Card>
133
139
  </CardContent>
134
140
  </Card>
135
141
 
@@ -196,7 +202,7 @@ export default function Demo() {
196
202
  </CardDescription>
197
203
  </CardHeader>
198
204
  <CardContent>
199
- <Tabs defaultValue="overview" orientation="vertical" className="gap-6">
205
+ <Tabs defaultValue="overview" orientation="vertical" style={{ gap: "var(--space-6)" }}>
200
206
  <TabsList variant="line" className="h-auto w-40 flex-col items-stretch">
201
207
  <TabsTrigger value="overview">概要</TabsTrigger>
202
208
  <TabsTrigger value="ledger">元帳</TabsTrigger>
@@ -8,6 +8,7 @@ import {
8
8
  CardDescription,
9
9
  CardHeader,
10
10
  CardTitle,
11
+ EmptyState,
11
12
  } from "@godxjp/ui/data-display";
12
13
  import { Button, Text } from "@godxjp/ui/general";
13
14
  import {
@@ -111,7 +112,7 @@ export default function Demo() {
111
112
  sticky
112
113
  hasActiveFilters={hasMemberFilters}
113
114
  onClear={clearMemberFilters}
114
- className="border-border bg-card border-b px-4"
115
+ className="border-border bg-card border-b"
115
116
  >
116
117
  <SearchInput
117
118
  aria-label="メンバーを検索"
@@ -154,16 +155,13 @@ export default function Demo() {
154
155
  wrap
155
156
  align="center"
156
157
  gap="xs"
157
- className="border-border bg-muted/40 min-h-9 border-b px-4 py-2"
158
+ className="border-border bg-muted/40 min-h-9 border-b"
158
159
  >
159
- <Flex
160
- direction="row"
161
- align="center"
162
- gap="xs"
163
- className="text-muted-foreground pe-1"
164
- >
160
+ <Flex direction="row" align="center" gap="xs">
165
161
  <Filter className="size-3.5" aria-hidden="true" />
166
- <Text size="xs">適用中</Text>
162
+ <Text size="xs" tone="muted">
163
+ 適用中
164
+ </Text>
167
165
  </Flex>
168
166
  {!hasMemberFilters && (
169
167
  <Text size="xs" tone="muted">
@@ -171,7 +169,7 @@ export default function Demo() {
171
169
  </Text>
172
170
  )}
173
171
  {activeChips.map((chip) => (
174
- <span key={chip.key} className="inline-flex items-center gap-1">
172
+ <Flex key={chip.key} align="center" gap="xs">
175
173
  <Badge tone={chip.tone} variant="outline">
176
174
  {chip.label}
177
175
  </Badge>
@@ -183,7 +181,7 @@ export default function Demo() {
183
181
  >
184
182
  <X aria-hidden="true" />
185
183
  </Button>
186
- </span>
184
+ </Flex>
187
185
  ))}
188
186
  {hasMemberFilters && (
189
187
  <Button
@@ -205,7 +203,7 @@ export default function Demo() {
205
203
  direction="row"
206
204
  align="center"
207
205
  justify="between"
208
- className="border-border/60 border-b px-4 py-2.5"
206
+ className="border-border/60 border-b"
209
207
  >
210
208
  <Text size="sm">
211
209
  {memberQuery.trim() || "田中"} {i + 1} 番
@@ -269,9 +267,11 @@ export default function Demo() {
269
267
  </Toolbar>
270
268
 
271
269
  {/* Simulated table body */}
272
- <Text as="div" tone="muted" className="rounded-md border p-4 text-center">
273
- DataTable がここに入ります · Toolbar は Card の外側 (上) に置く
274
- </Text>
270
+ <EmptyState
271
+ variant="section"
272
+ titleAs="p"
273
+ title="DataTable がここに入ります · Toolbar は Card の外側 (上) に置く"
274
+ />
275
275
  </Flex>
276
276
  </CardContent>
277
277
  </Card>
@@ -51,10 +51,10 @@ export default function Demo() {
51
51
  <CardContent>
52
52
  <Text as="p" tone="muted">
53
53
  このデモは{" "}
54
- <code className="bg-muted rounded px-1 py-0.5 font-mono text-xs">
54
+ <Text as="code" mono size="xs">
55
55
  defaultLocale=&quot;ja&quot; defaultTimezone=&quot;Asia/Tokyo&quot;
56
56
  defaultDateFormat=&quot;iso&quot; defaultTimeFormat=&quot;24h&quot;
57
- </code>{" "}
57
+ </Text>{" "}
58
58
  の AppProvider でラップされている。
59
59
  </Text>
60
60
  </CardContent>
@@ -45,8 +45,8 @@ import {
45
45
  Avatar,
46
46
  AvatarFallback,
47
47
  Badge,
48
- type BadgeProps,
49
48
  Card,
49
+ CardAction,
50
50
  CardContent,
51
51
  CardHeader,
52
52
  CardTitle,
@@ -58,6 +58,7 @@ import {
58
58
  TableHead,
59
59
  TableHeader,
60
60
  TableRow,
61
+ type BadgeProps,
61
62
  } from "@godxjp/ui/data-display";
62
63
  import { SearchInput } from "@godxjp/ui/data-entry";
63
64
  import {
@@ -341,28 +342,37 @@ export default function AcmePortalShowcase() {
341
342
  {/* Queue + Journey */}
342
343
  <ResponsiveGrid columns={{ sm: 1, md: 1, lg: 2 }}>
343
344
  <Card className="self-start">
344
- <CardHeader className="flex flex-row items-center justify-between">
345
+ <CardHeader>
345
346
  <CardTitle level={2}>Cần bạn xử lý</CardTitle>
346
- <Text size="xs" tone="muted">
347
- {QUEUE.length} việc
348
- </Text>
347
+ <CardAction>
348
+ <Text size="xs" tone="muted">
349
+ {QUEUE.length} việc
350
+ </Text>
351
+ </CardAction>
349
352
  </CardHeader>
350
353
  <CardContent flush>
351
354
  <ul className="divide-border divide-y">
352
355
  {QUEUE.map((q) => (
353
- <li key={q.title} className="flex items-center gap-3 px-4 py-3">
354
- <Badge tone={q.tone} variant="outline" icon={q.icon} aria-label={q.title} />
355
- <div className="min-w-0 flex-1">
356
- <Text as="div" size="sm" weight="medium" truncate>
357
- {q.title}
358
- </Text>
359
- <Text as="div" size="xs" tone="muted" truncate>
360
- {q.meta}
361
- </Text>
362
- </div>
363
- <Button variant="outline" size="sm">
364
- {q.action}
365
- </Button>
356
+ <li key={q.title} className="px-4 py-3">
357
+ <Flex align="center" gap="md">
358
+ <Badge
359
+ tone={q.tone}
360
+ variant="outline"
361
+ icon={q.icon}
362
+ aria-label={q.title}
363
+ />
364
+ <div className="min-w-0 flex-1">
365
+ <Text as="div" size="sm" weight="medium" truncate>
366
+ {q.title}
367
+ </Text>
368
+ <Text as="div" size="xs" tone="muted" truncate>
369
+ {q.meta}
370
+ </Text>
371
+ </div>
372
+ <Button variant="outline" size="sm">
373
+ {q.action}
374
+ </Button>
375
+ </Flex>
366
376
  </li>
367
377
  ))}
368
378
  </ul>
@@ -370,11 +380,13 @@ export default function AcmePortalShowcase() {
370
380
  </Card>
371
381
 
372
382
  <Card className="self-start">
373
- <CardHeader className="flex flex-row items-center justify-between">
383
+ <CardHeader>
374
384
  <CardTitle level={2}>Hành trình đơn TXM-100241</CardTitle>
375
- <Badge tone="info" variant="outline">
376
- <Plane aria-hidden="true" /> Đang vận chuyển
377
- </Badge>
385
+ <CardAction>
386
+ <Badge tone="info" variant="outline">
387
+ <Plane aria-hidden="true" /> Đang vận chuyển
388
+ </Badge>
389
+ </CardAction>
378
390
  </CardHeader>
379
391
  <CardContent>
380
392
  <Flex direction="col" gap="md">
@@ -393,12 +405,14 @@ export default function AcmePortalShowcase() {
393
405
 
394
406
  {/* Orders table — the centerpiece */}
395
407
  <Card>
396
- <CardHeader className="flex flex-row items-center justify-between">
408
+ <CardHeader>
397
409
  <CardTitle level={2}>Đơn mua hộ gần đây</CardTitle>
398
- <Button variant="ghost" size="sm">
399
- <Wallet aria-hidden="true" />
400
- Xem tất cả
401
- </Button>
410
+ <CardAction>
411
+ <Button variant="ghost" size="sm">
412
+ <Wallet aria-hidden="true" />
413
+ Xem tất cả
414
+ </Button>
415
+ </CardAction>
402
416
  </CardHeader>
403
417
  <CardContent flush>
404
418
  <Table>