@officesdk/design 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/cjs/index.d.ts +1871 -0
- package/dist/components/cjs/index.js +5175 -0
- package/dist/components/cjs/index.js.map +1 -0
- package/dist/components/esm/index.d.ts +1871 -0
- package/dist/components/esm/index.js +5140 -0
- package/dist/components/esm/index.js.map +1 -0
- package/dist/icons/cjs/index.js.map +1 -0
- package/dist/icons/{index.mjs → esm/index.js} +2 -2
- package/dist/icons/esm/index.js.map +1 -0
- package/dist/theme/cjs/index.d.ts +106 -0
- package/dist/theme/{index.js → cjs/index.js} +644 -288
- package/dist/theme/cjs/index.js.map +1 -0
- package/dist/theme/esm/index.d.ts +106 -0
- package/dist/theme/{index.mjs → esm/index.js} +646 -290
- package/dist/theme/esm/index.js.map +1 -0
- package/dist/utils/cjs/index.js.map +1 -0
- package/dist/utils/{index.mjs → esm/index.js} +2 -2
- package/dist/utils/esm/index.js.map +1 -0
- package/package.json +37 -27
- package/dist/components/index.d.mts +0 -996
- package/dist/components/index.d.ts +0 -996
- package/dist/components/index.js +0 -2485
- package/dist/components/index.js.map +0 -1
- package/dist/components/index.mjs +0 -2457
- package/dist/components/index.mjs.map +0 -1
- package/dist/icons/index.js.map +0 -1
- package/dist/icons/index.mjs.map +0 -1
- package/dist/index.d.mts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/index.mjs +0 -2
- package/dist/theme/index.d.mts +0 -9
- package/dist/theme/index.d.ts +0 -9
- package/dist/theme/index.js.map +0 -1
- package/dist/theme/index.mjs.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/index.mjs.map +0 -1
- /package/dist/icons/{index.d.ts → cjs/index.d.ts} +0 -0
- /package/dist/icons/{index.js → cjs/index.js} +0 -0
- /package/dist/icons/{index.d.mts → esm/index.d.ts} +0 -0
- /package/dist/utils/{index.d.ts → cjs/index.d.ts} +0 -0
- /package/dist/utils/{index.js → cjs/index.js} +0 -0
- /package/dist/utils/{index.d.mts → esm/index.d.mts} +0 -0
|
@@ -0,0 +1,1871 @@
|
|
|
1
|
+
import React$1 from 'react';
|
|
2
|
+
import { TooltipProps as TooltipProps$1 } from 'rc-tooltip/lib/Tooltip';
|
|
3
|
+
import { DropdownProps as DropdownProps$1 } from 'rc-dropdown';
|
|
4
|
+
import * as styled_components from 'styled-components';
|
|
5
|
+
import { ThemedStyledInterface } from 'styled-components';
|
|
6
|
+
import { DialogProps } from 'rc-dialog';
|
|
7
|
+
import { Theme } from '@officesdk/design/theme';
|
|
8
|
+
|
|
9
|
+
interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
10
|
+
/**
|
|
11
|
+
* Button variant type
|
|
12
|
+
* - 'icon': Square icon button without padding, size based on iconSize
|
|
13
|
+
*/
|
|
14
|
+
variant?: 'solid' | 'outlined' | 'text' | 'icon';
|
|
15
|
+
/**
|
|
16
|
+
* Button color type
|
|
17
|
+
* - 'status' is only available for 'text' variant
|
|
18
|
+
*/
|
|
19
|
+
colorType?: 'default' | 'guidance' | 'alert' | 'status';
|
|
20
|
+
/**
|
|
21
|
+
* Button size
|
|
22
|
+
*/
|
|
23
|
+
size?: 'small' | 'medium' | 'large' | 'extraLarge';
|
|
24
|
+
/**
|
|
25
|
+
* Whether the button is disabled
|
|
26
|
+
*/
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the button is in loading state
|
|
30
|
+
*/
|
|
31
|
+
loading?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the button should take full width of its container
|
|
34
|
+
*/
|
|
35
|
+
fullWidth?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Icon to display with the button text
|
|
38
|
+
* - If string: treated as icon src URL, rendered using Icon component
|
|
39
|
+
* - If ReactNode: rendered directly
|
|
40
|
+
*/
|
|
41
|
+
icon?: string | React$1.ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* Icon placement relative to text (only for text buttons)
|
|
44
|
+
*/
|
|
45
|
+
iconPlacement?: 'before' | 'after';
|
|
46
|
+
/**
|
|
47
|
+
* Whether the icon button should have a border (only for variant='icon')
|
|
48
|
+
*/
|
|
49
|
+
iconBordered?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Button Component
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // Basic button
|
|
56
|
+
* <Button>button</Button>
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // Button with icon (string URL)
|
|
60
|
+
* <Button icon="https://example.com/icon.svg" iconPlacement="before">button</Button>
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* // Button with icon (ReactNode)
|
|
64
|
+
* <Button icon={<CustomIcon />} iconPlacement="after">button</Button>
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Icon variant button (square, no padding)
|
|
68
|
+
* <Button variant="icon" icon={<CustomIcon />} iconBordered />
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* // Icon variant button without border
|
|
72
|
+
* <Button variant="icon" icon={<CustomIcon />} />
|
|
73
|
+
*/
|
|
74
|
+
declare const Button: React$1.FC<ButtonProps>;
|
|
75
|
+
|
|
76
|
+
interface SpinButtonProps {
|
|
77
|
+
/**
|
|
78
|
+
* Current value
|
|
79
|
+
*/
|
|
80
|
+
value?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Default value
|
|
83
|
+
*/
|
|
84
|
+
defaultValue?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Minimum value
|
|
87
|
+
*/
|
|
88
|
+
min?: number;
|
|
89
|
+
/**
|
|
90
|
+
* Maximum value
|
|
91
|
+
*/
|
|
92
|
+
max?: number;
|
|
93
|
+
/**
|
|
94
|
+
* Step increment/decrement
|
|
95
|
+
*/
|
|
96
|
+
step?: number;
|
|
97
|
+
/**
|
|
98
|
+
* Size variant
|
|
99
|
+
*/
|
|
100
|
+
size?: 'small' | 'large';
|
|
101
|
+
/**
|
|
102
|
+
* Whether the input is disabled
|
|
103
|
+
*/
|
|
104
|
+
disabled?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Whether to show alert state (red border)
|
|
107
|
+
*/
|
|
108
|
+
alert?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Whether to show the slider
|
|
111
|
+
*/
|
|
112
|
+
showSlider?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Number of decimal places
|
|
115
|
+
*/
|
|
116
|
+
precision?: number;
|
|
117
|
+
/**
|
|
118
|
+
* Format the display value
|
|
119
|
+
*/
|
|
120
|
+
formatter?: (value: number) => string;
|
|
121
|
+
/**
|
|
122
|
+
* Parse the input value
|
|
123
|
+
*/
|
|
124
|
+
parser?: (displayValue: string) => number;
|
|
125
|
+
/**
|
|
126
|
+
* Callback when value changes
|
|
127
|
+
*/
|
|
128
|
+
onChange?: (value: number | null) => void;
|
|
129
|
+
/**
|
|
130
|
+
* Custom className
|
|
131
|
+
*/
|
|
132
|
+
className?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Custom style
|
|
135
|
+
*/
|
|
136
|
+
style?: React$1.CSSProperties;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* SpinButton Component - Spin Button
|
|
140
|
+
*
|
|
141
|
+
* A numeric input with increment/decrement buttons
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* <SpinButton value={35} onChange={(val) => console.log(val)} />
|
|
145
|
+
*/
|
|
146
|
+
declare const SpinButton: React$1.FC<SpinButtonProps>;
|
|
147
|
+
|
|
148
|
+
interface SwitchProps {
|
|
149
|
+
/**
|
|
150
|
+
* Whether the switch is checked
|
|
151
|
+
*/
|
|
152
|
+
checked?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Default checked state
|
|
155
|
+
*/
|
|
156
|
+
defaultChecked?: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* Size variant
|
|
159
|
+
*/
|
|
160
|
+
size?: 'small' | 'medium' | 'large';
|
|
161
|
+
/**
|
|
162
|
+
* Whether the switch is disabled
|
|
163
|
+
*/
|
|
164
|
+
disabled?: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Callback when checked state changes
|
|
167
|
+
*/
|
|
168
|
+
onChange?: (checked: boolean) => void;
|
|
169
|
+
/**
|
|
170
|
+
* Custom className
|
|
171
|
+
*/
|
|
172
|
+
className?: string;
|
|
173
|
+
/**
|
|
174
|
+
* Custom style
|
|
175
|
+
*/
|
|
176
|
+
style?: React$1.CSSProperties;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Switch Component
|
|
180
|
+
*
|
|
181
|
+
* A toggle switch for binary states
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* <Switch checked={true} onChange={(checked) => console.log(checked)} />
|
|
185
|
+
*/
|
|
186
|
+
declare const Switch: React$1.FC<SwitchProps>;
|
|
187
|
+
|
|
188
|
+
interface RadioProps {
|
|
189
|
+
/**
|
|
190
|
+
* Whether the radio is checked
|
|
191
|
+
* @default false
|
|
192
|
+
*/
|
|
193
|
+
checked?: boolean;
|
|
194
|
+
/**
|
|
195
|
+
* Default checked state
|
|
196
|
+
* @default false
|
|
197
|
+
*/
|
|
198
|
+
defaultChecked?: boolean;
|
|
199
|
+
/**
|
|
200
|
+
* Whether the radio is disabled
|
|
201
|
+
*/
|
|
202
|
+
disabled?: boolean;
|
|
203
|
+
/**
|
|
204
|
+
* Value of the radio
|
|
205
|
+
*/
|
|
206
|
+
value?: string | number;
|
|
207
|
+
/**
|
|
208
|
+
* Name attribute for grouping radios
|
|
209
|
+
*/
|
|
210
|
+
name?: string;
|
|
211
|
+
/**
|
|
212
|
+
* ID attribute for the radio (used with htmlFor in labels)
|
|
213
|
+
*/
|
|
214
|
+
id?: string;
|
|
215
|
+
/**
|
|
216
|
+
* Callback when checked state changes
|
|
217
|
+
*/
|
|
218
|
+
onChange?: (event: React$1.ChangeEvent<HTMLInputElement>) => void;
|
|
219
|
+
/**
|
|
220
|
+
* prevent default click event, if true, change event will not be triggered
|
|
221
|
+
* @default false
|
|
222
|
+
*/
|
|
223
|
+
clickPreventDefault?: boolean;
|
|
224
|
+
/**
|
|
225
|
+
* Custom className
|
|
226
|
+
*/
|
|
227
|
+
className?: string;
|
|
228
|
+
/**
|
|
229
|
+
* Custom style
|
|
230
|
+
*/
|
|
231
|
+
style?: React$1.CSSProperties;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Radio Component
|
|
235
|
+
*
|
|
236
|
+
* A radio button for selecting one option from a group
|
|
237
|
+
*
|
|
238
|
+
* @example
|
|
239
|
+
* <Radio checked={true} onChange={(e) => console.log(e.target.checked)} />
|
|
240
|
+
*/
|
|
241
|
+
declare const Radio: React$1.FC<RadioProps>;
|
|
242
|
+
|
|
243
|
+
interface CheckboxProps {
|
|
244
|
+
/**
|
|
245
|
+
* Whether the checkbox is checked
|
|
246
|
+
*/
|
|
247
|
+
checked?: boolean;
|
|
248
|
+
/**
|
|
249
|
+
* Default checked state
|
|
250
|
+
*/
|
|
251
|
+
defaultChecked?: boolean;
|
|
252
|
+
/**
|
|
253
|
+
* Whether the checkbox is in indeterminate state
|
|
254
|
+
*/
|
|
255
|
+
indeterminate?: boolean;
|
|
256
|
+
/**
|
|
257
|
+
* Whether the checkbox is disabled
|
|
258
|
+
*/
|
|
259
|
+
disabled?: boolean;
|
|
260
|
+
/**
|
|
261
|
+
* Value of the checkbox
|
|
262
|
+
*/
|
|
263
|
+
value?: string | number;
|
|
264
|
+
/**
|
|
265
|
+
* Name attribute for the checkbox
|
|
266
|
+
*/
|
|
267
|
+
name?: string;
|
|
268
|
+
/**
|
|
269
|
+
* ID attribute for the checkbox (used with htmlFor in labels)
|
|
270
|
+
*/
|
|
271
|
+
id?: string;
|
|
272
|
+
/**
|
|
273
|
+
* Callback when checked state changes
|
|
274
|
+
*/
|
|
275
|
+
onChange?: (event: React$1.ChangeEvent<HTMLInputElement>) => void;
|
|
276
|
+
/**
|
|
277
|
+
* prevent default click event, if true, change event will not be triggered
|
|
278
|
+
* @default false
|
|
279
|
+
*/
|
|
280
|
+
clickPreventDefault?: boolean;
|
|
281
|
+
/**
|
|
282
|
+
* Custom className
|
|
283
|
+
*/
|
|
284
|
+
className?: string;
|
|
285
|
+
/**
|
|
286
|
+
* Custom style
|
|
287
|
+
*/
|
|
288
|
+
style?: React$1.CSSProperties;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Checkbox Component
|
|
292
|
+
*
|
|
293
|
+
* A checkbox for selecting multiple options
|
|
294
|
+
*
|
|
295
|
+
* @example
|
|
296
|
+
* <Checkbox checked={true} onChange={(e) => console.log(e.target.checked)} />
|
|
297
|
+
*
|
|
298
|
+
* @example
|
|
299
|
+
* // Indeterminate state
|
|
300
|
+
* <Checkbox indeterminate={true} />
|
|
301
|
+
*/
|
|
302
|
+
declare const Checkbox: React$1.FC<CheckboxProps>;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Value map utilities for piecewise linear mapping (non-linear slider)
|
|
306
|
+
*/
|
|
307
|
+
interface ValueMapPiece {
|
|
308
|
+
/** Size of the piece (value range) */
|
|
309
|
+
size: number;
|
|
310
|
+
/** Step increment, defaults to 1 */
|
|
311
|
+
step?: number;
|
|
312
|
+
/** Visual size (relative), defaults to size/step */
|
|
313
|
+
visualSize?: number;
|
|
314
|
+
}
|
|
315
|
+
interface ValueMap {
|
|
316
|
+
type: 'piecewise';
|
|
317
|
+
/** Starting value */
|
|
318
|
+
start: number;
|
|
319
|
+
/** Array of pieces defining the mapping */
|
|
320
|
+
pieces: ValueMapPiece[];
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
interface SliderProps {
|
|
324
|
+
/**
|
|
325
|
+
* Current value (0-100)
|
|
326
|
+
*/
|
|
327
|
+
value?: number;
|
|
328
|
+
/**
|
|
329
|
+
* Default value
|
|
330
|
+
*/
|
|
331
|
+
defaultValue?: number;
|
|
332
|
+
/**
|
|
333
|
+
* Minimum value
|
|
334
|
+
*/
|
|
335
|
+
min?: number;
|
|
336
|
+
/**
|
|
337
|
+
* Maximum value
|
|
338
|
+
*/
|
|
339
|
+
max?: number;
|
|
340
|
+
/**
|
|
341
|
+
* Step increment
|
|
342
|
+
*/
|
|
343
|
+
step?: number;
|
|
344
|
+
/**
|
|
345
|
+
* Whether the slider is disabled
|
|
346
|
+
*/
|
|
347
|
+
disabled?: boolean;
|
|
348
|
+
/**
|
|
349
|
+
* Slider direction
|
|
350
|
+
*/
|
|
351
|
+
direction?: 'horizontal' | 'vertical';
|
|
352
|
+
/**
|
|
353
|
+
* Value map for piecewise linear mapping (non-linear slider)
|
|
354
|
+
* When provided, min/max/step props are ignored
|
|
355
|
+
*/
|
|
356
|
+
valueMap?: ValueMap;
|
|
357
|
+
/**
|
|
358
|
+
* Callback when value changes
|
|
359
|
+
*/
|
|
360
|
+
onChange?: (value: number) => void;
|
|
361
|
+
/**
|
|
362
|
+
* Callback when dragging starts
|
|
363
|
+
*/
|
|
364
|
+
onDragStart?: () => void;
|
|
365
|
+
/**
|
|
366
|
+
* Callback when dragging ends
|
|
367
|
+
*/
|
|
368
|
+
onDragEnd?: () => void;
|
|
369
|
+
/**
|
|
370
|
+
* Custom className
|
|
371
|
+
*/
|
|
372
|
+
className?: string;
|
|
373
|
+
/**
|
|
374
|
+
* Custom style
|
|
375
|
+
*/
|
|
376
|
+
style?: React$1.CSSProperties;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Slider Component
|
|
380
|
+
*
|
|
381
|
+
* A slider for selecting a value from a range
|
|
382
|
+
*
|
|
383
|
+
* @example
|
|
384
|
+
* <Slider value={35} onChange={(val) => console.log(val)} />
|
|
385
|
+
*/
|
|
386
|
+
declare const Slider: React$1.FC<SliderProps>;
|
|
387
|
+
|
|
388
|
+
type InputSize = 'mini' | 'small' | 'medium' | 'large';
|
|
389
|
+
type LineType = 'outlined' | 'underlined' | 'borderless';
|
|
390
|
+
interface InputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'> {
|
|
391
|
+
/**
|
|
392
|
+
* Input line type
|
|
393
|
+
*/
|
|
394
|
+
lineType?: LineType;
|
|
395
|
+
/**
|
|
396
|
+
* Input size
|
|
397
|
+
*/
|
|
398
|
+
size?: InputSize;
|
|
399
|
+
/**
|
|
400
|
+
* Whether the input has an error state
|
|
401
|
+
*/
|
|
402
|
+
error?: boolean;
|
|
403
|
+
/**
|
|
404
|
+
* Whether the input is in readonly mode
|
|
405
|
+
*/
|
|
406
|
+
readOnly?: boolean;
|
|
407
|
+
/**
|
|
408
|
+
* Node to display before the input
|
|
409
|
+
*/
|
|
410
|
+
prefixNode?: React$1.ReactNode;
|
|
411
|
+
/**
|
|
412
|
+
* Node to display after the input
|
|
413
|
+
*/
|
|
414
|
+
suffixNode?: React$1.ReactNode;
|
|
415
|
+
/**
|
|
416
|
+
* Whether to show clear button when input has value
|
|
417
|
+
*/
|
|
418
|
+
clearable?: boolean;
|
|
419
|
+
/**
|
|
420
|
+
* Clear button click handler
|
|
421
|
+
*/
|
|
422
|
+
onClear?: () => void;
|
|
423
|
+
/**
|
|
424
|
+
* Custom clear icon
|
|
425
|
+
*/
|
|
426
|
+
clearIcon?: React$1.ReactNode;
|
|
427
|
+
/**
|
|
428
|
+
* Custom className
|
|
429
|
+
*/
|
|
430
|
+
className?: string;
|
|
431
|
+
/**
|
|
432
|
+
* Custom inline styles
|
|
433
|
+
*/
|
|
434
|
+
style?: React$1.CSSProperties;
|
|
435
|
+
/**
|
|
436
|
+
* Custom input className
|
|
437
|
+
*/
|
|
438
|
+
inputClassName?: string;
|
|
439
|
+
/**
|
|
440
|
+
* Custom input styles
|
|
441
|
+
*/
|
|
442
|
+
inputStyle?: React$1.CSSProperties;
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Input Component
|
|
446
|
+
*
|
|
447
|
+
* @example
|
|
448
|
+
* // Basic outlined input (default)
|
|
449
|
+
* <Input placeholder="Enter text" />
|
|
450
|
+
*
|
|
451
|
+
* @example
|
|
452
|
+
* // Underlined input
|
|
453
|
+
* <Input lineType="underlined" placeholder="Enter text" />
|
|
454
|
+
*
|
|
455
|
+
* @example
|
|
456
|
+
* // Input with prefix and suffix
|
|
457
|
+
* <Input prefixNode={<SearchIcon />} suffixNode={<Icon />} />
|
|
458
|
+
*
|
|
459
|
+
* @example
|
|
460
|
+
* // Input with clearable
|
|
461
|
+
* <Input clearable onClear={() => console.log('cleared')} />
|
|
462
|
+
*
|
|
463
|
+
* @example
|
|
464
|
+
* // Input with error state
|
|
465
|
+
* <Input error placeholder="Enter text" />
|
|
466
|
+
*/
|
|
467
|
+
declare const Input: React$1.ForwardRefExoticComponent<InputProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
468
|
+
|
|
469
|
+
interface SearchInputProps extends Omit<InputProps, 'prefixNode' | 'suffixNode'> {
|
|
470
|
+
/**
|
|
471
|
+
* Line type (outlined or underlined)
|
|
472
|
+
*/
|
|
473
|
+
lineType?: 'outlined' | 'underlined';
|
|
474
|
+
/**
|
|
475
|
+
* SearchInput size
|
|
476
|
+
*/
|
|
477
|
+
size?: 'mini' | 'small' | 'medium' | 'large';
|
|
478
|
+
/**
|
|
479
|
+
* Whether to show the clear button when input has value
|
|
480
|
+
*/
|
|
481
|
+
clearable?: boolean;
|
|
482
|
+
/**
|
|
483
|
+
* Callback when clear button is clicked
|
|
484
|
+
*/
|
|
485
|
+
onClear?: () => void;
|
|
486
|
+
/**
|
|
487
|
+
* Custom search icon (URL string or React node)
|
|
488
|
+
*/
|
|
489
|
+
searchIcon?: string | React$1.ReactNode;
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* SearchInput Component
|
|
493
|
+
*
|
|
494
|
+
* A wrapper around Input component with search icon and clear functionality
|
|
495
|
+
*
|
|
496
|
+
* @example
|
|
497
|
+
* // Basic search input
|
|
498
|
+
* <SearchInput placeholder="Search..." />
|
|
499
|
+
*
|
|
500
|
+
* @example
|
|
501
|
+
* // Underlined search input
|
|
502
|
+
* <SearchInput lineType="underlined" placeholder="Search..." />
|
|
503
|
+
*
|
|
504
|
+
* @example
|
|
505
|
+
* // Search input without clearable
|
|
506
|
+
* <SearchInput clearable={false} placeholder="Search..." />
|
|
507
|
+
*
|
|
508
|
+
* @example
|
|
509
|
+
* // Different sizes
|
|
510
|
+
* <SearchInput size="small" placeholder="Search..." />
|
|
511
|
+
* <SearchInput size="medium" placeholder="Search..." />
|
|
512
|
+
* <SearchInput size="large" placeholder="Search..." />
|
|
513
|
+
*/
|
|
514
|
+
declare const SearchInput: React$1.ForwardRefExoticComponent<SearchInputProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* UnderlinedInput Component
|
|
518
|
+
*
|
|
519
|
+
* @deprecated Use <Input lineType="underlined" /> instead
|
|
520
|
+
*
|
|
521
|
+
* This component is a simple alias for Input with lineType="underlined"
|
|
522
|
+
* and will be removed in a future version.
|
|
523
|
+
*
|
|
524
|
+
* @example
|
|
525
|
+
* // Old way (deprecated)
|
|
526
|
+
* <UnderlinedInput placeholder="Search..." />
|
|
527
|
+
*
|
|
528
|
+
* // New way (recommended)
|
|
529
|
+
* <Input lineType="underlined" placeholder="Search..." />
|
|
530
|
+
*/
|
|
531
|
+
declare const UnderlinedInput: React$1.ForwardRefExoticComponent<Omit<InputProps, "lineType"> & React$1.RefAttributes<HTMLInputElement>>;
|
|
532
|
+
|
|
533
|
+
interface NumberInputProps {
|
|
534
|
+
/**
|
|
535
|
+
* Current value
|
|
536
|
+
*/
|
|
537
|
+
value?: number;
|
|
538
|
+
/**
|
|
539
|
+
* Default value
|
|
540
|
+
*/
|
|
541
|
+
defaultValue?: number;
|
|
542
|
+
/**
|
|
543
|
+
* Minimum value
|
|
544
|
+
*/
|
|
545
|
+
min?: number;
|
|
546
|
+
/**
|
|
547
|
+
* Maximum value
|
|
548
|
+
*/
|
|
549
|
+
max?: number;
|
|
550
|
+
/**
|
|
551
|
+
* Step increment/decrement
|
|
552
|
+
*/
|
|
553
|
+
step?: number;
|
|
554
|
+
/**
|
|
555
|
+
* Size variant
|
|
556
|
+
*/
|
|
557
|
+
size?: 'small' | 'large';
|
|
558
|
+
/**
|
|
559
|
+
* Whether the input is disabled
|
|
560
|
+
*/
|
|
561
|
+
disabled?: boolean;
|
|
562
|
+
/**
|
|
563
|
+
* Whether to show alert state (red border)
|
|
564
|
+
*/
|
|
565
|
+
alert?: boolean;
|
|
566
|
+
/**
|
|
567
|
+
* Number of decimal places
|
|
568
|
+
*/
|
|
569
|
+
precision?: number;
|
|
570
|
+
/**
|
|
571
|
+
* Format the display value
|
|
572
|
+
*/
|
|
573
|
+
formatter?: (value: number) => string;
|
|
574
|
+
/**
|
|
575
|
+
* Parse the input value
|
|
576
|
+
*/
|
|
577
|
+
parser?: (displayValue: string) => number;
|
|
578
|
+
/**
|
|
579
|
+
* Unit text to display after the input
|
|
580
|
+
*/
|
|
581
|
+
unit?: string;
|
|
582
|
+
/**
|
|
583
|
+
* Placeholder text
|
|
584
|
+
*/
|
|
585
|
+
placeholder?: string;
|
|
586
|
+
/**
|
|
587
|
+
* Callback when value changes
|
|
588
|
+
* @param fixedValue - The clamped value within min/max range (can be undefined if empty)
|
|
589
|
+
* @param rawValue - The original input value before clamping (can be undefined if empty)
|
|
590
|
+
*/
|
|
591
|
+
onChange?: (fixedValue: number | undefined, rawValue: number | undefined) => void;
|
|
592
|
+
/**
|
|
593
|
+
* Custom className
|
|
594
|
+
*/
|
|
595
|
+
className?: string;
|
|
596
|
+
/**
|
|
597
|
+
* Custom style
|
|
598
|
+
*/
|
|
599
|
+
style?: React$1.CSSProperties;
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* NumberInput Component
|
|
603
|
+
*
|
|
604
|
+
* A numeric input with increment/decrement buttons
|
|
605
|
+
*
|
|
606
|
+
* @example
|
|
607
|
+
* <NumberInput value={35} onChange={(val) => console.log(val)} />
|
|
608
|
+
*/
|
|
609
|
+
declare const NumberInput: React$1.FC<NumberInputProps>;
|
|
610
|
+
|
|
611
|
+
interface IconSize {
|
|
612
|
+
width: string;
|
|
613
|
+
height: string;
|
|
614
|
+
}
|
|
615
|
+
interface IconProps {
|
|
616
|
+
/**
|
|
617
|
+
* Icon name from registry (requires IconProvider)
|
|
618
|
+
*/
|
|
619
|
+
name?: string;
|
|
620
|
+
/**
|
|
621
|
+
* Image URL for icon (e.g., PNG, JPG, or external SVG)
|
|
622
|
+
*/
|
|
623
|
+
src?: string;
|
|
624
|
+
/**
|
|
625
|
+
* Custom icon element (takes precedence over name and src)
|
|
626
|
+
*/
|
|
627
|
+
children?: React$1.ReactNode;
|
|
628
|
+
/**
|
|
629
|
+
* Size of the icon (px or custom width/height)
|
|
630
|
+
*/
|
|
631
|
+
size?: number | string | IconSize;
|
|
632
|
+
/**
|
|
633
|
+
* Color of the icon (only works with SVG icons, not image src)
|
|
634
|
+
*/
|
|
635
|
+
color?: string;
|
|
636
|
+
/**
|
|
637
|
+
* Alt text for image icons
|
|
638
|
+
*/
|
|
639
|
+
alt?: string;
|
|
640
|
+
/**
|
|
641
|
+
* Custom className
|
|
642
|
+
*/
|
|
643
|
+
className?: string;
|
|
644
|
+
/**
|
|
645
|
+
* Custom style
|
|
646
|
+
*/
|
|
647
|
+
style?: React$1.CSSProperties;
|
|
648
|
+
/**
|
|
649
|
+
* Click handler
|
|
650
|
+
*/
|
|
651
|
+
onClick?: (e: React$1.MouseEvent) => void;
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* Icon Component
|
|
655
|
+
*
|
|
656
|
+
* Renders icons from multiple sources with priority: children > src > name
|
|
657
|
+
*
|
|
658
|
+
* @example
|
|
659
|
+
* // Using with IconProvider and registry
|
|
660
|
+
* <Icon name="close" size={16} />
|
|
661
|
+
*
|
|
662
|
+
* @example
|
|
663
|
+
* // Using with image URL
|
|
664
|
+
* <Icon src="/icons/custom-icon.svg" size={24} />
|
|
665
|
+
*
|
|
666
|
+
* @example
|
|
667
|
+
* // Using with custom icon element
|
|
668
|
+
* <Icon><CustomSvg /></Icon>
|
|
669
|
+
*
|
|
670
|
+
* @example
|
|
671
|
+
* // Using with imported icon component
|
|
672
|
+
* import { CloseIcon } from '@officesdk/design/icons';
|
|
673
|
+
* <Icon><CloseIcon /></Icon>
|
|
674
|
+
*/
|
|
675
|
+
declare const Icon: React$1.FC<IconProps>;
|
|
676
|
+
|
|
677
|
+
type IconComponent = React$1.ComponentType<React$1.SVGProps<SVGSVGElement>>;
|
|
678
|
+
type IconRegistry = Record<string, IconComponent>;
|
|
679
|
+
interface IconProviderProps {
|
|
680
|
+
/**
|
|
681
|
+
* Icon registry mapping icon names to React components
|
|
682
|
+
* Import from @officesdk/design/icons
|
|
683
|
+
*/
|
|
684
|
+
icons: IconRegistry;
|
|
685
|
+
/**
|
|
686
|
+
* Children components
|
|
687
|
+
*/
|
|
688
|
+
children: React$1.ReactNode;
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* IconProvider Component
|
|
692
|
+
*
|
|
693
|
+
* Provides icon registry to child components via Context
|
|
694
|
+
*
|
|
695
|
+
* @example
|
|
696
|
+
* import { IconProvider } from '@officesdk/design';
|
|
697
|
+
* import { iconRegistry } from '@officesdk/design/icons';
|
|
698
|
+
*
|
|
699
|
+
* <IconProvider icons={iconRegistry}>
|
|
700
|
+
* <App />
|
|
701
|
+
* </IconProvider>
|
|
702
|
+
*/
|
|
703
|
+
declare const IconProvider: React$1.FC<IconProviderProps>;
|
|
704
|
+
/**
|
|
705
|
+
* Hook to access icon registry from context
|
|
706
|
+
*/
|
|
707
|
+
declare const useIconRegistry: () => IconRegistry | null;
|
|
708
|
+
|
|
709
|
+
type ToastVariant = 'success' | 'info' | 'error' | 'warn' | 'loading' | 'critical';
|
|
710
|
+
interface ToastProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, 'className' | 'style' | 'children' | 'onClick'> {
|
|
711
|
+
/**
|
|
712
|
+
* Toast variant type
|
|
713
|
+
*/
|
|
714
|
+
variant?: ToastVariant;
|
|
715
|
+
/**
|
|
716
|
+
* Toast message content (main text)
|
|
717
|
+
*/
|
|
718
|
+
message: React$1.ReactNode;
|
|
719
|
+
/**
|
|
720
|
+
* Optional description text (shows below message in multiline mode)
|
|
721
|
+
*/
|
|
722
|
+
description?: string;
|
|
723
|
+
/**
|
|
724
|
+
* Main action button text (blue color)
|
|
725
|
+
*/
|
|
726
|
+
mainButtonText?: string;
|
|
727
|
+
/**
|
|
728
|
+
* Main action button click handler
|
|
729
|
+
*/
|
|
730
|
+
onMainButtonClick?: () => void;
|
|
731
|
+
/**
|
|
732
|
+
* Secondary action button text (gray color)
|
|
733
|
+
*/
|
|
734
|
+
secondaryButtonText?: string;
|
|
735
|
+
/**
|
|
736
|
+
* Secondary action button click handler
|
|
737
|
+
*/
|
|
738
|
+
onSecondaryButtonClick?: () => void;
|
|
739
|
+
/**
|
|
740
|
+
* Whether to show close button
|
|
741
|
+
*/
|
|
742
|
+
closable?: boolean;
|
|
743
|
+
/**
|
|
744
|
+
* Close button click handler
|
|
745
|
+
*/
|
|
746
|
+
onClose?: () => void;
|
|
747
|
+
/**
|
|
748
|
+
* Auto close duration in milliseconds (0 to disable)
|
|
749
|
+
*/
|
|
750
|
+
duration?: number;
|
|
751
|
+
/**
|
|
752
|
+
* Custom icon (overrides default variant icon)
|
|
753
|
+
*/
|
|
754
|
+
icon?: React$1.ReactNode;
|
|
755
|
+
/**
|
|
756
|
+
* Whether to show icon
|
|
757
|
+
*/
|
|
758
|
+
showIcon?: boolean;
|
|
759
|
+
/**
|
|
760
|
+
* Custom className
|
|
761
|
+
*/
|
|
762
|
+
className?: string;
|
|
763
|
+
/**
|
|
764
|
+
* Custom style
|
|
765
|
+
*/
|
|
766
|
+
style?: React$1.CSSProperties;
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* Toast Component
|
|
770
|
+
*
|
|
771
|
+
* A notification message component with different variants
|
|
772
|
+
*
|
|
773
|
+
* @example
|
|
774
|
+
* // Single line toast
|
|
775
|
+
* <Toast variant="success" message="信息反馈" />
|
|
776
|
+
*
|
|
777
|
+
* @example
|
|
778
|
+
* // Toast with buttons
|
|
779
|
+
* <Toast
|
|
780
|
+
* variant="info"
|
|
781
|
+
* message="信息反馈"
|
|
782
|
+
* mainButtonText="按钮名称"
|
|
783
|
+
* onMainButtonClick={() => console.log('Main clicked')}
|
|
784
|
+
* secondaryButtonText="按钮名称"
|
|
785
|
+
* onSecondaryButtonClick={() => console.log('Secondary clicked')}
|
|
786
|
+
* closable
|
|
787
|
+
* />
|
|
788
|
+
*
|
|
789
|
+
* @example
|
|
790
|
+
* // Multi-line toast with description
|
|
791
|
+
* <Toast
|
|
792
|
+
* variant="success"
|
|
793
|
+
* message="信息反馈"
|
|
794
|
+
* description="信息具体说明"
|
|
795
|
+
* mainButtonText="按钮名称"
|
|
796
|
+
* closable
|
|
797
|
+
* />
|
|
798
|
+
*/
|
|
799
|
+
declare const Toast: React$1.FC<ToastProps>;
|
|
800
|
+
|
|
801
|
+
interface ToastContextValue {
|
|
802
|
+
showToast: (props: Omit<ToastProps, 'onClose'>) => string;
|
|
803
|
+
hideToast: (id: string) => void;
|
|
804
|
+
success: (message: React$1.ReactNode, options?: Partial<ToastProps>) => string;
|
|
805
|
+
info: (message: React$1.ReactNode, options?: Partial<ToastProps>) => string;
|
|
806
|
+
error: (message: React$1.ReactNode, options?: Partial<ToastProps>) => string;
|
|
807
|
+
warn: (message: React$1.ReactNode, options?: Partial<ToastProps>) => string;
|
|
808
|
+
loading: (message: React$1.ReactNode, options?: Partial<ToastProps>) => string;
|
|
809
|
+
}
|
|
810
|
+
interface ToastContainerProps {
|
|
811
|
+
placement?: 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center';
|
|
812
|
+
/**
|
|
813
|
+
* Maximum number of toasts to show at once
|
|
814
|
+
*/
|
|
815
|
+
maxCount?: number;
|
|
816
|
+
/**
|
|
817
|
+
* Default duration for auto-close (ms)
|
|
818
|
+
*/
|
|
819
|
+
defaultDuration?: number;
|
|
820
|
+
/**
|
|
821
|
+
* Children components
|
|
822
|
+
*/
|
|
823
|
+
children: React$1.ReactNode;
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* ToastContainer Component
|
|
827
|
+
*
|
|
828
|
+
* Provides toast context and manages toast display
|
|
829
|
+
*
|
|
830
|
+
* @example
|
|
831
|
+
* <ToastContainer>
|
|
832
|
+
* <App />
|
|
833
|
+
* </ToastContainer>
|
|
834
|
+
*/
|
|
835
|
+
declare const ToastContainer: React$1.FC<ToastContainerProps>;
|
|
836
|
+
/**
|
|
837
|
+
* Hook to access toast methods
|
|
838
|
+
*
|
|
839
|
+
* @example
|
|
840
|
+
* const toast = useToast();
|
|
841
|
+
* toast.success('Operation successful!');
|
|
842
|
+
* toast.error('Something went wrong');
|
|
843
|
+
*/
|
|
844
|
+
declare const useToast: () => ToastContextValue;
|
|
845
|
+
|
|
846
|
+
type ToastPlacement = 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center';
|
|
847
|
+
interface ToastContainerConfig {
|
|
848
|
+
placement?: ToastPlacement;
|
|
849
|
+
maxCount?: number;
|
|
850
|
+
defaultDuration?: number;
|
|
851
|
+
}
|
|
852
|
+
/**
|
|
853
|
+
* Global toast object that can be used anywhere
|
|
854
|
+
* No need to render ToastContainer component manually
|
|
855
|
+
*
|
|
856
|
+
* @example
|
|
857
|
+
* import { toast } from '@officesdk/design';
|
|
858
|
+
*
|
|
859
|
+
* // Configure (optional)
|
|
860
|
+
* toast.configure({
|
|
861
|
+
* placement: 'top-right',
|
|
862
|
+
* maxCount: 5,
|
|
863
|
+
* defaultDuration: 3000,
|
|
864
|
+
* });
|
|
865
|
+
*
|
|
866
|
+
* // Show toasts
|
|
867
|
+
* toast.success('Operation successful!');
|
|
868
|
+
* toast.error('Something went wrong');
|
|
869
|
+
* toast.info('Info message', { duration: 5000 });
|
|
870
|
+
* toast.warn('Warning message');
|
|
871
|
+
*
|
|
872
|
+
* const id = toast.show({ variant: 'info', message: 'Custom toast' });
|
|
873
|
+
* toast.hide(id);
|
|
874
|
+
* toast.hideAll();
|
|
875
|
+
*/
|
|
876
|
+
declare const toast: {
|
|
877
|
+
configure: (config: ToastContainerConfig) => void;
|
|
878
|
+
show: (props: Omit<ToastProps, "onClose">) => string;
|
|
879
|
+
hide: (id: string) => void;
|
|
880
|
+
hideAll: () => void;
|
|
881
|
+
success: (message: React$1.ReactNode, options?: Partial<ToastProps>) => string;
|
|
882
|
+
info: (message: React$1.ReactNode, options?: Partial<ToastProps>) => string;
|
|
883
|
+
error: (message: React$1.ReactNode, options?: Partial<ToastProps>) => string;
|
|
884
|
+
warn: (message: React$1.ReactNode, options?: Partial<ToastProps>) => string;
|
|
885
|
+
loading: (message: React$1.ReactNode, options?: Partial<ToastProps>) => string;
|
|
886
|
+
destroy: () => void;
|
|
887
|
+
};
|
|
888
|
+
|
|
889
|
+
interface TabItem {
|
|
890
|
+
/**
|
|
891
|
+
* Unique key for the tab
|
|
892
|
+
*/
|
|
893
|
+
key: string;
|
|
894
|
+
/**
|
|
895
|
+
* Tab label
|
|
896
|
+
*/
|
|
897
|
+
label: string | React$1.ReactNode;
|
|
898
|
+
/**
|
|
899
|
+
* Whether the tab is disabled
|
|
900
|
+
*/
|
|
901
|
+
disabled?: boolean;
|
|
902
|
+
/**
|
|
903
|
+
* Custom icon
|
|
904
|
+
*/
|
|
905
|
+
icon?: React$1.ReactNode;
|
|
906
|
+
}
|
|
907
|
+
interface TabsProps {
|
|
908
|
+
/**
|
|
909
|
+
* Tab items
|
|
910
|
+
*/
|
|
911
|
+
items: TabItem[];
|
|
912
|
+
/**
|
|
913
|
+
* Active tab key
|
|
914
|
+
*/
|
|
915
|
+
activeKey?: string;
|
|
916
|
+
/**
|
|
917
|
+
* Default active tab key
|
|
918
|
+
*/
|
|
919
|
+
defaultActiveKey?: string;
|
|
920
|
+
/**
|
|
921
|
+
* Tab variant
|
|
922
|
+
*/
|
|
923
|
+
variant?: 'line' | 'card';
|
|
924
|
+
/**
|
|
925
|
+
* Tab size
|
|
926
|
+
*/
|
|
927
|
+
size?: 'large';
|
|
928
|
+
/**
|
|
929
|
+
* Callback when tab changes
|
|
930
|
+
*/
|
|
931
|
+
onChange?: (key: string) => void;
|
|
932
|
+
/**
|
|
933
|
+
* Custom className
|
|
934
|
+
*/
|
|
935
|
+
className?: string;
|
|
936
|
+
/**
|
|
937
|
+
* Custom style
|
|
938
|
+
*/
|
|
939
|
+
style?: React$1.CSSProperties;
|
|
940
|
+
/**
|
|
941
|
+
* Custom className for tab item
|
|
942
|
+
*/
|
|
943
|
+
tabItemClassName?: string;
|
|
944
|
+
/**
|
|
945
|
+
* Custom style for tab item
|
|
946
|
+
*/
|
|
947
|
+
tabItemStyle?: React$1.CSSProperties;
|
|
948
|
+
}
|
|
949
|
+
/**
|
|
950
|
+
* Tab Component
|
|
951
|
+
*
|
|
952
|
+
* A tab component with line and card variants
|
|
953
|
+
*
|
|
954
|
+
* @example
|
|
955
|
+
* <Tab
|
|
956
|
+
* items={[
|
|
957
|
+
* { key: '1', label: 'Tab 1' },
|
|
958
|
+
* { key: '2', label: 'Tab 2' },
|
|
959
|
+
* ]}
|
|
960
|
+
* defaultActiveKey="1"
|
|
961
|
+
* />
|
|
962
|
+
*/
|
|
963
|
+
declare const Tabs: React$1.FC<TabsProps>;
|
|
964
|
+
|
|
965
|
+
interface TooltipProps extends Omit<Partial<TooltipProps$1>, 'prefixCls'> {
|
|
966
|
+
/**
|
|
967
|
+
* Tooltip content
|
|
968
|
+
*/
|
|
969
|
+
content?: React$1.ReactNode;
|
|
970
|
+
/**
|
|
971
|
+
* Tooltip variant
|
|
972
|
+
*/
|
|
973
|
+
variant?: 'black' | 'white';
|
|
974
|
+
/**
|
|
975
|
+
* Tooltip size (only for white variant)
|
|
976
|
+
*/
|
|
977
|
+
size?: 'small' | 'large';
|
|
978
|
+
/**
|
|
979
|
+
* Children element that triggers the tooltip
|
|
980
|
+
*/
|
|
981
|
+
children: React$1.ReactElement;
|
|
982
|
+
/**
|
|
983
|
+
* Function to get the container element for the tooltip
|
|
984
|
+
*/
|
|
985
|
+
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
986
|
+
}
|
|
987
|
+
/**
|
|
988
|
+
* Tooltip Component
|
|
989
|
+
*
|
|
990
|
+
* Note: Coverage for this component may appear lower than expected due to
|
|
991
|
+
* styled-components CSS-in-JS template literals (lines 68-200+) which are
|
|
992
|
+
* not properly tracked by V8 coverage. The actual component logic is fully tested.
|
|
993
|
+
*
|
|
994
|
+
* @example
|
|
995
|
+
* // Basic black tooltip
|
|
996
|
+
* <Tooltip content="Tooltip text">
|
|
997
|
+
* <button>Hover me</button>
|
|
998
|
+
* </Tooltip>
|
|
999
|
+
*
|
|
1000
|
+
* @example
|
|
1001
|
+
* // White tooltip with small size
|
|
1002
|
+
* <Tooltip content="Tooltip text" variant="white" size="small">
|
|
1003
|
+
* <button>Hover me</button>
|
|
1004
|
+
* </Tooltip>
|
|
1005
|
+
*
|
|
1006
|
+
* @example
|
|
1007
|
+
* // White tooltip with large size
|
|
1008
|
+
* <Tooltip content="Complex content" variant="white" size="large">
|
|
1009
|
+
* <button>Hover me</button>
|
|
1010
|
+
* </Tooltip>
|
|
1011
|
+
*/
|
|
1012
|
+
declare const Tooltip: React$1.FC<TooltipProps>;
|
|
1013
|
+
|
|
1014
|
+
interface ToolbarButtonProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, 'onClick' | 'onDoubleClick'> {
|
|
1015
|
+
/**
|
|
1016
|
+
* Whether the button is disabled
|
|
1017
|
+
*/
|
|
1018
|
+
disabled?: boolean;
|
|
1019
|
+
/**
|
|
1020
|
+
* Whether the button is in active state
|
|
1021
|
+
*/
|
|
1022
|
+
isActive?: boolean;
|
|
1023
|
+
/**
|
|
1024
|
+
* Icon to display
|
|
1025
|
+
* - If string: image URL
|
|
1026
|
+
* - If ReactNode: custom icon component
|
|
1027
|
+
*/
|
|
1028
|
+
icon?: string | React$1.ReactNode;
|
|
1029
|
+
/**
|
|
1030
|
+
* Label text or custom node
|
|
1031
|
+
*/
|
|
1032
|
+
label?: string | React$1.ReactNode;
|
|
1033
|
+
/**
|
|
1034
|
+
* Whether to show dropdown arrow
|
|
1035
|
+
*/
|
|
1036
|
+
hasDropdown?: boolean;
|
|
1037
|
+
/**
|
|
1038
|
+
* Whether the dropdown section is clickable separately
|
|
1039
|
+
*/
|
|
1040
|
+
splitDropdown?: boolean;
|
|
1041
|
+
/**
|
|
1042
|
+
* Click handler for main button
|
|
1043
|
+
*/
|
|
1044
|
+
onClick?: (e: React$1.MouseEvent<HTMLButtonElement>) => void;
|
|
1045
|
+
/**
|
|
1046
|
+
* Double click handler for main button
|
|
1047
|
+
*/
|
|
1048
|
+
onDoubleClick?: (e: React$1.MouseEvent<HTMLButtonElement>) => void;
|
|
1049
|
+
/**
|
|
1050
|
+
* Click handler for dropdown section
|
|
1051
|
+
*/
|
|
1052
|
+
onDropdownClick?: (e: React$1.MouseEvent<HTMLButtonElement>) => void;
|
|
1053
|
+
/**
|
|
1054
|
+
* Custom className
|
|
1055
|
+
*/
|
|
1056
|
+
className?: string;
|
|
1057
|
+
/**
|
|
1058
|
+
* Custom style
|
|
1059
|
+
*/
|
|
1060
|
+
style?: React$1.CSSProperties;
|
|
1061
|
+
}
|
|
1062
|
+
/**
|
|
1063
|
+
* ToolbarButton Component
|
|
1064
|
+
*
|
|
1065
|
+
* A toolbar button with optional icon, label, and dropdown functionality
|
|
1066
|
+
*
|
|
1067
|
+
* @example
|
|
1068
|
+
* // Icon component
|
|
1069
|
+
* <ToolbarButton icon={<Icon />} />
|
|
1070
|
+
*
|
|
1071
|
+
* @example
|
|
1072
|
+
* // Icon from URL
|
|
1073
|
+
* <ToolbarButton icon="https://example.com/icon.png" />
|
|
1074
|
+
*
|
|
1075
|
+
* @example
|
|
1076
|
+
* // Button with label and dropdown
|
|
1077
|
+
* <ToolbarButton icon={<Icon />} label="Format" hasDropdown />
|
|
1078
|
+
*
|
|
1079
|
+
* @example
|
|
1080
|
+
* // Button with custom label node
|
|
1081
|
+
* <ToolbarButton icon={<Icon />} label={<CustomLabel />} />
|
|
1082
|
+
*
|
|
1083
|
+
* @example
|
|
1084
|
+
* // Button with split dropdown
|
|
1085
|
+
* <ToolbarButton
|
|
1086
|
+
* icon={<Icon />}
|
|
1087
|
+
* label="Format"
|
|
1088
|
+
* hasDropdown
|
|
1089
|
+
* splitDropdown
|
|
1090
|
+
* onClick={handleClick}
|
|
1091
|
+
* onDropdownClick={handleDropdownClick}
|
|
1092
|
+
* />
|
|
1093
|
+
*/
|
|
1094
|
+
declare const ToolbarButton: React$1.FC<ToolbarButtonProps>;
|
|
1095
|
+
|
|
1096
|
+
type DropdownButtonSize = 'large' | 'medium';
|
|
1097
|
+
type DropdownButtonVariant = 'framed' | 'frameless';
|
|
1098
|
+
interface DropdownButtonProps extends Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
|
|
1099
|
+
/**
|
|
1100
|
+
* Button variant
|
|
1101
|
+
* - framed: with border (40px large)
|
|
1102
|
+
* - frameless: without border (28px medium)
|
|
1103
|
+
*/
|
|
1104
|
+
variant?: DropdownButtonVariant;
|
|
1105
|
+
/**
|
|
1106
|
+
* Button size
|
|
1107
|
+
*/
|
|
1108
|
+
size?: DropdownButtonSize;
|
|
1109
|
+
/**
|
|
1110
|
+
* Display value/label
|
|
1111
|
+
*/
|
|
1112
|
+
value?: string;
|
|
1113
|
+
/**
|
|
1114
|
+
* Placeholder when no value
|
|
1115
|
+
*/
|
|
1116
|
+
placeholder?: string;
|
|
1117
|
+
/**
|
|
1118
|
+
* Optional icon (URL string or ReactNode)
|
|
1119
|
+
*/
|
|
1120
|
+
icon?: string | React$1.ReactNode;
|
|
1121
|
+
/**
|
|
1122
|
+
* Custom indicator/arrow icon
|
|
1123
|
+
*/
|
|
1124
|
+
indicatorIcon?: React$1.ReactNode;
|
|
1125
|
+
/**
|
|
1126
|
+
* Whether the dropdown is open (controls arrow rotation)
|
|
1127
|
+
*/
|
|
1128
|
+
open?: boolean;
|
|
1129
|
+
/**
|
|
1130
|
+
* Whether the button is disabled
|
|
1131
|
+
*/
|
|
1132
|
+
disabled?: boolean;
|
|
1133
|
+
/**
|
|
1134
|
+
* Error state
|
|
1135
|
+
*/
|
|
1136
|
+
error?: boolean;
|
|
1137
|
+
/**
|
|
1138
|
+
* Custom className
|
|
1139
|
+
*/
|
|
1140
|
+
className?: string;
|
|
1141
|
+
/**
|
|
1142
|
+
* Custom style
|
|
1143
|
+
*/
|
|
1144
|
+
style?: React$1.CSSProperties;
|
|
1145
|
+
/**
|
|
1146
|
+
* Custom text style
|
|
1147
|
+
*/
|
|
1148
|
+
textStyle?: React$1.CSSProperties;
|
|
1149
|
+
}
|
|
1150
|
+
/**
|
|
1151
|
+
* DropdownButton Component
|
|
1152
|
+
*
|
|
1153
|
+
* A button component for triggering dropdown menus
|
|
1154
|
+
*
|
|
1155
|
+
* @example
|
|
1156
|
+
* // Framed dropdown button (with border, 40px)
|
|
1157
|
+
* <DropdownButton variant="framed" value="Option 1" />
|
|
1158
|
+
*
|
|
1159
|
+
* @example
|
|
1160
|
+
* // Frameless dropdown button (no border, 28px)
|
|
1161
|
+
* <DropdownButton variant="frameless" value="Option 1" />
|
|
1162
|
+
*
|
|
1163
|
+
* @example
|
|
1164
|
+
* // With icon
|
|
1165
|
+
* <DropdownButton icon={<CustomIcon />} value="Option 1" />
|
|
1166
|
+
*
|
|
1167
|
+
* @example
|
|
1168
|
+
* // Open state (arrow rotated)
|
|
1169
|
+
* <DropdownButton open value="Option 1" />
|
|
1170
|
+
*/
|
|
1171
|
+
declare const DropdownButton: React$1.ForwardRefExoticComponent<DropdownButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1172
|
+
|
|
1173
|
+
interface MenuItem {
|
|
1174
|
+
type?: 'item';
|
|
1175
|
+
key: string;
|
|
1176
|
+
label: string;
|
|
1177
|
+
description?: string;
|
|
1178
|
+
icon?: string | React$1.ReactNode;
|
|
1179
|
+
disabled?: boolean;
|
|
1180
|
+
selected?: boolean;
|
|
1181
|
+
selectable?: boolean;
|
|
1182
|
+
children?: MenuItem[];
|
|
1183
|
+
onClick?: (key: string) => void;
|
|
1184
|
+
}
|
|
1185
|
+
interface MenuGroup {
|
|
1186
|
+
type: 'group';
|
|
1187
|
+
key: string;
|
|
1188
|
+
label: string;
|
|
1189
|
+
children: MenuItem[];
|
|
1190
|
+
}
|
|
1191
|
+
interface MenuDivider {
|
|
1192
|
+
type: 'divider';
|
|
1193
|
+
key: string;
|
|
1194
|
+
}
|
|
1195
|
+
type MenuItemType = MenuItem | MenuGroup | MenuDivider;
|
|
1196
|
+
interface MenuProps {
|
|
1197
|
+
/**
|
|
1198
|
+
* Menu items
|
|
1199
|
+
*/
|
|
1200
|
+
items: MenuItemType[];
|
|
1201
|
+
/**
|
|
1202
|
+
* Currently selected key(s)
|
|
1203
|
+
*/
|
|
1204
|
+
selectedKeys?: string[];
|
|
1205
|
+
/**
|
|
1206
|
+
* Open submenu keys (controlled)
|
|
1207
|
+
*/
|
|
1208
|
+
openKeys?: string[];
|
|
1209
|
+
/**
|
|
1210
|
+
* Menu size
|
|
1211
|
+
*/
|
|
1212
|
+
size?: 'medium' | 'large';
|
|
1213
|
+
/**
|
|
1214
|
+
* Whether to show search box
|
|
1215
|
+
*/
|
|
1216
|
+
searchable?: boolean;
|
|
1217
|
+
/**
|
|
1218
|
+
* Search placeholder
|
|
1219
|
+
*/
|
|
1220
|
+
searchPlaceholder?: string;
|
|
1221
|
+
/**
|
|
1222
|
+
* Max height for scrolling
|
|
1223
|
+
*/
|
|
1224
|
+
maxHeight?: number;
|
|
1225
|
+
/**
|
|
1226
|
+
* Enable virtual scrolling
|
|
1227
|
+
*/
|
|
1228
|
+
virtual?: boolean;
|
|
1229
|
+
/**
|
|
1230
|
+
* Whether to always reserve space for active icon (for description alignment)
|
|
1231
|
+
*/
|
|
1232
|
+
reserveActiveIconSpace?: boolean;
|
|
1233
|
+
/**
|
|
1234
|
+
* Select handler
|
|
1235
|
+
*/
|
|
1236
|
+
onSelect?: (key: string) => void;
|
|
1237
|
+
/**
|
|
1238
|
+
* Search handler
|
|
1239
|
+
*/
|
|
1240
|
+
onSearch?: (value: string) => void;
|
|
1241
|
+
/**
|
|
1242
|
+
* Open keys change handler
|
|
1243
|
+
*/
|
|
1244
|
+
onOpenChange?: (keys: string[]) => void;
|
|
1245
|
+
/**
|
|
1246
|
+
* Custom className
|
|
1247
|
+
*/
|
|
1248
|
+
className?: string;
|
|
1249
|
+
/**
|
|
1250
|
+
* Custom style
|
|
1251
|
+
*/
|
|
1252
|
+
style?: React$1.CSSProperties;
|
|
1253
|
+
}
|
|
1254
|
+
/**
|
|
1255
|
+
* Menu Component
|
|
1256
|
+
*
|
|
1257
|
+
* A menu component based on rc-menu with virtual scrolling support
|
|
1258
|
+
*
|
|
1259
|
+
* @example
|
|
1260
|
+
* // Basic menu
|
|
1261
|
+
* <Menu
|
|
1262
|
+
* items={[
|
|
1263
|
+
* { key: '1', label: 'Option 1' },
|
|
1264
|
+
* { key: '2', label: 'Option 2' },
|
|
1265
|
+
* ]}
|
|
1266
|
+
* onSelect={(key) => console.log(key)}
|
|
1267
|
+
* />
|
|
1268
|
+
*
|
|
1269
|
+
* @example
|
|
1270
|
+
* // Menu with groups and dividers
|
|
1271
|
+
* <Menu
|
|
1272
|
+
* items={[
|
|
1273
|
+
* { type: 'group', key: 'g1', label: 'Group A', children: [...] },
|
|
1274
|
+
* { type: 'divider', key: 'd1' },
|
|
1275
|
+
* { key: '1', label: 'Option 1' },
|
|
1276
|
+
* ]}
|
|
1277
|
+
* />
|
|
1278
|
+
*
|
|
1279
|
+
* @example
|
|
1280
|
+
* // Menu with search
|
|
1281
|
+
* <Menu
|
|
1282
|
+
* searchable
|
|
1283
|
+
* items={items}
|
|
1284
|
+
* onSearch={(value) => console.log(value)}
|
|
1285
|
+
* />
|
|
1286
|
+
*/
|
|
1287
|
+
declare const Menu: React$1.FC<MenuProps>;
|
|
1288
|
+
|
|
1289
|
+
interface DropdownProps extends Omit<Partial<DropdownProps$1>, 'prefixCls' | 'placement'> {
|
|
1290
|
+
/**
|
|
1291
|
+
* Dropdown overlay content (usually a Menu component)
|
|
1292
|
+
*/
|
|
1293
|
+
overlay?: React$1.ReactElement | (() => React$1.ReactElement);
|
|
1294
|
+
/**
|
|
1295
|
+
* Trigger action (click, hover, contextMenu)
|
|
1296
|
+
*/
|
|
1297
|
+
trigger?: ('click' | 'hover' | 'contextMenu')[];
|
|
1298
|
+
/**
|
|
1299
|
+
* Placement of dropdown
|
|
1300
|
+
*/
|
|
1301
|
+
placement?: 'top' | 'topLeft' | 'topRight' | 'bottom' | 'bottomLeft' | 'bottomRight';
|
|
1302
|
+
/**
|
|
1303
|
+
* Whether dropdown is visible (controlled)
|
|
1304
|
+
*/
|
|
1305
|
+
visible?: boolean;
|
|
1306
|
+
/**
|
|
1307
|
+
* Default visibility (uncontrolled)
|
|
1308
|
+
*/
|
|
1309
|
+
defaultVisible?: boolean;
|
|
1310
|
+
/**
|
|
1311
|
+
* Callback when visibility changes
|
|
1312
|
+
*/
|
|
1313
|
+
onVisibleChange?: (visible: boolean) => void;
|
|
1314
|
+
/**
|
|
1315
|
+
* Children element that triggers the dropdown
|
|
1316
|
+
*/
|
|
1317
|
+
children: React$1.ReactElement;
|
|
1318
|
+
/**
|
|
1319
|
+
* Dropdown container class name
|
|
1320
|
+
*/
|
|
1321
|
+
overlayClassName?: string;
|
|
1322
|
+
/**
|
|
1323
|
+
* Function to get the container element for the dropdown
|
|
1324
|
+
*/
|
|
1325
|
+
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
1326
|
+
}
|
|
1327
|
+
/**
|
|
1328
|
+
* Dropdown Component
|
|
1329
|
+
*
|
|
1330
|
+
* A dropdown container component based on rc-dropdown
|
|
1331
|
+
*
|
|
1332
|
+
* @example
|
|
1333
|
+
* // Basic dropdown with menu
|
|
1334
|
+
* <Dropdown
|
|
1335
|
+
* overlay={<Menu items={items} />}
|
|
1336
|
+
* trigger={['click']}
|
|
1337
|
+
* >
|
|
1338
|
+
* <DropdownButton value="Select" />
|
|
1339
|
+
* </Dropdown>
|
|
1340
|
+
*
|
|
1341
|
+
* @example
|
|
1342
|
+
* // Controlled dropdown
|
|
1343
|
+
* <Dropdown
|
|
1344
|
+
* visible={open}
|
|
1345
|
+
* onVisibleChange={setOpen}
|
|
1346
|
+
* overlay={<Menu items={items} />}
|
|
1347
|
+
* >
|
|
1348
|
+
* <Button>Click me</Button>
|
|
1349
|
+
* </Dropdown>
|
|
1350
|
+
*
|
|
1351
|
+
* @example
|
|
1352
|
+
* // Custom trigger
|
|
1353
|
+
* <Dropdown
|
|
1354
|
+
* overlay={<Menu items={items} />}
|
|
1355
|
+
* trigger={['hover']}
|
|
1356
|
+
* placement="bottomLeft"
|
|
1357
|
+
* >
|
|
1358
|
+
* <span>Hover me</span>
|
|
1359
|
+
* </Dropdown>
|
|
1360
|
+
*/
|
|
1361
|
+
declare const Dropdown: React$1.FC<DropdownProps>;
|
|
1362
|
+
|
|
1363
|
+
declare const DropdownGlobalStyles: styled_components.GlobalStyleComponent<{}, styled_components.DefaultTheme>;
|
|
1364
|
+
declare const MenuGlobalStyles: styled_components.GlobalStyleComponent<{}, styled_components.DefaultTheme>;
|
|
1365
|
+
|
|
1366
|
+
interface ModalProps extends DialogProps {
|
|
1367
|
+
/**
|
|
1368
|
+
* Whether the modal is visible
|
|
1369
|
+
*/
|
|
1370
|
+
visible?: boolean;
|
|
1371
|
+
/**
|
|
1372
|
+
* Modal variant type
|
|
1373
|
+
* - 'message': Message dialog (max 400px, min 360px)
|
|
1374
|
+
* - 'functional': Functional dialog (default 640px, max 800px, min 400px)
|
|
1375
|
+
*/
|
|
1376
|
+
variant?: 'message' | 'functional';
|
|
1377
|
+
/**
|
|
1378
|
+
* Mask layer type
|
|
1379
|
+
* - 'light': Light mask (rgba(65,70,75,0.5))
|
|
1380
|
+
* - 'dark': Dark mask (rgba(44,48,51,0.8))
|
|
1381
|
+
*/
|
|
1382
|
+
maskType?: 'light' | 'dark';
|
|
1383
|
+
/**
|
|
1384
|
+
* Modal title
|
|
1385
|
+
*/
|
|
1386
|
+
title?: React$1.ReactNode;
|
|
1387
|
+
/**
|
|
1388
|
+
* Modal width
|
|
1389
|
+
*/
|
|
1390
|
+
width?: string | number;
|
|
1391
|
+
/**
|
|
1392
|
+
* Modal height
|
|
1393
|
+
*/
|
|
1394
|
+
height?: string | number;
|
|
1395
|
+
/**
|
|
1396
|
+
* Whether to show mask
|
|
1397
|
+
*/
|
|
1398
|
+
mask?: boolean;
|
|
1399
|
+
/**
|
|
1400
|
+
* Whether to close modal when clicking mask
|
|
1401
|
+
*/
|
|
1402
|
+
maskClosable?: boolean;
|
|
1403
|
+
/**
|
|
1404
|
+
* Whether to show close button
|
|
1405
|
+
*/
|
|
1406
|
+
closable?: boolean;
|
|
1407
|
+
/**
|
|
1408
|
+
* OK button text, set to null to hide
|
|
1409
|
+
*/
|
|
1410
|
+
okText?: string | null;
|
|
1411
|
+
/**
|
|
1412
|
+
* Cancel button text, set to null to hide
|
|
1413
|
+
*/
|
|
1414
|
+
cancelText?: string | null;
|
|
1415
|
+
/**
|
|
1416
|
+
* Whether OK button is disabled
|
|
1417
|
+
*/
|
|
1418
|
+
disabledOkButton?: boolean;
|
|
1419
|
+
/**
|
|
1420
|
+
* Custom footer, set to null to hide footer
|
|
1421
|
+
*/
|
|
1422
|
+
footer?: React$1.ReactNode;
|
|
1423
|
+
/**
|
|
1424
|
+
* Callback when OK button is clicked
|
|
1425
|
+
*/
|
|
1426
|
+
onOk?: (e: React$1.MouseEvent) => void;
|
|
1427
|
+
/**
|
|
1428
|
+
* Callback when Cancel button is clicked or modal is closed
|
|
1429
|
+
*/
|
|
1430
|
+
onCancel?: (e: React$1.MouseEvent | React$1.KeyboardEvent) => void;
|
|
1431
|
+
/**
|
|
1432
|
+
* Modal content
|
|
1433
|
+
*/
|
|
1434
|
+
children?: React$1.ReactNode;
|
|
1435
|
+
/**
|
|
1436
|
+
* CSS class prefix
|
|
1437
|
+
*/
|
|
1438
|
+
prefixCls?: string;
|
|
1439
|
+
/**
|
|
1440
|
+
* Custom className
|
|
1441
|
+
*/
|
|
1442
|
+
className?: string;
|
|
1443
|
+
/**
|
|
1444
|
+
* Custom style
|
|
1445
|
+
*/
|
|
1446
|
+
style?: React$1.CSSProperties;
|
|
1447
|
+
/**
|
|
1448
|
+
* z-index of the modal
|
|
1449
|
+
*/
|
|
1450
|
+
zIndex?: number;
|
|
1451
|
+
/**
|
|
1452
|
+
* Whether to destroy modal on close
|
|
1453
|
+
*/
|
|
1454
|
+
destroyOnClose?: boolean;
|
|
1455
|
+
/**
|
|
1456
|
+
* Whether to focus on modal when opened
|
|
1457
|
+
*/
|
|
1458
|
+
focusTriggerAfterClose?: boolean;
|
|
1459
|
+
/**
|
|
1460
|
+
* Return the mount node for Modal
|
|
1461
|
+
*/
|
|
1462
|
+
getContainer?: () => HTMLElement;
|
|
1463
|
+
}
|
|
1464
|
+
/**
|
|
1465
|
+
* Modal Component
|
|
1466
|
+
*
|
|
1467
|
+
* A dialog component for displaying content in a layer above the page.
|
|
1468
|
+
*
|
|
1469
|
+
* @example
|
|
1470
|
+
* // Basic usage
|
|
1471
|
+
* <Modal
|
|
1472
|
+
* visible={visible}
|
|
1473
|
+
* title="Modal Title"
|
|
1474
|
+
* onOk={handleOk}
|
|
1475
|
+
* onCancel={handleCancel}
|
|
1476
|
+
* >
|
|
1477
|
+
* Modal content
|
|
1478
|
+
* </Modal>
|
|
1479
|
+
*
|
|
1480
|
+
* @example
|
|
1481
|
+
* // Custom footer
|
|
1482
|
+
* <Modal
|
|
1483
|
+
* visible={visible}
|
|
1484
|
+
* title="Custom Footer"
|
|
1485
|
+
* footer={<Button onClick={handleClose}>Close</Button>}
|
|
1486
|
+
* onCancel={handleCancel}
|
|
1487
|
+
* >
|
|
1488
|
+
* Modal content
|
|
1489
|
+
* </Modal>
|
|
1490
|
+
*
|
|
1491
|
+
* @example
|
|
1492
|
+
* // No footer
|
|
1493
|
+
* <Modal
|
|
1494
|
+
* visible={visible}
|
|
1495
|
+
* title="No Footer"
|
|
1496
|
+
* footer={null}
|
|
1497
|
+
* onCancel={handleCancel}
|
|
1498
|
+
* >
|
|
1499
|
+
* Modal content
|
|
1500
|
+
* </Modal>
|
|
1501
|
+
*/
|
|
1502
|
+
declare const Modal: React$1.FC<ModalProps>;
|
|
1503
|
+
|
|
1504
|
+
declare const ModalGlobalStyles: any;
|
|
1505
|
+
|
|
1506
|
+
interface LoadingProps {
|
|
1507
|
+
/**
|
|
1508
|
+
* Size of the loading spinner
|
|
1509
|
+
* - 'small': 16x16 (for dropdown menus, search refresh)
|
|
1510
|
+
* - 'medium': 24x24 (for list/table refresh)
|
|
1511
|
+
* - 'large': 32x32 (for full page refresh)
|
|
1512
|
+
*/
|
|
1513
|
+
size?: 'small' | 'medium' | 'large';
|
|
1514
|
+
/**
|
|
1515
|
+
* Whether the spinner is visible
|
|
1516
|
+
*/
|
|
1517
|
+
spinning?: boolean;
|
|
1518
|
+
/**
|
|
1519
|
+
* Delay in milliseconds before showing the spinner (prevents flash)
|
|
1520
|
+
*/
|
|
1521
|
+
delay?: number;
|
|
1522
|
+
/**
|
|
1523
|
+
* Tip text displayed below the spinner
|
|
1524
|
+
*/
|
|
1525
|
+
tip?: React$1.ReactNode;
|
|
1526
|
+
/**
|
|
1527
|
+
* Whether to use fullscreen overlay mode
|
|
1528
|
+
*/
|
|
1529
|
+
fullscreen?: boolean;
|
|
1530
|
+
/**
|
|
1531
|
+
* Custom className
|
|
1532
|
+
*/
|
|
1533
|
+
className?: string;
|
|
1534
|
+
/**
|
|
1535
|
+
* Child content to wrap with loading overlay
|
|
1536
|
+
*/
|
|
1537
|
+
children?: React$1.ReactNode;
|
|
1538
|
+
/**
|
|
1539
|
+
* Custom loading indicator (React element or image URL)
|
|
1540
|
+
* When provided as a string, it will be used as the image src
|
|
1541
|
+
* When provided as a React element, it will be rendered directly
|
|
1542
|
+
*/
|
|
1543
|
+
indicator?: React$1.ReactNode | string;
|
|
1544
|
+
}
|
|
1545
|
+
/**
|
|
1546
|
+
* Loading Component
|
|
1547
|
+
*
|
|
1548
|
+
* A loading component that displays an animated indicator.
|
|
1549
|
+
* Supports GIF/CSS defaults via theme configuration or custom indicators via props.
|
|
1550
|
+
*
|
|
1551
|
+
* @example
|
|
1552
|
+
* // Basic usage (uses theme default indicator type)
|
|
1553
|
+
* <Loading />
|
|
1554
|
+
*
|
|
1555
|
+
* @example
|
|
1556
|
+
* // Different sizes
|
|
1557
|
+
* <Loading size="small" />
|
|
1558
|
+
* <Loading size="medium" />
|
|
1559
|
+
* <Loading size="large" />
|
|
1560
|
+
*
|
|
1561
|
+
* @example
|
|
1562
|
+
* // With tip
|
|
1563
|
+
* <Loading tip="Loading..." />
|
|
1564
|
+
*
|
|
1565
|
+
* @example
|
|
1566
|
+
* // Custom indicator (image URL)
|
|
1567
|
+
* <Loading indicator="/path/to/custom-loading.gif" />
|
|
1568
|
+
*
|
|
1569
|
+
* @example
|
|
1570
|
+
* // Custom indicator (React element)
|
|
1571
|
+
* <Loading indicator={<MyCustomSpinner />} />
|
|
1572
|
+
*
|
|
1573
|
+
* @example
|
|
1574
|
+
* // Wrap content
|
|
1575
|
+
* <Loading spinning={isLoading}>
|
|
1576
|
+
* <div>Content to load</div>
|
|
1577
|
+
* </Loading>
|
|
1578
|
+
*
|
|
1579
|
+
* @example
|
|
1580
|
+
* // Fullscreen loading
|
|
1581
|
+
* <Loading fullscreen spinning={isLoading} />
|
|
1582
|
+
*/
|
|
1583
|
+
declare const Loading: React$1.FC<LoadingProps>;
|
|
1584
|
+
|
|
1585
|
+
type DeepPartial<T extends object> = {
|
|
1586
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
1587
|
+
};
|
|
1588
|
+
|
|
1589
|
+
type ToastPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';
|
|
1590
|
+
interface ToastConfig {
|
|
1591
|
+
/**
|
|
1592
|
+
* Maximum number of toasts to show at once
|
|
1593
|
+
*/
|
|
1594
|
+
maxCount?: number;
|
|
1595
|
+
/**
|
|
1596
|
+
* Default duration for auto-close (ms)
|
|
1597
|
+
*/
|
|
1598
|
+
defaultDuration?: number;
|
|
1599
|
+
/**
|
|
1600
|
+
* Toast position on screen
|
|
1601
|
+
*/
|
|
1602
|
+
position?: ToastPosition;
|
|
1603
|
+
/**
|
|
1604
|
+
* Offset from edge (px)
|
|
1605
|
+
*/
|
|
1606
|
+
offset?: {
|
|
1607
|
+
x?: number;
|
|
1608
|
+
y?: number;
|
|
1609
|
+
};
|
|
1610
|
+
}
|
|
1611
|
+
interface ZIndexConfig {
|
|
1612
|
+
/**
|
|
1613
|
+
* Z-index for toast notifications
|
|
1614
|
+
*/
|
|
1615
|
+
toast?: number;
|
|
1616
|
+
/**
|
|
1617
|
+
* Z-index for modals
|
|
1618
|
+
*/
|
|
1619
|
+
modal?: number;
|
|
1620
|
+
/**
|
|
1621
|
+
* Z-index for dropdowns
|
|
1622
|
+
*/
|
|
1623
|
+
dropdown?: number;
|
|
1624
|
+
/**
|
|
1625
|
+
* Z-index for tooltips
|
|
1626
|
+
*/
|
|
1627
|
+
tooltip?: number;
|
|
1628
|
+
}
|
|
1629
|
+
interface AnimationConfig {
|
|
1630
|
+
/**
|
|
1631
|
+
* Default animation duration (ms)
|
|
1632
|
+
*/
|
|
1633
|
+
duration?: number;
|
|
1634
|
+
/**
|
|
1635
|
+
* Default easing function
|
|
1636
|
+
*/
|
|
1637
|
+
easing?: string;
|
|
1638
|
+
/**
|
|
1639
|
+
* Disable all animations
|
|
1640
|
+
*/
|
|
1641
|
+
disabled?: boolean;
|
|
1642
|
+
}
|
|
1643
|
+
interface A11yConfig {
|
|
1644
|
+
/**
|
|
1645
|
+
* Announce messages to screen readers
|
|
1646
|
+
*/
|
|
1647
|
+
announceMessages?: boolean;
|
|
1648
|
+
/**
|
|
1649
|
+
* Show focus visible indicators
|
|
1650
|
+
*/
|
|
1651
|
+
focusVisible?: boolean;
|
|
1652
|
+
/**
|
|
1653
|
+
* Reduce motion for users who prefer it
|
|
1654
|
+
*/
|
|
1655
|
+
reduceMotion?: boolean;
|
|
1656
|
+
}
|
|
1657
|
+
interface I18nConfig {
|
|
1658
|
+
/**
|
|
1659
|
+
* Toast messages
|
|
1660
|
+
*/
|
|
1661
|
+
toast?: {
|
|
1662
|
+
closeLabel?: string;
|
|
1663
|
+
};
|
|
1664
|
+
/**
|
|
1665
|
+
* Button messages
|
|
1666
|
+
*/
|
|
1667
|
+
button?: {
|
|
1668
|
+
loadingText?: string;
|
|
1669
|
+
};
|
|
1670
|
+
/**
|
|
1671
|
+
* Common messages
|
|
1672
|
+
*/
|
|
1673
|
+
common?: {
|
|
1674
|
+
confirm?: string;
|
|
1675
|
+
cancel?: string;
|
|
1676
|
+
ok?: string;
|
|
1677
|
+
};
|
|
1678
|
+
}
|
|
1679
|
+
interface UIConfig {
|
|
1680
|
+
/**
|
|
1681
|
+
* Theme configuration (required)
|
|
1682
|
+
*/
|
|
1683
|
+
theme: DeepPartial<Theme>;
|
|
1684
|
+
/**
|
|
1685
|
+
* Icon registry (optional)
|
|
1686
|
+
*/
|
|
1687
|
+
icons?: IconRegistry;
|
|
1688
|
+
/**
|
|
1689
|
+
* Toast configuration
|
|
1690
|
+
*/
|
|
1691
|
+
toast?: ToastConfig;
|
|
1692
|
+
/**
|
|
1693
|
+
* Locale code (e.g., 'zh-CN', 'en-US')
|
|
1694
|
+
*/
|
|
1695
|
+
locale?: string;
|
|
1696
|
+
/**
|
|
1697
|
+
* Internationalization configuration
|
|
1698
|
+
*/
|
|
1699
|
+
i18n?: I18nConfig;
|
|
1700
|
+
/**
|
|
1701
|
+
* Z-index layer management
|
|
1702
|
+
*/
|
|
1703
|
+
zIndex?: ZIndexConfig;
|
|
1704
|
+
/**
|
|
1705
|
+
* Animation configuration
|
|
1706
|
+
*/
|
|
1707
|
+
animation?: AnimationConfig;
|
|
1708
|
+
/**
|
|
1709
|
+
* Accessibility configuration
|
|
1710
|
+
*/
|
|
1711
|
+
a11y?: A11yConfig;
|
|
1712
|
+
/**
|
|
1713
|
+
* Render function
|
|
1714
|
+
*/
|
|
1715
|
+
renderFunction?: (element: React.ReactElement, container: HTMLElement) => void;
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
interface UIConfigProviderProps {
|
|
1719
|
+
/**
|
|
1720
|
+
* UI configuration
|
|
1721
|
+
*/
|
|
1722
|
+
config: UIConfig;
|
|
1723
|
+
/**
|
|
1724
|
+
* Children components
|
|
1725
|
+
*/
|
|
1726
|
+
children: React$1.ReactNode;
|
|
1727
|
+
}
|
|
1728
|
+
/**
|
|
1729
|
+
* UIConfigProvider Component (Optional, for React convenience)
|
|
1730
|
+
*
|
|
1731
|
+
* Unified provider for all UI components and global configurations.
|
|
1732
|
+
* Includes IconProvider, ToastContainer, and other settings.
|
|
1733
|
+
*
|
|
1734
|
+
* Note: Global styles (Tooltip, Menu, Dropdown) are now injected on-demand
|
|
1735
|
+
* when components are first used, so they are no longer included here.
|
|
1736
|
+
*
|
|
1737
|
+
* For non-React environments or when you want to avoid Provider nesting,
|
|
1738
|
+
* use initUIConfig() instead.
|
|
1739
|
+
*
|
|
1740
|
+
* @example
|
|
1741
|
+
* import { UIConfigProvider } from '@officesdk/design';
|
|
1742
|
+
* import { lightTheme } from '@officesdk/design/theme';
|
|
1743
|
+
* import { iconRegistry } from '@officesdk/design/icons';
|
|
1744
|
+
*
|
|
1745
|
+
* <UIConfigProvider config={{
|
|
1746
|
+
* theme: lightTheme,
|
|
1747
|
+
* icons: iconRegistry,
|
|
1748
|
+
* toast: {
|
|
1749
|
+
* defaultDuration: 3000,
|
|
1750
|
+
* maxCount: 5,
|
|
1751
|
+
* },
|
|
1752
|
+
* }}>
|
|
1753
|
+
* <App />
|
|
1754
|
+
* </UIConfigProvider>
|
|
1755
|
+
*/
|
|
1756
|
+
declare const UIConfigProvider: React$1.FC<UIConfigProviderProps>;
|
|
1757
|
+
/**
|
|
1758
|
+
* Hook to access UI configuration
|
|
1759
|
+
*
|
|
1760
|
+
* Falls back to global config if context is not available.
|
|
1761
|
+
* This allows components to work even without UIConfigProvider when initUIConfig() is used.
|
|
1762
|
+
*
|
|
1763
|
+
* @example
|
|
1764
|
+
* const config = useUIConfig();
|
|
1765
|
+
* console.log(config?.theme);
|
|
1766
|
+
* console.log(config?.locale);
|
|
1767
|
+
*/
|
|
1768
|
+
declare const useUIConfig: () => UIConfig | null;
|
|
1769
|
+
|
|
1770
|
+
/**
|
|
1771
|
+
* Create UI configuration with default values
|
|
1772
|
+
*
|
|
1773
|
+
* @example
|
|
1774
|
+
* import { createUIConfig } from '@officesdk/design';
|
|
1775
|
+
* import { lightTheme } from '@officesdk/design/theme';
|
|
1776
|
+
* import { iconRegistry } from '@officesdk/design/icons';
|
|
1777
|
+
*
|
|
1778
|
+
* const config = createUIConfig({
|
|
1779
|
+
* theme: lightTheme,
|
|
1780
|
+
* icons: iconRegistry,
|
|
1781
|
+
* toast: {
|
|
1782
|
+
* defaultDuration: 3000,
|
|
1783
|
+
* },
|
|
1784
|
+
* });
|
|
1785
|
+
*/
|
|
1786
|
+
declare const createUIConfig: (config: UIConfig) => UIConfig;
|
|
1787
|
+
/**
|
|
1788
|
+
* Merge multiple configs (useful for extending base configs)
|
|
1789
|
+
*/
|
|
1790
|
+
declare const mergeUIConfig: (baseConfig: UIConfig, ...configs: Partial<UIConfig>[]) => UIConfig;
|
|
1791
|
+
|
|
1792
|
+
/**
|
|
1793
|
+
* Initialize UI configuration globally (non-React)
|
|
1794
|
+
*
|
|
1795
|
+
* This function allows you to configure the UI library without using React Provider components.
|
|
1796
|
+
* It's useful for:
|
|
1797
|
+
* - Non-React environments
|
|
1798
|
+
* - Avoiding Provider nesting (e.g., in Modal components)
|
|
1799
|
+
* - Setting up configuration before React app starts
|
|
1800
|
+
*
|
|
1801
|
+
* After calling this function, all components will automatically use the global configuration.
|
|
1802
|
+
* Global styles (Tooltip, Menu, Dropdown) will be injected on-demand when components are first used.
|
|
1803
|
+
*
|
|
1804
|
+
* @param config - UI configuration object
|
|
1805
|
+
* @param config.theme - Theme configuration (required)
|
|
1806
|
+
* @param config.icons - Icon registry mapping icon names to React components
|
|
1807
|
+
* @param config.toast - Toast configuration (maxCount, defaultDuration, etc.)
|
|
1808
|
+
* @param config.locale - Locale code (e.g., 'zh-CN', 'en-US')
|
|
1809
|
+
* @param config.i18n - Internationalization configuration
|
|
1810
|
+
* @param config.zIndex - Z-index layer management
|
|
1811
|
+
* @param config.animation - Animation configuration
|
|
1812
|
+
* @param config.a11y - Accessibility configuration
|
|
1813
|
+
*
|
|
1814
|
+
* @example
|
|
1815
|
+
* import { initUIConfig } from '@officesdk/design';
|
|
1816
|
+
* import { lightTheme } from '@officesdk/design/theme';
|
|
1817
|
+
* import { iconRegistry } from '@officesdk/design/icons';
|
|
1818
|
+
*
|
|
1819
|
+
* // Initialize before React app starts
|
|
1820
|
+
* initUIConfig({
|
|
1821
|
+
* theme: lightTheme,
|
|
1822
|
+
* icons: iconRegistry,
|
|
1823
|
+
* toast: {
|
|
1824
|
+
* maxCount: 5,
|
|
1825
|
+
* defaultDuration: 3000,
|
|
1826
|
+
* },
|
|
1827
|
+
* });
|
|
1828
|
+
*
|
|
1829
|
+
* // Now you can use components without UIConfigProvider
|
|
1830
|
+
* function App() {
|
|
1831
|
+
* return <Button>Click me</Button>;
|
|
1832
|
+
* }
|
|
1833
|
+
*
|
|
1834
|
+
* @example
|
|
1835
|
+
* // Useful for Modal scenarios - no need to nest Provider
|
|
1836
|
+
* function Modal({ children }) {
|
|
1837
|
+
* return (
|
|
1838
|
+
* <Portal>
|
|
1839
|
+
* {children}
|
|
1840
|
+
* </Portal>
|
|
1841
|
+
* );
|
|
1842
|
+
* }
|
|
1843
|
+
*
|
|
1844
|
+
* @example
|
|
1845
|
+
* // Can be called multiple times to update config
|
|
1846
|
+
* initUIConfig({ theme: lightTheme });
|
|
1847
|
+
* // Later update icons
|
|
1848
|
+
* initUIConfig({ theme: lightTheme, icons: newIconRegistry });
|
|
1849
|
+
*/
|
|
1850
|
+
declare const initUIConfig: (config: UIConfig) => void;
|
|
1851
|
+
/**
|
|
1852
|
+
* Get global UI configuration
|
|
1853
|
+
*/
|
|
1854
|
+
declare const getUIConfig: () => UIConfig | null;
|
|
1855
|
+
/**
|
|
1856
|
+
* Get global icon registry
|
|
1857
|
+
*/
|
|
1858
|
+
declare const getGlobalIconRegistry: () => Record<string, React$1.ComponentType<React$1.SVGProps<SVGSVGElement>>> | null;
|
|
1859
|
+
/**
|
|
1860
|
+
* Get global toast config
|
|
1861
|
+
*/
|
|
1862
|
+
declare const getGlobalToastConfig: () => {
|
|
1863
|
+
maxCount?: number;
|
|
1864
|
+
defaultDuration?: number;
|
|
1865
|
+
} | null;
|
|
1866
|
+
|
|
1867
|
+
declare const styled: ThemedStyledInterface<Theme>;
|
|
1868
|
+
|
|
1869
|
+
declare const getGlobalTheme: () => Theme;
|
|
1870
|
+
|
|
1871
|
+
export { type A11yConfig, type AnimationConfig, Button, type ButtonProps, Checkbox, type CheckboxProps, Dropdown, DropdownButton, type DropdownButtonProps, DropdownGlobalStyles, type DropdownProps, type I18nConfig, Icon, type IconComponent, type IconProps, IconProvider, type IconProviderProps, type IconRegistry, Input, type InputProps, Loading, type LoadingProps, Menu, type MenuDivider, MenuGlobalStyles, type MenuGroup, type MenuItem, type MenuItemType, type MenuProps, Modal, ModalGlobalStyles, type ModalProps, NumberInput, type NumberInputProps, Radio, type RadioProps, SearchInput, type SearchInputProps, Slider, type SliderProps, SpinButton, type SpinButtonProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Toast, type ToastConfig, ToastContainer, type ToastContainerConfig, type ToastContainerProps, type ToastPosition, type ToastProps, ToolbarButton, type ToolbarButtonProps, Tooltip, type TooltipProps, type UIConfig, UIConfigProvider, type UIConfigProviderProps, UnderlinedInput, type InputProps as UnderlinedInputProps, type ZIndexConfig, createUIConfig, getGlobalIconRegistry, getGlobalTheme, getGlobalToastConfig, getUIConfig, initUIConfig, mergeUIConfig, styled, toast, useIconRegistry, useToast, useUIConfig };
|