@ubie/vitals-ui-business 0.2.0 → 0.3.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 (43) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/DESIGN.md +71 -0
  3. package/dist/index.cjs +275 -1
  4. package/dist/index.d.cts +269 -3
  5. package/dist/index.d.cts.map +1 -1
  6. package/dist/index.d.mts +269 -3
  7. package/dist/index.d.mts.map +1 -1
  8. package/dist/index.mjs +275 -5
  9. package/dist/index.mjs.map +1 -1
  10. package/docs/components/chat.md +81 -0
  11. package/docs/components/drawer.md +48 -0
  12. package/docs/components/layout.md +33 -0
  13. package/docs/components/modal.md +49 -0
  14. package/docs/components/table.md +60 -0
  15. package/docs/patterns/disclosure.md +114 -0
  16. package/docs/patterns/list-detail.md +71 -0
  17. package/docs/patterns/skeleton.md +48 -0
  18. package/docs/principles/README.md +21 -0
  19. package/docs/principles/information-design.md +94 -0
  20. package/docs/principles/scorecard.md +56 -0
  21. package/docs/principles/ux-principles.md +68 -0
  22. package/docs/tokens.md +48 -0
  23. package/package.json +12 -3
  24. package/src/UbieConfigProvider.tsx +7 -2
  25. package/src/components/ChatBubble/index.tsx +150 -0
  26. package/src/components/ChatConversations/index.tsx +38 -0
  27. package/src/components/Table/index.tsx +180 -0
  28. package/src/components/Table/rowAction.ts +25 -0
  29. package/src/index.ts +7 -0
  30. package/src/reference/driftCheck.ts +145 -0
  31. package/src/stories/business/Chat.stories.tsx +119 -0
  32. package/src/stories/business/Table.stories.tsx +236 -0
  33. package/src/stories/components/Table.stories.tsx +4 -1
  34. package/src/stories/components/UbieConfigProvider.stories.tsx +1 -1
  35. package/src/stories/patterns/Disclosure.stories.tsx +192 -0
  36. package/src/stories/patterns/ListDetail.stories.tsx +250 -0
  37. package/src/stories/patterns/Skeleton.stories.tsx +147 -0
  38. package/src/theme/businessTheme.ts +76 -0
  39. package/.storybook/main.ts +0 -23
  40. package/.storybook/preview.tsx +0 -37
  41. package/.storybook/vitest.setup.ts +0 -6
  42. package/tsconfig.json +0 -9
  43. package/vite.config.ts +0 -32
package/dist/index.d.cts CHANGED
@@ -1,15 +1,281 @@
1
- import { notification as xNotification, version as xVersion } from "@ant-design/x";
2
- import { ConfigProviderProps, notification, version } from "antd";
1
+ import { BubbleProps, Conversations, ConversationsProps, notification as xNotification, version as xVersion } from "@ant-design/x";
2
+ import { ConfigProviderProps, Table as Table$1, TableProps as TableProps$1, notification, version } from "antd";
3
3
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
+ import { TableRef } from "antd/es/table/index.js";
5
+ import { ComponentRef, MouseEvent, ReactNode, Ref } from "react";
6
+ import { BubbleContentType, BubbleRef } from "@ant-design/x/es/bubble/interface.js";
4
7
  export * from "@ant-design/x";
5
8
  export * from "antd";
6
9
 
7
10
  //#region src/UbieConfigProvider.d.ts
8
11
  type UbieConfigProviderProps = ConfigProviderProps;
12
+ /**
13
+ * ToB プロダクト共通のテーマ(businessTheme)を適用したうえで、利用側の ConfigProvider 設定を重ねる。
14
+ * 外側で businessTheme を当て、内側で利用側 props を渡すため、利用側の `theme` は差分として上書きされる。
15
+ */
9
16
  declare function UbieConfigProvider({
10
17
  children,
11
18
  ...configProviderProps
12
19
  }: UbieConfigProviderProps): _$react_jsx_runtime0.JSX.Element;
13
20
  //#endregion
14
- export { UbieConfigProvider, type UbieConfigProviderProps, notification, version, xNotification, xVersion };
21
+ //#region src/theme/businessTheme.d.ts
22
+ /**
23
+ * ToB プロダクト共通の antd テーマ。
24
+ *
25
+ * token 層は `@ubie/vitals-antd-theme` の `antdTheme` をそのまま引き継ぎ、
26
+ * business 共通の components 既定だけをここで足す。アプリ側は
27
+ * `{ ...businessTheme, components: { ...businessTheme.components, Layout: { ...businessTheme.components.Layout, headerHeight: 64 } } }`
28
+ * のように差分だけを上書きする。
29
+ */
30
+ declare const businessTheme: {
31
+ components: {
32
+ Layout: {
33
+ bodyBg: string;
34
+ footerBg: string;
35
+ headerBg: string;
36
+ };
37
+ Table: {
38
+ cellPaddingBlockSM: 6;
39
+ rowHoverBg: string;
40
+ };
41
+ };
42
+ token: {
43
+ colorPrimary: string;
44
+ colorLink: string;
45
+ blue: string;
46
+ blue1: string;
47
+ blue2: string;
48
+ blue3: string;
49
+ blue4: string;
50
+ blue5: string;
51
+ blue6: string;
52
+ blue7: string;
53
+ blue8: string;
54
+ blue9: string;
55
+ blue10: string;
56
+ pink: string;
57
+ pink1: string;
58
+ pink2: string;
59
+ pink3: string;
60
+ pink4: string;
61
+ pink5: string;
62
+ pink6: string;
63
+ pink7: string;
64
+ pink8: string;
65
+ pink9: string;
66
+ pink10: string;
67
+ sky: string;
68
+ sky1: string;
69
+ sky2: string;
70
+ sky3: string;
71
+ sky4: string;
72
+ sky5: string;
73
+ sky6: string;
74
+ sky7: string;
75
+ sky8: string;
76
+ sky9: string;
77
+ sky10: string;
78
+ green: string;
79
+ green1: string;
80
+ green2: string;
81
+ green3: string;
82
+ green4: string;
83
+ green5: string;
84
+ green6: string;
85
+ green7: string;
86
+ green8: string;
87
+ green9: string;
88
+ green10: string;
89
+ yellow: string;
90
+ yellow1: string;
91
+ yellow2: string;
92
+ yellow3: string;
93
+ yellow4: string;
94
+ yellow5: string;
95
+ yellow6: string;
96
+ yellow7: string;
97
+ yellow8: string;
98
+ yellow9: string;
99
+ yellow10: string;
100
+ purple: string;
101
+ purple1: string;
102
+ purple2: string;
103
+ purple3: string;
104
+ purple4: string;
105
+ purple5: string;
106
+ purple6: string;
107
+ purple7: string;
108
+ purple8: string;
109
+ purple9: string;
110
+ purple10: string;
111
+ red: string;
112
+ red1: string;
113
+ red2: string;
114
+ red3: string;
115
+ red4: string;
116
+ red5: string;
117
+ red6: string;
118
+ red7: string;
119
+ red8: string;
120
+ red9: string;
121
+ red10: string;
122
+ gray: string;
123
+ gray1: string;
124
+ gray2: string;
125
+ gray3: string;
126
+ gray4: string;
127
+ gray5: string;
128
+ gray6: string;
129
+ gray7: string;
130
+ gray8: string;
131
+ gray9: string;
132
+ gray10: string;
133
+ white: string;
134
+ colorSuccess: string;
135
+ colorSuccessBg: string;
136
+ colorWarning: string;
137
+ colorWarningBg: string;
138
+ colorError: string;
139
+ colorErrorBg: string;
140
+ colorInfo: string;
141
+ colorInfoBg: string;
142
+ colorTextBase: string;
143
+ colorBgBase: string;
144
+ colorBorder: string;
145
+ colorBorderSecondary: string;
146
+ colorTextPlaceholder: string;
147
+ };
148
+ };
149
+ //#endregion
150
+ //#region src/components/Table/index.d.ts
151
+ interface TableProps<RecordType = Record<PropertyKey, unknown>> extends Omit<TableProps$1<RecordType>, "columns"> {
152
+ /**
153
+ * 行クリック。行内の `data-row-action` 属性を持つ要素(とその子孫)からのクリックは行クリックにしない。
154
+ * 指定すると行に `cursor: pointer` が付く。
155
+ */
156
+ onRowClick?: (record: RecordType, event: MouseEvent<HTMLElement>) => void;
157
+ /** hover 中の行だけに描く行内アクション。末尾列として描画され、中のクリックは行クリックにならない。 */
158
+ hoverActions?: (record: RecordType) => ReactNode;
159
+ /** hover 効果(hoverActions の表示)を止める。 */
160
+ disableHoverEffect?: boolean;
161
+ ref?: Ref<TableRef>;
162
+ /**
163
+ * antd 継承分の再宣言。`AntdTableProps<RecordType>["columns"]` は optional なインデックスアクセスで
164
+ * `ColumnsType<RecordType> | undefined` になる(`resolveRowKey` の `RowKeyProp` と同じ TS の挙動)。
165
+ * `exactOptionalPropertyTypes: true` 下では継承したままの optional 宣言だと明示的な `undefined` を
166
+ * 弾いてしまい、`TableProps<Row>["columns"]` で型付けた変数をそのまま渡せない。ここだけ明示的に
167
+ * `| undefined` を許容する形へ広げる(実行時の意味は antd の `columns?` と同じ)。
168
+ */
169
+ columns?: TableProps$1<RecordType>["columns"] | undefined;
170
+ }
171
+ /**
172
+ * ToB プロダクト共通の Table。antd Table の superset。
173
+ *
174
+ * - `size` の既定は `small`(`businessTheme` の `Table.cellPaddingBlockSM` と組で一覧画面の密度にする)
175
+ * - `onRowClick` / `hoverActions` / `disableHoverEffect` を足す。それ以外の props は antd にそのまま渡す
176
+ * - hover 状態は React state で持つ(CSS に依存しないので描画テストで検査できる)
177
+ *
178
+ * @displayName Table
179
+ */
180
+ declare function InternalTable<RecordType extends object>(props: TableProps<RecordType>): _$react_jsx_runtime0.JSX.Element;
181
+ type TableStatics = Pick<typeof Table$1, "Column" | "ColumnGroup" | "Summary" | "SELECTION_COLUMN" | "EXPAND_COLUMN" | "SELECTION_ALL" | "SELECTION_INVERT" | "SELECTION_NONE">;
182
+ declare const Table: typeof InternalTable & TableStatics;
183
+ //#endregion
184
+ //#region src/components/ChatBubble/index.d.ts
185
+ /**
186
+ * LLM 出力の根拠を表す型。ChatBubble の footer slot に「根拠を見る」として描画される。
187
+ */
188
+ interface ChatBubbleEvidence {
189
+ /** 表示ラベル (例: "看護要約 v2") */
190
+ label: string;
191
+ /** リンク先 URL */
192
+ href?: string;
193
+ /** 任意ノード (Button などを差し込む場合) */
194
+ node?: ReactNode;
195
+ }
196
+ interface ChatBubbleProps<ContentType extends BubbleContentType = string> extends BubbleProps<ContentType> {
197
+ /**
198
+ * LLM 出力の根拠を Bubble footer に表示する。
199
+ * 配列で渡すと複数並べて表示する。
200
+ * 利用側の `footer` と合成して描画する(潰さない)。
201
+ */
202
+ evidence?: ChatBubbleEvidence | ChatBubbleEvidence[];
203
+ /**
204
+ * メッセージのタイムスタンプ。指定があれば extra slot に表示する。
205
+ * 利用側の `extra` と合成して描画する(潰さない)。
206
+ *
207
+ * 解釈できない値(`"いつか"` / `new Date("いつか")` など)は未指定と同じ扱いにする。
208
+ * `NaN:NaN` を利用者に見せないため。`timestampFormat` も呼ばれない。
209
+ */
210
+ timestamp?: string | Date;
211
+ /**
212
+ * timestamp の表示フォーマット関数。
213
+ * 既定は HH:mm 形式 (ローカルタイム)。
214
+ */
215
+ timestampFormat?: (date: Date) => string;
216
+ /**
217
+ * 指定があると footer に「リトライ」ボタンを表示する。
218
+ * エラー時のメッセージ再送に使う。
219
+ */
220
+ onRetry?: () => void;
221
+ /** リトライボタンの文言。既定は「リトライ」。 */
222
+ retryLabel?: ReactNode;
223
+ /**
224
+ * `Bubble` の ref(`nativeElement` で DOM に到達できる)。
225
+ * `BubbleProps` に `ref` の宣言が無いため、`Table` と同じ作法でここで宣言して明示的に渡す。
226
+ * `BubbleRef` は `@ant-design/x` の root export に無いので `es/bubble/interface` から取る。
227
+ */
228
+ ref?: Ref<BubbleRef>;
229
+ }
230
+ /**
231
+ * ToB プロダクト共通の ChatBubble。`@ant-design/x` の Bubble の superset。
232
+ *
233
+ * - `evidence` / `onRetry` を footer に、`timestamp` を extra に足す。それぞれ利用側の
234
+ * `footer` / `extra` を潰さず合成する(`footer` / `extra` が関数形でも解決してから合成する)
235
+ * - timestamp の表示はテーマの `token.fontSizeSM` と `Typography.Text type="secondary"` の色を使う
236
+ * (値のコピーをしない)
237
+ */
238
+ declare function ChatBubble<ContentType extends BubbleContentType = string>({
239
+ evidence,
240
+ timestamp,
241
+ timestampFormat,
242
+ onRetry,
243
+ retryLabel,
244
+ footer,
245
+ extra,
246
+ ref,
247
+ ...rest
248
+ }: ChatBubbleProps<ContentType>): _$react_jsx_runtime0.JSX.Element;
249
+ //#endregion
250
+ //#region src/components/ChatConversations/index.d.ts
251
+ interface ChatConversationsProps extends ConversationsProps {
252
+ /**
253
+ * items が空のときに表示する empty state。
254
+ * 指定が無ければ antd の `<Empty />` を表示する(文言は `ConfigProvider` の `locale` に従う。
255
+ * チャット固有の文言(例: "会話履歴がありません")が必要な場合は利用側がここで渡す)。
256
+ */
257
+ emptyState?: ReactNode;
258
+ /**
259
+ * `Conversations` の ref(`nativeElement` で DOM に到達できる)。
260
+ * `ConversationsProps` に `ref` の宣言が無いため、`Table` と同じ作法でここで宣言して明示的に渡す。
261
+ */
262
+ ref?: Ref<ComponentRef<typeof Conversations>>;
263
+ }
264
+ /**
265
+ * ToB プロダクト共通の ChatConversations。`@ant-design/x` の Conversations の superset。
266
+ *
267
+ * - `items` が空(未指定または長さ 0)のときも `Conversations` は常に描く(`style` / `className` /
268
+ * `creation`(新規会話ボタン)/ `groupable` / `ref` など利用側の props を落とさないため)
269
+ * - 空のときは `Conversations`(中身は空リスト)に加えて `emptyState`(既定は `<Empty />`)を描く
270
+ * - `emptyState` の契約は `ChatBubbleEvidence.node` と揃える。未指定(`undefined`)なら既定の
271
+ * `<Empty />`、`null` なら何も描かない、`0` や `""` のような falsy な `ReactNode` はそのまま描く
272
+ */
273
+ declare function ChatConversations({
274
+ emptyState,
275
+ items,
276
+ ref,
277
+ ...rest
278
+ }: ChatConversationsProps): _$react_jsx_runtime0.JSX.Element;
279
+ //#endregion
280
+ export { ChatBubble, type ChatBubbleEvidence, type ChatBubbleProps, ChatConversations, type ChatConversationsProps, Table, type TableProps, UbieConfigProvider, type UbieConfigProviderProps, businessTheme, notification, version, xNotification, xVersion };
15
281
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/UbieConfigProvider.tsx"],"mappings":";;;;;;;KAGY,uBAAA,GAA0B,mBAAA;AAAA,iBAEtB,kBAAA,CAAA;EAAqB,QAAA;EAAA,GAAa;AAAA,GAAuB,uBAAA,GAAuB,oBAAA,CAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/UbieConfigProvider.tsx","../src/theme/businessTheme.ts","../src/components/Table/index.tsx","../src/components/ChatBubble/index.tsx","../src/components/ChatConversations/index.tsx"],"mappings":";;;;;;;;;;KAIY,uBAAA,GAA0B,mBAAA;;;;;iBAMtB,kBAAA,CAAA;EAAqB,QAAA;EAAA,GAAa;AAAA,GAAuB,uBAAA,GAAuB,oBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;;;;;;cCqDnF,aAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAA,GAAM,GAAA,CAAI,YAAA,QAAoB,aAAA;AAAA;;;AJLhC;;;;;;;iBIiBgB,iBAAA,CAAA;EAAoB,UAAA;EAAY,KAAA;EAAO,GAAA;EAAA,GAAQ;AAAA,GAAQ,sBAAA,GAAsB,oBAAA,CAAA,GAAA,CAAA,OAAA"}
package/dist/index.d.mts CHANGED
@@ -1,15 +1,281 @@
1
- import { notification as xNotification, version as xVersion } from "@ant-design/x";
2
- import { ConfigProviderProps, notification, version } from "antd";
1
+ import { BubbleProps, Conversations, ConversationsProps, notification as xNotification, version as xVersion } from "@ant-design/x";
2
+ import { ConfigProviderProps, Table as Table$1, TableProps as TableProps$1, notification, version } from "antd";
3
3
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
+ import { ComponentRef, MouseEvent, ReactNode, Ref } from "react";
5
+ import { TableRef } from "antd/es/table/index.js";
6
+ import { BubbleContentType, BubbleRef } from "@ant-design/x/es/bubble/interface.js";
4
7
  export * from "@ant-design/x";
5
8
  export * from "antd";
6
9
 
7
10
  //#region src/UbieConfigProvider.d.ts
8
11
  type UbieConfigProviderProps = ConfigProviderProps;
12
+ /**
13
+ * ToB プロダクト共通のテーマ(businessTheme)を適用したうえで、利用側の ConfigProvider 設定を重ねる。
14
+ * 外側で businessTheme を当て、内側で利用側 props を渡すため、利用側の `theme` は差分として上書きされる。
15
+ */
9
16
  declare function UbieConfigProvider({
10
17
  children,
11
18
  ...configProviderProps
12
19
  }: UbieConfigProviderProps): _$react_jsx_runtime0.JSX.Element;
13
20
  //#endregion
14
- export { UbieConfigProvider, type UbieConfigProviderProps, notification, version, xNotification, xVersion };
21
+ //#region src/theme/businessTheme.d.ts
22
+ /**
23
+ * ToB プロダクト共通の antd テーマ。
24
+ *
25
+ * token 層は `@ubie/vitals-antd-theme` の `antdTheme` をそのまま引き継ぎ、
26
+ * business 共通の components 既定だけをここで足す。アプリ側は
27
+ * `{ ...businessTheme, components: { ...businessTheme.components, Layout: { ...businessTheme.components.Layout, headerHeight: 64 } } }`
28
+ * のように差分だけを上書きする。
29
+ */
30
+ declare const businessTheme: {
31
+ components: {
32
+ Layout: {
33
+ bodyBg: string;
34
+ footerBg: string;
35
+ headerBg: string;
36
+ };
37
+ Table: {
38
+ cellPaddingBlockSM: 6;
39
+ rowHoverBg: string;
40
+ };
41
+ };
42
+ token: {
43
+ colorPrimary: string;
44
+ colorLink: string;
45
+ blue: string;
46
+ blue1: string;
47
+ blue2: string;
48
+ blue3: string;
49
+ blue4: string;
50
+ blue5: string;
51
+ blue6: string;
52
+ blue7: string;
53
+ blue8: string;
54
+ blue9: string;
55
+ blue10: string;
56
+ pink: string;
57
+ pink1: string;
58
+ pink2: string;
59
+ pink3: string;
60
+ pink4: string;
61
+ pink5: string;
62
+ pink6: string;
63
+ pink7: string;
64
+ pink8: string;
65
+ pink9: string;
66
+ pink10: string;
67
+ sky: string;
68
+ sky1: string;
69
+ sky2: string;
70
+ sky3: string;
71
+ sky4: string;
72
+ sky5: string;
73
+ sky6: string;
74
+ sky7: string;
75
+ sky8: string;
76
+ sky9: string;
77
+ sky10: string;
78
+ green: string;
79
+ green1: string;
80
+ green2: string;
81
+ green3: string;
82
+ green4: string;
83
+ green5: string;
84
+ green6: string;
85
+ green7: string;
86
+ green8: string;
87
+ green9: string;
88
+ green10: string;
89
+ yellow: string;
90
+ yellow1: string;
91
+ yellow2: string;
92
+ yellow3: string;
93
+ yellow4: string;
94
+ yellow5: string;
95
+ yellow6: string;
96
+ yellow7: string;
97
+ yellow8: string;
98
+ yellow9: string;
99
+ yellow10: string;
100
+ purple: string;
101
+ purple1: string;
102
+ purple2: string;
103
+ purple3: string;
104
+ purple4: string;
105
+ purple5: string;
106
+ purple6: string;
107
+ purple7: string;
108
+ purple8: string;
109
+ purple9: string;
110
+ purple10: string;
111
+ red: string;
112
+ red1: string;
113
+ red2: string;
114
+ red3: string;
115
+ red4: string;
116
+ red5: string;
117
+ red6: string;
118
+ red7: string;
119
+ red8: string;
120
+ red9: string;
121
+ red10: string;
122
+ gray: string;
123
+ gray1: string;
124
+ gray2: string;
125
+ gray3: string;
126
+ gray4: string;
127
+ gray5: string;
128
+ gray6: string;
129
+ gray7: string;
130
+ gray8: string;
131
+ gray9: string;
132
+ gray10: string;
133
+ white: string;
134
+ colorSuccess: string;
135
+ colorSuccessBg: string;
136
+ colorWarning: string;
137
+ colorWarningBg: string;
138
+ colorError: string;
139
+ colorErrorBg: string;
140
+ colorInfo: string;
141
+ colorInfoBg: string;
142
+ colorTextBase: string;
143
+ colorBgBase: string;
144
+ colorBorder: string;
145
+ colorBorderSecondary: string;
146
+ colorTextPlaceholder: string;
147
+ };
148
+ };
149
+ //#endregion
150
+ //#region src/components/Table/index.d.ts
151
+ interface TableProps<RecordType = Record<PropertyKey, unknown>> extends Omit<TableProps$1<RecordType>, "columns"> {
152
+ /**
153
+ * 行クリック。行内の `data-row-action` 属性を持つ要素(とその子孫)からのクリックは行クリックにしない。
154
+ * 指定すると行に `cursor: pointer` が付く。
155
+ */
156
+ onRowClick?: (record: RecordType, event: MouseEvent<HTMLElement>) => void;
157
+ /** hover 中の行だけに描く行内アクション。末尾列として描画され、中のクリックは行クリックにならない。 */
158
+ hoverActions?: (record: RecordType) => ReactNode;
159
+ /** hover 効果(hoverActions の表示)を止める。 */
160
+ disableHoverEffect?: boolean;
161
+ ref?: Ref<TableRef>;
162
+ /**
163
+ * antd 継承分の再宣言。`AntdTableProps<RecordType>["columns"]` は optional なインデックスアクセスで
164
+ * `ColumnsType<RecordType> | undefined` になる(`resolveRowKey` の `RowKeyProp` と同じ TS の挙動)。
165
+ * `exactOptionalPropertyTypes: true` 下では継承したままの optional 宣言だと明示的な `undefined` を
166
+ * 弾いてしまい、`TableProps<Row>["columns"]` で型付けた変数をそのまま渡せない。ここだけ明示的に
167
+ * `| undefined` を許容する形へ広げる(実行時の意味は antd の `columns?` と同じ)。
168
+ */
169
+ columns?: TableProps$1<RecordType>["columns"] | undefined;
170
+ }
171
+ /**
172
+ * ToB プロダクト共通の Table。antd Table の superset。
173
+ *
174
+ * - `size` の既定は `small`(`businessTheme` の `Table.cellPaddingBlockSM` と組で一覧画面の密度にする)
175
+ * - `onRowClick` / `hoverActions` / `disableHoverEffect` を足す。それ以外の props は antd にそのまま渡す
176
+ * - hover 状態は React state で持つ(CSS に依存しないので描画テストで検査できる)
177
+ *
178
+ * @displayName Table
179
+ */
180
+ declare function InternalTable<RecordType extends object>(props: TableProps<RecordType>): _$react_jsx_runtime0.JSX.Element;
181
+ type TableStatics = Pick<typeof Table$1, "Column" | "ColumnGroup" | "Summary" | "SELECTION_COLUMN" | "EXPAND_COLUMN" | "SELECTION_ALL" | "SELECTION_INVERT" | "SELECTION_NONE">;
182
+ declare const Table: typeof InternalTable & TableStatics;
183
+ //#endregion
184
+ //#region src/components/ChatBubble/index.d.ts
185
+ /**
186
+ * LLM 出力の根拠を表す型。ChatBubble の footer slot に「根拠を見る」として描画される。
187
+ */
188
+ interface ChatBubbleEvidence {
189
+ /** 表示ラベル (例: "看護要約 v2") */
190
+ label: string;
191
+ /** リンク先 URL */
192
+ href?: string;
193
+ /** 任意ノード (Button などを差し込む場合) */
194
+ node?: ReactNode;
195
+ }
196
+ interface ChatBubbleProps<ContentType extends BubbleContentType = string> extends BubbleProps<ContentType> {
197
+ /**
198
+ * LLM 出力の根拠を Bubble footer に表示する。
199
+ * 配列で渡すと複数並べて表示する。
200
+ * 利用側の `footer` と合成して描画する(潰さない)。
201
+ */
202
+ evidence?: ChatBubbleEvidence | ChatBubbleEvidence[];
203
+ /**
204
+ * メッセージのタイムスタンプ。指定があれば extra slot に表示する。
205
+ * 利用側の `extra` と合成して描画する(潰さない)。
206
+ *
207
+ * 解釈できない値(`"いつか"` / `new Date("いつか")` など)は未指定と同じ扱いにする。
208
+ * `NaN:NaN` を利用者に見せないため。`timestampFormat` も呼ばれない。
209
+ */
210
+ timestamp?: string | Date;
211
+ /**
212
+ * timestamp の表示フォーマット関数。
213
+ * 既定は HH:mm 形式 (ローカルタイム)。
214
+ */
215
+ timestampFormat?: (date: Date) => string;
216
+ /**
217
+ * 指定があると footer に「リトライ」ボタンを表示する。
218
+ * エラー時のメッセージ再送に使う。
219
+ */
220
+ onRetry?: () => void;
221
+ /** リトライボタンの文言。既定は「リトライ」。 */
222
+ retryLabel?: ReactNode;
223
+ /**
224
+ * `Bubble` の ref(`nativeElement` で DOM に到達できる)。
225
+ * `BubbleProps` に `ref` の宣言が無いため、`Table` と同じ作法でここで宣言して明示的に渡す。
226
+ * `BubbleRef` は `@ant-design/x` の root export に無いので `es/bubble/interface` から取る。
227
+ */
228
+ ref?: Ref<BubbleRef>;
229
+ }
230
+ /**
231
+ * ToB プロダクト共通の ChatBubble。`@ant-design/x` の Bubble の superset。
232
+ *
233
+ * - `evidence` / `onRetry` を footer に、`timestamp` を extra に足す。それぞれ利用側の
234
+ * `footer` / `extra` を潰さず合成する(`footer` / `extra` が関数形でも解決してから合成する)
235
+ * - timestamp の表示はテーマの `token.fontSizeSM` と `Typography.Text type="secondary"` の色を使う
236
+ * (値のコピーをしない)
237
+ */
238
+ declare function ChatBubble<ContentType extends BubbleContentType = string>({
239
+ evidence,
240
+ timestamp,
241
+ timestampFormat,
242
+ onRetry,
243
+ retryLabel,
244
+ footer,
245
+ extra,
246
+ ref,
247
+ ...rest
248
+ }: ChatBubbleProps<ContentType>): _$react_jsx_runtime0.JSX.Element;
249
+ //#endregion
250
+ //#region src/components/ChatConversations/index.d.ts
251
+ interface ChatConversationsProps extends ConversationsProps {
252
+ /**
253
+ * items が空のときに表示する empty state。
254
+ * 指定が無ければ antd の `<Empty />` を表示する(文言は `ConfigProvider` の `locale` に従う。
255
+ * チャット固有の文言(例: "会話履歴がありません")が必要な場合は利用側がここで渡す)。
256
+ */
257
+ emptyState?: ReactNode;
258
+ /**
259
+ * `Conversations` の ref(`nativeElement` で DOM に到達できる)。
260
+ * `ConversationsProps` に `ref` の宣言が無いため、`Table` と同じ作法でここで宣言して明示的に渡す。
261
+ */
262
+ ref?: Ref<ComponentRef<typeof Conversations>>;
263
+ }
264
+ /**
265
+ * ToB プロダクト共通の ChatConversations。`@ant-design/x` の Conversations の superset。
266
+ *
267
+ * - `items` が空(未指定または長さ 0)のときも `Conversations` は常に描く(`style` / `className` /
268
+ * `creation`(新規会話ボタン)/ `groupable` / `ref` など利用側の props を落とさないため)
269
+ * - 空のときは `Conversations`(中身は空リスト)に加えて `emptyState`(既定は `<Empty />`)を描く
270
+ * - `emptyState` の契約は `ChatBubbleEvidence.node` と揃える。未指定(`undefined`)なら既定の
271
+ * `<Empty />`、`null` なら何も描かない、`0` や `""` のような falsy な `ReactNode` はそのまま描く
272
+ */
273
+ declare function ChatConversations({
274
+ emptyState,
275
+ items,
276
+ ref,
277
+ ...rest
278
+ }: ChatConversationsProps): _$react_jsx_runtime0.JSX.Element;
279
+ //#endregion
280
+ export { ChatBubble, type ChatBubbleEvidence, type ChatBubbleProps, ChatConversations, type ChatConversationsProps, Table, type TableProps, UbieConfigProvider, type UbieConfigProviderProps, businessTheme, notification, version, xNotification, xVersion };
15
281
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/UbieConfigProvider.tsx"],"mappings":";;;;;;;KAGY,uBAAA,GAA0B,mBAAA;AAAA,iBAEtB,kBAAA,CAAA;EAAqB,QAAA;EAAA,GAAa;AAAA,GAAuB,uBAAA,GAAuB,oBAAA,CAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/UbieConfigProvider.tsx","../src/theme/businessTheme.ts","../src/components/Table/index.tsx","../src/components/ChatBubble/index.tsx","../src/components/ChatConversations/index.tsx"],"mappings":";;;;;;;;;;KAIY,uBAAA,GAA0B,mBAAA;;;;;iBAMtB,kBAAA,CAAA;EAAqB,QAAA;EAAA,GAAa;AAAA,GAAuB,uBAAA,GAAuB,oBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;;;;;;cCqDnF,aAAA;;;;;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