@xinghunm/compass-ui 0.8.0 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -808,6 +808,108 @@ interface DropdownProps {
808
808
 
809
809
  declare const Dropdown: React__default.FC<DropdownProps>;
810
810
 
811
+ type TooltipPlacement = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
812
+ interface TooltipClassNames {
813
+ /**
814
+ * Custom class name for the trigger root.
815
+ */
816
+ root?: string;
817
+ /**
818
+ * Custom class name for the floating overlay container.
819
+ */
820
+ overlay?: string;
821
+ /**
822
+ * Custom class name for the tooltip content node.
823
+ */
824
+ content?: string;
825
+ /**
826
+ * Custom class name for the tooltip arrow node.
827
+ */
828
+ arrow?: string;
829
+ }
830
+ interface TooltipStyles {
831
+ /**
832
+ * Inline style applied to the trigger root.
833
+ */
834
+ root?: React__default.CSSProperties;
835
+ /**
836
+ * Inline style applied to the floating overlay container.
837
+ */
838
+ overlay?: React__default.CSSProperties;
839
+ /**
840
+ * Inline style applied to the tooltip content node.
841
+ */
842
+ content?: React__default.CSSProperties;
843
+ /**
844
+ * Inline style applied to the tooltip arrow node.
845
+ */
846
+ arrow?: React__default.CSSProperties;
847
+ }
848
+ interface TooltipProps {
849
+ /**
850
+ * Tooltip content
851
+ */
852
+ content?: React__default.ReactNode;
853
+ /**
854
+ * Trigger element. Fragment and non-element nodes will be wrapped with a span.
855
+ */
856
+ children: React__default.ReactNode;
857
+ /**
858
+ * Trigger mode
859
+ * @default 'hover'
860
+ */
861
+ trigger?: 'hover' | 'click';
862
+ /**
863
+ * Tooltip placement
864
+ * @default 'top'
865
+ */
866
+ placement?: TooltipPlacement;
867
+ /**
868
+ * Controlled open state
869
+ */
870
+ open?: boolean;
871
+ /**
872
+ * Default open state
873
+ */
874
+ defaultOpen?: boolean;
875
+ /**
876
+ * Callback when open state changes
877
+ */
878
+ onOpenChange?: (open: boolean) => void;
879
+ /**
880
+ * Whether the tooltip is disabled
881
+ */
882
+ disabled?: boolean;
883
+ /**
884
+ * Mouse enter delay in ms
885
+ * @default 0
886
+ */
887
+ mouseEnterDelay?: number;
888
+ /**
889
+ * Mouse leave delay in ms
890
+ * @default 100
891
+ */
892
+ mouseLeaveDelay?: number;
893
+ /**
894
+ * Custom root element class name
895
+ */
896
+ className?: string;
897
+ /**
898
+ * Custom root element style
899
+ */
900
+ style?: React__default.CSSProperties;
901
+ /**
902
+ * Semantic class names
903
+ */
904
+ classNames?: TooltipClassNames;
905
+ /**
906
+ * Semantic styles
907
+ */
908
+ styles?: TooltipStyles;
909
+ }
910
+
911
+ declare const Tooltip: React__default.FC<TooltipProps>;
912
+
811
913
  interface InputFieldProps extends Omit<React__default.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'> {
812
914
  /**
813
915
  * The type of input.
@@ -1059,7 +1161,7 @@ interface ModalBaseProps {
1059
1161
  };
1060
1162
  }
1061
1163
 
1062
- declare const Modal: (props: ModalBaseProps) => React__default.ReactPortal;
1164
+ declare const Modal: (props: ModalBaseProps) => React__default.ReactPortal | null;
1063
1165
 
1064
1166
  interface ModalFuncProps extends Omit<ModalBaseProps, 'isOpen' | 'children'> {
1065
1167
  title?: React__default.ReactNode;
@@ -1322,6 +1424,7 @@ interface Theme {
1322
1424
  progress: ProgressTheme;
1323
1425
  steps: StepsTheme;
1324
1426
  input: InputTheme;
1427
+ tooltip: TooltipTheme;
1325
1428
  dropdown: DropdownTheme;
1326
1429
  menu: MenuTheme;
1327
1430
  datePicker: DatePickerTheme;
@@ -1540,6 +1643,16 @@ interface InputTheme {
1540
1643
  activeBorderColor: string;
1541
1644
  hoverBorderColor: string;
1542
1645
  }
1646
+ interface TooltipTheme {
1647
+ zIndex: number;
1648
+ backgroundColor: string;
1649
+ contentColor: string;
1650
+ boxShadow: string;
1651
+ borderRadius: string;
1652
+ padding: string;
1653
+ maxWidth: string;
1654
+ fontSize: string;
1655
+ }
1543
1656
  interface DropdownTheme {
1544
1657
  zIndex: number;
1545
1658
  backgroundColor: string;
@@ -1551,6 +1664,15 @@ type ThemeMode = 'light' | 'dark';
1551
1664
  type DeepPartial<T> = {
1552
1665
  [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
1553
1666
  };
1667
+ interface ThemeProviderProps {
1668
+ children: React__default.ReactNode;
1669
+ theme?: DeepPartial<Theme>;
1670
+ lightTheme?: DeepPartial<Theme>;
1671
+ darkTheme?: DeepPartial<Theme>;
1672
+ defaultMode?: ThemeMode;
1673
+ /** Whether to inject CSS variables to :root. Defaults to true. */
1674
+ global?: boolean;
1675
+ }
1554
1676
 
1555
1677
  interface ModalLocale {
1556
1678
  okText: string;
@@ -1642,6 +1764,15 @@ interface ConfigProviderProps {
1642
1764
 
1643
1765
  declare const ConfigProvider: React__default.FC<ConfigProviderProps>;
1644
1766
 
1767
+ interface ThemeContextType {
1768
+ mode: ThemeMode;
1769
+ setMode: (mode: ThemeMode) => void;
1770
+ toggleTheme: () => void;
1771
+ theme: Theme;
1772
+ }
1773
+ declare const ThemeProvider: React__default.FC<ThemeProviderProps>;
1774
+ declare const useTheme: () => ThemeContextType;
1775
+
1645
1776
  interface InputNumberProps extends Omit<InputFieldProps, 'onChange' | 'value' | 'defaultValue' | 'type' | 'allowClear'> {
1646
1777
  /**
1647
1778
  * The current value.
@@ -1953,4 +2084,4 @@ type TabsComponent = typeof Tabs & {
1953
2084
  };
1954
2085
  declare const _default: TabsComponent;
1955
2086
 
1956
- export { AutoComplete, type AutoCompleteOption, type AutoCompleteProps, Button, type ButtonProps, type ColumnType, ConfigProvider, type ConfigProviderProps, type DataNode, DatePicker, type DatePickerProps, type DateRangePickerProps, Dropdown, type DropdownProps, type FieldData, Form, type FormInstance, type FormItemProps, type FormProps, InputField, type InputFieldProps, InputNumber, type InputNumberProps, type ItemType, Menu, type MenuItemProps, type MenuProps, messageWithHook as Message, type MessageProps, ModalWithStatics as Modal, type ModalBaseProps as ModalProps, type NamePath, Pagination, type PaginationProps, Progress, type ProgressProps, type RowSelection, Select, type SelectOption, type SelectProps, type SelectValue, Steps, type StepsProps, type TabItem, type TabPaneProps, Table, type TableProps, _default as Tabs, type TabsProps, Tree, type TreeNodeProps, type TreeProps, TreeSelect, type TreeSelectProps, type ValidateErrorEntity };
2087
+ export { AutoComplete, type AutoCompleteOption, type AutoCompleteProps, Button, type ButtonProps, type ColumnType, ConfigProvider, type ConfigProviderProps, type DataNode, DatePicker, type DatePickerProps, type DateRangePickerProps, type DeepPartial, Dropdown, type DropdownProps, type FieldData, Form, type FormInstance, type FormItemProps, type FormProps, InputField, type InputFieldProps, InputNumber, type InputNumberProps, type ItemType, Menu, type MenuItemProps, type MenuProps, messageWithHook as Message, type MessageProps, ModalWithStatics as Modal, type ModalBaseProps as ModalProps, type NamePath, Pagination, type PaginationProps, Progress, type ProgressProps, type RowSelection, Select, type SelectOption, type SelectProps, type SelectValue, Steps, type StepsProps, type TabItem, type TabPaneProps, Table, type TableProps, _default as Tabs, type TabsProps, type Theme, type ThemeMode, ThemeProvider, type ThemeProviderProps, Tooltip, type TooltipPlacement, type TooltipProps, Tree, type TreeNodeProps, type TreeProps, TreeSelect, type TreeSelectProps, type ValidateErrorEntity, useTheme };
package/dist/index.d.ts CHANGED
@@ -808,6 +808,108 @@ interface DropdownProps {
808
808
 
809
809
  declare const Dropdown: React__default.FC<DropdownProps>;
810
810
 
811
+ type TooltipPlacement = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
812
+ interface TooltipClassNames {
813
+ /**
814
+ * Custom class name for the trigger root.
815
+ */
816
+ root?: string;
817
+ /**
818
+ * Custom class name for the floating overlay container.
819
+ */
820
+ overlay?: string;
821
+ /**
822
+ * Custom class name for the tooltip content node.
823
+ */
824
+ content?: string;
825
+ /**
826
+ * Custom class name for the tooltip arrow node.
827
+ */
828
+ arrow?: string;
829
+ }
830
+ interface TooltipStyles {
831
+ /**
832
+ * Inline style applied to the trigger root.
833
+ */
834
+ root?: React__default.CSSProperties;
835
+ /**
836
+ * Inline style applied to the floating overlay container.
837
+ */
838
+ overlay?: React__default.CSSProperties;
839
+ /**
840
+ * Inline style applied to the tooltip content node.
841
+ */
842
+ content?: React__default.CSSProperties;
843
+ /**
844
+ * Inline style applied to the tooltip arrow node.
845
+ */
846
+ arrow?: React__default.CSSProperties;
847
+ }
848
+ interface TooltipProps {
849
+ /**
850
+ * Tooltip content
851
+ */
852
+ content?: React__default.ReactNode;
853
+ /**
854
+ * Trigger element. Fragment and non-element nodes will be wrapped with a span.
855
+ */
856
+ children: React__default.ReactNode;
857
+ /**
858
+ * Trigger mode
859
+ * @default 'hover'
860
+ */
861
+ trigger?: 'hover' | 'click';
862
+ /**
863
+ * Tooltip placement
864
+ * @default 'top'
865
+ */
866
+ placement?: TooltipPlacement;
867
+ /**
868
+ * Controlled open state
869
+ */
870
+ open?: boolean;
871
+ /**
872
+ * Default open state
873
+ */
874
+ defaultOpen?: boolean;
875
+ /**
876
+ * Callback when open state changes
877
+ */
878
+ onOpenChange?: (open: boolean) => void;
879
+ /**
880
+ * Whether the tooltip is disabled
881
+ */
882
+ disabled?: boolean;
883
+ /**
884
+ * Mouse enter delay in ms
885
+ * @default 0
886
+ */
887
+ mouseEnterDelay?: number;
888
+ /**
889
+ * Mouse leave delay in ms
890
+ * @default 100
891
+ */
892
+ mouseLeaveDelay?: number;
893
+ /**
894
+ * Custom root element class name
895
+ */
896
+ className?: string;
897
+ /**
898
+ * Custom root element style
899
+ */
900
+ style?: React__default.CSSProperties;
901
+ /**
902
+ * Semantic class names
903
+ */
904
+ classNames?: TooltipClassNames;
905
+ /**
906
+ * Semantic styles
907
+ */
908
+ styles?: TooltipStyles;
909
+ }
910
+
911
+ declare const Tooltip: React__default.FC<TooltipProps>;
912
+
811
913
  interface InputFieldProps extends Omit<React__default.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'> {
812
914
  /**
813
915
  * The type of input.
@@ -1059,7 +1161,7 @@ interface ModalBaseProps {
1059
1161
  };
1060
1162
  }
1061
1163
 
1062
- declare const Modal: (props: ModalBaseProps) => React__default.ReactPortal;
1164
+ declare const Modal: (props: ModalBaseProps) => React__default.ReactPortal | null;
1063
1165
 
1064
1166
  interface ModalFuncProps extends Omit<ModalBaseProps, 'isOpen' | 'children'> {
1065
1167
  title?: React__default.ReactNode;
@@ -1322,6 +1424,7 @@ interface Theme {
1322
1424
  progress: ProgressTheme;
1323
1425
  steps: StepsTheme;
1324
1426
  input: InputTheme;
1427
+ tooltip: TooltipTheme;
1325
1428
  dropdown: DropdownTheme;
1326
1429
  menu: MenuTheme;
1327
1430
  datePicker: DatePickerTheme;
@@ -1540,6 +1643,16 @@ interface InputTheme {
1540
1643
  activeBorderColor: string;
1541
1644
  hoverBorderColor: string;
1542
1645
  }
1646
+ interface TooltipTheme {
1647
+ zIndex: number;
1648
+ backgroundColor: string;
1649
+ contentColor: string;
1650
+ boxShadow: string;
1651
+ borderRadius: string;
1652
+ padding: string;
1653
+ maxWidth: string;
1654
+ fontSize: string;
1655
+ }
1543
1656
  interface DropdownTheme {
1544
1657
  zIndex: number;
1545
1658
  backgroundColor: string;
@@ -1551,6 +1664,15 @@ type ThemeMode = 'light' | 'dark';
1551
1664
  type DeepPartial<T> = {
1552
1665
  [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
1553
1666
  };
1667
+ interface ThemeProviderProps {
1668
+ children: React__default.ReactNode;
1669
+ theme?: DeepPartial<Theme>;
1670
+ lightTheme?: DeepPartial<Theme>;
1671
+ darkTheme?: DeepPartial<Theme>;
1672
+ defaultMode?: ThemeMode;
1673
+ /** Whether to inject CSS variables to :root. Defaults to true. */
1674
+ global?: boolean;
1675
+ }
1554
1676
 
1555
1677
  interface ModalLocale {
1556
1678
  okText: string;
@@ -1642,6 +1764,15 @@ interface ConfigProviderProps {
1642
1764
 
1643
1765
  declare const ConfigProvider: React__default.FC<ConfigProviderProps>;
1644
1766
 
1767
+ interface ThemeContextType {
1768
+ mode: ThemeMode;
1769
+ setMode: (mode: ThemeMode) => void;
1770
+ toggleTheme: () => void;
1771
+ theme: Theme;
1772
+ }
1773
+ declare const ThemeProvider: React__default.FC<ThemeProviderProps>;
1774
+ declare const useTheme: () => ThemeContextType;
1775
+
1645
1776
  interface InputNumberProps extends Omit<InputFieldProps, 'onChange' | 'value' | 'defaultValue' | 'type' | 'allowClear'> {
1646
1777
  /**
1647
1778
  * The current value.
@@ -1953,4 +2084,4 @@ type TabsComponent = typeof Tabs & {
1953
2084
  };
1954
2085
  declare const _default: TabsComponent;
1955
2086
 
1956
- export { AutoComplete, type AutoCompleteOption, type AutoCompleteProps, Button, type ButtonProps, type ColumnType, ConfigProvider, type ConfigProviderProps, type DataNode, DatePicker, type DatePickerProps, type DateRangePickerProps, Dropdown, type DropdownProps, type FieldData, Form, type FormInstance, type FormItemProps, type FormProps, InputField, type InputFieldProps, InputNumber, type InputNumberProps, type ItemType, Menu, type MenuItemProps, type MenuProps, messageWithHook as Message, type MessageProps, ModalWithStatics as Modal, type ModalBaseProps as ModalProps, type NamePath, Pagination, type PaginationProps, Progress, type ProgressProps, type RowSelection, Select, type SelectOption, type SelectProps, type SelectValue, Steps, type StepsProps, type TabItem, type TabPaneProps, Table, type TableProps, _default as Tabs, type TabsProps, Tree, type TreeNodeProps, type TreeProps, TreeSelect, type TreeSelectProps, type ValidateErrorEntity };
2087
+ export { AutoComplete, type AutoCompleteOption, type AutoCompleteProps, Button, type ButtonProps, type ColumnType, ConfigProvider, type ConfigProviderProps, type DataNode, DatePicker, type DatePickerProps, type DateRangePickerProps, type DeepPartial, Dropdown, type DropdownProps, type FieldData, Form, type FormInstance, type FormItemProps, type FormProps, InputField, type InputFieldProps, InputNumber, type InputNumberProps, type ItemType, Menu, type MenuItemProps, type MenuProps, messageWithHook as Message, type MessageProps, ModalWithStatics as Modal, type ModalBaseProps as ModalProps, type NamePath, Pagination, type PaginationProps, Progress, type ProgressProps, type RowSelection, Select, type SelectOption, type SelectProps, type SelectValue, Steps, type StepsProps, type TabItem, type TabPaneProps, Table, type TableProps, _default as Tabs, type TabsProps, type Theme, type ThemeMode, ThemeProvider, type ThemeProviderProps, Tooltip, type TooltipPlacement, type TooltipProps, Tree, type TreeNodeProps, type TreeProps, TreeSelect, type TreeSelectProps, type ValidateErrorEntity, useTheme };