@nimbus-ds/components 5.31.0 → 5.32.0

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.ts CHANGED
@@ -4035,5 +4035,93 @@ export interface SegmentedControlContextValue {
4035
4035
  * @throws Error if not within a SegmentedControl
4036
4036
  */
4037
4037
  export declare const useSegmentedControlContext: () => SegmentedControlContextValue;
4038
+ export interface SplitButtonActionProperties {
4039
+ /**
4040
+ * The content of the action item.
4041
+ * @TJS-type React.ReactNode
4042
+ */
4043
+ children: ReactNode;
4044
+ /**
4045
+ * Optional icon to display before the action text.
4046
+ * @TJS-type React.ReactNode
4047
+ */
4048
+ icon?: ReactNode;
4049
+ /**
4050
+ * Callback function when the action is clicked.
4051
+ * @TJS-type () => void;
4052
+ */
4053
+ onClick?: () => void;
4054
+ /**
4055
+ * Disables the action item.
4056
+ * @default false
4057
+ */
4058
+ disabled?: boolean;
4059
+ }
4060
+ export type SplitButtonActionProps = SplitButtonActionProperties & Pick<BoxProps, "backgroundColor" | "borderWidth" | "display" | "alignItems" | "gap" | "p" | "borderRadius">;
4061
+ declare const SplitButtonAction: React.FC<SplitButtonActionProps>;
4062
+ export interface SplitButtonPrimaryProperties {
4063
+ /**
4064
+ * The content of the primary button.
4065
+ * @TJS-type React.ReactNode
4066
+ */
4067
+ children: ReactNode;
4068
+ /**
4069
+ * Callback function when the primary button is clicked.
4070
+ * @TJS-type () => void;
4071
+ */
4072
+ onClick?: () => void;
4073
+ }
4074
+ export type SplitButtonPrimaryProps = SplitButtonPrimaryProperties & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onClick" | "children">;
4075
+ declare const SplitButtonPrimary: React.FC<SplitButtonPrimaryProps>;
4076
+ export interface SplitButtonSecondaryProperties {
4077
+ /**
4078
+ * The content of the secondary dropdown menu.
4079
+ * @TJS-type React.ReactNode
4080
+ */
4081
+ children: ReactNode;
4082
+ /**
4083
+ * Accessible label for the dropdown button.
4084
+ * @default "Show more actions"
4085
+ */
4086
+ ariaLabel?: string;
4087
+ }
4088
+ export type SplitButtonSecondaryProps = SplitButtonSecondaryProperties & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children">;
4089
+ declare const SplitButtonSecondary: React.FC<SplitButtonSecondaryProps>;
4090
+ export interface SplitButtonComponents {
4091
+ Action: typeof SplitButtonAction;
4092
+ Primary: typeof SplitButtonPrimary;
4093
+ Secondary: typeof SplitButtonSecondary;
4094
+ }
4095
+ export interface SplitButtonProperties {
4096
+ /**
4097
+ * The subcomponents (Primary and Secondary).
4098
+ * @TJS-type React.ReactNode
4099
+ */
4100
+ children: ReactNode;
4101
+ /**
4102
+ * Disables the entire split button.
4103
+ * @default false
4104
+ */
4105
+ disabled?: boolean;
4106
+ /**
4107
+ * Controls the visibility of the popover.
4108
+ */
4109
+ open?: boolean;
4110
+ /**
4111
+ * Callback function to control popover opening and closing.
4112
+ * @TJS-type (open: boolean) => void;
4113
+ */
4114
+ onOpenChange?: (open: boolean) => void;
4115
+ /**
4116
+ * Position of the popover relative to the button.
4117
+ * @default bottom-end
4118
+ */
4119
+ popoverPosition?: PopoverProps["position"];
4120
+ }
4121
+ export type SplitButtonProps = SplitButtonProperties & Omit<BoxProps, "children" | "display" | "gap" | "position">;
4122
+ /**
4123
+ * SplitButton component allows users to perform actions by clicking a primary button and displaying a dropdown menu with additional actions.
4124
+ */
4125
+ export declare const SplitButton: React.FC<SplitButtonProps> & SplitButtonComponents;
4038
4126
 
4039
4127
  export {};