@godxjp/ui 31.4.0 → 31.5.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/agent/START-HERE.md +5 -5
- package/agent/components/CodeBlock.json +7 -1
- package/agent/components/OrgChart.json +59 -0
- package/agent/components-index.json +5 -0
- package/agent/components.json +66 -1
- package/agent/index.json +6 -6
- package/agent/llms.txt +6 -6
- package/agent/tokens.json +108 -0
- package/dist/components/data-display/code-block.js +90 -4
- package/dist/components/data-display/index.d.ts +2 -0
- package/dist/components/data-display/index.js +2 -0
- package/dist/components/data-display/org-chart.d.ts +5 -0
- package/dist/components/data-display/org-chart.js +169 -0
- package/dist/components/general/typography.d.ts +32 -0
- package/dist/components/general/typography.js +11 -2
- package/dist/contracts/measurement.json +1 -1
- package/dist/i18n/messages/en.json +10 -0
- package/dist/i18n/messages/ja.json +10 -0
- package/dist/i18n/messages/vi.json +10 -0
- package/dist/props/components/data-display.prop.d.ts +51 -1
- package/dist/props/registry.d.ts +39 -0
- package/dist/props/registry.js +49 -0
- package/dist/styles/data-display-layout.css +173 -0
- package/dist/styles/layers.json +14 -1
- package/dist/tokens/base.css +1 -0
- package/dist/tokens/components/org-chart.css +27 -0
- package/docs/FRAME-COVERAGE-REPORT.md +3 -2
- package/docs/data-display/code-block.tsx +27 -0
- package/docs/data-display/org-chart.tsx +165 -0
- package/docs/navigation/tabs.tsx +17 -15
- package/docs/query/data-state.tsx +2 -4
- package/docs/showcase/table-view-tabs.tsx +1 -1
- package/package.json +2 -2
package/dist/styles/layers.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "31.
|
|
2
|
+
"version": "31.5.0",
|
|
3
3
|
"generatedBy": "scripts/gen-style-layers.mjs — do not edit by hand; run `pnpm gen:style-layers`",
|
|
4
4
|
"base": "base.css",
|
|
5
5
|
"fonts": "fonts.css",
|
|
@@ -349,6 +349,9 @@
|
|
|
349
349
|
},
|
|
350
350
|
"CodeBlock": {
|
|
351
351
|
"layers": [
|
|
352
|
+
"control.css",
|
|
353
|
+
"text-layout.css",
|
|
354
|
+
"dialog-layout.css",
|
|
352
355
|
"data-display-layout.css"
|
|
353
356
|
]
|
|
354
357
|
},
|
|
@@ -673,6 +676,16 @@
|
|
|
673
676
|
"control.css"
|
|
674
677
|
]
|
|
675
678
|
},
|
|
679
|
+
"OrgChart": {
|
|
680
|
+
"layers": [
|
|
681
|
+
"layout.css",
|
|
682
|
+
"control.css",
|
|
683
|
+
"table-layout.css",
|
|
684
|
+
"alert-layout.css",
|
|
685
|
+
"data-display-layout.css",
|
|
686
|
+
"form-layout.css"
|
|
687
|
+
]
|
|
688
|
+
},
|
|
676
689
|
"OrgSwitcher": {
|
|
677
690
|
"layers": [
|
|
678
691
|
"shell-layout.css",
|
package/dist/tokens/base.css
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
@import "./components/text.css";
|
|
39
39
|
@import "./components/tree.css";
|
|
40
40
|
@import "./components/thought-chain.css";
|
|
41
|
+
@import "./components/org-chart.css";
|
|
41
42
|
@import "./components/welcome.css";
|
|
42
43
|
@import "./components/actions.css";
|
|
43
44
|
@import "./components/attachments.css";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
|
|
5
|
+
--org-chart-node-inline-size: 13rem;
|
|
6
|
+
--org-chart-node-padding-block: var(--space-3);
|
|
7
|
+
--org-chart-node-padding-inline: var(--space-3);
|
|
8
|
+
--org-chart-node-gap: var(--space-3);
|
|
9
|
+
--org-chart-node-text-gap: var(--space-1);
|
|
10
|
+
--org-chart-node-radius: initial;
|
|
11
|
+
--org-chart-node-border-width: initial;
|
|
12
|
+
--org-chart-node-border-color: initial;
|
|
13
|
+
--org-chart-node-background: initial;
|
|
14
|
+
--org-chart-node-foreground: initial;
|
|
15
|
+
--org-chart-node-title-color: initial;
|
|
16
|
+
--org-chart-node-font-size: var(--font-size-sm, var(--font-size-base));
|
|
17
|
+
|
|
18
|
+
--org-chart-agent-border-style: dashed;
|
|
19
|
+
|
|
20
|
+
--org-chart-level-gap: var(--space-8);
|
|
21
|
+
--org-chart-sibling-gap: var(--space-4);
|
|
22
|
+
|
|
23
|
+
--org-chart-line-width: initial;
|
|
24
|
+
--org-chart-line-color: initial;
|
|
25
|
+
|
|
26
|
+
--org-chart-padding: var(--space-2);
|
|
27
|
+
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
> Generated by `scripts/frame-coverage.mjs` (issue #163). Do not edit by hand — run `pnpm check:frame-coverage`.
|
|
4
4
|
> Standard: [FRAME-COVERAGE-STANDARD.md](./FRAME-COVERAGE-STANDARD.md). A missing dimension is **UNTESTED**, never a pass.
|
|
5
5
|
|
|
6
|
-
- Public components: **
|
|
7
|
-
- With ≥1 frame: **
|
|
6
|
+
- Public components: **177**
|
|
7
|
+
- With ≥1 frame: **153** · zero-frame: **24**
|
|
8
8
|
- Fully covered (every contract axis declared): **0**
|
|
9
9
|
|
|
10
10
|
## UNTESTED — no `/frame/**` route
|
|
@@ -211,6 +211,7 @@ Legend: ✓ covered · N/A reasoned skip · · UNTESTED (blank cell = UNTESTED).
|
|
|
211
211
|
| Welcome | ✓ | · | N/A | N/A | · | · | · | · | · | · |
|
|
212
212
|
| Actions | ✓ | · | N/A | N/A | · | · | · | · | · | · |
|
|
213
213
|
| ThoughtChain | ✓ | N/A | N/A | N/A | · | · | · | · | · | · |
|
|
214
|
+
| OrgChart | ✓ | N/A | N/A | N/A | · | · | · | · | · | · |
|
|
214
215
|
| Attachments | ✓ | N/A | · | N/A | · | · | · | · | · | · |
|
|
215
216
|
| Marquee | ✓ | N/A | N/A | N/A | · | · | · | · | · | · |
|
|
216
217
|
| Masonry | ✓ | N/A | N/A | N/A | · | · | · | · | · | · |
|
|
@@ -84,6 +84,33 @@ export default function Demo() {
|
|
|
84
84
|
</Flex>
|
|
85
85
|
</CardContent>
|
|
86
86
|
</Card>
|
|
87
|
+
<Card>
|
|
88
|
+
<CardHeader>
|
|
89
|
+
<CardTitle level={2}>Copyable (gh#1032)</CardTitle>
|
|
90
|
+
<CardDescription>
|
|
91
|
+
antd Typography's copyable, same name and semantics. The button sits in the
|
|
92
|
+
inline-end corner, the block reserves that column so no line runs under it, and the
|
|
93
|
+
copy is announced politely. Pass copyable.text to copy something other than the
|
|
94
|
+
block's text content; the button stays in its corner while the block scrolls.
|
|
95
|
+
</CardDescription>
|
|
96
|
+
</CardHeader>
|
|
97
|
+
<CardContent>
|
|
98
|
+
<Flex direction="col" gap="md">
|
|
99
|
+
<CodeBlock copyable language="bash" aria-label="Install command">
|
|
100
|
+
pnpm add @godxjp/ui
|
|
101
|
+
</CodeBlock>
|
|
102
|
+
<CodeBlock
|
|
103
|
+
copyable={{ tooltips: ["Copy response", "Copied"] }}
|
|
104
|
+
maxHeight="sm"
|
|
105
|
+
language="json"
|
|
106
|
+
aria-label="Response body with a copy button"
|
|
107
|
+
>
|
|
108
|
+
{responseBody}
|
|
109
|
+
</CodeBlock>
|
|
110
|
+
</Flex>
|
|
111
|
+
</CardContent>
|
|
112
|
+
</Card>
|
|
113
|
+
|
|
87
114
|
<Card>
|
|
88
115
|
<CardHeader>
|
|
89
116
|
<CardTitle level={2}>Syntax colour · the package owns the palette (gh#784)</CardTitle>
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Avatar,
|
|
3
|
+
AvatarFallback,
|
|
4
|
+
Badge,
|
|
5
|
+
Card,
|
|
6
|
+
CardContent,
|
|
7
|
+
OrgChart,
|
|
8
|
+
type OrgChartNodeProp,
|
|
9
|
+
} from "@godxjp/ui/data-display";
|
|
10
|
+
import { Text } from "@godxjp/ui/general";
|
|
11
|
+
import {
|
|
12
|
+
AppShell,
|
|
13
|
+
Flex,
|
|
14
|
+
PageContainer,
|
|
15
|
+
Sidebar,
|
|
16
|
+
type SidebarSectionProp,
|
|
17
|
+
Topbar,
|
|
18
|
+
} from "@godxjp/ui/layout";
|
|
19
|
+
import { Bot, Building2, Settings, Users } from "lucide-react";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* OrgChart — who reports to whom, people and AI agents on one chart (gh#1034).
|
|
23
|
+
*
|
|
24
|
+
* Three levels: the CEO, three department heads, and their reports, two of which are AI agents.
|
|
25
|
+
* An agent's box is dashed and its accessible name ends in "AI agent", so the difference is never
|
|
26
|
+
* the stroke alone. The chart is an APG tree view: Tab lands on one box, the arrow keys walk it.
|
|
27
|
+
*
|
|
28
|
+
* Narrow the preview: under 40rem of CONTAINER width the same data turns into an indented Tree.
|
|
29
|
+
* The second card is deliberately narrow to show that form beside the wide one.
|
|
30
|
+
*
|
|
31
|
+
* Composed only from real @godxjp/ui components.
|
|
32
|
+
*/
|
|
33
|
+
const sections: SidebarSectionProp[] = [
|
|
34
|
+
{
|
|
35
|
+
label: "Organization",
|
|
36
|
+
items: [
|
|
37
|
+
{ id: "chart", label: "Org chart", icon: Building2 },
|
|
38
|
+
{ id: "members", label: "Members", icon: Users },
|
|
39
|
+
{ id: "agents", label: "Agents", icon: Bot },
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
{ label: "Admin", items: [{ id: "settings", label: "Settings", icon: Settings }] },
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
const mark = (initials: string) => (
|
|
46
|
+
<Avatar size="sm">
|
|
47
|
+
<AvatarFallback>{initials}</AvatarFallback>
|
|
48
|
+
</Avatar>
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const agentMark = (
|
|
52
|
+
<Avatar size="sm" appearance="tinted">
|
|
53
|
+
<AvatarFallback>
|
|
54
|
+
<Bot aria-hidden="true" />
|
|
55
|
+
</AvatarFallback>
|
|
56
|
+
</Avatar>
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
const org: OrgChartNodeProp[] = [
|
|
60
|
+
{
|
|
61
|
+
key: "ceo",
|
|
62
|
+
name: "Haruka Tanaka",
|
|
63
|
+
title: "Chief Executive Officer",
|
|
64
|
+
avatar: mark("HT"),
|
|
65
|
+
children: [
|
|
66
|
+
{
|
|
67
|
+
key: "cto",
|
|
68
|
+
name: "Kenji Watanabe",
|
|
69
|
+
title: "Chief Technology Officer",
|
|
70
|
+
avatar: mark("KW"),
|
|
71
|
+
children: [
|
|
72
|
+
{
|
|
73
|
+
key: "review-agent",
|
|
74
|
+
name: "Review Agent",
|
|
75
|
+
title: "Code review · pull requests",
|
|
76
|
+
variant: "agent",
|
|
77
|
+
avatar: agentMark,
|
|
78
|
+
extra: <Badge tone="success">Running</Badge>,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
key: "platform",
|
|
82
|
+
name: "Mai Suzuki",
|
|
83
|
+
title: "Platform Lead",
|
|
84
|
+
avatar: mark("MS"),
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
key: "coo",
|
|
90
|
+
name: "Daniel Park",
|
|
91
|
+
title: "Chief Operating Officer",
|
|
92
|
+
avatar: mark("DP"),
|
|
93
|
+
children: [
|
|
94
|
+
{
|
|
95
|
+
key: "support-agent",
|
|
96
|
+
name: "Support Agent",
|
|
97
|
+
title: "Tier-1 customer support",
|
|
98
|
+
variant: "agent",
|
|
99
|
+
avatar: agentMark,
|
|
100
|
+
extra: <Badge tone="warning">Paused</Badge>,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
key: "ops",
|
|
104
|
+
name: "Linh Nguyen",
|
|
105
|
+
title: "Operations Manager",
|
|
106
|
+
avatar: mark("LN"),
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
key: "cfo",
|
|
112
|
+
name: "Sofia Rossi",
|
|
113
|
+
title: "Chief Financial Officer",
|
|
114
|
+
avatar: mark("SR"),
|
|
115
|
+
children: [
|
|
116
|
+
{
|
|
117
|
+
key: "controller",
|
|
118
|
+
name: "Takumi Ito",
|
|
119
|
+
title: "Financial Controller",
|
|
120
|
+
avatar: mark("TI"),
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
];
|
|
127
|
+
|
|
128
|
+
export default function OrgChartDoc() {
|
|
129
|
+
return (
|
|
130
|
+
<AppShell
|
|
131
|
+
sidebar={
|
|
132
|
+
<Sidebar
|
|
133
|
+
activeId="chart"
|
|
134
|
+
sections={sections}
|
|
135
|
+
onSelect={() => {}}
|
|
136
|
+
product={{ name: "CoreDesk", role: "Admin", color: "hsl(var(--primary))" }}
|
|
137
|
+
/>
|
|
138
|
+
}
|
|
139
|
+
topbar={<Topbar />}
|
|
140
|
+
>
|
|
141
|
+
<PageContainer
|
|
142
|
+
title="Org chart"
|
|
143
|
+
subtitle="OrgChart · people and AI agents, top-down. Dashed boxes are agents."
|
|
144
|
+
>
|
|
145
|
+
<Card>
|
|
146
|
+
<CardContent>
|
|
147
|
+
<OrgChart data={org} label="Company org chart" />
|
|
148
|
+
</CardContent>
|
|
149
|
+
</Card>
|
|
150
|
+
|
|
151
|
+
{/* THE NARROW FORM: the same data under 40rem of container width. */}
|
|
152
|
+
<Flex direction="col" gap="sm">
|
|
153
|
+
<Text size="sm" weight="medium">
|
|
154
|
+
narrow container · the same data as a Tree
|
|
155
|
+
</Text>
|
|
156
|
+
<Card className="max-w-sm">
|
|
157
|
+
<CardContent>
|
|
158
|
+
<OrgChart data={org} label="Company org chart (list)" />
|
|
159
|
+
</CardContent>
|
|
160
|
+
</Card>
|
|
161
|
+
</Flex>
|
|
162
|
+
</PageContainer>
|
|
163
|
+
</AppShell>
|
|
164
|
+
);
|
|
165
|
+
}
|
package/docs/navigation/tabs.tsx
CHANGED
|
@@ -651,37 +651,39 @@ export default function Demo() {
|
|
|
651
651
|
rendered and the view below is never remounted by a tab switch. */}
|
|
652
652
|
<Card>
|
|
653
653
|
<CardHeader>
|
|
654
|
-
<CardTitle level={2}>
|
|
654
|
+
<CardTitle level={2}>
|
|
655
|
+
controls · strip only (switches a region outside the tabs)
|
|
656
|
+
</CardTitle>
|
|
655
657
|
<CardDescription>
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
compound
|
|
658
|
+
Pass the id of an outside region to controls: no tabpanel is rendered and the selected
|
|
659
|
+
tab's aria-controls points at that region. The region lives outside Tabs, so switching
|
|
660
|
+
tabs never remounts it. A compound TabsTrigger draws the same count as items.
|
|
659
661
|
</CardDescription>
|
|
660
662
|
</CardHeader>
|
|
661
663
|
<CardContent>
|
|
662
664
|
<Flex direction="col" gap="md">
|
|
663
665
|
<Tabs
|
|
664
|
-
aria-label="
|
|
666
|
+
aria-label="Status"
|
|
665
667
|
controls="tabs-inbox-view"
|
|
666
668
|
variant="line"
|
|
667
669
|
value={inboxStatus}
|
|
668
670
|
onValueChange={setInboxStatus}
|
|
669
671
|
items={[
|
|
670
|
-
{ value: "open", label: "
|
|
671
|
-
{ value: "doing", label: "
|
|
672
|
-
{ value: "done", label: "
|
|
672
|
+
{ value: "open", label: "Open", count: 12, countLabel: "threads" },
|
|
673
|
+
{ value: "doing", label: "In progress", count: 3, countLabel: "threads" },
|
|
674
|
+
{ value: "done", label: "Done", count: 128, countLabel: "threads" },
|
|
673
675
|
]}
|
|
674
676
|
/>
|
|
675
|
-
<section id="tabs-inbox-view" aria-label="
|
|
676
|
-
<Text as="p"
|
|
677
|
+
<section id="tabs-inbox-view" aria-label="Threads">
|
|
678
|
+
<Text as="p">Showing: {inboxStatus}</Text>
|
|
677
679
|
</section>
|
|
678
|
-
<Tabs aria-label="
|
|
680
|
+
<Tabs aria-label="Saved views" controls="tabs-inbox-view" defaultValue="mine">
|
|
679
681
|
<TabsList variant="line">
|
|
680
|
-
<TabsTrigger value="mine" count={4} countLabel="
|
|
681
|
-
|
|
682
|
+
<TabsTrigger value="mine" count={4} countLabel="threads">
|
|
683
|
+
Mine
|
|
682
684
|
</TabsTrigger>
|
|
683
|
-
<TabsTrigger value="all" count={143} countLabel="
|
|
684
|
-
|
|
685
|
+
<TabsTrigger value="all" count={143} countLabel="threads">
|
|
686
|
+
All
|
|
685
687
|
</TabsTrigger>
|
|
686
688
|
</TabsList>
|
|
687
689
|
</Tabs>
|
|
@@ -66,9 +66,7 @@ function LoadingBlock() {
|
|
|
66
66
|
query={query}
|
|
67
67
|
skeleton={<SkeletonTable rows={4} columns={3} />}
|
|
68
68
|
isEmpty={(d) => d.length === 0}
|
|
69
|
-
empty={
|
|
70
|
-
<EmptyState title="データがありません" description="条件に合う請求書はありません。" />
|
|
71
|
-
}
|
|
69
|
+
empty={<EmptyState title="No invoices" description="No invoice matches the filter." />}
|
|
72
70
|
>
|
|
73
71
|
{(d) => <DataTable data={d} columns={columns} getRowId={(r) => r.id} />}
|
|
74
72
|
</DataState>
|
|
@@ -78,7 +76,7 @@ function LoadingBlock() {
|
|
|
78
76
|
size="sm"
|
|
79
77
|
onClick={() => void client.resetQueries({ queryKey: ["ds-loading"] })}
|
|
80
78
|
>
|
|
81
|
-
|
|
79
|
+
Load again
|
|
82
80
|
</Button>
|
|
83
81
|
</Flex>
|
|
84
82
|
);
|
|
@@ -430,7 +430,7 @@ export default function Demo() {
|
|
|
430
430
|
{/* Saved-view ribbon — controlled, strip-only Tabs (gh#1021): `controls` points the
|
|
431
431
|
selected tab at the grid below, which lives outside the Tabs and is never remounted. */}
|
|
432
432
|
<Tabs
|
|
433
|
-
aria-label="
|
|
433
|
+
aria-label="Saved views"
|
|
434
434
|
controls="attendance-grid"
|
|
435
435
|
value={view}
|
|
436
436
|
onValueChange={(v) => setView(v as ViewId)}
|