@godxjp/ui 21.0.0 → 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.
Files changed (103) hide show
  1. package/dist/app/app-provider.js +2 -1
  2. package/dist/components/data-display/badge.d.ts +28 -1
  3. package/dist/components/data-display/badge.js +2 -0
  4. package/dist/components/data-display/data-table.d.ts +18 -2
  5. package/dist/components/data-display/data-table.js +4 -0
  6. package/dist/components/data-display/index.d.ts +1 -1
  7. package/dist/components/data-display/popover.d.ts +19 -1
  8. package/dist/components/data-display/popover.js +9 -1
  9. package/dist/components/data-display/progress.d.ts +37 -0
  10. package/dist/components/data-display/progress.js +57 -5
  11. package/dist/components/data-entry/date-picker.d.ts +10 -3
  12. package/dist/components/data-entry/date-picker.js +503 -238
  13. package/dist/components/data-entry/form-field.d.ts +1 -1
  14. package/dist/components/data-entry/form-field.js +4 -1
  15. package/dist/components/data-entry/form.js +10 -1
  16. package/dist/components/data-entry/index.d.ts +0 -6
  17. package/dist/components/data-entry/index.js +0 -6
  18. package/dist/components/data-entry/label.d.ts +14 -1
  19. package/dist/components/data-entry/label.js +6 -1
  20. package/dist/components/data-entry/radio.d.ts +27 -6
  21. package/dist/components/data-entry/radio.js +88 -43
  22. package/dist/components/data-entry/search-select.js +8 -1
  23. package/dist/components/data-entry/select.js +2 -0
  24. package/dist/components/data-entry/switch.d.ts +6 -3
  25. package/dist/components/data-entry/switch.js +34 -11
  26. package/dist/components/layout/mobile-shell.d.ts +1 -1
  27. package/dist/components/layout/mobile-shell.js +2 -0
  28. package/dist/components/navigation/menubar.d.ts +10 -3
  29. package/dist/components/navigation/steps.d.ts +1 -1
  30. package/dist/components/navigation/steps.js +3 -1
  31. package/dist/components/navigation/tabs-scroll.d.ts +27 -0
  32. package/dist/components/navigation/tabs-scroll.js +52 -1
  33. package/dist/components/navigation/tabs.d.ts +2 -2
  34. package/dist/components/navigation/tabs.js +88 -23
  35. package/dist/components/ui/index.d.ts +0 -1
  36. package/dist/components/ui/index.js +0 -1
  37. package/dist/components/ui/segmented.d.ts +15 -1
  38. package/dist/components/ui/segmented.js +13 -6
  39. package/dist/i18n/messages/en.json +3 -2
  40. package/dist/i18n/messages/ja.json +3 -2
  41. package/dist/i18n/messages/vi.json +3 -2
  42. package/dist/lib/datetime/picker-format.d.ts +18 -0
  43. package/dist/lib/datetime/picker-format.js +35 -1
  44. package/dist/lib/field-a11y.d.ts +12 -0
  45. package/dist/lib/field-a11y.js +14 -1
  46. package/dist/props/components/data-display.prop.d.ts +7 -0
  47. package/dist/props/components/data-entry.prop.d.ts +180 -99
  48. package/dist/props/components/index.d.ts +1 -1
  49. package/dist/props/components/layout.prop.d.ts +12 -1
  50. package/dist/props/components/navigation.prop.d.ts +76 -1
  51. package/dist/props/registry.d.ts +16 -16
  52. package/dist/props/registry.js +16 -15
  53. package/dist/props/vocabulary/data.prop.d.ts +12 -0
  54. package/dist/props/vocabulary/index.d.ts +2 -2
  55. package/dist/props/vocabulary/layout.prop.d.ts +11 -0
  56. package/dist/styles/badge-layout.css +4 -0
  57. package/dist/styles/card-layout.css +6 -6
  58. package/dist/styles/control.css +15 -6
  59. package/dist/styles/data-display-layout.css +76 -13
  60. package/dist/styles/focus-ring.css +4 -2
  61. package/dist/styles/navigation-layout.css +25 -0
  62. package/dist/styles/shell-layout.css +5 -0
  63. package/dist/styles/table-layout.css +34 -0
  64. package/dist/tokens/components/data-display.css +9 -0
  65. package/dist/tokens/components/navigation.css +6 -0
  66. package/dist/tokens/components/segmented.css +0 -2
  67. package/dist/tokens/components/shell.css +2 -0
  68. package/dist/tokens/components/table.css +3 -0
  69. package/dist/tokens/foundation.css +7 -0
  70. package/docs/COMPONENTS.md +14 -14
  71. package/docs/CONSUMER-RULES.md +24 -1
  72. package/docs/FRAME-COVERAGE-REPORT.md +3 -6
  73. package/docs/TOKENS.md +65 -0
  74. package/docs/data-display/badge.tsx +37 -0
  75. package/docs/data-display/data-table/index.tsx +18 -0
  76. package/docs/data-display/popover.tsx +41 -1
  77. package/docs/data-display/progress.tsx +28 -0
  78. package/docs/data-entry/calendar.tsx +2 -2
  79. package/docs/data-entry/date-picker.tsx +143 -3
  80. package/docs/data-entry/form/examples/invoice-form.tsx +2 -2
  81. package/docs/data-entry/form-field/examples/a11y-contract.tsx +3 -5
  82. package/docs/data-entry/form.tsx +4 -4
  83. package/docs/data-entry/number-input.tsx +31 -0
  84. package/docs/data-entry/segmented.tsx +103 -1
  85. package/docs/layout/mobile-shell.tsx +5 -0
  86. package/docs/navigation/tabs.tsx +149 -0
  87. package/docs/roadmap/antd-parity.md +35 -34
  88. package/docs/roadmap/parity-audit-data-entry.md +178 -165
  89. package/docs/roadmap/parity-backlog.md +6 -7
  90. package/docs/showcase/acme-portal.tsx +7 -0
  91. package/package.json +11 -23
  92. package/scripts/ui-audit.mjs +17 -4
  93. package/dist/components/data-entry/date-range-picker.d.ts +0 -11
  94. package/dist/components/data-entry/date-range-picker.js +0 -349
  95. package/dist/components/data-entry/month-picker.d.ts +0 -10
  96. package/dist/components/data-entry/month-picker.js +0 -241
  97. package/dist/components/data-entry/month-range-picker.d.ts +0 -10
  98. package/dist/components/data-entry/month-range-picker.js +0 -301
  99. package/dist/components/ui/date-range-picker.d.ts +0 -1
  100. package/dist/components/ui/date-range-picker.js +0 -2
  101. package/docs/data-entry/date-range-picker.tsx +0 -175
  102. package/docs/data-entry/month-picker.tsx +0 -101
  103. package/docs/data-entry/month-range-picker.tsx +0 -115
@@ -1,175 +0,0 @@
1
- import { useState } from "react";
2
- import { ja } from "date-fns/locale";
3
-
4
- import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@godxjp/ui/data-display";
5
- import { DateRangePicker, FormField } from "@godxjp/ui/data-entry";
6
- import { Flex, PageContainer } from "@godxjp/ui/layout";
7
- import type { DateRange } from "react-day-picker";
8
-
9
- /**
10
- * DateRangePicker — WAI-ARIA date-range control with two typeable ISO inputs
11
- * + popover calendar. Submits as ${name}_from / ${name}_to. Never compose
12
- * two DatePickers side-by-side to fake a range. Composed only from real
13
- * @godxjp/ui components.
14
- */
15
- export default function Demo() {
16
- const [period, setPeriod] = useState<DateRange | undefined>({
17
- from: new Date(2026, 3, 1),
18
- to: new Date(2027, 2, 31),
19
- });
20
- const [reportRange, setReportRange] = useState<DateRange | undefined>(undefined);
21
- const [campaign, setCampaign] = useState<DateRange | undefined>({
22
- from: new Date(2026, 5, 1),
23
- to: new Date(2026, 5, 30),
24
- });
25
-
26
- return (
27
- <PageContainer
28
- title="DateRangePicker"
29
- subtitle="期間入力 · 開始/終了 ISO 入力 + 範囲カレンダーポップオーバー"
30
- >
31
- <Flex direction="col" gap="lg">
32
- <Card>
33
- <CardHeader>
34
- <CardTitle level={2}>基本 (controlled)</CardTitle>
35
- <CardDescription>
36
- value + onValueChange
37
- で制御。開始/終了を直接タイプ入力するか、カレンダーアイコンを開いて
38
- 範囲を選択できる。name=&#34;period&#34; を指定すると period_from / period_to として
39
- ISO yyyy-MM-dd でフォーム送信される。
40
- </CardDescription>
41
- </CardHeader>
42
- <CardContent>
43
- <FormField id="period" label="会計期間" required>
44
- <DateRangePicker
45
- id="period"
46
- name="period"
47
- value={period}
48
- onValueChange={setPeriod}
49
- fromDate={new Date(2020, 0, 1)}
50
- toDate={new Date(2030, 11, 31)}
51
- />
52
- </FormField>
53
- </CardContent>
54
- </Card>
55
-
56
- <Card>
57
- <CardHeader>
58
- <CardTitle level={2}>レポート期間フィルター (未選択)</CardTitle>
59
- <CardDescription>
60
- 初期値なし。選択後は reportRange_from / reportRange_to
61
- がクエリパラメータとして使われる。
62
- </CardDescription>
63
- </CardHeader>
64
- <CardContent>
65
- <FormField id="report-range" label="レポート期間">
66
- <DateRangePicker
67
- id="report-range"
68
- name="reportRange"
69
- value={reportRange}
70
- onValueChange={setReportRange}
71
- fromDate={new Date(2024, 0, 1)}
72
- toDate={new Date(2026, 11, 31)}
73
- placeholder="yyyy-mm-dd"
74
- />
75
- </FormField>
76
- </CardContent>
77
- </Card>
78
-
79
- <Card>
80
- <CardHeader>
81
- <CardTitle level={2}>非制御 (defaultValue)</CardTitle>
82
- <CardDescription>
83
- value / onValueChange を渡さず defaultValue
84
- で初期範囲だけ与える。状態はコンポーネント内部で 保持され、name=&#34;fiscal_year&#34;
85
- のまま fiscal_year_from / fiscal_year_to として送信される。
86
- </CardDescription>
87
- </CardHeader>
88
- <CardContent>
89
- <FormField id="fiscal-year" label="会計年度 (初期値のみ)">
90
- <DateRangePicker
91
- id="fiscal-year"
92
- name="fiscal_year"
93
- defaultValue={{
94
- from: new Date(2026, 3, 1),
95
- to: new Date(2027, 2, 31),
96
- }}
97
- fromDate={new Date(2020, 0, 1)}
98
- toDate={new Date(2030, 11, 31)}
99
- />
100
- </FormField>
101
- </CardContent>
102
- </Card>
103
-
104
- <Card>
105
- <CardHeader>
106
- <CardTitle level={2}>locale で日本語カレンダー</CardTitle>
107
- <CardDescription>
108
- locale=&#123;ja&#125; を渡すとポップオーバーのカレンダーが日本語表記 (曜日・月名)
109
- になる。 入力欄は常に ISO yyyy-MM-dd を保持する。
110
- </CardDescription>
111
- </CardHeader>
112
- <CardContent>
113
- <FormField id="campaign-period" label="キャンペーン期間">
114
- <DateRangePicker
115
- id="campaign-period"
116
- name="campaign_period"
117
- value={campaign}
118
- onValueChange={setCampaign}
119
- locale={ja}
120
- fromDate={new Date(2024, 0, 1)}
121
- toDate={new Date(2027, 11, 31)}
122
- />
123
- </FormField>
124
- </CardContent>
125
- </Card>
126
-
127
- <Card>
128
- <CardHeader>
129
- <CardTitle level={2}>disabled 状態</CardTitle>
130
- <CardDescription>確定済み期間や読み取り専用フィールドに使用。</CardDescription>
131
- </CardHeader>
132
- <CardContent>
133
- <FormField id="locked-period" label="確定期間">
134
- <DateRangePicker
135
- id="locked-period"
136
- name="locked_period"
137
- value={{
138
- from: new Date(2025, 3, 1),
139
- to: new Date(2026, 2, 31),
140
- }}
141
- disabled
142
- />
143
- </FormField>
144
- </CardContent>
145
- </Card>
146
-
147
- <Card>
148
- <CardHeader>
149
- <CardTitle level={2}>期間プリセットと確定</CardTitle>
150
- </CardHeader>
151
- <CardContent>
152
- <FormField id="preset-range" label="集計期間">
153
- <DateRangePicker
154
- id="preset-range"
155
- name="report"
156
- format="yyyy/MM/dd"
157
- needConfirm
158
- allowEmpty={[false, true]}
159
- showWeek
160
- minDate={new Date(2026, 0, 1)}
161
- maxDate={new Date(2026, 11, 31)}
162
- presets={[
163
- {
164
- label: "9月",
165
- value: () => ({ from: new Date(2026, 8, 1), to: new Date(2026, 8, 30) }),
166
- },
167
- ]}
168
- />
169
- </FormField>
170
- </CardContent>
171
- </Card>
172
- </Flex>
173
- </PageContainer>
174
- );
175
- }
@@ -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=&#34;closing_ym&#34; を指定すると 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
- }