@officesdk/design 0.1.3 → 0.1.5

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.
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
2
  import { TooltipProps as TooltipProps$1 } from 'rc-tooltip/lib/Tooltip';
3
+ import { ThemedStyledInterface } from 'styled-components';
4
+ import { CommonThemeConfig } from '@officesdk/editor-sdk-core/shared';
3
5
 
4
6
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
5
7
  /**
@@ -758,7 +760,7 @@ interface TooltipProps extends Partial<TooltipProps$1> {
758
760
  /**
759
761
  * Tooltip content
760
762
  */
761
- content: React.ReactNode;
763
+ content?: React.ReactNode;
762
764
  /**
763
765
  * Tooltip variant
764
766
  */
@@ -803,6 +805,74 @@ interface TooltipProps extends Partial<TooltipProps$1> {
803
805
  */
804
806
  declare const Tooltip: React.FC<TooltipProps>;
805
807
 
808
+ interface ToolbarButtonProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'> {
809
+ /**
810
+ * Whether the button is disabled
811
+ */
812
+ disabled?: boolean;
813
+ /**
814
+ * Whether the button is in active state
815
+ */
816
+ active?: boolean;
817
+ /**
818
+ * Icon to display
819
+ */
820
+ icon?: React.ReactNode;
821
+ /**
822
+ * Label text
823
+ */
824
+ label?: string;
825
+ /**
826
+ * Whether to show dropdown arrow
827
+ */
828
+ hasDropdown?: boolean;
829
+ /**
830
+ * Whether the dropdown section is clickable separately
831
+ */
832
+ splitDropdown?: boolean;
833
+ /**
834
+ * Click handler for main button
835
+ */
836
+ onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
837
+ /**
838
+ * Click handler for dropdown section
839
+ */
840
+ onDropdownClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
841
+ /**
842
+ * Custom className
843
+ */
844
+ className?: string;
845
+ /**
846
+ * Custom style
847
+ */
848
+ style?: React.CSSProperties;
849
+ }
850
+ /**
851
+ * ToolbarButton Component
852
+ *
853
+ * A toolbar button with optional icon, label, and dropdown functionality
854
+ *
855
+ * @example
856
+ * // Icon only button
857
+ * <ToolbarButton icon={<Icon />} />
858
+ *
859
+ * @example
860
+ * // Button with label and dropdown
861
+ * <ToolbarButton icon={<Icon />} label="Format" hasDropdown />
862
+ *
863
+ * @example
864
+ * // Button with split dropdown
865
+ * <ToolbarButton
866
+ * icon={<Icon />}
867
+ * label="Format"
868
+ * hasDropdown
869
+ * splitDropdown
870
+ * onClick={handleClick}
871
+ * onDropdownClick={handleDropdownClick}
872
+ * />
873
+ */
874
+ declare const ToolbarButton: React.FC<ToolbarButtonProps>;
875
+
806
876
  type ToastPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';
807
877
  interface ToastConfig {
808
878
  /**
@@ -993,4 +1063,8 @@ declare const createUIConfig: (config: UIConfig) => UIConfig;
993
1063
  */
994
1064
  declare const mergeUIConfig: (baseConfig: UIConfig, ...configs: Partial<UIConfig>[]) => UIConfig;
995
1065
 
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 };
1066
+ declare const styled: ThemedStyledInterface<CommonThemeConfig>;
1067
+
1068
+ declare const getGlobalTheme: () => Record<string, any>;
1069
+
1070
+ 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, ToolbarButton, type ToolbarButtonProps, Tooltip, type TooltipProps, type UIConfig, UIConfigProvider, type UIConfigProviderProps, type ZIndexConfig, createUIConfig, getGlobalTheme, mergeUIConfig, styled, useIconRegistry, useToast, useUIConfig };