@officesdk/design 0.2.0 → 0.2.1

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