@godxjp/ui 20.2.1 → 22.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/app/app-provider.js +2 -1
- package/dist/components/data-display/badge.d.ts +28 -1
- package/dist/components/data-display/badge.js +2 -0
- package/dist/components/data-display/chat-bubble.d.ts +30 -0
- package/dist/components/data-display/chat-bubble.js +229 -0
- package/dist/components/data-display/data-table.d.ts +18 -2
- package/dist/components/data-display/data-table.js +4 -0
- package/dist/components/data-display/descriptions.js +4 -1
- package/dist/components/data-display/index.d.ts +5 -3
- package/dist/components/data-display/index.js +5 -2
- package/dist/components/data-display/popover.d.ts +19 -1
- package/dist/components/data-display/popover.js +12 -3
- package/dist/components/data-display/progress.d.ts +37 -0
- package/dist/components/data-display/progress.js +57 -5
- package/dist/components/data-display/scroll-area.js +26 -1
- package/dist/components/data-display/tree.d.ts +8 -0
- package/dist/components/data-display/tree.js +426 -0
- package/dist/components/data-entry/chat-composer.d.ts +50 -0
- package/dist/components/data-entry/chat-composer.js +163 -0
- package/dist/components/data-entry/chat-suggestion.d.ts +28 -0
- package/dist/components/data-entry/chat-suggestion.js +285 -0
- package/dist/components/data-entry/date-picker.d.ts +10 -3
- package/dist/components/data-entry/date-picker.js +503 -238
- package/dist/components/data-entry/form-field.d.ts +1 -1
- package/dist/components/data-entry/form-field.js +4 -1
- package/dist/components/data-entry/form.js +10 -1
- package/dist/components/data-entry/index.d.ts +4 -6
- package/dist/components/data-entry/index.js +4 -6
- package/dist/components/data-entry/label.d.ts +14 -1
- package/dist/components/data-entry/label.js +6 -1
- package/dist/components/data-entry/radio.d.ts +27 -6
- package/dist/components/data-entry/radio.js +88 -43
- package/dist/components/data-entry/search-select.js +8 -1
- package/dist/components/data-entry/select.js +2 -0
- package/dist/components/data-entry/switch.d.ts +6 -3
- package/dist/components/data-entry/switch.js +34 -11
- package/dist/components/data-entry/textarea.js +3 -1
- package/dist/components/data-entry/tree-utils.d.ts +10 -48
- package/dist/components/data-entry/tree-utils.js +1 -154
- package/dist/components/layout/mobile-shell.d.ts +1 -1
- package/dist/components/layout/mobile-shell.js +2 -0
- package/dist/components/navigation/menubar.d.ts +10 -3
- package/dist/components/navigation/steps.d.ts +1 -1
- package/dist/components/navigation/steps.js +3 -1
- package/dist/components/navigation/tabs-scroll.d.ts +27 -0
- package/dist/components/navigation/tabs-scroll.js +52 -1
- package/dist/components/navigation/tabs.d.ts +2 -2
- package/dist/components/navigation/tabs.js +88 -23
- package/dist/components/ui/index.d.ts +0 -1
- package/dist/components/ui/index.js +0 -1
- package/dist/components/ui/segmented.d.ts +15 -1
- package/dist/components/ui/segmented.js +13 -6
- package/dist/i18n/messages/en.json +48 -2
- package/dist/i18n/messages/ja.json +46 -2
- package/dist/i18n/messages/vi.json +47 -2
- package/dist/lib/datetime/picker-format.d.ts +18 -0
- package/dist/lib/datetime/picker-format.js +35 -1
- package/dist/lib/field-a11y.d.ts +12 -0
- package/dist/lib/field-a11y.js +14 -1
- package/dist/lib/tree.d.ts +53 -0
- package/dist/lib/tree.js +155 -0
- package/dist/props/components/data-display.prop.d.ts +194 -1
- package/dist/props/components/data-entry.prop.d.ts +307 -99
- package/dist/props/components/index.d.ts +1 -1
- package/dist/props/components/layout.prop.d.ts +12 -1
- package/dist/props/components/navigation.prop.d.ts +76 -1
- package/dist/props/registry.d.ts +156 -19
- package/dist/props/registry.js +218 -18
- package/dist/props/vocabulary/data.prop.d.ts +12 -0
- package/dist/props/vocabulary/index.d.ts +2 -2
- package/dist/props/vocabulary/layout.prop.d.ts +11 -0
- package/dist/styles/badge-layout.css +4 -0
- package/dist/styles/card-layout.css +6 -6
- package/dist/styles/control.css +22 -6
- package/dist/styles/data-display-layout.css +385 -68
- package/dist/styles/data-entry-layout.css +64 -0
- package/dist/styles/focus-ring.css +4 -2
- package/dist/styles/navigation-layout.css +25 -0
- package/dist/styles/shell-layout.css +7 -1
- package/dist/styles/table-layout.css +34 -0
- package/dist/tokens/base.css +3 -0
- package/dist/tokens/components/chat-bubble.css +36 -0
- package/dist/tokens/components/chat-composer.css +19 -0
- package/dist/tokens/components/data-display.css +9 -6
- package/dist/tokens/components/descriptions.css +4 -0
- package/dist/tokens/components/navigation.css +6 -0
- package/dist/tokens/components/segmented.css +0 -2
- package/dist/tokens/components/shell.css +3 -0
- package/dist/tokens/components/table.css +3 -0
- package/dist/tokens/components/tree.css +27 -0
- package/dist/tokens/foundation.css +7 -0
- package/docs/COMPONENTS.md +14 -14
- package/docs/CONSUMER-RULES.md +24 -1
- package/docs/FRAME-COVERAGE-LEDGER.md +1 -1
- package/docs/FRAME-COVERAGE-REPORT.md +9 -7
- package/docs/TOKENS.md +65 -0
- package/docs/data-display/badge.tsx +37 -0
- package/docs/data-display/chat-bubble.tsx +397 -0
- package/docs/data-display/data-table/index.tsx +18 -0
- package/docs/data-display/popover.tsx +41 -1
- package/docs/data-display/progress.tsx +28 -0
- package/docs/data-display/timeline.tsx +46 -0
- package/docs/data-display/tree.tsx +394 -0
- package/docs/data-entry/calendar.tsx +2 -2
- package/docs/data-entry/chat-composer.tsx +464 -0
- package/docs/data-entry/chat-suggestion.tsx +301 -0
- package/docs/data-entry/date-picker.tsx +143 -3
- package/docs/data-entry/form/examples/invoice-form.tsx +2 -2
- package/docs/data-entry/form-field/examples/a11y-contract.tsx +3 -5
- package/docs/data-entry/form.tsx +4 -4
- package/docs/data-entry/number-input.tsx +31 -0
- package/docs/data-entry/segmented.tsx +103 -1
- package/docs/layout/mobile-shell.tsx +5 -0
- package/docs/navigation/tabs.tsx +149 -0
- package/docs/roadmap/ai-chat-components.md +207 -0
- package/docs/roadmap/antd-parity.md +155 -0
- package/docs/roadmap/badge-tag-chip-count.md +172 -0
- package/docs/roadmap/list-masonry.md +159 -0
- package/docs/roadmap/parity-audit-data-display-feedback.md +567 -0
- package/docs/roadmap/parity-audit-data-entry.md +357 -0
- package/docs/roadmap/parity-audit-layout-navigation-general.md +464 -0
- package/docs/roadmap/parity-backlog.md +78 -0
- package/docs/roadmap/tree-components.md +151 -0
- package/docs/showcase/acme-portal.tsx +7 -0
- package/docs/showcase/table-tree-rows.tsx +4 -4
- package/package.json +13 -23
- package/scripts/ui-audit.mjs +17 -4
- package/dist/components/data-display/tree-list.d.ts +0 -13
- package/dist/components/data-display/tree-list.js +0 -26
- package/dist/components/data-entry/date-range-picker.d.ts +0 -11
- package/dist/components/data-entry/date-range-picker.js +0 -349
- package/dist/components/data-entry/month-picker.d.ts +0 -10
- package/dist/components/data-entry/month-picker.js +0 -241
- package/dist/components/data-entry/month-range-picker.d.ts +0 -10
- package/dist/components/data-entry/month-range-picker.js +0 -301
- package/dist/components/ui/date-range-picker.d.ts +0 -1
- package/dist/components/ui/date-range-picker.js +0 -2
- package/docs/data-display/tree-list.tsx +0 -107
- package/docs/data-entry/date-range-picker.tsx +0 -175
- package/docs/data-entry/month-picker.tsx +0 -101
- package/docs/data-entry/month-range-picker.tsx +0 -115
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { useState } from "react";
|
|
2
|
-
|
|
3
|
-
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@godxjp/ui/data-display";
|
|
4
|
-
import { FormField, MonthPicker } from "@godxjp/ui/data-entry";
|
|
5
|
-
import { Flex, PageContainer } from "@godxjp/ui/layout";
|
|
6
|
-
|
|
7
|
-
/** MonthPicker — typeable yyyy/MM field with a localized month-grid affordance. */
|
|
8
|
-
export default function Demo() {
|
|
9
|
-
const [month, setMonth] = useState<Date | undefined>(new Date(2026, 6, 1));
|
|
10
|
-
|
|
11
|
-
return (
|
|
12
|
-
<PageContainer title="MonthPicker" subtitle="年月入力 · yyyy/MM + 月グリッド">
|
|
13
|
-
<Flex direction="col" gap="lg">
|
|
14
|
-
<Card>
|
|
15
|
-
<CardHeader>
|
|
16
|
-
<CardTitle level={2}>Controlled · form submission</CardTitle>
|
|
17
|
-
<CardDescription>
|
|
18
|
-
value + onValueChange で制御し、name は yyyy/MM の表示値を送信する。直接入力と
|
|
19
|
-
月グリッド選択のどちらも利用できる。
|
|
20
|
-
</CardDescription>
|
|
21
|
-
</CardHeader>
|
|
22
|
-
<CardContent>
|
|
23
|
-
<FormField id="billing-month" label="請求年月" required helper="yyyy/MM 形式">
|
|
24
|
-
<MonthPicker
|
|
25
|
-
id="billing-month"
|
|
26
|
-
name="billing_month"
|
|
27
|
-
value={month}
|
|
28
|
-
onValueChange={setMonth}
|
|
29
|
-
/>
|
|
30
|
-
</FormField>
|
|
31
|
-
</CardContent>
|
|
32
|
-
</Card>
|
|
33
|
-
|
|
34
|
-
<Card>
|
|
35
|
-
<CardHeader>
|
|
36
|
-
<CardTitle level={2}>Uncontrolled · bounded years</CardTitle>
|
|
37
|
-
<CardDescription>
|
|
38
|
-
defaultValue で内部状態を初期化し、fromYear / toYear で年移動を制限する。
|
|
39
|
-
</CardDescription>
|
|
40
|
-
</CardHeader>
|
|
41
|
-
<CardContent>
|
|
42
|
-
<FormField id="fiscal-month" label="会計年月">
|
|
43
|
-
<MonthPicker
|
|
44
|
-
id="fiscal-month"
|
|
45
|
-
name="fiscal_month"
|
|
46
|
-
defaultValue={new Date(2025, 3, 1)}
|
|
47
|
-
fromYear={2024}
|
|
48
|
-
toYear={2027}
|
|
49
|
-
/>
|
|
50
|
-
</FormField>
|
|
51
|
-
</CardContent>
|
|
52
|
-
</Card>
|
|
53
|
-
|
|
54
|
-
<Card>
|
|
55
|
-
<CardHeader>
|
|
56
|
-
<CardTitle level={2}>Clear affordance variants</CardTitle>
|
|
57
|
-
<CardDescription>
|
|
58
|
-
値がある既定状態ではクリア操作を表示する。必須フィールドでは allowClear=false
|
|
59
|
-
にして不用意な空値を防ぐ。
|
|
60
|
-
</CardDescription>
|
|
61
|
-
</CardHeader>
|
|
62
|
-
<CardContent>
|
|
63
|
-
<Flex direction="col" gap="md">
|
|
64
|
-
<FormField id="clearable-month" label="クリア可能">
|
|
65
|
-
<MonthPicker id="clearable-month" defaultValue={new Date(2026, 0, 1)} />
|
|
66
|
-
</FormField>
|
|
67
|
-
<FormField id="fixed-month" label="クリア不可" required>
|
|
68
|
-
<MonthPicker
|
|
69
|
-
id="fixed-month"
|
|
70
|
-
defaultValue={new Date(2026, 0, 1)}
|
|
71
|
-
allowClear={false}
|
|
72
|
-
/>
|
|
73
|
-
</FormField>
|
|
74
|
-
</Flex>
|
|
75
|
-
</CardContent>
|
|
76
|
-
</Card>
|
|
77
|
-
|
|
78
|
-
<Card>
|
|
79
|
-
<CardHeader>
|
|
80
|
-
<CardTitle level={2}>Disabled · empty and populated</CardTitle>
|
|
81
|
-
<CardDescription>権限不足または確定済みデータの操作不可状態。</CardDescription>
|
|
82
|
-
</CardHeader>
|
|
83
|
-
<CardContent>
|
|
84
|
-
<Flex direction="col" gap="md">
|
|
85
|
-
<FormField id="disabled-month-empty" label="無効(未選択)">
|
|
86
|
-
<MonthPicker id="disabled-month-empty" disabled />
|
|
87
|
-
</FormField>
|
|
88
|
-
<FormField id="disabled-month-value" label="無効(選択済み)">
|
|
89
|
-
<MonthPicker
|
|
90
|
-
id="disabled-month-value"
|
|
91
|
-
defaultValue={new Date(2026, 8, 1)}
|
|
92
|
-
disabled
|
|
93
|
-
/>
|
|
94
|
-
</FormField>
|
|
95
|
-
</Flex>
|
|
96
|
-
</CardContent>
|
|
97
|
-
</Card>
|
|
98
|
-
</Flex>
|
|
99
|
-
</PageContainer>
|
|
100
|
-
);
|
|
101
|
-
}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { useState } from "react";
|
|
2
|
-
|
|
3
|
-
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@godxjp/ui/data-display";
|
|
4
|
-
import { FormField, MonthRangePicker } from "@godxjp/ui/data-entry";
|
|
5
|
-
import { Flex, PageContainer } from "@godxjp/ui/layout";
|
|
6
|
-
import type { DateRange } from "react-day-picker";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* MonthRangePicker — 年月 (yyyy/MM) 範囲入力。DateRangePicker と同じ
|
|
10
|
-
* 「ひとつのコントロール [開始 → 終了 ✕ 📅]」規約で、月グリッドポップオーバーを
|
|
11
|
-
* 視覚的アフォーダンスとして持つ。逆順 (from > to) は自動で入れ替え正規化される。
|
|
12
|
-
* MonthPicker を 2 つ並べて範囲を偽装しないこと。
|
|
13
|
-
*/
|
|
14
|
-
export default function Demo() {
|
|
15
|
-
const [closing, setClosing] = useState<DateRange | undefined>({
|
|
16
|
-
from: new Date(2026, 0, 1),
|
|
17
|
-
to: new Date(2026, 5, 1),
|
|
18
|
-
});
|
|
19
|
-
const [negotiation, setNegotiation] = useState<DateRange | undefined>(undefined);
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<PageContainer
|
|
23
|
-
title="MonthRangePicker"
|
|
24
|
-
subtitle="年月範囲入力 · 開始/終了 yyyy/MM 入力 + 月グリッドポップオーバー"
|
|
25
|
-
>
|
|
26
|
-
<Flex direction="col" gap="lg">
|
|
27
|
-
<Card>
|
|
28
|
-
<CardHeader>
|
|
29
|
-
<CardTitle level={2}>基本 (controlled)</CardTitle>
|
|
30
|
-
<CardDescription>
|
|
31
|
-
value + onValueChange で制御。開始/終了を直接タイプ入力するか、カレンダーアイコンから
|
|
32
|
-
月グリッドで 2 ステップ選択 (開始 → 終了)。逆順に選んでも from ≤ to
|
|
33
|
-
に自動正規化される。name="closing_ym" を指定すると closing_ym_from /
|
|
34
|
-
closing_ym_to として yyyy/MM でフォーム送信される。
|
|
35
|
-
</CardDescription>
|
|
36
|
-
</CardHeader>
|
|
37
|
-
<CardContent>
|
|
38
|
-
<FormField id="closing-ym" label="締め年月" required>
|
|
39
|
-
<MonthRangePicker
|
|
40
|
-
id="closing-ym"
|
|
41
|
-
name="closing_ym"
|
|
42
|
-
value={closing}
|
|
43
|
-
onValueChange={setClosing}
|
|
44
|
-
/>
|
|
45
|
-
</FormField>
|
|
46
|
-
</CardContent>
|
|
47
|
-
</Card>
|
|
48
|
-
|
|
49
|
-
<Card>
|
|
50
|
-
<CardHeader>
|
|
51
|
-
<CardTitle level={2}>検索フィルター (未選択)</CardTitle>
|
|
52
|
-
<CardDescription>
|
|
53
|
-
初期値なし。確定済み範囲の上でもう一度選ぶと新しい範囲が開始される (reset-on-complete
|
|
54
|
-
· 開始月が固まって選び直せない、が起きない)。
|
|
55
|
-
</CardDescription>
|
|
56
|
-
</CardHeader>
|
|
57
|
-
<CardContent>
|
|
58
|
-
<FormField id="negotiation-ym" label="商談発生年月">
|
|
59
|
-
<MonthRangePicker
|
|
60
|
-
id="negotiation-ym"
|
|
61
|
-
name="search_negotiation_ym"
|
|
62
|
-
value={negotiation}
|
|
63
|
-
onValueChange={setNegotiation}
|
|
64
|
-
/>
|
|
65
|
-
</FormField>
|
|
66
|
-
</CardContent>
|
|
67
|
-
</Card>
|
|
68
|
-
|
|
69
|
-
<Card>
|
|
70
|
-
<CardHeader>
|
|
71
|
-
<CardTitle level={2}>非制御 (defaultValue) + 年クランプ</CardTitle>
|
|
72
|
-
<CardDescription>
|
|
73
|
-
defaultValue で初期範囲だけ与え、fromYear / toYear
|
|
74
|
-
でグリッドの年ナビゲーションを境界年で止める。
|
|
75
|
-
</CardDescription>
|
|
76
|
-
</CardHeader>
|
|
77
|
-
<CardContent>
|
|
78
|
-
<FormField id="fiscal-ym" label="会計年度範囲 (2024–2027)">
|
|
79
|
-
<MonthRangePicker
|
|
80
|
-
id="fiscal-ym"
|
|
81
|
-
name="fiscal_ym"
|
|
82
|
-
defaultValue={{
|
|
83
|
-
from: new Date(2026, 3, 1),
|
|
84
|
-
to: new Date(2027, 2, 1),
|
|
85
|
-
}}
|
|
86
|
-
fromYear={2024}
|
|
87
|
-
toYear={2027}
|
|
88
|
-
/>
|
|
89
|
-
</FormField>
|
|
90
|
-
</CardContent>
|
|
91
|
-
</Card>
|
|
92
|
-
|
|
93
|
-
<Card>
|
|
94
|
-
<CardHeader>
|
|
95
|
-
<CardTitle level={2}>disabled 状態</CardTitle>
|
|
96
|
-
<CardDescription>確定済み範囲や読み取り専用フィールドに使用。</CardDescription>
|
|
97
|
-
</CardHeader>
|
|
98
|
-
<CardContent>
|
|
99
|
-
<FormField id="locked-ym" label="確定範囲">
|
|
100
|
-
<MonthRangePicker
|
|
101
|
-
id="locked-ym"
|
|
102
|
-
name="locked_ym"
|
|
103
|
-
value={{
|
|
104
|
-
from: new Date(2025, 3, 1),
|
|
105
|
-
to: new Date(2026, 2, 1),
|
|
106
|
-
}}
|
|
107
|
-
disabled
|
|
108
|
-
/>
|
|
109
|
-
</FormField>
|
|
110
|
-
</CardContent>
|
|
111
|
-
</Card>
|
|
112
|
-
</Flex>
|
|
113
|
-
</PageContainer>
|
|
114
|
-
);
|
|
115
|
-
}
|