@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.
Files changed (43) hide show
  1. package/dist/components/cjs/index.d.ts +1871 -0
  2. package/dist/components/cjs/index.js +5175 -0
  3. package/dist/components/cjs/index.js.map +1 -0
  4. package/dist/components/esm/index.d.ts +1871 -0
  5. package/dist/components/esm/index.js +5140 -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
@@ -1,996 +0,0 @@
1
- import React from 'react';
2
- import { TooltipProps as TooltipProps$1 } from 'rc-tooltip/lib/Tooltip';
3
-
4
- interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
5
- /**
6
- * Button variant type
7
- */
8
- variant?: 'solid' | 'outlined' | 'text' | 'icon';
9
- /**
10
- * Button color type
11
- * - 'status' is only available for 'text' variant
12
- */
13
- colorType?: 'default' | 'guidance' | 'alert' | 'status';
14
- /**
15
- * Button size
16
- */
17
- size?: 'small' | 'medium' | 'large' | 'extraLarge';
18
- /**
19
- * Whether the button is disabled
20
- */
21
- disabled?: boolean;
22
- /**
23
- * Whether the button is in loading state
24
- */
25
- loading?: boolean;
26
- /**
27
- * Whether the button should take full width of its container
28
- */
29
- fullWidth?: boolean;
30
- /**
31
- * Icon to display before the button text
32
- */
33
- iconBefore?: React.ReactNode;
34
- /**
35
- * Icon to display after the button text
36
- */
37
- iconAfter?: React.ReactNode;
38
- /**
39
- * Whether the icon button should have a border (only for variant='icon')
40
- */
41
- iconBordered?: boolean;
42
- }
43
- /**
44
- * Button Component
45
- *
46
- * @example
47
- * // Basic button
48
- * <Button>button</Button>
49
- *
50
- * @example
51
- * // Button with icons
52
- * <Button iconBefore={<Icon />}>button</Button>
53
- *
54
- * @example
55
- * // Icon-only button
56
- * <Button variant="icon" iconBordered><Icon /></Button>
57
- */
58
- declare const Button: React.FC<ButtonProps>;
59
-
60
- interface SpinButtonProps {
61
- /**
62
- * Current value
63
- */
64
- value?: number;
65
- /**
66
- * Default value
67
- */
68
- defaultValue?: number;
69
- /**
70
- * Minimum value
71
- */
72
- min?: number;
73
- /**
74
- * Maximum value
75
- */
76
- max?: number;
77
- /**
78
- * Step increment/decrement
79
- */
80
- step?: number;
81
- /**
82
- * Size variant
83
- */
84
- size?: 'small' | 'large';
85
- /**
86
- * Whether the input is disabled
87
- */
88
- disabled?: boolean;
89
- /**
90
- * Whether to show alert state (red border)
91
- */
92
- alert?: boolean;
93
- /**
94
- * Whether to show the slider
95
- */
96
- showSlider?: boolean;
97
- /**
98
- * Number of decimal places
99
- */
100
- precision?: number;
101
- /**
102
- * Format the display value
103
- */
104
- formatter?: (value: number) => string;
105
- /**
106
- * Parse the input value
107
- */
108
- parser?: (displayValue: string) => number;
109
- /**
110
- * Callback when value changes
111
- */
112
- onChange?: (value: number | null) => void;
113
- /**
114
- * Custom className
115
- */
116
- className?: string;
117
- /**
118
- * Custom style
119
- */
120
- style?: React.CSSProperties;
121
- }
122
- /**
123
- * SpinButton Component - Spin Button
124
- *
125
- * A numeric input with increment/decrement buttons
126
- *
127
- * @example
128
- * <SpinButton value={35} onChange={(val) => console.log(val)} />
129
- */
130
- declare const SpinButton: React.FC<SpinButtonProps>;
131
-
132
- interface SwitchProps {
133
- /**
134
- * Whether the switch is checked
135
- */
136
- checked?: boolean;
137
- /**
138
- * Default checked state
139
- */
140
- defaultChecked?: boolean;
141
- /**
142
- * Size variant
143
- */
144
- size?: 'small' | 'medium' | 'large';
145
- /**
146
- * Whether the switch is disabled
147
- */
148
- disabled?: boolean;
149
- /**
150
- * Callback when checked state changes
151
- */
152
- onChange?: (checked: boolean) => void;
153
- /**
154
- * Custom className
155
- */
156
- className?: string;
157
- /**
158
- * Custom style
159
- */
160
- style?: React.CSSProperties;
161
- }
162
- /**
163
- * Switch Component
164
- *
165
- * A toggle switch for binary states
166
- *
167
- * @example
168
- * <Switch checked={true} onChange={(checked) => console.log(checked)} />
169
- */
170
- declare const Switch: React.FC<SwitchProps>;
171
-
172
- interface RadioProps {
173
- /**
174
- * Whether the radio is checked
175
- */
176
- checked?: boolean;
177
- /**
178
- * Default checked state
179
- */
180
- defaultChecked?: boolean;
181
- /**
182
- * Whether the radio is disabled
183
- */
184
- disabled?: boolean;
185
- /**
186
- * Value of the radio
187
- */
188
- value?: string | number;
189
- /**
190
- * Name attribute for grouping radios
191
- */
192
- name?: string;
193
- /**
194
- * ID attribute for the radio (used with htmlFor in labels)
195
- */
196
- id?: string;
197
- /**
198
- * Callback when checked state changes
199
- */
200
- onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
201
- /**
202
- * Custom className
203
- */
204
- className?: string;
205
- /**
206
- * Custom style
207
- */
208
- style?: React.CSSProperties;
209
- }
210
- /**
211
- * Radio Component
212
- *
213
- * A radio button for selecting one option from a group
214
- *
215
- * @example
216
- * <Radio checked={true} onChange={(e) => console.log(e.target.checked)} />
217
- */
218
- declare const Radio: React.FC<RadioProps>;
219
-
220
- interface CheckboxProps {
221
- /**
222
- * Whether the checkbox is checked
223
- */
224
- checked?: boolean;
225
- /**
226
- * Default checked state
227
- */
228
- defaultChecked?: boolean;
229
- /**
230
- * Whether the checkbox is in indeterminate state
231
- */
232
- indeterminate?: boolean;
233
- /**
234
- * Whether the checkbox is disabled
235
- */
236
- disabled?: boolean;
237
- /**
238
- * Value of the checkbox
239
- */
240
- value?: string | number;
241
- /**
242
- * Name attribute for the checkbox
243
- */
244
- name?: string;
245
- /**
246
- * ID attribute for the checkbox (used with htmlFor in labels)
247
- */
248
- id?: string;
249
- /**
250
- * Callback when checked state changes
251
- */
252
- onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
253
- /**
254
- * Custom className
255
- */
256
- className?: string;
257
- /**
258
- * Custom style
259
- */
260
- style?: React.CSSProperties;
261
- }
262
- /**
263
- * Checkbox Component
264
- *
265
- * A checkbox for selecting multiple options
266
- *
267
- * @example
268
- * <Checkbox checked={true} onChange={(e) => console.log(e.target.checked)} />
269
- *
270
- * @example
271
- * // Indeterminate state
272
- * <Checkbox indeterminate={true} />
273
- */
274
- declare const Checkbox: React.FC<CheckboxProps>;
275
-
276
- interface SliderProps {
277
- /**
278
- * Current value (0-100)
279
- */
280
- value?: number;
281
- /**
282
- * Default value
283
- */
284
- defaultValue?: number;
285
- /**
286
- * Minimum value
287
- */
288
- min?: number;
289
- /**
290
- * Maximum value
291
- */
292
- max?: number;
293
- /**
294
- * Step increment
295
- */
296
- step?: number;
297
- /**
298
- * Whether the slider is disabled
299
- */
300
- disabled?: boolean;
301
- /**
302
- * Callback when value changes
303
- */
304
- onChange?: (value: number) => void;
305
- /**
306
- * Callback when dragging starts
307
- */
308
- onDragStart?: () => void;
309
- /**
310
- * Callback when dragging ends
311
- */
312
- onDragEnd?: () => void;
313
- /**
314
- * Custom className
315
- */
316
- className?: string;
317
- /**
318
- * Custom style
319
- */
320
- style?: React.CSSProperties;
321
- }
322
- /**
323
- * Slider Component
324
- *
325
- * A slider for selecting a value from a range
326
- *
327
- * @example
328
- * <Slider value={35} onChange={(val) => console.log(val)} />
329
- */
330
- declare const Slider: React.FC<SliderProps>;
331
-
332
- type InputSize = 'small' | 'medium' | 'large' | 'extraLarge';
333
- interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'> {
334
- /**
335
- * Input size
336
- */
337
- size?: InputSize;
338
- /**
339
- * Whether the input has an error state
340
- */
341
- error?: boolean;
342
- /**
343
- * Whether the input is in readonly mode
344
- */
345
- readOnly?: boolean;
346
- /**
347
- * Node to display before the input
348
- */
349
- prefixNode?: React.ReactNode;
350
- /**
351
- * Node to display after the input
352
- */
353
- suffixNode?: React.ReactNode;
354
- /**
355
- * Custom className
356
- */
357
- className?: string;
358
- /**
359
- * Custom inline styles
360
- */
361
- style?: React.CSSProperties;
362
- }
363
- /**
364
- * Input Component
365
- *
366
- * @example
367
- * // Basic input
368
- * <Input placeholder="Enter text" />
369
- *
370
- * @example
371
- * // Input with prefix and suffix
372
- * <Input prefixNode={<SearchIcon />} suffixNode={<CloseIcon />} />
373
- *
374
- * @example
375
- * // Input with error state
376
- * <Input error placeholder="Enter text" />
377
- */
378
- declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
379
-
380
- interface SearchInputProps extends Omit<InputProps, 'size' | 'prefixNode'> {
381
- /**
382
- * SearchInput size (only medium and large)
383
- */
384
- size?: 'extraLarge' | 'large';
385
- /**
386
- * Whether to show the clear button when input has value
387
- */
388
- clearable?: boolean;
389
- /**
390
- * Callback when clear button is clicked
391
- */
392
- onClear?: () => void;
393
- /**
394
- * Custom search icon
395
- */
396
- searchIcon?: React.ReactNode;
397
- }
398
- /**
399
- * SearchInput Component
400
- *
401
- * @example
402
- * // Basic search input
403
- * <SearchInput placeholder="Search..." />
404
- *
405
- * @example
406
- * // Search input with clearable
407
- * <SearchInput clearable onClear={() => console.log('cleared')} />
408
- *
409
- * @example
410
- * // Large search input
411
- * <SearchInput size="large" placeholder="Search..." />
412
- */
413
- declare const SearchInput: React.ForwardRefExoticComponent<SearchInputProps & React.RefAttributes<HTMLInputElement>>;
414
-
415
- interface NumberInputProps {
416
- /**
417
- * Current value
418
- */
419
- value?: number;
420
- /**
421
- * Default value
422
- */
423
- defaultValue?: number;
424
- /**
425
- * Minimum value
426
- */
427
- min?: number;
428
- /**
429
- * Maximum value
430
- */
431
- max?: number;
432
- /**
433
- * Step increment/decrement
434
- */
435
- step?: number;
436
- /**
437
- * Size variant
438
- */
439
- size?: 'small' | 'large';
440
- /**
441
- * Whether the input is disabled
442
- */
443
- disabled?: boolean;
444
- /**
445
- * Whether to show alert state (red border)
446
- */
447
- alert?: boolean;
448
- /**
449
- * Number of decimal places
450
- */
451
- precision?: number;
452
- /**
453
- * Format the display value
454
- */
455
- formatter?: (value: number) => string;
456
- /**
457
- * Parse the input value
458
- */
459
- parser?: (displayValue: string) => number;
460
- /**
461
- * Unit text to display after the input
462
- */
463
- unit?: string;
464
- /**
465
- * Callback when value changes
466
- */
467
- onChange?: (value: number | null) => void;
468
- /**
469
- * Custom className
470
- */
471
- className?: string;
472
- /**
473
- * Custom style
474
- */
475
- style?: React.CSSProperties;
476
- }
477
- /**
478
- * NumberInput Component
479
- *
480
- * A numeric input with increment/decrement buttons
481
- *
482
- * @example
483
- * <NumberInput value={35} onChange={(val) => console.log(val)} />
484
- */
485
- declare const NumberInput: React.FC<NumberInputProps>;
486
-
487
- interface IconProps {
488
- /**
489
- * Icon name from registry (requires IconProvider)
490
- */
491
- name?: string;
492
- /**
493
- * Image URL for icon (e.g., PNG, JPG, or external SVG)
494
- */
495
- src?: string;
496
- /**
497
- * Custom icon element (takes precedence over name and src)
498
- */
499
- children?: React.ReactNode;
500
- /**
501
- * Size of the icon (px)
502
- */
503
- size?: number | string;
504
- /**
505
- * Color of the icon (only works with SVG icons, not image src)
506
- */
507
- color?: string;
508
- /**
509
- * Alt text for image icons
510
- */
511
- alt?: string;
512
- /**
513
- * Custom className
514
- */
515
- className?: string;
516
- /**
517
- * Custom style
518
- */
519
- style?: React.CSSProperties;
520
- /**
521
- * Click handler
522
- */
523
- onClick?: (e: React.MouseEvent) => void;
524
- }
525
- /**
526
- * Icon Component
527
- *
528
- * Renders icons from multiple sources with priority: children > src > name
529
- *
530
- * @example
531
- * // Using with IconProvider and registry
532
- * <Icon name="close" size={16} />
533
- *
534
- * @example
535
- * // Using with image URL
536
- * <Icon src="/icons/custom-icon.svg" size={24} />
537
- *
538
- * @example
539
- * // Using with custom icon element
540
- * <Icon><CustomSvg /></Icon>
541
- *
542
- * @example
543
- * // Using with imported icon component
544
- * import { CloseIcon } from '@officesdk/design/icons';
545
- * <Icon><CloseIcon /></Icon>
546
- */
547
- declare const Icon: React.FC<IconProps>;
548
-
549
- type IconComponent = React.ComponentType<React.SVGProps<SVGSVGElement>>;
550
- type IconRegistry = Record<string, IconComponent>;
551
- interface IconProviderProps {
552
- /**
553
- * Icon registry mapping icon names to React components
554
- * Import from @officesdk/design/icons
555
- */
556
- icons: IconRegistry;
557
- /**
558
- * Children components
559
- */
560
- children: React.ReactNode;
561
- }
562
- /**
563
- * IconProvider Component
564
- *
565
- * Provides icon registry to child components via Context
566
- *
567
- * @example
568
- * import { IconProvider } from '@officesdk/design';
569
- * import { iconRegistry } from '@officesdk/design/icons';
570
- *
571
- * <IconProvider icons={iconRegistry}>
572
- * <App />
573
- * </IconProvider>
574
- */
575
- declare const IconProvider: React.FC<IconProviderProps>;
576
- /**
577
- * Hook to access icon registry from context
578
- */
579
- declare const useIconRegistry: () => IconRegistry | null;
580
-
581
- interface ToastProps {
582
- /**
583
- * Toast variant type
584
- */
585
- variant?: 'success' | 'info' | 'error' | 'warn';
586
- /**
587
- * Toast message content
588
- */
589
- message: string;
590
- /**
591
- * Optional action button text
592
- */
593
- actionText?: string;
594
- /**
595
- * Action button click handler
596
- */
597
- onAction?: () => void;
598
- /**
599
- * Whether to show close button
600
- */
601
- closable?: boolean;
602
- /**
603
- * Close button click handler
604
- */
605
- onClose?: () => void;
606
- /**
607
- * Auto close duration in milliseconds (0 to disable)
608
- */
609
- duration?: number;
610
- /**
611
- * Custom icon (overrides default variant icon)
612
- */
613
- icon?: React.ReactNode;
614
- /**
615
- * Whether to show icon
616
- */
617
- showIcon?: boolean;
618
- /**
619
- * Custom className
620
- */
621
- className?: string;
622
- /**
623
- * Custom style
624
- */
625
- style?: React.CSSProperties;
626
- }
627
- /**
628
- * Toast Component
629
- *
630
- * A notification message component with different variants
631
- *
632
- * @example
633
- * <Toast variant="success" message="Operation successful!" />
634
- *
635
- * @example
636
- * <Toast
637
- * variant="info"
638
- * message="New update available"
639
- * actionText="Update"
640
- * onAction={() => console.log('Update clicked')}
641
- * closable
642
- * />
643
- */
644
- declare const Toast: React.FC<ToastProps>;
645
-
646
- interface ToastContextValue {
647
- showToast: (props: Omit<ToastProps, 'onClose'>) => string;
648
- hideToast: (id: string) => void;
649
- success: (message: string, options?: Partial<ToastProps>) => string;
650
- info: (message: string, options?: Partial<ToastProps>) => string;
651
- error: (message: string, options?: Partial<ToastProps>) => string;
652
- warn: (message: string, options?: Partial<ToastProps>) => string;
653
- }
654
- interface ToastContainerProps {
655
- /**
656
- * Maximum number of toasts to show at once
657
- */
658
- maxCount?: number;
659
- /**
660
- * Default duration for auto-close (ms)
661
- */
662
- defaultDuration?: number;
663
- /**
664
- * Children components
665
- */
666
- children: React.ReactNode;
667
- }
668
- /**
669
- * ToastContainer Component
670
- *
671
- * Provides toast context and manages toast display
672
- *
673
- * @example
674
- * <ToastContainer>
675
- * <App />
676
- * </ToastContainer>
677
- */
678
- declare const ToastContainer: React.FC<ToastContainerProps>;
679
- /**
680
- * Hook to access toast methods
681
- *
682
- * @example
683
- * const toast = useToast();
684
- * toast.success('Operation successful!');
685
- * toast.error('Something went wrong');
686
- */
687
- declare const useToast: () => ToastContextValue;
688
-
689
- interface TabItem {
690
- /**
691
- * Unique key for the tab
692
- */
693
- key: string;
694
- /**
695
- * Tab label
696
- */
697
- label: string;
698
- /**
699
- * Whether the tab is disabled
700
- */
701
- disabled?: boolean;
702
- /**
703
- * Custom icon
704
- */
705
- icon?: React.ReactNode;
706
- }
707
- interface TabsProps {
708
- /**
709
- * Tab items
710
- */
711
- items: TabItem[];
712
- /**
713
- * Active tab key
714
- */
715
- activeKey?: string;
716
- /**
717
- * Default active tab key
718
- */
719
- defaultActiveKey?: string;
720
- /**
721
- * Tab variant
722
- */
723
- variant?: 'line' | 'card';
724
- /**
725
- * Tab size
726
- */
727
- size?: 'large';
728
- /**
729
- * Callback when tab changes
730
- */
731
- onChange?: (key: string) => void;
732
- /**
733
- * Custom className
734
- */
735
- className?: string;
736
- /**
737
- * Custom style
738
- */
739
- style?: React.CSSProperties;
740
- }
741
- /**
742
- * Tab Component
743
- *
744
- * A tab component with line and card variants
745
- *
746
- * @example
747
- * <Tab
748
- * items={[
749
- * { key: '1', label: 'Tab 1' },
750
- * { key: '2', label: 'Tab 2' },
751
- * ]}
752
- * defaultActiveKey="1"
753
- * />
754
- */
755
- declare const Tabs: React.FC<TabsProps>;
756
-
757
- interface TooltipProps extends Partial<TooltipProps$1> {
758
- /**
759
- * Tooltip content
760
- */
761
- content: React.ReactNode;
762
- /**
763
- * Tooltip variant
764
- */
765
- variant?: 'black' | 'white';
766
- /**
767
- * Tooltip size (only for white variant)
768
- */
769
- size?: 'small' | 'large';
770
- /**
771
- * Children element that triggers the tooltip
772
- */
773
- children: React.ReactElement;
774
- /**
775
- * Function to get the container element for the tooltip
776
- */
777
- getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
778
- }
779
- /**
780
- * Tooltip Component
781
- *
782
- * Note: Coverage for this component may appear lower than expected due to
783
- * styled-components CSS-in-JS template literals (lines 68-200+) which are
784
- * not properly tracked by V8 coverage. The actual component logic is fully tested.
785
- *
786
- * @example
787
- * // Basic black tooltip
788
- * <Tooltip content="Tooltip text">
789
- * <button>Hover me</button>
790
- * </Tooltip>
791
- *
792
- * @example
793
- * // White tooltip with small size
794
- * <Tooltip content="Tooltip text" variant="white" size="small">
795
- * <button>Hover me</button>
796
- * </Tooltip>
797
- *
798
- * @example
799
- * // White tooltip with large size
800
- * <Tooltip content="Complex content" variant="white" size="large">
801
- * <button>Hover me</button>
802
- * </Tooltip>
803
- */
804
- declare const Tooltip: React.FC<TooltipProps>;
805
-
806
- type ToastPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';
807
- interface ToastConfig {
808
- /**
809
- * Maximum number of toasts to show at once
810
- */
811
- maxCount?: number;
812
- /**
813
- * Default duration for auto-close (ms)
814
- */
815
- defaultDuration?: number;
816
- /**
817
- * Toast position on screen
818
- */
819
- position?: ToastPosition;
820
- /**
821
- * Offset from edge (px)
822
- */
823
- offset?: {
824
- x?: number;
825
- y?: number;
826
- };
827
- }
828
- interface ZIndexConfig {
829
- /**
830
- * Z-index for toast notifications
831
- */
832
- toast?: number;
833
- /**
834
- * Z-index for modals
835
- */
836
- modal?: number;
837
- /**
838
- * Z-index for dropdowns
839
- */
840
- dropdown?: number;
841
- /**
842
- * Z-index for tooltips
843
- */
844
- tooltip?: number;
845
- }
846
- interface AnimationConfig {
847
- /**
848
- * Default animation duration (ms)
849
- */
850
- duration?: number;
851
- /**
852
- * Default easing function
853
- */
854
- easing?: string;
855
- /**
856
- * Disable all animations
857
- */
858
- disabled?: boolean;
859
- }
860
- interface A11yConfig {
861
- /**
862
- * Announce messages to screen readers
863
- */
864
- announceMessages?: boolean;
865
- /**
866
- * Show focus visible indicators
867
- */
868
- focusVisible?: boolean;
869
- /**
870
- * Reduce motion for users who prefer it
871
- */
872
- reduceMotion?: boolean;
873
- }
874
- interface I18nConfig {
875
- /**
876
- * Toast messages
877
- */
878
- toast?: {
879
- closeLabel?: string;
880
- };
881
- /**
882
- * Button messages
883
- */
884
- button?: {
885
- loadingText?: string;
886
- };
887
- /**
888
- * Common messages
889
- */
890
- common?: {
891
- confirm?: string;
892
- cancel?: string;
893
- ok?: string;
894
- };
895
- }
896
- interface UIConfig {
897
- /**
898
- * Theme configuration (required)
899
- */
900
- theme: any;
901
- /**
902
- * Icon registry (optional)
903
- */
904
- icons?: IconRegistry;
905
- /**
906
- * Toast configuration
907
- */
908
- toast?: ToastConfig;
909
- /**
910
- * Locale code (e.g., 'zh-CN', 'en-US')
911
- */
912
- locale?: string;
913
- /**
914
- * Internationalization configuration
915
- */
916
- i18n?: I18nConfig;
917
- /**
918
- * Z-index layer management
919
- */
920
- zIndex?: ZIndexConfig;
921
- /**
922
- * Animation configuration
923
- */
924
- animation?: AnimationConfig;
925
- /**
926
- * Accessibility configuration
927
- */
928
- a11y?: A11yConfig;
929
- }
930
-
931
- interface UIConfigProviderProps {
932
- /**
933
- * UI configuration
934
- */
935
- config: UIConfig;
936
- /**
937
- * Children components
938
- */
939
- children: React.ReactNode;
940
- }
941
- /**
942
- * UIConfigProvider Component
943
- *
944
- * Unified provider for all UI components and global configurations
945
- * Includes ThemeProvider, IconProvider, ToastContainer, and other settings
946
- *
947
- * @example
948
- * import { UIConfigProvider } from '@officesdk/design';
949
- * import { lightTheme } from '@officesdk/design/theme';
950
- * import { iconRegistry } from '@officesdk/design/icons';
951
- *
952
- * <UIConfigProvider config={{
953
- * theme: lightTheme,
954
- * icons: iconRegistry,
955
- * toast: {
956
- * defaultDuration: 3000,
957
- * maxCount: 5,
958
- * },
959
- * }}>
960
- * <App />
961
- * </UIConfigProvider>
962
- */
963
- declare const UIConfigProvider: React.FC<UIConfigProviderProps>;
964
- /**
965
- * Hook to access UI configuration
966
- *
967
- * @example
968
- * const config = useUIConfig();
969
- * console.log(config.theme);
970
- * console.log(config.locale);
971
- */
972
- declare const useUIConfig: () => UIConfig;
973
-
974
- /**
975
- * Create UI configuration with default values
976
- *
977
- * @example
978
- * import { createUIConfig } from '@officesdk/design';
979
- * import { lightTheme } from '@officesdk/design/theme';
980
- * import { iconRegistry } from '@officesdk/design/icons';
981
- *
982
- * const config = createUIConfig({
983
- * theme: lightTheme,
984
- * icons: iconRegistry,
985
- * toast: {
986
- * defaultDuration: 3000,
987
- * },
988
- * });
989
- */
990
- declare const createUIConfig: (config: UIConfig) => UIConfig;
991
- /**
992
- * Merge multiple configs (useful for extending base configs)
993
- */
994
- declare const mergeUIConfig: (baseConfig: UIConfig, ...configs: Partial<UIConfig>[]) => UIConfig;
995
-
996
- export { type A11yConfig, type AnimationConfig, Button, type ButtonProps, Checkbox, type CheckboxProps, type I18nConfig, Icon, type IconComponent, type IconProps, IconProvider, type IconProviderProps, type IconRegistry, Input, type InputProps, 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 ToastContainerProps, type ToastPosition, type ToastProps, Tooltip, type TooltipProps, type UIConfig, UIConfigProvider, type UIConfigProviderProps, type ZIndexConfig, createUIConfig, mergeUIConfig, useIconRegistry, useToast, useUIConfig };