@xinghunm/compass-ui 0.7.1 → 0.8.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.
package/dist/index.d.mts CHANGED
@@ -515,6 +515,10 @@ interface SelectProps {
515
515
  * Custom selected icon in the dropdown menu
516
516
  */
517
517
  menuItemSelectedIcon?: React__default.ReactNode;
518
+ /**
519
+ * Custom popup content renderer. Receives default menu node.
520
+ */
521
+ popupRender?: (menu: React__default.ReactNode) => React__default.ReactNode;
518
522
  }
519
523
  interface OptionProps {
520
524
  value: string | number;
@@ -804,6 +808,108 @@ interface DropdownProps {
804
808
 
805
809
  declare const Dropdown: React__default.FC<DropdownProps>;
806
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
+
807
913
  interface InputFieldProps extends Omit<React__default.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'> {
808
914
  /**
809
915
  * The type of input.
@@ -1318,6 +1424,7 @@ interface Theme {
1318
1424
  progress: ProgressTheme;
1319
1425
  steps: StepsTheme;
1320
1426
  input: InputTheme;
1427
+ tooltip: TooltipTheme;
1321
1428
  dropdown: DropdownTheme;
1322
1429
  menu: MenuTheme;
1323
1430
  datePicker: DatePickerTheme;
@@ -1381,13 +1488,25 @@ interface SelectTheme {
1381
1488
  hoverBorderColor: string;
1382
1489
  activeBorderColor: string;
1383
1490
  placeholderColor: string;
1491
+ dropdownBg: string;
1492
+ dropdownBoxShadow: string;
1493
+ dropdownPadding: string;
1494
+ dropdownZIndex: number;
1495
+ dropdownMaxHeight: string;
1384
1496
  optionSelectedBg: string;
1385
1497
  optionHoverBg: string;
1386
1498
  optionColor: string;
1387
1499
  optionSelectedColor: string;
1500
+ optionPadding: string;
1501
+ optionMinHeight: string;
1502
+ optionFontSize: string;
1388
1503
  tagBg: string;
1389
1504
  tagColor: string;
1390
1505
  tagBorderColor: string;
1506
+ tagHeight: string;
1507
+ tagPadding: string;
1508
+ tagFontSize: string;
1509
+ tagBorderRadius: string;
1391
1510
  padding: {
1392
1511
  sm: string;
1393
1512
  md: string;
@@ -1398,6 +1517,11 @@ interface SelectTheme {
1398
1517
  md: string;
1399
1518
  lg: string;
1400
1519
  };
1520
+ minHeight: {
1521
+ sm: string;
1522
+ md: string;
1523
+ lg: string;
1524
+ };
1401
1525
  }
1402
1526
  interface DatePickerTheme {
1403
1527
  cellWidth: string;
@@ -1519,6 +1643,16 @@ interface InputTheme {
1519
1643
  activeBorderColor: string;
1520
1644
  hoverBorderColor: string;
1521
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
+ }
1522
1656
  interface DropdownTheme {
1523
1657
  zIndex: number;
1524
1658
  backgroundColor: string;
@@ -1707,6 +1841,7 @@ interface FieldEntity {
1707
1841
  onStoreChange: () => void;
1708
1842
  validateRules: (options?: {
1709
1843
  triggerName?: string;
1844
+ validateOnly?: boolean;
1710
1845
  }) => Promise<string[] | null>;
1711
1846
  getNamePath: () => InternalNamePath;
1712
1847
  getErrors: () => string[];
@@ -1729,6 +1864,9 @@ interface ValidateErrorEntity<Values = Record<string, unknown>> {
1729
1864
  }[];
1730
1865
  outOfDate: boolean;
1731
1866
  }
1867
+ interface ValidateFieldsOptions {
1868
+ validateOnly?: boolean;
1869
+ }
1732
1870
  interface InternalHooks {
1733
1871
  registerField: (entity: FieldEntity) => () => void;
1734
1872
  registerWatch: (callback: (namePath: InternalNamePath) => void) => () => void;
@@ -1749,7 +1887,7 @@ interface FormInstance<Values = Record<string, unknown>> {
1749
1887
  setFields: (fields: FieldData[]) => void;
1750
1888
  setFieldValue: (name: NamePath, value: unknown) => void;
1751
1889
  setFieldsValue: (values: RecursivePartial<Values>) => void;
1752
- validateFields: (nameList?: NamePath[]) => Promise<Values>;
1890
+ validateFields: (nameList?: NamePath[] | ValidateFieldsOptions, options?: ValidateFieldsOptions) => Promise<Values>;
1753
1891
  submit: () => void;
1754
1892
  getInternalHooks: (secret: string) => InternalHooks | null;
1755
1893
  }
@@ -1928,4 +2066,4 @@ type TabsComponent = typeof Tabs & {
1928
2066
  };
1929
2067
  declare const _default: TabsComponent;
1930
2068
 
1931
- 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 };
2069
+ 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, Tooltip, type TooltipPlacement, type TooltipProps, Tree, type TreeNodeProps, type TreeProps, TreeSelect, type TreeSelectProps, type ValidateErrorEntity };
package/dist/index.d.ts CHANGED
@@ -515,6 +515,10 @@ interface SelectProps {
515
515
  * Custom selected icon in the dropdown menu
516
516
  */
517
517
  menuItemSelectedIcon?: React__default.ReactNode;
518
+ /**
519
+ * Custom popup content renderer. Receives default menu node.
520
+ */
521
+ popupRender?: (menu: React__default.ReactNode) => React__default.ReactNode;
518
522
  }
519
523
  interface OptionProps {
520
524
  value: string | number;
@@ -804,6 +808,108 @@ interface DropdownProps {
804
808
 
805
809
  declare const Dropdown: React__default.FC<DropdownProps>;
806
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
+
807
913
  interface InputFieldProps extends Omit<React__default.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'> {
808
914
  /**
809
915
  * The type of input.
@@ -1318,6 +1424,7 @@ interface Theme {
1318
1424
  progress: ProgressTheme;
1319
1425
  steps: StepsTheme;
1320
1426
  input: InputTheme;
1427
+ tooltip: TooltipTheme;
1321
1428
  dropdown: DropdownTheme;
1322
1429
  menu: MenuTheme;
1323
1430
  datePicker: DatePickerTheme;
@@ -1381,13 +1488,25 @@ interface SelectTheme {
1381
1488
  hoverBorderColor: string;
1382
1489
  activeBorderColor: string;
1383
1490
  placeholderColor: string;
1491
+ dropdownBg: string;
1492
+ dropdownBoxShadow: string;
1493
+ dropdownPadding: string;
1494
+ dropdownZIndex: number;
1495
+ dropdownMaxHeight: string;
1384
1496
  optionSelectedBg: string;
1385
1497
  optionHoverBg: string;
1386
1498
  optionColor: string;
1387
1499
  optionSelectedColor: string;
1500
+ optionPadding: string;
1501
+ optionMinHeight: string;
1502
+ optionFontSize: string;
1388
1503
  tagBg: string;
1389
1504
  tagColor: string;
1390
1505
  tagBorderColor: string;
1506
+ tagHeight: string;
1507
+ tagPadding: string;
1508
+ tagFontSize: string;
1509
+ tagBorderRadius: string;
1391
1510
  padding: {
1392
1511
  sm: string;
1393
1512
  md: string;
@@ -1398,6 +1517,11 @@ interface SelectTheme {
1398
1517
  md: string;
1399
1518
  lg: string;
1400
1519
  };
1520
+ minHeight: {
1521
+ sm: string;
1522
+ md: string;
1523
+ lg: string;
1524
+ };
1401
1525
  }
1402
1526
  interface DatePickerTheme {
1403
1527
  cellWidth: string;
@@ -1519,6 +1643,16 @@ interface InputTheme {
1519
1643
  activeBorderColor: string;
1520
1644
  hoverBorderColor: string;
1521
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
+ }
1522
1656
  interface DropdownTheme {
1523
1657
  zIndex: number;
1524
1658
  backgroundColor: string;
@@ -1707,6 +1841,7 @@ interface FieldEntity {
1707
1841
  onStoreChange: () => void;
1708
1842
  validateRules: (options?: {
1709
1843
  triggerName?: string;
1844
+ validateOnly?: boolean;
1710
1845
  }) => Promise<string[] | null>;
1711
1846
  getNamePath: () => InternalNamePath;
1712
1847
  getErrors: () => string[];
@@ -1729,6 +1864,9 @@ interface ValidateErrorEntity<Values = Record<string, unknown>> {
1729
1864
  }[];
1730
1865
  outOfDate: boolean;
1731
1866
  }
1867
+ interface ValidateFieldsOptions {
1868
+ validateOnly?: boolean;
1869
+ }
1732
1870
  interface InternalHooks {
1733
1871
  registerField: (entity: FieldEntity) => () => void;
1734
1872
  registerWatch: (callback: (namePath: InternalNamePath) => void) => () => void;
@@ -1749,7 +1887,7 @@ interface FormInstance<Values = Record<string, unknown>> {
1749
1887
  setFields: (fields: FieldData[]) => void;
1750
1888
  setFieldValue: (name: NamePath, value: unknown) => void;
1751
1889
  setFieldsValue: (values: RecursivePartial<Values>) => void;
1752
- validateFields: (nameList?: NamePath[]) => Promise<Values>;
1890
+ validateFields: (nameList?: NamePath[] | ValidateFieldsOptions, options?: ValidateFieldsOptions) => Promise<Values>;
1753
1891
  submit: () => void;
1754
1892
  getInternalHooks: (secret: string) => InternalHooks | null;
1755
1893
  }
@@ -1928,4 +2066,4 @@ type TabsComponent = typeof Tabs & {
1928
2066
  };
1929
2067
  declare const _default: TabsComponent;
1930
2068
 
1931
- 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 };
2069
+ 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, Tooltip, type TooltipPlacement, type TooltipProps, Tree, type TreeNodeProps, type TreeProps, TreeSelect, type TreeSelectProps, type ValidateErrorEntity };