@godxjp/ui 19.5.0 → 20.0.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/card.d.ts +2 -2
- package/dist/components/data-display/collapsible.d.ts +23 -4
- package/dist/components/data-display/collapsible.js +119 -4
- package/dist/components/data-display/index.d.ts +3 -1
- package/dist/components/data-display/index.js +2 -0
- package/dist/components/data-display/legend.d.ts +15 -0
- package/dist/components/data-display/legend.js +11 -0
- package/dist/components/data-display/list-row.js +1 -1
- package/dist/components/data-display/popover.d.ts +58 -5
- package/dist/components/data-display/popover.js +206 -27
- package/dist/components/data-display/progress.d.ts +50 -2
- package/dist/components/data-display/progress.js +57 -9
- package/dist/components/data-entry/calendar.d.ts +1 -1
- package/dist/components/data-entry/calendar.js +67 -32
- package/dist/components/data-entry/checkbox.d.ts +19 -6
- package/dist/components/data-entry/checkbox.js +55 -16
- package/dist/components/data-entry/choice-option.d.ts +1 -1
- package/dist/components/data-entry/date-range-picker.d.ts +1 -1
- package/dist/components/data-entry/field.js +0 -1
- package/dist/components/data-entry/form.js +1 -1
- package/dist/components/data-entry/label.d.ts +3 -2
- package/dist/components/data-entry/label.js +23 -10
- package/dist/components/data-entry/month-picker.d.ts +1 -1
- package/dist/components/data-entry/month-range-picker.d.ts +1 -1
- package/dist/components/data-entry/transfer.js +16 -6
- package/dist/components/data-entry/tree-select-strategy.d.ts +1 -1
- package/dist/components/data-entry/tree-select.js +29 -12
- package/dist/components/data-entry/tree-utils.d.ts +1 -1
- package/dist/components/data-entry/upload.js +7 -2
- package/dist/components/feedback/dialog.d.ts +105 -38
- package/dist/components/feedback/dialog.js +272 -194
- package/dist/components/feedback/overlay-close-focus.d.ts +31 -0
- package/dist/components/feedback/overlay-close-focus.js +31 -0
- package/dist/components/feedback/overlay-header-tone.d.ts +1 -1
- package/dist/components/feedback/sheet.d.ts +53 -11
- package/dist/components/feedback/sheet.js +150 -81
- package/dist/components/feedback/tooltip.d.ts +51 -7
- package/dist/components/feedback/tooltip.js +107 -25
- package/dist/components/general/button.js +2 -2
- package/dist/components/general/logo.d.ts +17 -0
- package/dist/components/general/logo.js +22 -16
- package/dist/components/general/typography.d.ts +7 -1
- package/dist/components/general/typography.js +20 -5
- package/dist/components/layout/app-shell.d.ts +1 -1
- package/dist/components/layout/app-shell.js +52 -8
- package/dist/components/layout/aspect-ratio.js +0 -1
- package/dist/components/layout/auth-divider.js +0 -1
- package/dist/components/layout/flex.d.ts +1 -1
- package/dist/components/layout/flex.js +19 -2
- package/dist/components/layout/nav-surface.d.ts +26 -0
- package/dist/components/layout/nav-surface.js +17 -0
- package/dist/components/layout/org-switcher.d.ts +5 -1
- package/dist/components/layout/org-switcher.js +5 -3
- package/dist/components/layout/separator.js +0 -1
- package/dist/components/layout/sidebar.js +4 -1
- package/dist/components/layout/split-pane.d.ts +14 -1
- package/dist/components/layout/split-pane.js +26 -13
- package/dist/components/layout/topbar-item.js +1 -2
- package/dist/components/navigation/app-setting-picker.js +21 -2
- package/dist/components/navigation/app-setting-toggle.d.ts +16 -0
- package/dist/components/navigation/app-setting-toggle.js +96 -0
- package/dist/components/navigation/dropdown-menu.d.ts +199 -18
- package/dist/components/navigation/dropdown-menu.js +344 -117
- package/dist/components/navigation/index.d.ts +2 -0
- package/dist/components/navigation/index.js +2 -0
- package/dist/components/navigation/pagination-utils.d.ts +2 -1
- package/dist/components/navigation/tabs.d.ts +47 -6
- package/dist/components/navigation/tabs.js +152 -90
- package/dist/components/ui/accordion.d.ts +50 -5
- package/dist/components/ui/accordion.js +239 -33
- package/dist/components/ui/aspect-ratio.d.ts +23 -2
- package/dist/components/ui/aspect-ratio.js +15 -13
- package/dist/components/ui/avatar.d.ts +29 -4
- package/dist/components/ui/avatar.js +111 -25
- package/dist/components/ui/hover-card.d.ts +42 -4
- package/dist/components/ui/hover-card.js +183 -27
- package/dist/components/ui/label.js +0 -1
- package/dist/components/ui/segmented.d.ts +3 -3
- package/dist/components/ui/separator.d.ts +8 -2
- package/dist/components/ui/separator.js +17 -9
- package/dist/components/ui/toggle-group.d.ts +50 -5
- package/dist/components/ui/toggle-group.js +79 -20
- package/dist/components/ui/toggle.d.ts +31 -5
- package/dist/components/ui/toggle.js +42 -3
- package/dist/i18n/messages/en.json +8 -0
- package/dist/i18n/messages/ja.json +8 -0
- package/dist/i18n/messages/vi.json +8 -0
- package/dist/lib/control-styles.d.ts +1 -1
- package/dist/lib/control-styles.js +1 -1
- package/dist/lib/slot.d.ts +32 -0
- package/dist/lib/slot.js +22 -0
- package/dist/lib/variants.d.ts +22 -3
- package/dist/lib/variants.js +56 -1
- package/dist/props/components/app.prop.d.ts +25 -1
- package/dist/props/components/data-display.prop.d.ts +17 -0
- package/dist/props/components/data-entry.prop.d.ts +32 -4
- package/dist/props/components/general.prop.d.ts +31 -1
- package/dist/props/components/index.d.ts +1 -1
- package/dist/props/components/layout.prop.d.ts +118 -5
- package/dist/props/components/navigation.prop.d.ts +1 -1
- package/dist/props/registry.d.ts +22 -2
- package/dist/props/registry.js +33 -2
- package/dist/props/vocabulary/content.prop.d.ts +1 -1
- package/dist/props/vocabulary/index.d.ts +2 -2
- package/dist/props/vocabulary/interaction.prop.d.ts +17 -1
- package/dist/props/vocabulary/layout.prop.d.ts +57 -1
- package/dist/styles/control.css +142 -1
- package/dist/styles/core.css +5 -2
- package/dist/styles/data-display-layout.css +72 -0
- package/dist/styles/focus-ring.css +13 -1
- package/dist/styles/index.css +5 -2
- package/dist/styles/layout.css +106 -0
- package/dist/styles/shell-layout.css +140 -8
- package/dist/styles/text-layout.css +16 -4
- package/dist/tokens/base.css +2 -1
- package/dist/tokens/components/data-display.css +11 -0
- package/dist/tokens/components/shell.css +3 -1
- package/dist/tokens/components/text.css +7 -0
- package/dist/tokens/foundation.css +2 -0
- package/docs/COMPONENTS.md +9 -3
- package/docs/DESIGN-AUTHORITY.md +96 -71
- package/docs/FRAME-COVERAGE-REPORT.md +5 -3
- package/docs/README.md +14 -14
- package/docs/WHAT-BELONGS-HERE.md +179 -0
- package/docs/data-display/legend.tsx +145 -0
- package/docs/data-display/progress.tsx +32 -0
- package/docs/data-entry/segmented.tsx +1 -1
- package/docs/data-entry/select.tsx +2 -2
- package/docs/feedback/sheet.tsx +1 -1
- package/docs/general/typography.tsx +84 -1
- package/docs/layout/app-shell-arrangements.tsx +225 -0
- package/docs/layout/aspect-ratio.tsx +1 -1
- package/docs/navigation/app-setting-picker.tsx +26 -1
- package/docs/navigation/app-setting-toggle.tsx +111 -0
- package/package.json +11 -8
- package/scripts/_agent-setup.mjs +165 -3
- package/scripts/consumer-rule.md +98 -0
- package/scripts/guinea-pig-skill.md +322 -0
- package/scripts/init-guinea-pig.mjs +62 -0
- package/scripts/postinstall.mjs +13 -2
- package/scripts/ui-audit.mjs +115 -14
- /package/dist/tokens/{antd.generated.css → derived.css} +0 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { AppShell, Flex, PageContainer, Sidebar, Topbar } from "@godxjp/ui/layout";
|
|
3
|
+
import type { SidebarSectionProp } from "@godxjp/ui/layout";
|
|
4
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@godxjp/ui/data-display";
|
|
5
|
+
import { Button, Text } from "@godxjp/ui/general";
|
|
6
|
+
import {
|
|
7
|
+
Building2,
|
|
8
|
+
Hash,
|
|
9
|
+
LayoutDashboard,
|
|
10
|
+
MessagesSquare,
|
|
11
|
+
PanelLeftClose,
|
|
12
|
+
PanelLeftOpen,
|
|
13
|
+
Settings,
|
|
14
|
+
Users,
|
|
15
|
+
} from "lucide-react";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* AppShell · column arrangements.
|
|
19
|
+
*
|
|
20
|
+
* THE SHELL HAS TWO INDEPENDENT GEOMETRY AXES, and this page exists so they can be seen next to
|
|
21
|
+
* each other rather than rediscovered:
|
|
22
|
+
*
|
|
23
|
+
* - `topbarSpan` — how far the BAR reaches. "content" starts it beside the sidebar (the rail
|
|
24
|
+
* runs the full window height); "full" runs it edge to edge with the navigation beneath it.
|
|
25
|
+
* - `navRail` — how many navigation COLUMNS there are. Passing the slot adds a second,
|
|
26
|
+
* narrower track before the sidebar: the workspace/organization switcher shape.
|
|
27
|
+
*
|
|
28
|
+
* They are axes, not a preset list. All four combinations are real product shapes, so there is no
|
|
29
|
+
* invalid pairing and nothing to reconcile — which is why the rail is a SLOT and not a fourth
|
|
30
|
+
* value bolted onto `topbarSpan`.
|
|
31
|
+
*
|
|
32
|
+
* Composed only from real @godxjp/ui components.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
const WORKSPACE_RAIL: SidebarSectionProp[] = [
|
|
36
|
+
{
|
|
37
|
+
items: [
|
|
38
|
+
{ id: "home", label: "ホーム", icon: LayoutDashboard },
|
|
39
|
+
{ id: "chat", label: "チャット", icon: MessagesSquare },
|
|
40
|
+
{ id: "people", label: "メンバー", icon: Users },
|
|
41
|
+
{ id: "admin", label: "管理", icon: Settings },
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
const CHANNELS: SidebarSectionProp[] = [
|
|
47
|
+
{
|
|
48
|
+
label: "チャンネル",
|
|
49
|
+
items: [
|
|
50
|
+
{ id: "general", label: "general", icon: Hash },
|
|
51
|
+
{ id: "design", label: "design", icon: Hash },
|
|
52
|
+
{ id: "incident", label: "incident-2026", icon: Hash },
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
label: "ダイレクトメッセージ",
|
|
57
|
+
items: [
|
|
58
|
+
{ id: "dm-sato", label: "佐藤 花子", icon: Users },
|
|
59
|
+
{ id: "dm-tanaka", label: "田中 一郎", icon: Users },
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
export default function Demo() {
|
|
65
|
+
const [withRail, setWithRail] = useState(true);
|
|
66
|
+
const [fullSpan, setFullSpan] = useState(false);
|
|
67
|
+
const [collapsed, setCollapsed] = useState(false);
|
|
68
|
+
|
|
69
|
+
// The rail is ordinary navigation, so it is an ordinary <Sidebar> in icon-only mode — the shell
|
|
70
|
+
// owns the TRACK, never the content that goes in it.
|
|
71
|
+
const rail = (
|
|
72
|
+
<Sidebar aria-label="ワークスペース" activeId="chat" collapsed sections={WORKSPACE_RAIL} />
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<AppShell
|
|
77
|
+
topbarSpan={fullSpan ? "full" : "content"}
|
|
78
|
+
navRail={withRail ? rail : undefined}
|
|
79
|
+
navRailLabel="ワークスペース"
|
|
80
|
+
sidebarCollapsed={collapsed}
|
|
81
|
+
logo={
|
|
82
|
+
<Flex align="center" gap="sm">
|
|
83
|
+
<Building2 aria-hidden="true" />
|
|
84
|
+
<Text weight="medium">CoreChat</Text>
|
|
85
|
+
</Flex>
|
|
86
|
+
}
|
|
87
|
+
sidebar={
|
|
88
|
+
<Sidebar
|
|
89
|
+
aria-label="チャンネル"
|
|
90
|
+
activeId="general"
|
|
91
|
+
collapsed={collapsed}
|
|
92
|
+
sections={CHANNELS}
|
|
93
|
+
/>
|
|
94
|
+
}
|
|
95
|
+
topbar={
|
|
96
|
+
<Topbar
|
|
97
|
+
start={
|
|
98
|
+
<Button
|
|
99
|
+
size="sm"
|
|
100
|
+
variant="ghost"
|
|
101
|
+
aria-label={collapsed ? "サイドバーを開く" : "サイドバーを閉じる"}
|
|
102
|
+
aria-expanded={!collapsed}
|
|
103
|
+
onClick={() => setCollapsed((c) => !c)}
|
|
104
|
+
>
|
|
105
|
+
{collapsed ? (
|
|
106
|
+
<PanelLeftOpen aria-hidden="true" />
|
|
107
|
+
) : (
|
|
108
|
+
<PanelLeftClose aria-hidden="true" />
|
|
109
|
+
)}
|
|
110
|
+
</Button>
|
|
111
|
+
}
|
|
112
|
+
/>
|
|
113
|
+
}
|
|
114
|
+
>
|
|
115
|
+
<PageContainer
|
|
116
|
+
title="列の構成"
|
|
117
|
+
subtitle={`${withRail ? "3 列" : "2 列"} · topbarSpan="${fullSpan ? "full" : "content"}"${
|
|
118
|
+
collapsed ? " · 折りたたみ" : ""
|
|
119
|
+
}`}
|
|
120
|
+
extra={
|
|
121
|
+
<Flex gap="sm">
|
|
122
|
+
<Button
|
|
123
|
+
size="sm"
|
|
124
|
+
variant={withRail ? "default" : "outline"}
|
|
125
|
+
aria-pressed={withRail}
|
|
126
|
+
onClick={() => setWithRail((v) => !v)}
|
|
127
|
+
>
|
|
128
|
+
navRail
|
|
129
|
+
</Button>
|
|
130
|
+
<Button
|
|
131
|
+
size="sm"
|
|
132
|
+
variant={fullSpan ? "default" : "outline"}
|
|
133
|
+
aria-pressed={fullSpan}
|
|
134
|
+
onClick={() => setFullSpan((v) => !v)}
|
|
135
|
+
>
|
|
136
|
+
topbarSpan=full
|
|
137
|
+
</Button>
|
|
138
|
+
<Button
|
|
139
|
+
size="sm"
|
|
140
|
+
variant={collapsed ? "default" : "outline"}
|
|
141
|
+
aria-pressed={collapsed}
|
|
142
|
+
onClick={() => setCollapsed((v) => !v)}
|
|
143
|
+
>
|
|
144
|
+
折りたたみ
|
|
145
|
+
</Button>
|
|
146
|
+
</Flex>
|
|
147
|
+
}
|
|
148
|
+
>
|
|
149
|
+
<Flex direction="col" gap="lg">
|
|
150
|
+
<Card>
|
|
151
|
+
<CardHeader>
|
|
152
|
+
<CardTitle level={2}>2 本の軸は独立している</CardTitle>
|
|
153
|
+
<CardDescription>
|
|
154
|
+
上の 3 つのボタンは互いに干渉しない。<code>navRail</code> は「ナビゲーションの列が
|
|
155
|
+
何本か」を、<code>topbarSpan</code> は「バーがどこまで伸びるか」を答える別々の軸で、
|
|
156
|
+
4 通りの組み合わせはすべて実在するプロダクトの形なので、禁止すべき組み合わせは
|
|
157
|
+
存在しない。だから rail は <code>topbarSpan</code> に足した 4 つ目の値ではなく
|
|
158
|
+
スロットとして実装されている ― プリセット名を 4 つ覚える API にはしない。
|
|
159
|
+
</CardDescription>
|
|
160
|
+
<CardDescription>
|
|
161
|
+
列幅はすべてトークン。<code>--app-shell-nav-rail-width</code>(4rem)が rail、
|
|
162
|
+
<code>--app-shell-sidebar-width</code>(16rem)がサイドバー、
|
|
163
|
+
<code>--app-shell-sidebar-collapsed-width</code>(4rem)が折りたたみ時の
|
|
164
|
+
サイドバー。3 つ目は 19.x では <code>--app-shell-rail-width</code> という名前で、
|
|
165
|
+
20.0.0 で追加された本物の rail と正面衝突した ― 同じ 4rem、同じ「rail」の綴り、
|
|
166
|
+
意味は別物。エイリアスを残さず改名したのは、どちらの読み方でも
|
|
167
|
+
もっともらしい幅に解決してしまい、静かに壊れるため。
|
|
168
|
+
</CardDescription>
|
|
169
|
+
</CardHeader>
|
|
170
|
+
</Card>
|
|
171
|
+
|
|
172
|
+
<Card>
|
|
173
|
+
<CardHeader>
|
|
174
|
+
<CardTitle level={2}>折りたたみは 1 本の列だけを畳む</CardTitle>
|
|
175
|
+
<CardDescription>
|
|
176
|
+
「折りたたみ」を押すと、サイドバーの列だけが 16rem → 4rem になり、rail
|
|
177
|
+
は幅を保つ。Slack の挙動であり、折りたたみ中も rail
|
|
178
|
+
の行き先に手が届き続ける唯一の形。 rail まで一緒に畳むと、意味の分からない
|
|
179
|
+
アイコンの帯が 2 本並ぶだけになる。
|
|
180
|
+
</CardDescription>
|
|
181
|
+
</CardHeader>
|
|
182
|
+
<CardContent>
|
|
183
|
+
<Flex direction="col" gap="sm">
|
|
184
|
+
<Flex justify="between">
|
|
185
|
+
<Text tone="muted">rail</Text>
|
|
186
|
+
<Text mono>{withRail ? "4rem(固定)" : "—"}</Text>
|
|
187
|
+
</Flex>
|
|
188
|
+
<Flex justify="between">
|
|
189
|
+
<Text tone="muted">sidebar</Text>
|
|
190
|
+
<Text mono>{collapsed ? "4rem" : "16rem"}</Text>
|
|
191
|
+
</Flex>
|
|
192
|
+
<Flex justify="between">
|
|
193
|
+
<Text tone="muted">コンテンツ左端</Text>
|
|
194
|
+
<Text mono>
|
|
195
|
+
{withRail ? (collapsed ? "128px" : "320px") : collapsed ? "64px" : "256px"}
|
|
196
|
+
</Text>
|
|
197
|
+
</Flex>
|
|
198
|
+
</Flex>
|
|
199
|
+
</CardContent>
|
|
200
|
+
</Card>
|
|
201
|
+
|
|
202
|
+
<Card>
|
|
203
|
+
<CardHeader>
|
|
204
|
+
<CardTitle level={2}>900px 以下では両方の列が消える</CardTitle>
|
|
205
|
+
<CardDescription>
|
|
206
|
+
Frame の Dimensions を 900px 以下にすると、rail とサイドバーの両方が隠れ、
|
|
207
|
+
AppShell 所有のドロワーが navigation を引き受ける。 rail
|
|
208
|
+
を渡している場合、ドロワーの既定値は「rail のあとにサイドバー」になる ―
|
|
209
|
+
両方の列が隠れる幅で <code>sidebar</code> だけを既定にすると、rail
|
|
210
|
+
が運んでいるアプリ階層の行き先が 端末によって存在したりしなかったりする。
|
|
211
|
+
いくつかの画面幅にしか無いコントロールは、コントロールではなく罠。
|
|
212
|
+
</CardDescription>
|
|
213
|
+
<CardDescription>
|
|
214
|
+
グリッドのテンプレートから領域名が消えるだけでは要素は消えない ―
|
|
215
|
+
実測では、狭幅テンプレートを当てて <code>.app-sidebar</code> だけを隠した状態で
|
|
216
|
+
rail が暗黙の列に自動配置され、33×168px の断片としてページ本文の上に残った。
|
|
217
|
+
だから狭幅ブロックは rail を明示的に隠す。
|
|
218
|
+
</CardDescription>
|
|
219
|
+
</CardHeader>
|
|
220
|
+
</Card>
|
|
221
|
+
</Flex>
|
|
222
|
+
</PageContainer>
|
|
223
|
+
</AppShell>
|
|
224
|
+
);
|
|
225
|
+
}
|
|
@@ -4,7 +4,7 @@ import { Skeleton } from "@godxjp/ui/feedback";
|
|
|
4
4
|
import { AspectRatio, Flex, PageContainer } from "@godxjp/ui/layout";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* AspectRatio ·
|
|
7
|
+
* AspectRatio · AspectRatio (thuộc tính CSS aspect-ratio, một node). Stabilises media/preview frames so
|
|
8
8
|
* they do not reflow during load. ratio = width / height (number). Children fill
|
|
9
9
|
* the constrained box · use object-fit: cover on images, width/height 100% on
|
|
10
10
|
* iframes and SVG charts. Do not use for unconstrained text content. Composed
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
CardTitle,
|
|
10
10
|
} from "@godxjp/ui/data-display";
|
|
11
11
|
import { Text } from "@godxjp/ui/general";
|
|
12
|
-
import { Flex, PageContainer, Topbar } from "@godxjp/ui/layout";
|
|
12
|
+
import { Flex, PageContainer, Topbar, TopbarItem } from "@godxjp/ui/layout";
|
|
13
13
|
import { AppSettingPicker } from "@godxjp/ui/navigation";
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -123,6 +123,31 @@ export default function Demo() {
|
|
|
123
123
|
</CardContent>
|
|
124
124
|
</Card>
|
|
125
125
|
|
|
126
|
+
<Card>
|
|
127
|
+
<CardHeader>
|
|
128
|
+
<CardTitle level={2}>バーのセル(appearance="bar")</CardTitle>
|
|
129
|
+
<CardDescription>
|
|
130
|
+
<code>icon</code> と同じ構造上の省略を保ったまま、箱だけがバーの
|
|
131
|
+
<strong>セル</strong>になる。バーの高さいっぱいに伸び、角は
|
|
132
|
+
<code>--topbar-item-radius</code>(<code>TopbarItem</code> と同じつまみ)で四角い。
|
|
133
|
+
ホバーの面はバーそのものを塗る。
|
|
134
|
+
<code>icon</code> をバーに置くと <code>--control-height</code>
|
|
135
|
+
の丸い錠剤が背の高い帯の中に浮き、バー本来のクロームとは別系統に読める。
|
|
136
|
+
</CardDescription>
|
|
137
|
+
</CardHeader>
|
|
138
|
+
<CardContent>
|
|
139
|
+
<Topbar
|
|
140
|
+
start={<TopbarItem>プロジェクト</TopbarItem>}
|
|
141
|
+
end={
|
|
142
|
+
<>
|
|
143
|
+
<AppSettingPicker kind="locale" appearance="bar" id="topbar-locale-bar" />
|
|
144
|
+
<AppSettingPicker kind="theme" appearance="bar" id="topbar-theme-bar" />
|
|
145
|
+
</>
|
|
146
|
+
}
|
|
147
|
+
/>
|
|
148
|
+
</CardContent>
|
|
149
|
+
</Card>
|
|
150
|
+
|
|
126
151
|
<Card>
|
|
127
152
|
<CardHeader>
|
|
128
153
|
<CardTitle level={2}>無効化</CardTitle>
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { AppProvider } from "@godxjp/ui/app";
|
|
2
|
+
import {
|
|
3
|
+
Avatar,
|
|
4
|
+
AvatarFallback,
|
|
5
|
+
Card,
|
|
6
|
+
CardContent,
|
|
7
|
+
CardDescription,
|
|
8
|
+
CardHeader,
|
|
9
|
+
CardTitle,
|
|
10
|
+
} from "@godxjp/ui/data-display";
|
|
11
|
+
import { Text } from "@godxjp/ui/general";
|
|
12
|
+
import { Flex, PageContainer, Topbar } from "@godxjp/ui/layout";
|
|
13
|
+
import { AppSettingToggle } from "@godxjp/ui/navigation";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* AppSettingToggle — ONE button that steps a single AppProvider setting to its next value and
|
|
17
|
+
* shows that value as its glyph. The no-menu counterpart to AppSettingPicker: same binding
|
|
18
|
+
* contract, same option order, one tap instead of open-then-choose. `appearance="bar"` (the
|
|
19
|
+
* default) is a CELL of the bar — full bar height, the bar's own hover surface, square corners.
|
|
20
|
+
*/
|
|
21
|
+
export default function Demo() {
|
|
22
|
+
return (
|
|
23
|
+
<AppProvider defaultLocale="ja" defaultTimeFormat="24h" persist={false}>
|
|
24
|
+
<PageContainer
|
|
25
|
+
title="AppSettingToggle"
|
|
26
|
+
subtitle="押すたびに次の値へ送る 1 ボタン。ドロップダウンなし。"
|
|
27
|
+
>
|
|
28
|
+
<Flex direction="col" gap="lg">
|
|
29
|
+
<Card>
|
|
30
|
+
<CardHeader>
|
|
31
|
+
<CardTitle level={2}>トップバーのセル(既定)</CardTitle>
|
|
32
|
+
<CardDescription>
|
|
33
|
+
appearance="bar" はバーの一部として全高で伸び、角は
|
|
34
|
+
--topbar-item-radius。--control-height の錠剤がバーの中に浮くことはない。
|
|
35
|
+
</CardDescription>
|
|
36
|
+
</CardHeader>
|
|
37
|
+
<CardContent>
|
|
38
|
+
<Topbar
|
|
39
|
+
start={
|
|
40
|
+
<Avatar className="rounded-md">
|
|
41
|
+
<AvatarFallback>G</AvatarFallback>
|
|
42
|
+
</Avatar>
|
|
43
|
+
}
|
|
44
|
+
end={
|
|
45
|
+
<>
|
|
46
|
+
<AppSettingToggle kind="theme" id="topbar-theme-toggle" />
|
|
47
|
+
<AppSettingToggle kind="density" id="topbar-density-toggle" />
|
|
48
|
+
<AppSettingToggle kind="fontSize" id="topbar-font-size-toggle" />
|
|
49
|
+
<AppSettingToggle kind="timeFormat" id="topbar-time-format-toggle" />
|
|
50
|
+
</>
|
|
51
|
+
}
|
|
52
|
+
/>
|
|
53
|
+
</CardContent>
|
|
54
|
+
</Card>
|
|
55
|
+
|
|
56
|
+
<Card>
|
|
57
|
+
<CardHeader>
|
|
58
|
+
<CardTitle level={2}>バー以外(appearance="icon")</CardTitle>
|
|
59
|
+
<CardDescription>
|
|
60
|
+
設定行やカードヘッダーなど、バーではない場所。--control-height
|
|
61
|
+
の正方形ゴーストボタン。
|
|
62
|
+
</CardDescription>
|
|
63
|
+
</CardHeader>
|
|
64
|
+
<CardContent>
|
|
65
|
+
<Flex direction="row" gap="md" align="center" wrap>
|
|
66
|
+
<Flex direction="row" gap="sm" align="center">
|
|
67
|
+
<Text weight="medium">テーマ</Text>
|
|
68
|
+
<AppSettingToggle kind="theme" appearance="icon" id="icon-theme-toggle" />
|
|
69
|
+
</Flex>
|
|
70
|
+
<Flex direction="row" gap="sm" align="center">
|
|
71
|
+
<Text weight="medium">時刻形式</Text>
|
|
72
|
+
<AppSettingToggle
|
|
73
|
+
kind="timeFormat"
|
|
74
|
+
appearance="icon"
|
|
75
|
+
id="icon-time-format-toggle"
|
|
76
|
+
/>
|
|
77
|
+
</Flex>
|
|
78
|
+
</Flex>
|
|
79
|
+
</CardContent>
|
|
80
|
+
</Card>
|
|
81
|
+
|
|
82
|
+
<Card>
|
|
83
|
+
<CardHeader>
|
|
84
|
+
<CardTitle level={2}>制御モードと無効化</CardTitle>
|
|
85
|
+
<CardDescription>
|
|
86
|
+
value + onValueChange で外部状態に紐づけ、disabled で操作を止める。
|
|
87
|
+
</CardDescription>
|
|
88
|
+
</CardHeader>
|
|
89
|
+
<CardContent>
|
|
90
|
+
<Flex direction="row" gap="md" align="center">
|
|
91
|
+
<AppSettingToggle
|
|
92
|
+
kind="density"
|
|
93
|
+
appearance="icon"
|
|
94
|
+
value="comfortable"
|
|
95
|
+
onValueChange={() => {}}
|
|
96
|
+
id="controlled-density-toggle"
|
|
97
|
+
/>
|
|
98
|
+
<AppSettingToggle
|
|
99
|
+
kind="theme"
|
|
100
|
+
appearance="icon"
|
|
101
|
+
disabled
|
|
102
|
+
id="disabled-theme-toggle"
|
|
103
|
+
/>
|
|
104
|
+
</Flex>
|
|
105
|
+
</CardContent>
|
|
106
|
+
</Card>
|
|
107
|
+
</Flex>
|
|
108
|
+
</PageContainer>
|
|
109
|
+
</AppProvider>
|
|
110
|
+
);
|
|
111
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@godxjp/ui",
|
|
3
|
-
"version": "
|
|
4
|
-
"godxUiMcp": "
|
|
3
|
+
"version": "20.0.0",
|
|
4
|
+
"godxUiMcp": "20.0.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -30,6 +30,9 @@
|
|
|
30
30
|
"scripts/visual-audit-rules.mjs",
|
|
31
31
|
"scripts/audit-hook.mjs",
|
|
32
32
|
"scripts/init-agent-kit.mjs",
|
|
33
|
+
"scripts/init-guinea-pig.mjs",
|
|
34
|
+
"scripts/guinea-pig-skill.md",
|
|
35
|
+
"scripts/consumer-rule.md",
|
|
33
36
|
"scripts/postinstall.mjs",
|
|
34
37
|
"scripts/_agent-setup.mjs",
|
|
35
38
|
"scripts/cli.mjs",
|
|
@@ -308,6 +311,7 @@
|
|
|
308
311
|
"format": "prettier --check .",
|
|
309
312
|
"format:fix": "prettier --write .",
|
|
310
313
|
"test": "vitest run",
|
|
314
|
+
"test:manual": "vitest run --config vitest.manual.config.ts",
|
|
311
315
|
"test:visual:auth-login": "node scripts/auth-shell-login-visual.mjs",
|
|
312
316
|
"test:visual:auth-registration": "node scripts/auth-shell-registration-visual.mjs",
|
|
313
317
|
"test:visual:topbar-collision": "node scripts/topbar-collision-visual.mjs",
|
|
@@ -335,8 +339,8 @@
|
|
|
335
339
|
"check:frame-runtime": "pnpm check:data-entry-frame-runtime && pnpm check:data-entry-touch-aria && pnpm check:layout-nav-frames && pnpm check:provider-feedback-query-runtime && pnpm check:layout-nav-closure && pnpm check:final-touch-rtl && pnpm check:data-table-pagination-wrap && pnpm check:button-icon-xs",
|
|
336
340
|
"verify": "pnpm typecheck && pnpm lint && pnpm format && pnpm build && pnpm preview:build && pnpm check:example-imports && pnpm check:core-isolation && pnpm check:no-consumer-coupling && pnpm check:prop-vocabulary && pnpm check:token-tiers && pnpm check:no-external-assets && pnpm check:token-scale-bypass && pnpm check:dist-tokens-resolve && pnpm check:no-hardcoded-geometry && pnpm check:no-hardcoded-css-values && pnpm check:no-inline-magic-numbers && pnpm check:no-tailwind-class-assertions && pnpm check:control-sizing && pnpm check:rtl && pnpm check:typography && pnpm check:mcp-lockstep && pnpm check:mcp-sync && pnpm check:doc-prop-existence && pnpm check:mcp-catalog-coverage && pnpm check:mcp-orphans && pnpm check:mcp-pattern-imports && pnpm check:audit-sync && pnpm check:frame-coverage && pnpm test",
|
|
337
341
|
"verify:static": "pnpm build && pnpm check:packed-public-contract && pnpm typecheck && pnpm typecheck:docs && pnpm lint && pnpm preview:build && pnpm check:example-imports && pnpm check:core-isolation && pnpm check:no-consumer-coupling && pnpm check:use-client && pnpm check:prop-vocabulary && pnpm check:token-tiers && pnpm check:token-scale-bypass && pnpm check:dist-tokens-resolve && pnpm check:no-hardcoded-geometry && pnpm check:no-hardcoded-css-values && pnpm check:no-inline-magic-numbers && pnpm check:no-tailwind-class-assertions && pnpm check:control-sizing && pnpm check:rtl && pnpm check:typography && pnpm check:mcp-lockstep && pnpm check:mcp-sync && pnpm check:doc-prop-existence && pnpm check:mcp-catalog-coverage && pnpm check:mcp-orphans && pnpm check:mcp-pattern-imports && pnpm check:audit-sync && pnpm check:mcp-prop-sync && pnpm check:contrast && pnpm check:visual-audit && pnpm test",
|
|
338
|
-
"verify:ci": "pnpm
|
|
339
|
-
"verify:ci:static": "pnpm build && pnpm check:packed-public-contract && pnpm typecheck && pnpm typecheck:docs && pnpm lint && pnpm preview:build && pnpm check:example-imports && pnpm check:core-isolation && pnpm check:no-consumer-coupling && pnpm check:use-client && pnpm check:prop-vocabulary && pnpm check:token-tiers && pnpm check:no-external-assets && pnpm check:token-scale-bypass && pnpm check:dist-tokens-resolve && pnpm check:no-hardcoded-geometry && pnpm check:no-hardcoded-css-values && pnpm check:no-inline-magic-numbers && pnpm check:no-tailwind-class-assertions && pnpm check:control-sizing && pnpm check:rtl && pnpm check:typography && pnpm check:mcp-lockstep && pnpm check:mcp-sync && pnpm check:doc-prop-existence && pnpm check:mcp-catalog-coverage && pnpm check:mcp-orphans && pnpm check:mcp-pattern-imports && pnpm check:audit-sync && pnpm check:mcp-prop-sync",
|
|
342
|
+
"verify:ci": "pnpm verify:ci:static && pnpm check:frame-contracts && pnpm test",
|
|
343
|
+
"verify:ci:static": "pnpm build && pnpm check:packed-public-contract && pnpm typecheck && pnpm typecheck:docs && pnpm lint && pnpm preview:build && pnpm check:registry && pnpm check:example-imports && pnpm check:core-isolation && pnpm check:no-consumer-coupling && pnpm check:use-client && pnpm check:prop-vocabulary && pnpm check:token-tiers && pnpm check:no-external-assets && pnpm check:token-scale-bypass && pnpm check:no-antd-runtime && pnpm check:dist-tokens-resolve && pnpm check:no-hardcoded-geometry && pnpm check:no-hardcoded-css-values && pnpm check:no-inline-magic-numbers && pnpm check:no-tailwind-class-assertions && pnpm check:control-sizing && pnpm check:rtl && pnpm check:typography && pnpm check:mcp-lockstep && pnpm check:mcp-sync && pnpm check:doc-prop-existence && pnpm check:mcp-catalog-coverage && pnpm check:mcp-orphans && pnpm check:mcp-pattern-imports && pnpm check:audit-sync && pnpm check:gate-coverage && pnpm check:mcp-prop-sync",
|
|
340
344
|
"verify:browser": "pnpm check:contrast && pnpm check:visual-audit",
|
|
341
345
|
"verify:release": "pnpm verify:static && pnpm check:frame-contracts && pnpm check:frame-coverage && pnpm check:frame-axe",
|
|
342
346
|
"verify:publish-tree": "pnpm build && pnpm check:packed-public-contract && pnpm check:use-client && pnpm check:dist-tokens-resolve",
|
|
@@ -365,9 +369,6 @@
|
|
|
365
369
|
"check:rtl": "node scripts/check-rtl.mjs",
|
|
366
370
|
"check:typography": "node scripts/check-typography.mjs",
|
|
367
371
|
"gen:component-tokens": "node scripts/gen-component-tokens.mjs",
|
|
368
|
-
"gen:antd-tokens": "node scripts/gen-antd-tokens.mjs",
|
|
369
|
-
"check:antd-tokens": "node scripts/gen-antd-tokens.mjs --check",
|
|
370
|
-
"report:antd-tokens": "node scripts/gen-antd-tokens.mjs --report",
|
|
371
372
|
"check:no-antd-runtime": "node scripts/check-no-antd-runtime.mjs",
|
|
372
373
|
"gen:email-tokens": "node scripts/gen-email-tokens.mjs",
|
|
373
374
|
"check:core-isolation": "node scripts/check-core-isolation.mjs",
|
|
@@ -384,6 +385,7 @@
|
|
|
384
385
|
"dev": "node scripts/dev.mjs",
|
|
385
386
|
"prepublishOnly": "pnpm run build",
|
|
386
387
|
"check:audit-sync": "node scripts/check-audit-sync.mjs",
|
|
388
|
+
"check:gate-coverage": "node scripts/check-gate-coverage.mjs",
|
|
387
389
|
"check:contrast": "node scripts/check-contrast.mjs",
|
|
388
390
|
"visual-audit": "node scripts/visual-audit.mjs",
|
|
389
391
|
"check:visual-audit": "node scripts/visual-audit-smoke.mjs",
|
|
@@ -451,6 +453,7 @@
|
|
|
451
453
|
"@radix-ui/react-toggle": "^1.1.18",
|
|
452
454
|
"@radix-ui/react-toggle-group": "^1.1.19",
|
|
453
455
|
"@radix-ui/react-tooltip": "^1.2.16",
|
|
456
|
+
"@react-aria/utils": "^3.34.1",
|
|
454
457
|
"@tanstack/react-table": "^9.2.4",
|
|
455
458
|
"class-variance-authority": "^0.7.1",
|
|
456
459
|
"clsx": "^2.1.1",
|
|
@@ -460,6 +463,7 @@
|
|
|
460
463
|
"input-otp": "^1.5.0",
|
|
461
464
|
"lucide-react": "^1.37.0",
|
|
462
465
|
"qrcode.react": "4.2.0",
|
|
466
|
+
"react-aria-components": "^1.21.1",
|
|
463
467
|
"react-day-picker": "^10.0.1",
|
|
464
468
|
"react-resizable-panels": "^4.12.3",
|
|
465
469
|
"sonner": "^2.0.8",
|
|
@@ -483,7 +487,6 @@
|
|
|
483
487
|
"@types/react-dom": "^19.2.5",
|
|
484
488
|
"@vitejs/plugin-react": "^6.1.1",
|
|
485
489
|
"@vitest/coverage-v8": "^4.1.11",
|
|
486
|
-
"antd": "6.6.2",
|
|
487
490
|
"axe-core": "^4.13.0",
|
|
488
491
|
"eslint": "^10.9.1",
|
|
489
492
|
"eslint-plugin-react": "^7.37.5",
|