@officesdk/design 0.1.25 → 0.1.27

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.
@@ -3,6 +3,7 @@ import { TooltipProps as TooltipProps$1 } from 'rc-tooltip/lib/Tooltip';
3
3
  import { DropdownProps as DropdownProps$1 } from 'rc-dropdown';
4
4
  import * as styled_components from 'styled-components';
5
5
  import { ThemedStyledInterface } from 'styled-components';
6
+ import { DialogProps } from 'rc-dialog';
6
7
  import { Theme } from '@officesdk/design/theme';
7
8
 
8
9
  interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
@@ -969,7 +970,7 @@ interface TooltipProps extends Omit<Partial<TooltipProps$1>, 'prefixCls'> {
969
970
  */
970
971
  declare const Tooltip: React$1.FC<TooltipProps>;
971
972
 
972
- interface ToolbarButtonProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, 'onClick'> {
973
+ interface ToolbarButtonProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, 'onClick' | 'onDoubleClick'> {
973
974
  /**
974
975
  * Whether the button is disabled
975
976
  */
@@ -977,15 +978,17 @@ interface ToolbarButtonProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>
977
978
  /**
978
979
  * Whether the button is in active state
979
980
  */
980
- active?: boolean;
981
+ isActive?: boolean;
981
982
  /**
982
983
  * Icon to display
984
+ * - If string: image URL
985
+ * - If ReactNode: custom icon component
983
986
  */
984
- icon?: React$1.ReactNode;
987
+ icon?: string | React$1.ReactNode;
985
988
  /**
986
- * Label text
989
+ * Label text or custom node
987
990
  */
988
- label?: string;
991
+ label?: string | React$1.ReactNode;
989
992
  /**
990
993
  * Whether to show dropdown arrow
991
994
  */
@@ -998,6 +1001,10 @@ interface ToolbarButtonProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>
998
1001
  * Click handler for main button
999
1002
  */
1000
1003
  onClick?: (e: React$1.MouseEvent<HTMLButtonElement>) => void;
1004
+ /**
1005
+ * Double click handler for main button
1006
+ */
1007
+ onDoubleClick?: (e: React$1.MouseEvent<HTMLButtonElement>) => void;
1001
1008
  /**
1002
1009
  * Click handler for dropdown section
1003
1010
  */
@@ -1017,14 +1024,22 @@ interface ToolbarButtonProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>
1017
1024
  * A toolbar button with optional icon, label, and dropdown functionality
1018
1025
  *
1019
1026
  * @example
1020
- * // Icon only button
1027
+ * // Icon component
1021
1028
  * <ToolbarButton icon={<Icon />} />
1022
1029
  *
1023
1030
  * @example
1031
+ * // Icon from URL
1032
+ * <ToolbarButton icon="https://example.com/icon.png" />
1033
+ *
1034
+ * @example
1024
1035
  * // Button with label and dropdown
1025
1036
  * <ToolbarButton icon={<Icon />} label="Format" hasDropdown />
1026
1037
  *
1027
1038
  * @example
1039
+ * // Button with custom label node
1040
+ * <ToolbarButton icon={<Icon />} label={<CustomLabel />} />
1041
+ *
1042
+ * @example
1028
1043
  * // Button with split dropdown
1029
1044
  * <ToolbarButton
1030
1045
  * icon={<Icon />}
@@ -1307,6 +1322,146 @@ declare const Dropdown: React$1.FC<DropdownProps>;
1307
1322
  declare const DropdownGlobalStyles: styled_components.GlobalStyleComponent<{}, styled_components.DefaultTheme>;
1308
1323
  declare const MenuGlobalStyles: styled_components.GlobalStyleComponent<{}, styled_components.DefaultTheme>;
1309
1324
 
1325
+ interface ModalProps extends DialogProps {
1326
+ /**
1327
+ * Whether the modal is visible
1328
+ */
1329
+ visible?: boolean;
1330
+ /**
1331
+ * Modal variant type
1332
+ * - 'message': Message dialog (max 400px, min 360px)
1333
+ * - 'functional': Functional dialog (default 640px, max 800px, min 400px)
1334
+ */
1335
+ variant?: 'message' | 'functional';
1336
+ /**
1337
+ * Mask layer type
1338
+ * - 'light': Light mask (rgba(65,70,75,0.5))
1339
+ * - 'dark': Dark mask (rgba(44,48,51,0.8))
1340
+ */
1341
+ maskType?: 'light' | 'dark';
1342
+ /**
1343
+ * Modal title
1344
+ */
1345
+ title?: React$1.ReactNode;
1346
+ /**
1347
+ * Modal width
1348
+ */
1349
+ width?: string | number;
1350
+ /**
1351
+ * Modal height
1352
+ */
1353
+ height?: string | number;
1354
+ /**
1355
+ * Whether to show mask
1356
+ */
1357
+ mask?: boolean;
1358
+ /**
1359
+ * Whether to close modal when clicking mask
1360
+ */
1361
+ maskClosable?: boolean;
1362
+ /**
1363
+ * Whether to show close button
1364
+ */
1365
+ closable?: boolean;
1366
+ /**
1367
+ * OK button text, set to null to hide
1368
+ */
1369
+ okText?: string | null;
1370
+ /**
1371
+ * Cancel button text, set to null to hide
1372
+ */
1373
+ cancelText?: string | null;
1374
+ /**
1375
+ * Whether OK button is disabled
1376
+ */
1377
+ disabledOkButton?: boolean;
1378
+ /**
1379
+ * Custom footer, set to null to hide footer
1380
+ */
1381
+ footer?: React$1.ReactNode;
1382
+ /**
1383
+ * Callback when OK button is clicked
1384
+ */
1385
+ onOk?: (e: React$1.MouseEvent) => void;
1386
+ /**
1387
+ * Callback when Cancel button is clicked or modal is closed
1388
+ */
1389
+ onCancel?: (e: React$1.MouseEvent | React$1.KeyboardEvent) => void;
1390
+ /**
1391
+ * Modal content
1392
+ */
1393
+ children?: React$1.ReactNode;
1394
+ /**
1395
+ * CSS class prefix
1396
+ */
1397
+ prefixCls?: string;
1398
+ /**
1399
+ * Custom className
1400
+ */
1401
+ className?: string;
1402
+ /**
1403
+ * Custom style
1404
+ */
1405
+ style?: React$1.CSSProperties;
1406
+ /**
1407
+ * z-index of the modal
1408
+ */
1409
+ zIndex?: number;
1410
+ /**
1411
+ * Whether to destroy modal on close
1412
+ */
1413
+ destroyOnClose?: boolean;
1414
+ /**
1415
+ * Whether to focus on modal when opened
1416
+ */
1417
+ focusTriggerAfterClose?: boolean;
1418
+ /**
1419
+ * Return the mount node for Modal
1420
+ */
1421
+ getContainer?: () => HTMLElement;
1422
+ }
1423
+ /**
1424
+ * Modal Component
1425
+ *
1426
+ * A dialog component for displaying content in a layer above the page.
1427
+ *
1428
+ * @example
1429
+ * // Basic usage
1430
+ * <Modal
1431
+ * visible={visible}
1432
+ * title="Modal Title"
1433
+ * onOk={handleOk}
1434
+ * onCancel={handleCancel}
1435
+ * >
1436
+ * Modal content
1437
+ * </Modal>
1438
+ *
1439
+ * @example
1440
+ * // Custom footer
1441
+ * <Modal
1442
+ * visible={visible}
1443
+ * title="Custom Footer"
1444
+ * footer={<Button onClick={handleClose}>Close</Button>}
1445
+ * onCancel={handleCancel}
1446
+ * >
1447
+ * Modal content
1448
+ * </Modal>
1449
+ *
1450
+ * @example
1451
+ * // No footer
1452
+ * <Modal
1453
+ * visible={visible}
1454
+ * title="No Footer"
1455
+ * footer={null}
1456
+ * onCancel={handleCancel}
1457
+ * >
1458
+ * Modal content
1459
+ * </Modal>
1460
+ */
1461
+ declare const Modal: React$1.FC<ModalProps>;
1462
+
1463
+ declare const ModalGlobalStyles: any;
1464
+
1310
1465
  type DeepPartial<T extends object> = {
1311
1466
  [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
1312
1467
  };
@@ -1593,4 +1748,4 @@ declare const styled: ThemedStyledInterface<Theme>;
1593
1748
 
1594
1749
  declare const getGlobalTheme: () => Theme;
1595
1750
 
1596
- 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, Menu, type MenuDivider, MenuGlobalStyles, type MenuGroup, type MenuItem, type MenuItemType, type MenuProps, 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 };
1751
+ 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, 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 };