@godxjp/ui 2.1.0 → 5.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/BRAND.md +39 -29
- package/CHANGELOG.md +554 -10
- package/README.md +143 -168
- package/config/eslint.js +54 -0
- package/config/prettier.cjs +20 -0
- package/config/tsconfig.base.json +22 -0
- package/config/vitest.base.ts +26 -0
- package/dist/MiniMonth-YAmPGEpC.d.ts +143 -0
- package/dist/Table.types-BbsxoIYE.d.ts +352 -0
- package/dist/color-DO0qqUAb.d.ts +38 -0
- package/dist/components/composites.d.ts +963 -0
- package/dist/components/composites.js +7340 -0
- package/dist/components/composites.js.map +1 -0
- package/dist/components/primitives.d.ts +2633 -163
- package/dist/components/primitives.js +7264 -165
- package/dist/components/primitives.js.map +1 -1
- package/dist/components/shell.d.ts +82 -12
- package/dist/components/shell.js +168 -162
- package/dist/components/shell.js.map +1 -1
- package/dist/hooks.d.ts +83 -8
- package/dist/hooks.js +497 -83
- package/dist/hooks.js.map +1 -1
- package/dist/i18n.d.ts +55 -3
- package/dist/i18n.js +456 -5
- package/dist/i18n.js.map +1 -1
- package/dist/index.d.ts +24 -5
- package/dist/index.js +12522 -267
- package/dist/index.js.map +1 -1
- package/dist/padding-DY0JV5Ja.d.ts +16 -0
- package/dist/preferences.d.ts +132 -0
- package/dist/preferences.js +262 -0
- package/dist/preferences.js.map +1 -0
- package/dist/props.d.ts +86 -0
- package/dist/props.js +16 -0
- package/dist/props.js.map +1 -0
- package/dist/size-CQwNvOWd.d.ts +19 -0
- package/dist/{data.d.ts → types-LTj-2bl-.d.ts} +7 -12
- package/dist/useTableViews-D5NIAJ7h.d.ts +154 -0
- package/package.json +92 -34
- package/src/tokens/tailwind.css +158 -0
- package/dist/components/screens.d.ts +0 -51
- package/dist/components/screens.js +0 -806
- package/dist/components/screens.js.map +0 -1
- package/dist/data.js +0 -93
- package/dist/data.js.map +0 -1
- package/src/tokens/tokens.css +0 -765
|
@@ -0,0 +1,963 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { ReactNode, CSSProperties } from 'react';
|
|
4
|
+
import { c as MiniMonthYMD, a as CalendarRef, e as SegmentedControlItem, C as CalendarEvent, T as TimeLocale, E as EventBlockVariant, P as PersonRef } from '../MiniMonth-YAmPGEpC.js';
|
|
5
|
+
import { Table, ColumnPinningState, RowData } from '@tanstack/react-table';
|
|
6
|
+
import { b as TableColumn, n as TableRowKey, e as TableDensity, q as TableSortState, g as TableExpandableConfig, t as TableTreeConfig, f as TableEditingConfig, k as TableGroupBy, w as TableViews, r as TableToolbar, T as TableBatchActionsConfig, i as TableFilterBar, h as TableFilter, l as TablePagination, d as TableColumnVisibility, v as TableViewSnapshot, u as TableViewItem, c as TableColumnPinningChange, j as TableFilterOption, s as TableToolbarConfig } from '../Table.types-BbsxoIYE.js';
|
|
7
|
+
import { c as UseTableSelectionResult, a as UseTablePaginationResult, e as UseTableViewsResult } from '../useTableViews-D5NIAJ7h.js';
|
|
8
|
+
import '../size-CQwNvOWd.js';
|
|
9
|
+
import '../color-DO0qqUAb.js';
|
|
10
|
+
|
|
11
|
+
type UploadStatus = "pending" | "uploading" | "success" | "error" | "removed";
|
|
12
|
+
type UploadListType = "text" | "picture" | "picture-card";
|
|
13
|
+
interface UploadFile {
|
|
14
|
+
/** Stable client-side identifier (used as React key). */
|
|
15
|
+
uid: string;
|
|
16
|
+
/** File name shown in the list. */
|
|
17
|
+
name: string;
|
|
18
|
+
/** Size in bytes. */
|
|
19
|
+
size: number;
|
|
20
|
+
/** MIME type. */
|
|
21
|
+
type: string;
|
|
22
|
+
/** Lifecycle phase. */
|
|
23
|
+
status: UploadStatus;
|
|
24
|
+
/** 0..100. */
|
|
25
|
+
percent: number;
|
|
26
|
+
/** Human-readable error from the upload transport. */
|
|
27
|
+
error?: string;
|
|
28
|
+
/** Final URL (or pre-existing URL for controlled mode). */
|
|
29
|
+
url?: string;
|
|
30
|
+
/** Local object URL used for thumbnails before upload completes. */
|
|
31
|
+
thumbUrl?: string;
|
|
32
|
+
/** The original `File` — only present until the upload resolves. */
|
|
33
|
+
originFile?: File;
|
|
34
|
+
}
|
|
35
|
+
interface UploadRequestParams {
|
|
36
|
+
file: File;
|
|
37
|
+
/** Push 0..100 progress to the list item. */
|
|
38
|
+
onProgress: (percent: number) => void;
|
|
39
|
+
/** Aborts when the user removes the item mid-upload. */
|
|
40
|
+
signal: AbortSignal;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Service supplies the transport. Resolve with `{ url }` to stamp
|
|
44
|
+
* the final URL on the list item; resolve with `void` to keep the
|
|
45
|
+
* client-side thumbUrl. Throw to surface an error.
|
|
46
|
+
*/
|
|
47
|
+
type UploadCustomRequest = (params: UploadRequestParams) => Promise<{
|
|
48
|
+
url?: string;
|
|
49
|
+
} | void>;
|
|
50
|
+
interface UploadLabels {
|
|
51
|
+
/** Default trigger CTA. */
|
|
52
|
+
dropHint: string;
|
|
53
|
+
/** Second-line hint under the dashed trigger. */
|
|
54
|
+
dropSubHint: string;
|
|
55
|
+
/** Picture-card "+ Upload". */
|
|
56
|
+
pictureCardHint: string;
|
|
57
|
+
/** Per-item remove button aria-label. */
|
|
58
|
+
remove: string;
|
|
59
|
+
/** Per-item retry button aria-label. */
|
|
60
|
+
retry: string;
|
|
61
|
+
/** Per-item preview button aria-label. */
|
|
62
|
+
preview: string;
|
|
63
|
+
/** Error: file type rejected. */
|
|
64
|
+
rejectedType: string;
|
|
65
|
+
/** Error: file too large (supports `{{mb}}` interpolation). */
|
|
66
|
+
rejectedTooLarge: string;
|
|
67
|
+
/** Error: too many files (supports `{{count}}` interpolation). */
|
|
68
|
+
rejectedTooMany: string;
|
|
69
|
+
}
|
|
70
|
+
interface UploadProps {
|
|
71
|
+
/** Allow selecting multiple files at once. */
|
|
72
|
+
multiple?: boolean;
|
|
73
|
+
/** MIME pattern passed to `<input accept=>`, e.g. `image/*`, `.pdf,.docx`. */
|
|
74
|
+
accept?: string;
|
|
75
|
+
/** Max bytes per file. Files larger are rejected before upload. */
|
|
76
|
+
maxSize?: number;
|
|
77
|
+
/** Max items in the list (ignored when `multiple=false`). */
|
|
78
|
+
maxCount?: number;
|
|
79
|
+
/** Hide the trigger + disable all actions. */
|
|
80
|
+
disabled?: boolean;
|
|
81
|
+
/** Visual variant of the file list. */
|
|
82
|
+
listType?: UploadListType;
|
|
83
|
+
/** Controlled mode — when supplied the composite never owns state. */
|
|
84
|
+
fileList?: UploadFile[];
|
|
85
|
+
/** Uncontrolled initial state. */
|
|
86
|
+
defaultFileList?: UploadFile[];
|
|
87
|
+
/** Synchronous or async gate run before queueing. Return false → skip. */
|
|
88
|
+
beforeUpload?: (file: File) => boolean | Promise<boolean>;
|
|
89
|
+
/** Service-supplied transport. */
|
|
90
|
+
customRequest: UploadCustomRequest;
|
|
91
|
+
/** Fires whenever the list mutates (controlled + uncontrolled). */
|
|
92
|
+
onChange?: (files: UploadFile[]) => void;
|
|
93
|
+
/** Fires before remove. Return false / reject to keep the item. */
|
|
94
|
+
onRemove?: (file: UploadFile) => boolean | Promise<boolean>;
|
|
95
|
+
/** Fires when the user taps the preview button. */
|
|
96
|
+
onPreview?: (file: UploadFile) => void;
|
|
97
|
+
/** Override label strings. */
|
|
98
|
+
labels?: Partial<UploadLabels>;
|
|
99
|
+
/** Map a thrown error to user copy. */
|
|
100
|
+
errorMapper?: (err: unknown) => string;
|
|
101
|
+
/** Replace the default dashed trigger area. */
|
|
102
|
+
trigger?: ReactNode;
|
|
103
|
+
/** Alias for `trigger` (composability with shadcn-style). */
|
|
104
|
+
children?: ReactNode;
|
|
105
|
+
/** Extra className on the outer wrapper. */
|
|
106
|
+
className?: string;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
declare function Upload({ multiple, accept, maxSize, maxCount, disabled, listType, fileList, defaultFileList, beforeUpload, customRequest, onChange, onRemove, onPreview, labels: labelOverrides, errorMapper, trigger, children, className, }: UploadProps): react_jsx_runtime.JSX.Element;
|
|
110
|
+
|
|
111
|
+
interface ImageUploadProps extends Omit<UploadProps, "listType" | "accept" | "customRequest"> {
|
|
112
|
+
/** MIME allowlist for images (default JPEG/PNG/WebP). */
|
|
113
|
+
allowedTypes?: string[];
|
|
114
|
+
/** Optional crop aspect — when set, every selected image runs through the cropper. */
|
|
115
|
+
aspect?: number;
|
|
116
|
+
/** Crop shape — `round` for avatars, `rect` for banners. Default `rect`. */
|
|
117
|
+
cropShape?: "round" | "rect";
|
|
118
|
+
/** Picture-card edge in px (default 96 — Ant's picture-card). */
|
|
119
|
+
thumbSize?: number;
|
|
120
|
+
/** Service transport — same shape as <Upload>'s customRequest. */
|
|
121
|
+
customRequest: UploadCustomRequest;
|
|
122
|
+
/** Localised cropper labels. */
|
|
123
|
+
cropLabels?: {
|
|
124
|
+
confirm: string;
|
|
125
|
+
cancel: string;
|
|
126
|
+
zoom: string;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
declare function ImageUpload({ allowedTypes, aspect, cropShape, thumbSize: _thumbSize, customRequest, cropLabels: cropLabelOverrides, beforeUpload, ...rest }: ImageUploadProps): react_jsx_runtime.JSX.Element;
|
|
130
|
+
|
|
131
|
+
interface AvatarUploaderLabels {
|
|
132
|
+
chooseImage: string;
|
|
133
|
+
upload: string;
|
|
134
|
+
cancel: string;
|
|
135
|
+
cancelUpload: string;
|
|
136
|
+
tryAgain: string;
|
|
137
|
+
uploadSuccess: string;
|
|
138
|
+
change: string;
|
|
139
|
+
rejectedType: string;
|
|
140
|
+
rejectedTooLarge: string;
|
|
141
|
+
}
|
|
142
|
+
interface AvatarUploadCallbackParams {
|
|
143
|
+
/** Selected source file (pre-crop). */
|
|
144
|
+
file: File;
|
|
145
|
+
/** Cropped image blob ready to ship. */
|
|
146
|
+
blob: Blob;
|
|
147
|
+
/** 0..100 progress callback. */
|
|
148
|
+
onProgress?: (pct: number) => void;
|
|
149
|
+
/** AbortController signal — fires when user cancels. */
|
|
150
|
+
signal: AbortSignal;
|
|
151
|
+
}
|
|
152
|
+
interface AvatarUploaderProps {
|
|
153
|
+
/** Required — service provides the actual upload + persistence. */
|
|
154
|
+
onUpload: (params: AvatarUploadCallbackParams) => Promise<void>;
|
|
155
|
+
/** Override file validation. Return `null` for OK, string for error message. */
|
|
156
|
+
validate?: (file: File) => string | null;
|
|
157
|
+
/** Allowed MIME types (default JPEG/PNG/WebP). */
|
|
158
|
+
allowedTypes?: string[];
|
|
159
|
+
/** Max file size in bytes (default 5 MiB). */
|
|
160
|
+
maxSize?: number;
|
|
161
|
+
/** Crop aspect ratio (default 1, square). */
|
|
162
|
+
aspect?: number;
|
|
163
|
+
/** Crop shape — "round" (default, fits avatar) or "rect". */
|
|
164
|
+
cropShape?: "round" | "rect";
|
|
165
|
+
/** Localised button + error strings. */
|
|
166
|
+
labels?: Partial<AvatarUploaderLabels>;
|
|
167
|
+
/** Map a thrown error to a user-friendly message. */
|
|
168
|
+
errorMapper?: (err: unknown) => string;
|
|
169
|
+
/** Hook fired on success after `onUpload` resolves. */
|
|
170
|
+
onSuccess?: () => void;
|
|
171
|
+
/** Hook fired when user picks cancel. */
|
|
172
|
+
onCancel?: () => void;
|
|
173
|
+
/** Render a custom "choose image" trigger instead of the default Button. */
|
|
174
|
+
trigger?: ReactNode;
|
|
175
|
+
}
|
|
176
|
+
declare function AvatarUploader({ onUpload, validate, allowedTypes, maxSize, aspect, cropShape, labels: labelOverrides, errorMapper, onSuccess, onCancel, trigger, }: AvatarUploaderProps): react_jsx_runtime.JSX.Element;
|
|
177
|
+
|
|
178
|
+
interface MediaItem {
|
|
179
|
+
id: string;
|
|
180
|
+
filename: string;
|
|
181
|
+
contentType: string;
|
|
182
|
+
/** Signed view URL — fetchable directly as an <img src>. */
|
|
183
|
+
url: string;
|
|
184
|
+
thumbnailUrl?: string;
|
|
185
|
+
width?: number;
|
|
186
|
+
height?: number;
|
|
187
|
+
/** Size in bytes. */
|
|
188
|
+
size?: number;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
type MediaUploadSize = "small" | "default" | "large";
|
|
192
|
+
type MediaUploadShape = "square" | "circle" | "card";
|
|
193
|
+
interface MediaUploadSingleProps {
|
|
194
|
+
/** Controlled — UUID OR full MediaItem; component fetches metadata if only id given. */
|
|
195
|
+
value?: string | MediaItem | null;
|
|
196
|
+
defaultValue?: string | MediaItem | null;
|
|
197
|
+
onValueChange?: (value: MediaItem | null) => void;
|
|
198
|
+
accept?: string;
|
|
199
|
+
/** Max file size in bytes. */
|
|
200
|
+
maxSize?: number;
|
|
201
|
+
disabled?: boolean;
|
|
202
|
+
/** Preview shape — square / circle / card. */
|
|
203
|
+
shape?: MediaUploadShape;
|
|
204
|
+
size?: MediaUploadSize;
|
|
205
|
+
className?: string;
|
|
206
|
+
}
|
|
207
|
+
declare function MediaUploadSingle({ value, defaultValue, onValueChange, accept, maxSize, disabled, shape, size, className, }: MediaUploadSingleProps): react_jsx_runtime.JSX.Element;
|
|
208
|
+
interface MediaUploadMultipleProps {
|
|
209
|
+
value?: Array<string | MediaItem>;
|
|
210
|
+
defaultValue?: Array<string | MediaItem>;
|
|
211
|
+
onValueChange?: (value: MediaItem[]) => void;
|
|
212
|
+
accept?: string;
|
|
213
|
+
maxSize?: number;
|
|
214
|
+
maxCount?: number;
|
|
215
|
+
disabled?: boolean;
|
|
216
|
+
size?: MediaUploadSize;
|
|
217
|
+
className?: string;
|
|
218
|
+
}
|
|
219
|
+
declare function MediaUploadMultiple({ value, defaultValue, onValueChange, accept, maxSize, maxCount, disabled, size, className, }: MediaUploadMultipleProps): react_jsx_runtime.JSX.Element;
|
|
220
|
+
interface MediaUploadAvatarProps {
|
|
221
|
+
value?: string | MediaItem | null;
|
|
222
|
+
defaultValue?: string | MediaItem | null;
|
|
223
|
+
onValueChange?: (value: MediaItem | null) => void;
|
|
224
|
+
/** Crop aspect ratio (default 1 = square). */
|
|
225
|
+
aspect?: number;
|
|
226
|
+
size?: MediaUploadSize;
|
|
227
|
+
disabled?: boolean;
|
|
228
|
+
className?: string;
|
|
229
|
+
}
|
|
230
|
+
declare function MediaUploadAvatar({ value, defaultValue, onValueChange, aspect, size, disabled, className, }: MediaUploadAvatarProps): react_jsx_runtime.JSX.Element;
|
|
231
|
+
declare const MediaUpload: {
|
|
232
|
+
Single: typeof MediaUploadSingle;
|
|
233
|
+
Multiple: typeof MediaUploadMultiple;
|
|
234
|
+
Avatar: typeof MediaUploadAvatar;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* LocaleInput — multilingual text field with a tab strip switcher.
|
|
239
|
+
*
|
|
240
|
+
* One field stores a value per locale. The base locale (first in the
|
|
241
|
+
* `locales` list, or `defaultLocale` if provided) is the fallback —
|
|
242
|
+
* when a translation is missing the base value is used at render time.
|
|
243
|
+
* Translation status is surfaced per-tab via a coloured dot:
|
|
244
|
+
*
|
|
245
|
+
* - `filled` → success (green)
|
|
246
|
+
* - `draft` → warning (amber, e.g. stale relative to base)
|
|
247
|
+
* - `empty` → destructive (red, no translation yet)
|
|
248
|
+
*
|
|
249
|
+
* `statusByLocale` lets callers pass the dot state explicitly. If
|
|
250
|
+
* omitted, status is derived: empty string → `empty`, otherwise
|
|
251
|
+
* `filled`.
|
|
252
|
+
*
|
|
253
|
+
* @example
|
|
254
|
+
* <LocaleInput
|
|
255
|
+
* locales={["ja", "en", "vi"]}
|
|
256
|
+
* baseLocale="ja"
|
|
257
|
+
* values={{ ja: "特選 まぐろ握り 6貫盛り合わせ", en: "Tuna nigiri assortment (6 pcs)", vi: "" }}
|
|
258
|
+
* onChange={(locale, value) => set(locale, value)}
|
|
259
|
+
* placeholder="商品名"
|
|
260
|
+
* />
|
|
261
|
+
*
|
|
262
|
+
* The visual contract maps to the canonical `.loc-tabs` + `.loc-panel`
|
|
263
|
+
* classes from the dxs-kintai design system (no service-specific
|
|
264
|
+
* locale lists baked into the source).
|
|
265
|
+
*/
|
|
266
|
+
type LocaleStatus = "filled" | "draft" | "empty";
|
|
267
|
+
interface LocaleInputProps {
|
|
268
|
+
/** Ordered locale codes (BCP-47 or arbitrary string). First is base unless `baseLocale` is set. */
|
|
269
|
+
locales: string[];
|
|
270
|
+
/** Locale rendered initially. Defaults to the first locale. */
|
|
271
|
+
defaultLocale?: string;
|
|
272
|
+
/** Controlled active locale. Pair with `onLocaleChange`. */
|
|
273
|
+
activeLocale?: string;
|
|
274
|
+
/** Controlled active-locale change handler. */
|
|
275
|
+
onLocaleChange?: (locale: string) => void;
|
|
276
|
+
/** Fallback locale — labelled "(base)" in the tab. Defaults to `locales[0]`. */
|
|
277
|
+
baseLocale?: string;
|
|
278
|
+
/** Current values keyed by locale. */
|
|
279
|
+
values: Record<string, string>;
|
|
280
|
+
/** Fired when the user edits the value for the active locale. */
|
|
281
|
+
onChange?: (locale: string, value: string) => void;
|
|
282
|
+
/** Optional explicit status per locale dot. Derived from `values` when omitted. */
|
|
283
|
+
statusByLocale?: Record<string, LocaleStatus>;
|
|
284
|
+
/** Placeholder rendered in the input/textarea. */
|
|
285
|
+
placeholder?: string;
|
|
286
|
+
/** Render a `<textarea>` instead of `<input>`. */
|
|
287
|
+
multiline?: boolean;
|
|
288
|
+
/** Rows for the textarea (only when `multiline`). */
|
|
289
|
+
rows?: number;
|
|
290
|
+
/** Validation status applied to the visible input. */
|
|
291
|
+
status?: "default" | "error" | "warning";
|
|
292
|
+
/** Show a translation-progress meta string (e.g. "3 / 4 translated") in the tab strip. */
|
|
293
|
+
meta?: ReactNode;
|
|
294
|
+
/** Trailing tab-strip slot (e.g. an "+ Add locale" button). */
|
|
295
|
+
tabsExtra?: ReactNode;
|
|
296
|
+
/** Resolve a human label from a locale code; defaults to `locale.toUpperCase()`. */
|
|
297
|
+
resolveLocaleLabel?: (locale: string) => ReactNode;
|
|
298
|
+
/** Label shown next to the base locale tab. Defaults to "(base)". */
|
|
299
|
+
baseLabel?: ReactNode;
|
|
300
|
+
/** Max length for the input — surfaces a `.count` row when set. */
|
|
301
|
+
maxLength?: number;
|
|
302
|
+
/** Optional help text rendered under the active panel. */
|
|
303
|
+
help?: ReactNode;
|
|
304
|
+
/** Visual class for the help line (`info` | `warn` | `err` | `ok`). */
|
|
305
|
+
helpStatus?: "info" | "warn" | "err" | "ok";
|
|
306
|
+
/** Outer wrapper className. */
|
|
307
|
+
className?: string;
|
|
308
|
+
/** Outer wrapper style. */
|
|
309
|
+
style?: CSSProperties;
|
|
310
|
+
/** Input ID — useful when paired with a `<label htmlFor>`. */
|
|
311
|
+
id?: string;
|
|
312
|
+
}
|
|
313
|
+
declare const LocaleInput: react.ForwardRefExoticComponent<LocaleInputProps & react.RefAttributes<HTMLDivElement>>;
|
|
314
|
+
/**
|
|
315
|
+
* LocaleRowInput — per-row locale form (canonical pattern ②).
|
|
316
|
+
*
|
|
317
|
+
* Renders every locale stacked vertically, each row showing the locale
|
|
318
|
+
* code + a translation-status dot on the left and the input on the
|
|
319
|
+
* right. Useful when reviewers want to see every translation at once.
|
|
320
|
+
*/
|
|
321
|
+
interface LocaleRowInputProps extends Omit<LocaleInputProps, "activeLocale" | "onLocaleChange" | "defaultLocale" | "tabsExtra" | "meta"> {
|
|
322
|
+
/** Per-locale row className. */
|
|
323
|
+
rowClassName?: string;
|
|
324
|
+
}
|
|
325
|
+
declare const LocaleRowInput: react.ForwardRefExoticComponent<LocaleRowInputProps & react.RefAttributes<HTMLDivElement>>;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* CalendarSidebar — left rail for the calendar screen:
|
|
329
|
+
* 1. "Create event" pill CTA
|
|
330
|
+
* 2. Mini-month with prev/next nav
|
|
331
|
+
* 3. People search field
|
|
332
|
+
* 4. Three grouped calendar lists (mine / org / shared)
|
|
333
|
+
*
|
|
334
|
+
* Generic: takes a flat list of `CalendarRef` and groups by `c.group`.
|
|
335
|
+
* Labels are caller-supplied so the sidebar is locale-agnostic.
|
|
336
|
+
*/
|
|
337
|
+
interface CalendarSidebarLabels {
|
|
338
|
+
createEvent: string;
|
|
339
|
+
searchPeople: string;
|
|
340
|
+
/** Section labels keyed by `CalendarRef.group`. */
|
|
341
|
+
sections: Record<string, string>;
|
|
342
|
+
/** Mini-month title (e.g. "5月 2026"). */
|
|
343
|
+
monthLabel: string;
|
|
344
|
+
/** Footer CTA label (e.g. "Add another calendar"). */
|
|
345
|
+
addCalendar?: string;
|
|
346
|
+
}
|
|
347
|
+
interface CalendarSidebarProps {
|
|
348
|
+
today: MiniMonthYMD;
|
|
349
|
+
selected: MiniMonthYMD;
|
|
350
|
+
/** Year + month for the mini-month grid. */
|
|
351
|
+
miniMonthYear: number;
|
|
352
|
+
miniMonthMonth: number;
|
|
353
|
+
calendars: CalendarRef[];
|
|
354
|
+
eventDots?: Record<string, boolean>;
|
|
355
|
+
labels: CalendarSidebarLabels;
|
|
356
|
+
/** Order of group keys to render. */
|
|
357
|
+
groupOrder?: string[];
|
|
358
|
+
onSelectDate?: (ymd: MiniMonthYMD) => void;
|
|
359
|
+
onToggleCalendar?: (id: string) => void;
|
|
360
|
+
onCreate?: () => void;
|
|
361
|
+
onPrevMonth?: () => void;
|
|
362
|
+
onNextMonth?: () => void;
|
|
363
|
+
onAddCalendar?: () => void;
|
|
364
|
+
/** Optional dow labels passed straight through to MiniMonth. */
|
|
365
|
+
miniMonthDows?: MiniMonthYMD extends infer _ ? readonly [string, string, string, string, string, string, string] : never;
|
|
366
|
+
}
|
|
367
|
+
declare function CalendarSidebar({ today, selected, miniMonthYear, miniMonthMonth, calendars, eventDots, labels, groupOrder, onSelectDate, onToggleCalendar, onCreate, onPrevMonth, onNextMonth, onAddCalendar, miniMonthDows, }: CalendarSidebarProps): react_jsx_runtime.JSX.Element;
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* CalendarTopbar — top rail for the calendar screen:
|
|
371
|
+
* - product sticker + product name + tenant tag
|
|
372
|
+
* - Today button + prev/next nav
|
|
373
|
+
* - main title (date range / month / etc.)
|
|
374
|
+
* - search field (cmd-K)
|
|
375
|
+
* - bell + settings icon buttons
|
|
376
|
+
* - view-switcher segmented control
|
|
377
|
+
* - viewer avatar
|
|
378
|
+
*
|
|
379
|
+
* Generic — service identity strings are caller-supplied so the topbar
|
|
380
|
+
* stays product-agnostic.
|
|
381
|
+
*/
|
|
382
|
+
interface CalendarTopbarProps<V extends string = string> {
|
|
383
|
+
/** Sticker glyph (single character or short label). */
|
|
384
|
+
sticker: ReactNode;
|
|
385
|
+
productName: ReactNode;
|
|
386
|
+
/** Optional tenant chip (e.g. "Famgia"). */
|
|
387
|
+
tenant?: ReactNode;
|
|
388
|
+
titleMain: ReactNode;
|
|
389
|
+
titleSub?: ReactNode;
|
|
390
|
+
/** View-switcher options. */
|
|
391
|
+
views: SegmentedControlItem<V>[];
|
|
392
|
+
view: V;
|
|
393
|
+
onChangeView: (next: V) => void;
|
|
394
|
+
onToday?: () => void;
|
|
395
|
+
onPrev?: () => void;
|
|
396
|
+
onNext?: () => void;
|
|
397
|
+
todayLabel: string;
|
|
398
|
+
searchPlaceholder: string;
|
|
399
|
+
searchKbd?: string;
|
|
400
|
+
/** Viewer avatar — typically `<Avatar size={32}>` with initials. */
|
|
401
|
+
avatar?: ReactNode;
|
|
402
|
+
onSearchOpen?: () => void;
|
|
403
|
+
onNotificationsOpen?: () => void;
|
|
404
|
+
onSettingsOpen?: () => void;
|
|
405
|
+
}
|
|
406
|
+
declare function CalendarTopbar<V extends string = string>({ sticker, productName, tenant, titleMain, titleSub, views, view, onChangeView, onToday, onPrev, onNext, todayLabel, searchPlaceholder, searchKbd, avatar, onSearchOpen, onNotificationsOpen, onSettingsOpen, }: CalendarTopbarProps<V>): react_jsx_runtime.JSX.Element;
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* WeekView — 7-column scrolling time grid with all-day band on top.
|
|
410
|
+
* Computes the Mon-Sun window around `selected` automatically; takes a
|
|
411
|
+
* flat list of `CalendarEvent` and filters them by visibility (`shown`)
|
|
412
|
+
* of their owning calendar.
|
|
413
|
+
*
|
|
414
|
+
* Service-agnostic: the consumer maps `event.type` + `event.status` to
|
|
415
|
+
* the EventBlock visual variant via `resolveVariant`.
|
|
416
|
+
*/
|
|
417
|
+
interface WeekViewYMD {
|
|
418
|
+
y: number;
|
|
419
|
+
m: number;
|
|
420
|
+
d: number;
|
|
421
|
+
}
|
|
422
|
+
interface WeekViewProps {
|
|
423
|
+
today: WeekViewYMD;
|
|
424
|
+
selected: WeekViewYMD;
|
|
425
|
+
events: CalendarEvent[];
|
|
426
|
+
calendars: CalendarRef[];
|
|
427
|
+
locale?: TimeLocale;
|
|
428
|
+
/** Currently selected event id (paints the accent ring). */
|
|
429
|
+
selectedEventId?: string | null;
|
|
430
|
+
onPickEvent?: (event: CalendarEvent) => void;
|
|
431
|
+
/** Override day-of-week labels. Defaults per locale. */
|
|
432
|
+
dowLabels?: readonly [string, string, string, string, string, string, string];
|
|
433
|
+
/** Map an event → EventBlock variant. Defaults: customer→solid, focus→focus, tentative→tentative, else tint. */
|
|
434
|
+
resolveVariant?: (event: CalendarEvent) => EventBlockVariant;
|
|
435
|
+
/** All-day label (defaults: locale-specific). */
|
|
436
|
+
allDayLabel?: string;
|
|
437
|
+
/** Timezone label (top-left corner). */
|
|
438
|
+
tzLabel?: string;
|
|
439
|
+
/** Now-line override (mostly for storybook determinism). */
|
|
440
|
+
nowOverride?: Date;
|
|
441
|
+
}
|
|
442
|
+
declare function WeekView({ today, selected, events, calendars, locale, selectedEventId, onPickEvent, dowLabels, resolveVariant, allDayLabel, tzLabel, nowOverride, }: WeekViewProps): react_jsx_runtime.JSX.Element;
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* MonthView — 6×7 month grid (Mon-first). Each cell shows up to 4
|
|
446
|
+
* events (overflow indicator below). All-day events render as solid
|
|
447
|
+
* color bars (`AllDayChip` size=month); timed events render as one-line
|
|
448
|
+
* `EventPill`s.
|
|
449
|
+
*/
|
|
450
|
+
interface MonthViewYMD {
|
|
451
|
+
y: number;
|
|
452
|
+
m: number;
|
|
453
|
+
d: number;
|
|
454
|
+
}
|
|
455
|
+
interface MonthViewProps {
|
|
456
|
+
today: MonthViewYMD;
|
|
457
|
+
selected: MonthViewYMD;
|
|
458
|
+
events: CalendarEvent[];
|
|
459
|
+
calendars: CalendarRef[];
|
|
460
|
+
locale?: TimeLocale;
|
|
461
|
+
onPickEvent?: (event: CalendarEvent) => void;
|
|
462
|
+
/** Max events shown per cell before overflow row. Default 4. */
|
|
463
|
+
maxEventsPerCell?: number;
|
|
464
|
+
/** Override day-of-week labels. */
|
|
465
|
+
dowLabels?: readonly [string, string, string, string, string, string, string];
|
|
466
|
+
/** Localise the "+N more" suffix. */
|
|
467
|
+
formatOverflow?: (n: number) => string;
|
|
468
|
+
}
|
|
469
|
+
declare function MonthView({ today, selected, events, calendars, locale, onPickEvent, maxEventsPerCell, dowLabels, formatOverflow, }: MonthViewProps): react_jsx_runtime.JSX.Element;
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* DayView — single-column time grid with a hero header showing the
|
|
473
|
+
* date number + day-of-week + Today badge + event count. All-day
|
|
474
|
+
* events render as pill chips across a strip beneath the hero.
|
|
475
|
+
*/
|
|
476
|
+
interface DayViewYMD {
|
|
477
|
+
y: number;
|
|
478
|
+
m: number;
|
|
479
|
+
d: number;
|
|
480
|
+
}
|
|
481
|
+
interface DayViewProps {
|
|
482
|
+
today: DayViewYMD;
|
|
483
|
+
selected: DayViewYMD;
|
|
484
|
+
events: CalendarEvent[];
|
|
485
|
+
calendars: CalendarRef[];
|
|
486
|
+
locale?: TimeLocale;
|
|
487
|
+
selectedEventId?: string | null;
|
|
488
|
+
onPickEvent?: (event: CalendarEvent) => void;
|
|
489
|
+
resolveVariant?: (event: CalendarEvent) => EventBlockVariant;
|
|
490
|
+
/** Override dow labels. */
|
|
491
|
+
dowLabels?: readonly [string, string, string, string, string, string, string];
|
|
492
|
+
/** "Today" badge text. */
|
|
493
|
+
todayLabel?: string;
|
|
494
|
+
/** Localise "(count) events" — receives count. */
|
|
495
|
+
formatEventCount?: (count: number) => string;
|
|
496
|
+
nowOverride?: Date;
|
|
497
|
+
}
|
|
498
|
+
declare function DayView({ today, selected, events, calendars, locale, selectedEventId, onPickEvent, resolveVariant, dowLabels, todayLabel, formatEventCount, nowOverride, }: DayViewProps): react_jsx_runtime.JSX.Element;
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* DayHeaderHero — page-header strip rendered above `DayView`: large
|
|
502
|
+
* day number + day-of-week + month/year + optional Today badge + event
|
|
503
|
+
* count summary. Visually distinct from the `DayHeaderPill` atom (which
|
|
504
|
+
* sits inside a week's column header).
|
|
505
|
+
*/
|
|
506
|
+
interface DayHeaderHeroProps {
|
|
507
|
+
day: number;
|
|
508
|
+
dow: string;
|
|
509
|
+
monthLabel: string;
|
|
510
|
+
isToday?: boolean;
|
|
511
|
+
todayLabel?: string;
|
|
512
|
+
eventCount?: number;
|
|
513
|
+
formatEventCount?: (n: number) => string;
|
|
514
|
+
className?: string;
|
|
515
|
+
}
|
|
516
|
+
declare function DayHeaderHero({ day, dow, monthLabel, isToday, todayLabel, eventCount, formatEventCount, className, }: DayHeaderHeroProps): react_jsx_runtime.JSX.Element;
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* AgendaView — date-grouped list of events for the next N days. Each
|
|
520
|
+
* group renders a 92px date gutter (dow + day number + month + NOW
|
|
521
|
+
* pill) | rail of event rows (time, title, location, avatar stack).
|
|
522
|
+
*/
|
|
523
|
+
interface AgendaViewYMD {
|
|
524
|
+
y: number;
|
|
525
|
+
m: number;
|
|
526
|
+
d: number;
|
|
527
|
+
}
|
|
528
|
+
interface AgendaViewProps {
|
|
529
|
+
today: AgendaViewYMD;
|
|
530
|
+
selected: AgendaViewYMD;
|
|
531
|
+
events: CalendarEvent[];
|
|
532
|
+
calendars: CalendarRef[];
|
|
533
|
+
/** People directory used to resolve attendee IDs to AvatarStack items. */
|
|
534
|
+
people: PersonRef[];
|
|
535
|
+
locale?: TimeLocale;
|
|
536
|
+
/** Number of days to render starting from the week's Monday. Default 14. */
|
|
537
|
+
days?: number;
|
|
538
|
+
onPickEvent?: (event: CalendarEvent) => void;
|
|
539
|
+
/** Localised "All day" label override. */
|
|
540
|
+
allDayLabel?: string;
|
|
541
|
+
todayBadge?: string;
|
|
542
|
+
dowLabels?: readonly [string, string, string, string, string, string, string];
|
|
543
|
+
}
|
|
544
|
+
declare function AgendaView({ today, selected, events, calendars, people, locale, days, onPickEvent, allDayLabel, todayBadge, dowLabels, }: AgendaViewProps): react_jsx_runtime.JSX.Element;
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
* EventDetailPanel — 360px right-rail panel for an opened event.
|
|
548
|
+
* Header — color-dot + title + cal name + status + edit/delete/close
|
|
549
|
+
* Body — when / where / attendees / description / notifications rows
|
|
550
|
+
* Footer — RSVP 3-button row (Yes / Maybe / No)
|
|
551
|
+
*
|
|
552
|
+
* Generic: status labels + RSVP labels + "(you)" + section labels all
|
|
553
|
+
* caller-supplied so the panel stays locale-agnostic.
|
|
554
|
+
*/
|
|
555
|
+
interface EventDetailLabels {
|
|
556
|
+
joinMeeting?: string;
|
|
557
|
+
attendeesSummary: (count: number, accepted: number) => string;
|
|
558
|
+
addPerson: string;
|
|
559
|
+
rsvpQuestion: string;
|
|
560
|
+
rsvpYes: string;
|
|
561
|
+
rsvpMaybe: string;
|
|
562
|
+
rsvpNo: string;
|
|
563
|
+
selfLabel: string;
|
|
564
|
+
organizerLabel: string;
|
|
565
|
+
/** Date/time line for the When row, e.g. "Wed, May 20 · GMT+09". */
|
|
566
|
+
whenSubtitle: ReactNode;
|
|
567
|
+
/** "All day" / "Cả ngày" / "終日". */
|
|
568
|
+
allDay: string;
|
|
569
|
+
/** Status label per `event.status`. */
|
|
570
|
+
statusLabels: Record<string, string>;
|
|
571
|
+
}
|
|
572
|
+
interface EventDetailPanelProps {
|
|
573
|
+
event: CalendarEvent;
|
|
574
|
+
calendar?: CalendarRef;
|
|
575
|
+
people: PersonRef[];
|
|
576
|
+
labels: EventDetailLabels;
|
|
577
|
+
/** Description body content — JSX so callers can use markdown / lists. */
|
|
578
|
+
description?: ReactNode;
|
|
579
|
+
/** Notifications list. */
|
|
580
|
+
notifications?: ReactNode;
|
|
581
|
+
onClose?: () => void;
|
|
582
|
+
onEdit?: () => void;
|
|
583
|
+
onDelete?: () => void;
|
|
584
|
+
onRSVP?: (rsvp: "yes" | "maybe" | "no") => void;
|
|
585
|
+
}
|
|
586
|
+
declare function EventDetailPanel({ event, calendar, people, labels, description, notifications, onClose, onEdit, onDelete, onRSVP, }: EventDetailPanelProps): react_jsx_runtime.JSX.Element;
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* CreateEventDialog — 880×640 modal-shaped create form. Two-column
|
|
590
|
+
* layout: form on the left, options rail on the right (calendar
|
|
591
|
+
* picker, free/busy, notifications, guest permissions, helper card).
|
|
592
|
+
*
|
|
593
|
+
* Does NOT manage open/close — the consumer wraps the JSX in a Radix
|
|
594
|
+
* `Dialog` (or any portal). The visual shell + the form scaffolding is
|
|
595
|
+
* what this component owns.
|
|
596
|
+
*/
|
|
597
|
+
interface CreateEventTab {
|
|
598
|
+
id: string;
|
|
599
|
+
label: ReactNode;
|
|
600
|
+
}
|
|
601
|
+
interface CreateEventLabels {
|
|
602
|
+
/** Repeat-rule option list — caller-supplied so locale stays out of the SDK. */
|
|
603
|
+
repeatOptions: {
|
|
604
|
+
value: string;
|
|
605
|
+
label: string;
|
|
606
|
+
}[];
|
|
607
|
+
whenFromLabel: string;
|
|
608
|
+
whenToLabel: string;
|
|
609
|
+
allDay: string;
|
|
610
|
+
locationPlaceholder: string;
|
|
611
|
+
createMeet: string;
|
|
612
|
+
attendeesPlaceholder: string;
|
|
613
|
+
findATime: string;
|
|
614
|
+
attendeesSummary: ReactNode;
|
|
615
|
+
detailsButton: string;
|
|
616
|
+
cancel: string;
|
|
617
|
+
save: string;
|
|
618
|
+
/** Right-rail section labels. */
|
|
619
|
+
rail: {
|
|
620
|
+
saveTo: string;
|
|
621
|
+
showAs: string;
|
|
622
|
+
showAsBusy: string;
|
|
623
|
+
showAsFree: string;
|
|
624
|
+
notifications: string;
|
|
625
|
+
addNotification: string;
|
|
626
|
+
guestPermissions: string;
|
|
627
|
+
permissionEdit: string;
|
|
628
|
+
permissionInvite: string;
|
|
629
|
+
permissionGuestList: string;
|
|
630
|
+
helpTitle: string;
|
|
631
|
+
helpBody: (calendarName: string) => ReactNode;
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
interface CreateEventDialogProps {
|
|
635
|
+
/** Default form values. */
|
|
636
|
+
initialTitle?: string;
|
|
637
|
+
initialCalendarId: string;
|
|
638
|
+
/** Tab ids (e.g. event / task / focus / ooo). */
|
|
639
|
+
tabs: CreateEventTab[];
|
|
640
|
+
initialTab?: string;
|
|
641
|
+
/** Visible calendars to choose from (read-only ones filtered out). */
|
|
642
|
+
calendars: CalendarRef[];
|
|
643
|
+
/** Selected attendee list (chip array). */
|
|
644
|
+
attendees: PersonRef[];
|
|
645
|
+
/** When summary line (e.g. "Wed, May 20"). */
|
|
646
|
+
whenDate: ReactNode;
|
|
647
|
+
/** Start / end time strings. */
|
|
648
|
+
whenStart: string;
|
|
649
|
+
whenEnd: string;
|
|
650
|
+
labels: CreateEventLabels;
|
|
651
|
+
/** Notifications list — caller renders pills. */
|
|
652
|
+
notificationsList?: ReactNode;
|
|
653
|
+
/** Description default value. */
|
|
654
|
+
descriptionDefault?: string;
|
|
655
|
+
onRemoveAttendee?: (id: string) => void;
|
|
656
|
+
onChangeCalendar?: (id: string) => void;
|
|
657
|
+
onChangeTitle?: (next: string) => void;
|
|
658
|
+
onCancel?: () => void;
|
|
659
|
+
onSave?: () => void;
|
|
660
|
+
}
|
|
661
|
+
declare function CreateEventDialog({ initialTitle, initialCalendarId, tabs, initialTab, calendars, attendees, whenDate, whenStart, whenEnd, labels, notificationsList, descriptionDefault, onRemoveAttendee, onChangeCalendar, onChangeTitle, onCancel, onSave, }: CreateEventDialogProps): react_jsx_runtime.JSX.Element;
|
|
662
|
+
|
|
663
|
+
/**
|
|
664
|
+
* FindATimePanel — 1100×720 scheduling assistant. People rows on the
|
|
665
|
+
* left, time grid on the right with busy / tentative / free shading;
|
|
666
|
+
* "chosen-time" overlay tracks `selectedRange`. Footer: suggested-slot
|
|
667
|
+
* cards. Legend at the bottom.
|
|
668
|
+
*
|
|
669
|
+
* Generic: caller supplies the people directory + their per-slot
|
|
670
|
+
* availability arrays. Labels are caller-supplied for locale fit.
|
|
671
|
+
*/
|
|
672
|
+
interface FindATimeLabels {
|
|
673
|
+
title: string;
|
|
674
|
+
subtitle: ReactNode;
|
|
675
|
+
peopleCol: string;
|
|
676
|
+
peopleCount: (n: number) => string;
|
|
677
|
+
durationLabel: string;
|
|
678
|
+
expandHours: string;
|
|
679
|
+
apply: string;
|
|
680
|
+
/** "Suggestions — slots all attendees free". */
|
|
681
|
+
suggestionsLabel: string;
|
|
682
|
+
/** Legend texts. */
|
|
683
|
+
legendBusy: string;
|
|
684
|
+
legendTentative: string;
|
|
685
|
+
legendFree: string;
|
|
686
|
+
workingHours: string;
|
|
687
|
+
}
|
|
688
|
+
interface FindATimeSlotSuggestion {
|
|
689
|
+
id: string;
|
|
690
|
+
label: ReactNode;
|
|
691
|
+
meta: ReactNode;
|
|
692
|
+
best?: boolean;
|
|
693
|
+
/** Optional click → set selectedRange to this slot. */
|
|
694
|
+
range?: [number, number];
|
|
695
|
+
}
|
|
696
|
+
interface FindATimePanelProps {
|
|
697
|
+
people: PersonRef[];
|
|
698
|
+
/** Per-person availability: 0 = free, 1 = tentative, 2 = busy. */
|
|
699
|
+
availability: Record<string, ReadonlyArray<0 | 1 | 2>>;
|
|
700
|
+
/** Working-hour range (e.g. 9..18) — header label only; slot count comes from availability arrays. */
|
|
701
|
+
hours: number[];
|
|
702
|
+
selectedRange: [number, number] | null;
|
|
703
|
+
onChangeRange?: (range: [number, number] | null) => void;
|
|
704
|
+
suggestions: FindATimeSlotSuggestion[];
|
|
705
|
+
labels: FindATimeLabels;
|
|
706
|
+
onPrev?: () => void;
|
|
707
|
+
onNext?: () => void;
|
|
708
|
+
selfLabel?: string;
|
|
709
|
+
}
|
|
710
|
+
declare function FindATimePanel({ people, availability, hours, selectedRange, onChangeRange, suggestions, labels, onPrev, onNext, selfLabel, }: FindATimePanelProps): react_jsx_runtime.JSX.Element;
|
|
711
|
+
|
|
712
|
+
type TableImportStep = "file" | "mapping" | "validate" | "apply";
|
|
713
|
+
interface TableImportStepperLabels {
|
|
714
|
+
file?: ReactNode;
|
|
715
|
+
mapping?: ReactNode;
|
|
716
|
+
validate?: ReactNode;
|
|
717
|
+
apply?: ReactNode;
|
|
718
|
+
}
|
|
719
|
+
interface TableImportFileInfo {
|
|
720
|
+
/** Detected file name (display only). */
|
|
721
|
+
name: string;
|
|
722
|
+
/** Row count summary, e.g. `1,284 行`. */
|
|
723
|
+
rowSummary?: ReactNode;
|
|
724
|
+
/** Byte size summary, e.g. `132 KB`. */
|
|
725
|
+
sizeSummary?: ReactNode;
|
|
726
|
+
/** Detected encoding label (canon shows `SHIFT-JIS 検出`). */
|
|
727
|
+
encodingLabel?: ReactNode;
|
|
728
|
+
/** 0–1 progress fraction during validation. */
|
|
729
|
+
progress?: number;
|
|
730
|
+
/** Free-form left / right meta beneath the progress bar. */
|
|
731
|
+
progressLeftLabel?: ReactNode;
|
|
732
|
+
progressRightLabel?: ReactNode;
|
|
733
|
+
/** Whether to show the success file icon (vs the error one). */
|
|
734
|
+
status?: "ok" | "error";
|
|
735
|
+
}
|
|
736
|
+
interface TableImportErrorRow {
|
|
737
|
+
line: ReactNode;
|
|
738
|
+
message: ReactNode;
|
|
739
|
+
value: ReactNode;
|
|
740
|
+
severity?: "error" | "warning";
|
|
741
|
+
}
|
|
742
|
+
interface TableImportFlowProps {
|
|
743
|
+
title?: ReactNode;
|
|
744
|
+
/** Currently active step (one of the 4). */
|
|
745
|
+
currentStep: TableImportStep;
|
|
746
|
+
stepLabels?: TableImportStepperLabels;
|
|
747
|
+
file?: TableImportFileInfo;
|
|
748
|
+
errors?: TableImportErrorRow[];
|
|
749
|
+
/** Renders the actions row at the bottom of the card. */
|
|
750
|
+
actions?: ReactNode;
|
|
751
|
+
className?: string;
|
|
752
|
+
}
|
|
753
|
+
declare function TableImportFlow({ title, currentStep, stepLabels, file, errors, actions, className, }: TableImportFlowProps): react_jsx_runtime.JSX.Element;
|
|
754
|
+
type TableExportFormat = "csv-utf8" | "csv-shift-jis" | "xlsx" | "pdf";
|
|
755
|
+
type TableExportRange = "current-filter" | "selected" | "all";
|
|
756
|
+
interface TableExportDialogProps {
|
|
757
|
+
open: boolean;
|
|
758
|
+
onOpenChange: (open: boolean) => void;
|
|
759
|
+
title?: ReactNode;
|
|
760
|
+
/** Selected output format. */
|
|
761
|
+
format: TableExportFormat;
|
|
762
|
+
onFormatChange: (format: TableExportFormat) => void;
|
|
763
|
+
/** Selected scope. */
|
|
764
|
+
range: TableExportRange;
|
|
765
|
+
onRangeChange: (range: TableExportRange) => void;
|
|
766
|
+
/** Whether to include hidden columns. */
|
|
767
|
+
includeHiddenColumns: boolean;
|
|
768
|
+
onIncludeHiddenColumnsChange: (next: boolean) => void;
|
|
769
|
+
/** Counts shown next to the range options. */
|
|
770
|
+
rangeCounts?: {
|
|
771
|
+
currentFilter?: number;
|
|
772
|
+
selected?: number;
|
|
773
|
+
all?: number;
|
|
774
|
+
};
|
|
775
|
+
/** Counts shown next to the columns options. */
|
|
776
|
+
columnCounts?: {
|
|
777
|
+
visible?: number;
|
|
778
|
+
total?: number;
|
|
779
|
+
};
|
|
780
|
+
/** Save callback. */
|
|
781
|
+
onExport: () => void;
|
|
782
|
+
/** Cancel callback. */
|
|
783
|
+
onCancel?: () => void;
|
|
784
|
+
exportLabel?: ReactNode;
|
|
785
|
+
cancelLabel?: ReactNode;
|
|
786
|
+
/** Optional copy overrides. */
|
|
787
|
+
labels?: {
|
|
788
|
+
format?: ReactNode;
|
|
789
|
+
range?: ReactNode;
|
|
790
|
+
columns?: ReactNode;
|
|
791
|
+
csvUtf8?: ReactNode;
|
|
792
|
+
csvShiftJis?: ReactNode;
|
|
793
|
+
xlsx?: ReactNode;
|
|
794
|
+
pdf?: ReactNode;
|
|
795
|
+
currentFilter?: (count?: number) => ReactNode;
|
|
796
|
+
selected?: (count?: number) => ReactNode;
|
|
797
|
+
all?: (count?: number) => ReactNode;
|
|
798
|
+
visibleOnly?: (count?: number) => ReactNode;
|
|
799
|
+
includeHidden?: (count?: number) => ReactNode;
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
declare function TableExportDialog({ open, onOpenChange, title, format, onFormatChange, range, onRangeChange, includeHiddenColumns, onIncludeHiddenColumnsChange, rangeCounts, columnCounts, onExport, onCancel, exportLabel, cancelLabel, labels, }: TableExportDialogProps): react_jsx_runtime.JSX.Element;
|
|
803
|
+
|
|
804
|
+
interface UseDataTableOptions<TData> {
|
|
805
|
+
data: TData[];
|
|
806
|
+
columns: TableColumn<TData, unknown>[];
|
|
807
|
+
rowKey?: TableRowKey<TData>;
|
|
808
|
+
getRowId?: (row: TData, index: number) => string;
|
|
809
|
+
selection?: UseTableSelectionResult;
|
|
810
|
+
batchActions?: ReactNode | TableBatchActionsConfig<TData> | {
|
|
811
|
+
actions: TableBatchActionsConfig<TData>["actions"];
|
|
812
|
+
getCheckboxDisabled?: TableBatchActionsConfig<TData>["getCheckboxDisabled"];
|
|
813
|
+
selectedLabel?: TableBatchActionsConfig<TData>["selectedLabel"];
|
|
814
|
+
selectAllLabel?: TableBatchActionsConfig<TData>["selectAllLabel"];
|
|
815
|
+
clearLabel?: TableBatchActionsConfig<TData>["clearLabel"];
|
|
816
|
+
};
|
|
817
|
+
pagination?: UseTablePaginationResult;
|
|
818
|
+
total?: number;
|
|
819
|
+
pageSizeOptions?: number[];
|
|
820
|
+
showSizeChanger?: boolean;
|
|
821
|
+
showTotal?: (total: number, range: [number, number]) => ReactNode;
|
|
822
|
+
/** Direct pagination config — bypasses the `UseTablePaginationResult` slice. */
|
|
823
|
+
paginationConfig?: TablePagination;
|
|
824
|
+
views?: UseTableViewsResult;
|
|
825
|
+
onViewApply?: (view: TableViewItem) => void;
|
|
826
|
+
filters?: TableFilter[];
|
|
827
|
+
onFiltersChange?: (filters: TableFilter[]) => void;
|
|
828
|
+
filterBar?: TableFilterBar;
|
|
829
|
+
onResetFilters?: () => void;
|
|
830
|
+
sort?: TableSortState;
|
|
831
|
+
onSortChange?: (sort: TableSortState) => void;
|
|
832
|
+
resizable?: boolean;
|
|
833
|
+
columnVisibility?: TableColumnVisibility;
|
|
834
|
+
defaultColumnVisibility?: TableColumnVisibility;
|
|
835
|
+
onColumnVisibilityChange?: (columnVisibility: TableColumnVisibility) => void;
|
|
836
|
+
onColumnPinningChange?: TableColumnPinningChange;
|
|
837
|
+
toolbar?: TableToolbar;
|
|
838
|
+
expandable?: TableExpandableConfig<TData>;
|
|
839
|
+
tree?: TableTreeConfig<TData>;
|
|
840
|
+
editing?: TableEditingConfig<TData>;
|
|
841
|
+
groupBy?: TableGroupBy<TData>;
|
|
842
|
+
density?: TableDensity;
|
|
843
|
+
stickyHeader?: boolean;
|
|
844
|
+
rowClassName?: string | ((row: {
|
|
845
|
+
original: TData;
|
|
846
|
+
}) => string | undefined);
|
|
847
|
+
caption?: ReactNode;
|
|
848
|
+
footer?: ReactNode;
|
|
849
|
+
empty?: ReactNode;
|
|
850
|
+
tableKey?: string;
|
|
851
|
+
containerClassName?: string;
|
|
852
|
+
className?: string;
|
|
853
|
+
}
|
|
854
|
+
interface DataTableInstance<TData> {
|
|
855
|
+
/** Resolved props ready to spread on `<Table>` — already strips chrome. */
|
|
856
|
+
tableProps: {
|
|
857
|
+
columns: TableColumn<TData, unknown>[];
|
|
858
|
+
data: TData[];
|
|
859
|
+
rowKey?: TableRowKey<TData>;
|
|
860
|
+
getRowId?: (row: TData, index: number) => string;
|
|
861
|
+
density?: TableDensity;
|
|
862
|
+
stickyHeader?: boolean;
|
|
863
|
+
resizable?: boolean;
|
|
864
|
+
caption?: ReactNode;
|
|
865
|
+
footer?: ReactNode;
|
|
866
|
+
empty?: ReactNode;
|
|
867
|
+
containerClassName?: string;
|
|
868
|
+
className?: string;
|
|
869
|
+
rowClassName?: string | ((row: {
|
|
870
|
+
original: TData;
|
|
871
|
+
}) => string | undefined);
|
|
872
|
+
sort?: TableSortState;
|
|
873
|
+
onSortChange?: (sort: TableSortState) => void;
|
|
874
|
+
expandable?: TableExpandableConfig<TData>;
|
|
875
|
+
tree?: TableTreeConfig<TData>;
|
|
876
|
+
editing?: TableEditingConfig<TData>;
|
|
877
|
+
groupBy?: TableGroupBy<TData>;
|
|
878
|
+
};
|
|
879
|
+
/** TanStack instance built by the hook (Stage 4b — hoisted from the primitive). */
|
|
880
|
+
instance: Table<TData>;
|
|
881
|
+
/** Chrome config — consumed by `<DataTable>`'s renderers, not by the primitive. */
|
|
882
|
+
chromeProps: {
|
|
883
|
+
views: TableViews | undefined;
|
|
884
|
+
toolbar: TableToolbar | undefined;
|
|
885
|
+
batchActions: ReactNode | TableBatchActionsConfig<TData> | undefined;
|
|
886
|
+
filterBar: TableFilterBar | undefined;
|
|
887
|
+
filters: TableFilter[] | undefined;
|
|
888
|
+
onFiltersChange: ((filters: TableFilter[]) => void) | undefined;
|
|
889
|
+
onResetFilters: (() => void) | undefined;
|
|
890
|
+
pagination: TablePagination | undefined;
|
|
891
|
+
columnVisibility: TableColumnVisibility;
|
|
892
|
+
columnPinning: ColumnPinningState;
|
|
893
|
+
autoColumnPinning: ColumnPinningState;
|
|
894
|
+
setColumnPinning: (pinning: ColumnPinningState) => void;
|
|
895
|
+
setColumnVisibility: (visibility: TableColumnVisibility) => void;
|
|
896
|
+
currentViewSnapshot: TableViewSnapshot;
|
|
897
|
+
duplicateView: TableViewItem | undefined;
|
|
898
|
+
savedViews: TableViewItem[];
|
|
899
|
+
setSavedViews: (views: TableViewItem[]) => void;
|
|
900
|
+
saveViewDefaultName: (count: number) => string;
|
|
901
|
+
};
|
|
902
|
+
/** Slice references (so consumer hooks remain visible). */
|
|
903
|
+
selection: UseTableSelectionResult | undefined;
|
|
904
|
+
pagination: UseTablePaginationResult | undefined;
|
|
905
|
+
views: UseTableViewsResult | undefined;
|
|
906
|
+
}
|
|
907
|
+
/**
|
|
908
|
+
* useDataTable — composite-level state + TanStack instance builder.
|
|
909
|
+
*
|
|
910
|
+
* Stage 4b of the Table refactor (Plan §3). The TanStack instance and
|
|
911
|
+
* the chrome-related state (column visibility, column pinning, saved
|
|
912
|
+
* views) live here on the composite side; `<DataTable>` renders the
|
|
913
|
+
* chrome around the slim `<Table>` primitive.
|
|
914
|
+
*/
|
|
915
|
+
declare function useDataTable<TData>(options: UseDataTableOptions<TData>): DataTableInstance<TData>;
|
|
916
|
+
|
|
917
|
+
/**
|
|
918
|
+
* Composite-only `ColumnMeta` extension. The `<Table>` primitive
|
|
919
|
+
* does not render filter UI or the column manager — these fields
|
|
920
|
+
* are consumed exclusively by `<DataTable>`'s chrome
|
|
921
|
+
* (`DataTableChrome` filter chip bar + `ColumnManagerSheet`).
|
|
922
|
+
*
|
|
923
|
+
* Augmentation merges with the primitive declaration in
|
|
924
|
+
* `data-display/Table.types.ts` whenever this module is in the
|
|
925
|
+
* TypeScript program (i.e. as soon as a consumer imports anything
|
|
926
|
+
* from `@godxjp/ui/components/composites`).
|
|
927
|
+
*/
|
|
928
|
+
declare module "@tanstack/react-table" {
|
|
929
|
+
interface ColumnMeta<TData extends RowData, TValue> {
|
|
930
|
+
filterable?: boolean;
|
|
931
|
+
filterLabel?: ReactNode;
|
|
932
|
+
filterOptions?: TableFilterOption[];
|
|
933
|
+
hideable?: boolean;
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
/** Replaceable regions of the composite's rendered tree. */
|
|
937
|
+
interface DataTableSlots {
|
|
938
|
+
/** Override the toolbar entirely — replaces the default rendering. */
|
|
939
|
+
toolbar?: ReactNode;
|
|
940
|
+
/** Toolbar primary action (+ 新規 / Create new). */
|
|
941
|
+
primaryAction?: TableToolbarConfig["primaryAction"];
|
|
942
|
+
/** Extra toolbar nodes appended after `primaryAction` / columns button. */
|
|
943
|
+
toolbarActions?: TableToolbarConfig["actions"];
|
|
944
|
+
/** Footer content rendered below the body (above pagination). */
|
|
945
|
+
footer?: ReactNode;
|
|
946
|
+
/** Empty-state override — replaces the default `<Empty>` primitive. */
|
|
947
|
+
emptyState?: ReactNode;
|
|
948
|
+
}
|
|
949
|
+
/** Composite `<DataTable>` prop surface. */
|
|
950
|
+
interface DataTableProps<TData> {
|
|
951
|
+
/** Table instance from `useDataTable`. */
|
|
952
|
+
table: DataTableInstance<TData>;
|
|
953
|
+
/** Replaceable regions of the rendered tree. */
|
|
954
|
+
slots?: DataTableSlots;
|
|
955
|
+
/** Forwarded to the outer `<table>` className. */
|
|
956
|
+
className?: string;
|
|
957
|
+
/** Forwarded to the `.table-stack` wrapper className. */
|
|
958
|
+
containerClassName?: string;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
declare function DataTable<TData>({ table, slots, className, containerClassName, }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
962
|
+
|
|
963
|
+
export { AgendaView, type AgendaViewProps, type AgendaViewYMD, type AvatarUploadCallbackParams, AvatarUploader, type AvatarUploaderLabels, type AvatarUploaderProps, CalendarSidebar, type CalendarSidebarLabels, type CalendarSidebarProps, CalendarTopbar, type CalendarTopbarProps, CreateEventDialog, type CreateEventDialogProps, type CreateEventLabels, type CreateEventTab, DataTable, type DataTableInstance, type DataTableProps, type DataTableSlots, DayHeaderHero, type DayHeaderHeroProps, DayView, type DayViewProps, type DayViewYMD, type EventDetailLabels, EventDetailPanel, type EventDetailPanelProps, type FindATimeLabels, FindATimePanel, type FindATimePanelProps, type FindATimeSlotSuggestion, ImageUpload, type ImageUploadProps, LocaleInput, type LocaleInputProps, LocaleRowInput, type LocaleRowInputProps, type LocaleStatus, MediaUpload, MediaUploadAvatar, type MediaUploadAvatarProps, MediaUploadMultiple, type MediaUploadMultipleProps, type MediaUploadShape, MediaUploadSingle, type MediaUploadSingleProps, type MediaUploadSize, MonthView, type MonthViewProps, type MonthViewYMD, TableExportDialog, type TableExportDialogProps, type TableExportFormat, type TableExportRange, type TableImportErrorRow, type TableImportFileInfo, TableImportFlow, type TableImportFlowProps, type TableImportStep, type TableImportStepperLabels, Upload, type UploadCustomRequest, type UploadFile, type UploadLabels, type UploadListType, type UploadProps, type UploadRequestParams, type UploadStatus, type UseDataTableOptions, WeekView, type WeekViewProps, type WeekViewYMD, useDataTable };
|