@geckoui/geckoui 1.2.0-beta.2 → 1.3.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.mts CHANGED
@@ -1,10 +1,8 @@
1
1
  import * as react from 'react';
2
- import react__default, { RefObject, InputHTMLAttributes, FC, ReactNode, JSX, ForwardedRef, LabelHTMLAttributes, PropsWithChildren, ButtonHTMLAttributes, DetailedHTMLProps, ReactElement, RefCallback, Dispatch, SetStateAction, HtmlHTMLAttributes, ChangeEvent, HTMLAttributes, JSXElementConstructor, SVGProps } from 'react';
2
+ import react__default, { RefObject, InputHTMLAttributes, FC, ReactNode, JSX, ForwardedRef, LabelHTMLAttributes, PropsWithChildren, ButtonHTMLAttributes, DetailedHTMLProps, ReactElement, RefCallback, Dispatch, SetStateAction, HtmlHTMLAttributes, ChangeEvent, HTMLAttributes, SVGProps } from 'react';
3
3
  import { ControllerProps, Control, FieldValues, ControllerRenderProps, ControllerFieldState, UseFormStateReturn } from 'react-hook-form';
4
4
  import { Placement, Strategy, useFloating } from '@floating-ui/react';
5
5
  import { TextareaAutosizeProps } from 'react-textarea-autosize';
6
- import * as _headlessui_react from '@headlessui/react';
7
- import { SwitchProps as SwitchProps$1, MenuItemsProps as MenuItemsProps$1, MenuButtonProps as MenuButtonProps$1, MenuItemProps as MenuItemProps$1 } from '@headlessui/react';
8
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
9
7
  import { ToasterProps } from 'sonner';
10
8
  export { toast } from 'sonner';
@@ -1556,70 +1554,17 @@ interface RHFTextareaProps extends RHFBaseProps, Omit<TextareaProps, "name" | "o
1556
1554
  */
1557
1555
  declare const RHFTextarea: FC<RHFTextareaProps>;
1558
1556
 
1559
- /** Extensible size map - To allow module augmentation */
1560
1557
  interface SwitchSizeMap {
1561
1558
  sm: unknown;
1562
1559
  md: unknown;
1563
1560
  }
1564
- interface SwitchProps extends Omit<SwitchProps$1, "className"> {
1565
- /**
1566
- * The size of the switch.(default: 'md')
1567
- * */
1561
+ interface SwitchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "size" | "type"> {
1562
+ onChange?: (checked: boolean) => void;
1568
1563
  size?: keyof SwitchSizeMap;
1569
- /**
1570
- * Class name for the switch.
1571
- * */
1572
- className?: string;
1573
- /**
1574
- * Style for the thumb of the switch.
1575
- * */
1576
1564
  thumbClassName?: string;
1577
1565
  }
1578
1566
 
1579
- /**
1580
- * Switch is a toggle component built on HeadlessUI that provides an accessible
1581
- * on/off control. It supports multiple sizes, controlled and uncontrolled modes,
1582
- * and integrates seamlessly with forms.
1583
- *
1584
- * @example
1585
- * Toggle feature in settings:
1586
- *
1587
- * ```tsx
1588
- * const [notificationsEnabled, setNotificationsEnabled] = useState(true);
1589
- *
1590
- * <div className="flex items-center gap-3">
1591
- * <Switch
1592
- * checked={notificationsEnabled}
1593
- * onChange={setNotificationsEnabled}
1594
- * size="md"
1595
- * />
1596
- * <span>Enable email notifications</span>
1597
- * </div>
1598
- * ```
1599
- *
1600
- * @example
1601
- * Uncontrolled with default value:
1602
- *
1603
- * ```tsx
1604
- * <Switch defaultChecked={true} size="lg" />
1605
- * ```
1606
- *
1607
- * @example
1608
- * Custom styling and sizes:
1609
- *
1610
- * ```tsx
1611
- * <Switch
1612
- * checked={darkMode}
1613
- * onChange={toggleDarkMode}
1614
- * size="sm"
1615
- * className="bg-blue-500 data-[checked]:bg-green-600"
1616
- * thumbClassName="shadow-lg"
1617
- * />
1618
- * ```
1619
- *
1620
- * @see https://headlessui.com/react/switch for advanced usage
1621
- */
1622
- declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<null>>;
1567
+ declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLInputElement>>;
1623
1568
 
1624
1569
  interface RHFSwitchProps extends RHFBaseProps, Omit<SwitchProps, "name" | "value"> {
1625
1570
  /**
@@ -3641,118 +3586,132 @@ declare namespace Drawer {
3641
3586
  var dismiss: () => void;
3642
3587
  }
3643
3588
 
3644
- type ReactTag = keyof JSX.IntrinsicElements | JSXElementConstructor<any>;
3645
- type MenuButtonProps<T extends ReactTag> = MenuButtonProps$1<T>;
3646
- type MenuItemsProps<T extends ReactTag> = MenuItemsProps$1<T>;
3647
- type MenuItemProps<T extends ReactTag> = MenuItemProps$1<T>;
3589
+ interface MenuProps extends PropsWithChildren {
3590
+ /**
3591
+ * Text label for the default menu button.
3592
+ * If `MenuTrigger` is provided as a child, this is ignored.
3593
+ */
3594
+ label?: string;
3595
+ /**
3596
+ * Whether the menu is disabled
3597
+ */
3598
+ disabled?: boolean;
3599
+ /**
3600
+ * Placement of the dropdown panel relative to the trigger.
3601
+ * @default "bottom-start"
3602
+ */
3603
+ placement?: Placement;
3604
+ /**
3605
+ * Floating strategy for the dropdown panel
3606
+ */
3607
+ floatingStrategy?: Strategy;
3608
+ /**
3609
+ * Additional class name for the menu wrapper
3610
+ */
3611
+ className?: string;
3612
+ /**
3613
+ * Additional class name for the dropdown panel
3614
+ */
3615
+ menuClassName?: string;
3616
+ /**
3617
+ * Additional class name for the default menu button.
3618
+ * Only applies when no `MenuTrigger` is provided.
3619
+ */
3620
+ buttonClassName?: string;
3621
+ }
3622
+ interface MenuContextProps {
3623
+ open: boolean;
3624
+ setOpen: Dispatch<SetStateAction<boolean>>;
3625
+ floating: ReturnType<typeof useFloating>;
3626
+ openMenu: () => void;
3627
+ closeMenu: () => void;
3628
+ toggleMenu: () => void;
3629
+ disabled: boolean;
3630
+ menuRef: RefObject<HTMLDivElement | null>;
3631
+ }
3648
3632
 
3649
- /**
3650
- * Menu is a styled wrapper around HeadlessUI's Menu for creating dropdown menus and action lists.
3651
- * Provides pre-styled components for building accessible, keyboard-navigable menus.
3652
- * @see https://headlessui.com/react/menu for complete API documentation
3653
- */
3654
- declare const Menu: _headlessui_react._internal_ComponentMenu & {
3655
- Button: _headlessui_react._internal_ComponentMenuButton;
3656
- Items: _headlessui_react._internal_ComponentMenuItems;
3657
- Item: _headlessui_react._internal_ComponentMenuItem;
3658
- Section: _headlessui_react._internal_ComponentMenuSection;
3659
- Heading: _headlessui_react._internal_ComponentMenuHeading;
3660
- Separator: _headlessui_react._internal_ComponentMenuSeparator;
3633
+ declare const Menu: {
3634
+ ({ label, disabled, placement, floatingStrategy, className, menuClassName, buttonClassName, children }: MenuProps): react_jsx_runtime.JSX.Element;
3635
+ displayName: string;
3661
3636
  };
3662
- /**
3663
- * MenuButton triggers the menu dropdown when clicked or activated.
3664
- * Supports polymorphic rendering via the `as` prop.
3665
- * @see https://headlessui.com/react/menu for complete API documentation
3666
- */
3667
- declare const MenuButton: <T extends ReactTag>({ as, ...rest }: MenuButtonProps<T>) => react_jsx_runtime.JSX.Element;
3668
- /**
3669
- * MenuItems contains the dropdown panel with all menu options.
3670
- * Automatically handles positioning, animations, and focus management.
3671
- * @see https://headlessui.com/react/menu for complete API documentation
3672
- */
3673
- declare const MenuItems: <T extends ReactTag>({ as, ...rest }: MenuItemsProps<T>) => react_jsx_runtime.JSX.Element;
3674
- /**
3675
- * MenuItem represents an individual selectable option within the menu.
3676
- * Receives active and disabled states for conditional styling.
3677
- * @see https://headlessui.com/react/menu for complete API documentation
3678
- */
3679
- declare const MenuItem: <T extends ReactTag>({ children, as, ...rest }: MenuItemProps<T>) => react_jsx_runtime.JSX.Element;
3680
- /**
3681
- * MenuHeading displays a non-interactive header within menu sections.
3682
- * @see https://headlessui.com/react/menu for complete API documentation
3683
- */
3684
- declare const MenuHeading: _headlessui_react._internal_ComponentMenuHeading;
3685
- /**
3686
- * MenuSection groups related menu items together under a heading.
3687
- * @see https://headlessui.com/react/menu for complete API documentation
3688
- */
3689
- declare const MenuSection: _headlessui_react._internal_ComponentMenuSection;
3690
- /**
3691
- * MenuSeparator provides a visual divider between menu groups or items.
3692
- * @see https://headlessui.com/react/menu for complete API documentation
3693
- */
3694
- declare const MenuSeparator: _headlessui_react._internal_ComponentMenuSeparator;
3695
3637
 
3696
- type DropdownClassName<T> = string | ((item: T, index: number) => string | undefined);
3697
- interface DropdownItem {
3698
- label: ReactNode | FC;
3638
+ interface MenuItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onClick"> {
3639
+ /**
3640
+ * Text label for the menu item.
3641
+ * Used as the default rendered content if no `children` is provided.
3642
+ */
3643
+ label: string;
3644
+ /**
3645
+ * Whether the menu item is disabled
3646
+ */
3699
3647
  disabled?: boolean;
3648
+ /**
3649
+ * Additional class name for the menu item
3650
+ */
3700
3651
  className?: string;
3652
+ /**
3653
+ * Callback fired when the menu item is clicked.
3654
+ * The menu will close automatically after the callback.
3655
+ */
3701
3656
  onClick?: () => void;
3657
+ /**
3658
+ * Custom content for the menu item.
3659
+ * If not provided, `label` is rendered as text.
3660
+ */
3661
+ children?: ReactNode;
3702
3662
  }
3703
- interface DropdownProps extends PropsWithChildren {
3704
- anchor?: MenuItemsProps<"button">["anchor"];
3663
+
3664
+ declare const MenuItem: {
3665
+ ({ label, disabled, className, onClick, children, ...rest }: MenuItemProps): react_jsx_runtime.JSX.Element;
3666
+ displayName: string;
3667
+ };
3668
+
3669
+ interface MenuTriggerRenderProps {
3705
3670
  /**
3706
- * Items to be displayed in the dropdown
3707
- * */
3708
- items: DropdownItem[];
3671
+ * Whether the menu is currently open
3672
+ */
3673
+ open: boolean;
3709
3674
  /**
3710
- * Additional class name for the dropdown button
3711
- * */
3712
- className?: string;
3675
+ * Open the menu
3676
+ */
3677
+ openMenu: () => void;
3713
3678
  /**
3714
- * Additional class name for the dropdown menu
3715
- * */
3716
- menuClassName?: string;
3679
+ * Close the menu
3680
+ */
3681
+ closeMenu: () => void;
3717
3682
  /**
3718
- * Icon to be displayed on the dropdown button
3719
- * If you want to hide the icon, pass `null`
3720
- * */
3721
- icon?: ReactNode | FC;
3683
+ * Toggle the menu open/closed
3684
+ */
3685
+ toggleMenu: () => void;
3722
3686
  /**
3723
- * Hide the icon on the dropdown button
3724
- * */
3725
- iconClassName?: string;
3687
+ * Whether the menu is disabled
3688
+ */
3689
+ disabled: boolean;
3690
+ }
3691
+ interface MenuTriggerProps {
3726
3692
  /**
3727
- * Hide arrow icon on the dropdown button
3728
- * */
3729
- hideArrowIcon?: boolean;
3730
- [key: `data-${string}`]: string;
3693
+ * Render function that receives menu state and controls.
3694
+ *
3695
+ * @example
3696
+ * ```tsx
3697
+ * <MenuTrigger>
3698
+ * {({ open, toggleMenu }) => (
3699
+ * <button onClick={toggleMenu}>
3700
+ * Actions {open ? '▲' : '▼'}
3701
+ * </button>
3702
+ * )}
3703
+ * </MenuTrigger>
3704
+ * ```
3705
+ */
3706
+ children: (props: MenuTriggerRenderProps) => ReactNode;
3731
3707
  }
3732
3708
 
3733
- /**
3734
- * Fast and easy dropdown component extended from `Menu` and `Button` components.
3735
- * So this won't have much customization options like the `Menu` component.
3736
- * If you think this component is not enough for your use case, you can use the `Menu` component directly.
3737
- *
3738
- * @example
3739
- *
3740
- * ```js
3741
- * import { Dropdown } from "@geckoui/geckoui";
3742
- *
3743
- * const items = [
3744
- * { label: "Item 1", onClick: () => console.log("Item 1 clicked") },
3745
- * { label: "Item 2", onClick: () => console.log("Item 2 clicked") },
3746
- * { label: "Item 3", onClick: () => console.log("Item 3 clicked") },
3747
- * ];
3748
- *
3749
- * <Dropdown items={items} />
3750
- * ```
3751
- * */
3752
- declare function Dropdown({ items, anchor, icon, className, menuClassName, iconClassName, children, hideArrowIcon, ...rest }: DropdownProps): react_jsx_runtime.JSX.Element;
3753
- declare namespace Dropdown {
3754
- var displayName: string;
3755
- }
3709
+ declare const MenuTrigger: {
3710
+ ({ children }: MenuTriggerProps): react.ReactNode;
3711
+ displayName: string;
3712
+ };
3713
+
3714
+ declare const useMenu: () => MenuContextProps;
3756
3715
 
3757
3716
  type BaseIconProps = SVGProps<SVGSVGElement>;
3758
3717
 
@@ -3825,4 +3784,4 @@ declare class FileOnlyPickerHandler extends BaseFilePickerHandler {
3825
3784
 
3826
3785
  declare const FilePicker: typeof FileOnlyPickerHandler;
3827
3786
 
3828
- export { type ActionsArgs, Alert, type AlertProps, type AlertVariantMap, BaseDateRangeInput, type BaseDateRangeInputProps, type BaseSelectProps, Button, type ButtonColorMap, type ButtonProps, type ButtonSizeMap, type ButtonVariantMap, _default as Calendar, type CalendarActiveProps, type CalendarOverload, type CalendarProps, type CalendarRangeModeProps, type CalendarRef, type CalendarSingleModeProps, CalendarType, Checkbox, type CheckboxProps, ConfirmDialog, type ConfirmDialogActionsArgs, type ConfirmDialogContentProps, type ConfirmDialogOptions, CounterInput, type CounterInputProps, type CounterInputSizeMap, type CustomSelectOptionArgs, type CustomSelectOptionBaseArgs, type DataAttributeProps, type DateFormat$1 as DateFormat, DateInput, type DateInputProps, type DateRange, DateRangeInput, type DateRangeInputProps, type DayCellRenderProps, Dialog, type DialogContentProps, type DialogOptions, Drawer, type DrawerPlacementMap, type DrawerProps, Dropdown, type DropdownClassName, type DropdownItem, type DropdownProps, FilePicker, type FilePickerFile, type FilePickerOptions, type FileSize, type FileWithPreview, type FocusedOption, GeckoUIPortal, type GeckoUIPortalProps, Input, InputError, type InputErrorProps, type InputProps, Label, type LabelProps, LoadingButton, type LoadingButtonProps, Menu, MenuButton, type MenuButtonProps, MenuHeading, MenuItem, type MenuItemProps, MenuItems, type MenuItemsProps, MenuSection, MenuSeparator, type MultiSelectProps, type MultiSelectTriggerProps, type MultiSelectTriggerRenderProps, OTPInput, type OTPInputProps, type OpenFilePickerFn, type OpenFilePickerOptions, Pagination, type PaginationProps, type RHFBaseProps, RHFCheckbox, type RHFCheckboxProps, RHFController, RHFCounterInput, type RHFCounterInputProps, RHFCurrencyInput, type RHFCurrencyInputProps, RHFDateInput, type RHFDateInputProps, RHFDateRangeInput, type RHFDateRangeInputProps, RHFError, type RHFErrorProps, type RHFErrorRenderProps, RHFFileInput, type RHFFileInputProps, RHFFilePicker, type RHFFilePickerBaseProps, type RHFFilePickerProps, type RHFFilePickerRenderProps, type RHFFilePickerRendererProps, RHFInput, RHFInputGroup, type RHFInputGroupProps, type RHFInputProps, RHFNumberInput, type RHFNumberInputProps, RHFOTPInput, type RHFOTPInputProps, RHFRadio, type RHFRadioProps, type RHFRenderArgs, RHFSelect, type RHFSelectOverload, type RHFSelectProps, RHFSwitch, type RHFSwitchProps, RHFTextarea, type RHFTextareaProps, Radio, type RadioProps, type ReactTag, Select, SelectConsumer, type SelectConsumerProps, type SelectContextProps, SelectDropdownSearch, SelectEmpty, type SelectEmptyProps, SelectOption, type SelectOptionConfig, type SelectOptionElement, type SelectOptionProps, type SelectOverload, type SelectProps, SelectTrigger, type SelectTriggerBaseRenderProps, type SelectTriggerOverload, type SelectTriggerProps, type SelectionMode, type SingleSelectProps, type SingleSelectTriggerProps, type SingleSelectTriggerRenderProps, Spinner, Switch, type SwitchProps, type SwitchSizeMap, Textarea, type TextareaProps, Tooltip, type TooltipProps, type UseFilePickerOptions, type UseFilePickerReturn, fileToUInt8Array, getDataAttributes, hasDisplayName, isAsyncFn, isTwoFileEqualByFileContent, toThousandsSeparatorFormat, useClickOutside, useEscListener, useFilePicker, usePreventDefault, useSelect };
3787
+ export { type ActionsArgs, Alert, type AlertProps, type AlertVariantMap, BaseDateRangeInput, type BaseDateRangeInputProps, type BaseSelectProps, Button, type ButtonColorMap, type ButtonProps, type ButtonSizeMap, type ButtonVariantMap, _default as Calendar, type CalendarActiveProps, type CalendarOverload, type CalendarProps, type CalendarRangeModeProps, type CalendarRef, type CalendarSingleModeProps, CalendarType, Checkbox, type CheckboxProps, ConfirmDialog, type ConfirmDialogActionsArgs, type ConfirmDialogContentProps, type ConfirmDialogOptions, CounterInput, type CounterInputProps, type CounterInputSizeMap, type CustomSelectOptionArgs, type CustomSelectOptionBaseArgs, type DataAttributeProps, type DateFormat$1 as DateFormat, DateInput, type DateInputProps, type DateRange, DateRangeInput, type DateRangeInputProps, type DayCellRenderProps, Dialog, type DialogContentProps, type DialogOptions, Drawer, type DrawerPlacementMap, type DrawerProps, FilePicker, type FilePickerFile, type FilePickerOptions, type FileSize, type FileWithPreview, type FocusedOption, GeckoUIPortal, type GeckoUIPortalProps, Input, InputError, type InputErrorProps, type InputProps, Label, type LabelProps, LoadingButton, type LoadingButtonProps, Menu, type MenuContextProps, MenuItem, type MenuItemProps, type MenuProps, MenuTrigger, type MenuTriggerProps, type MenuTriggerRenderProps, type MultiSelectProps, type MultiSelectTriggerProps, type MultiSelectTriggerRenderProps, OTPInput, type OTPInputProps, type OpenFilePickerFn, type OpenFilePickerOptions, Pagination, type PaginationProps, type RHFBaseProps, RHFCheckbox, type RHFCheckboxProps, RHFController, RHFCounterInput, type RHFCounterInputProps, RHFCurrencyInput, type RHFCurrencyInputProps, RHFDateInput, type RHFDateInputProps, RHFDateRangeInput, type RHFDateRangeInputProps, RHFError, type RHFErrorProps, type RHFErrorRenderProps, RHFFileInput, type RHFFileInputProps, RHFFilePicker, type RHFFilePickerBaseProps, type RHFFilePickerProps, type RHFFilePickerRenderProps, type RHFFilePickerRendererProps, RHFInput, RHFInputGroup, type RHFInputGroupProps, type RHFInputProps, RHFNumberInput, type RHFNumberInputProps, RHFOTPInput, type RHFOTPInputProps, RHFRadio, type RHFRadioProps, type RHFRenderArgs, RHFSelect, type RHFSelectOverload, type RHFSelectProps, RHFSwitch, type RHFSwitchProps, RHFTextarea, type RHFTextareaProps, Radio, type RadioProps, Select, SelectConsumer, type SelectConsumerProps, type SelectContextProps, SelectDropdownSearch, SelectEmpty, type SelectEmptyProps, SelectOption, type SelectOptionConfig, type SelectOptionElement, type SelectOptionProps, type SelectOverload, type SelectProps, SelectTrigger, type SelectTriggerBaseRenderProps, type SelectTriggerOverload, type SelectTriggerProps, type SelectionMode, type SingleSelectProps, type SingleSelectTriggerProps, type SingleSelectTriggerRenderProps, Spinner, Switch, type SwitchProps, type SwitchSizeMap, Textarea, type TextareaProps, Tooltip, type TooltipProps, type UseFilePickerOptions, type UseFilePickerReturn, fileToUInt8Array, getDataAttributes, hasDisplayName, isAsyncFn, isTwoFileEqualByFileContent, toThousandsSeparatorFormat, useClickOutside, useEscListener, useFilePicker, useMenu, usePreventDefault, useSelect };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,8 @@
1
1
  import * as react from 'react';
2
- import react__default, { RefObject, InputHTMLAttributes, FC, ReactNode, JSX, ForwardedRef, LabelHTMLAttributes, PropsWithChildren, ButtonHTMLAttributes, DetailedHTMLProps, ReactElement, RefCallback, Dispatch, SetStateAction, HtmlHTMLAttributes, ChangeEvent, HTMLAttributes, JSXElementConstructor, SVGProps } from 'react';
2
+ import react__default, { RefObject, InputHTMLAttributes, FC, ReactNode, JSX, ForwardedRef, LabelHTMLAttributes, PropsWithChildren, ButtonHTMLAttributes, DetailedHTMLProps, ReactElement, RefCallback, Dispatch, SetStateAction, HtmlHTMLAttributes, ChangeEvent, HTMLAttributes, SVGProps } from 'react';
3
3
  import { ControllerProps, Control, FieldValues, ControllerRenderProps, ControllerFieldState, UseFormStateReturn } from 'react-hook-form';
4
4
  import { Placement, Strategy, useFloating } from '@floating-ui/react';
5
5
  import { TextareaAutosizeProps } from 'react-textarea-autosize';
6
- import * as _headlessui_react from '@headlessui/react';
7
- import { SwitchProps as SwitchProps$1, MenuItemsProps as MenuItemsProps$1, MenuButtonProps as MenuButtonProps$1, MenuItemProps as MenuItemProps$1 } from '@headlessui/react';
8
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
9
7
  import { ToasterProps } from 'sonner';
10
8
  export { toast } from 'sonner';
@@ -1556,70 +1554,17 @@ interface RHFTextareaProps extends RHFBaseProps, Omit<TextareaProps, "name" | "o
1556
1554
  */
1557
1555
  declare const RHFTextarea: FC<RHFTextareaProps>;
1558
1556
 
1559
- /** Extensible size map - To allow module augmentation */
1560
1557
  interface SwitchSizeMap {
1561
1558
  sm: unknown;
1562
1559
  md: unknown;
1563
1560
  }
1564
- interface SwitchProps extends Omit<SwitchProps$1, "className"> {
1565
- /**
1566
- * The size of the switch.(default: 'md')
1567
- * */
1561
+ interface SwitchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "size" | "type"> {
1562
+ onChange?: (checked: boolean) => void;
1568
1563
  size?: keyof SwitchSizeMap;
1569
- /**
1570
- * Class name for the switch.
1571
- * */
1572
- className?: string;
1573
- /**
1574
- * Style for the thumb of the switch.
1575
- * */
1576
1564
  thumbClassName?: string;
1577
1565
  }
1578
1566
 
1579
- /**
1580
- * Switch is a toggle component built on HeadlessUI that provides an accessible
1581
- * on/off control. It supports multiple sizes, controlled and uncontrolled modes,
1582
- * and integrates seamlessly with forms.
1583
- *
1584
- * @example
1585
- * Toggle feature in settings:
1586
- *
1587
- * ```tsx
1588
- * const [notificationsEnabled, setNotificationsEnabled] = useState(true);
1589
- *
1590
- * <div className="flex items-center gap-3">
1591
- * <Switch
1592
- * checked={notificationsEnabled}
1593
- * onChange={setNotificationsEnabled}
1594
- * size="md"
1595
- * />
1596
- * <span>Enable email notifications</span>
1597
- * </div>
1598
- * ```
1599
- *
1600
- * @example
1601
- * Uncontrolled with default value:
1602
- *
1603
- * ```tsx
1604
- * <Switch defaultChecked={true} size="lg" />
1605
- * ```
1606
- *
1607
- * @example
1608
- * Custom styling and sizes:
1609
- *
1610
- * ```tsx
1611
- * <Switch
1612
- * checked={darkMode}
1613
- * onChange={toggleDarkMode}
1614
- * size="sm"
1615
- * className="bg-blue-500 data-[checked]:bg-green-600"
1616
- * thumbClassName="shadow-lg"
1617
- * />
1618
- * ```
1619
- *
1620
- * @see https://headlessui.com/react/switch for advanced usage
1621
- */
1622
- declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<null>>;
1567
+ declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLInputElement>>;
1623
1568
 
1624
1569
  interface RHFSwitchProps extends RHFBaseProps, Omit<SwitchProps, "name" | "value"> {
1625
1570
  /**
@@ -3641,118 +3586,132 @@ declare namespace Drawer {
3641
3586
  var dismiss: () => void;
3642
3587
  }
3643
3588
 
3644
- type ReactTag = keyof JSX.IntrinsicElements | JSXElementConstructor<any>;
3645
- type MenuButtonProps<T extends ReactTag> = MenuButtonProps$1<T>;
3646
- type MenuItemsProps<T extends ReactTag> = MenuItemsProps$1<T>;
3647
- type MenuItemProps<T extends ReactTag> = MenuItemProps$1<T>;
3589
+ interface MenuProps extends PropsWithChildren {
3590
+ /**
3591
+ * Text label for the default menu button.
3592
+ * If `MenuTrigger` is provided as a child, this is ignored.
3593
+ */
3594
+ label?: string;
3595
+ /**
3596
+ * Whether the menu is disabled
3597
+ */
3598
+ disabled?: boolean;
3599
+ /**
3600
+ * Placement of the dropdown panel relative to the trigger.
3601
+ * @default "bottom-start"
3602
+ */
3603
+ placement?: Placement;
3604
+ /**
3605
+ * Floating strategy for the dropdown panel
3606
+ */
3607
+ floatingStrategy?: Strategy;
3608
+ /**
3609
+ * Additional class name for the menu wrapper
3610
+ */
3611
+ className?: string;
3612
+ /**
3613
+ * Additional class name for the dropdown panel
3614
+ */
3615
+ menuClassName?: string;
3616
+ /**
3617
+ * Additional class name for the default menu button.
3618
+ * Only applies when no `MenuTrigger` is provided.
3619
+ */
3620
+ buttonClassName?: string;
3621
+ }
3622
+ interface MenuContextProps {
3623
+ open: boolean;
3624
+ setOpen: Dispatch<SetStateAction<boolean>>;
3625
+ floating: ReturnType<typeof useFloating>;
3626
+ openMenu: () => void;
3627
+ closeMenu: () => void;
3628
+ toggleMenu: () => void;
3629
+ disabled: boolean;
3630
+ menuRef: RefObject<HTMLDivElement | null>;
3631
+ }
3648
3632
 
3649
- /**
3650
- * Menu is a styled wrapper around HeadlessUI's Menu for creating dropdown menus and action lists.
3651
- * Provides pre-styled components for building accessible, keyboard-navigable menus.
3652
- * @see https://headlessui.com/react/menu for complete API documentation
3653
- */
3654
- declare const Menu: _headlessui_react._internal_ComponentMenu & {
3655
- Button: _headlessui_react._internal_ComponentMenuButton;
3656
- Items: _headlessui_react._internal_ComponentMenuItems;
3657
- Item: _headlessui_react._internal_ComponentMenuItem;
3658
- Section: _headlessui_react._internal_ComponentMenuSection;
3659
- Heading: _headlessui_react._internal_ComponentMenuHeading;
3660
- Separator: _headlessui_react._internal_ComponentMenuSeparator;
3633
+ declare const Menu: {
3634
+ ({ label, disabled, placement, floatingStrategy, className, menuClassName, buttonClassName, children }: MenuProps): react_jsx_runtime.JSX.Element;
3635
+ displayName: string;
3661
3636
  };
3662
- /**
3663
- * MenuButton triggers the menu dropdown when clicked or activated.
3664
- * Supports polymorphic rendering via the `as` prop.
3665
- * @see https://headlessui.com/react/menu for complete API documentation
3666
- */
3667
- declare const MenuButton: <T extends ReactTag>({ as, ...rest }: MenuButtonProps<T>) => react_jsx_runtime.JSX.Element;
3668
- /**
3669
- * MenuItems contains the dropdown panel with all menu options.
3670
- * Automatically handles positioning, animations, and focus management.
3671
- * @see https://headlessui.com/react/menu for complete API documentation
3672
- */
3673
- declare const MenuItems: <T extends ReactTag>({ as, ...rest }: MenuItemsProps<T>) => react_jsx_runtime.JSX.Element;
3674
- /**
3675
- * MenuItem represents an individual selectable option within the menu.
3676
- * Receives active and disabled states for conditional styling.
3677
- * @see https://headlessui.com/react/menu for complete API documentation
3678
- */
3679
- declare const MenuItem: <T extends ReactTag>({ children, as, ...rest }: MenuItemProps<T>) => react_jsx_runtime.JSX.Element;
3680
- /**
3681
- * MenuHeading displays a non-interactive header within menu sections.
3682
- * @see https://headlessui.com/react/menu for complete API documentation
3683
- */
3684
- declare const MenuHeading: _headlessui_react._internal_ComponentMenuHeading;
3685
- /**
3686
- * MenuSection groups related menu items together under a heading.
3687
- * @see https://headlessui.com/react/menu for complete API documentation
3688
- */
3689
- declare const MenuSection: _headlessui_react._internal_ComponentMenuSection;
3690
- /**
3691
- * MenuSeparator provides a visual divider between menu groups or items.
3692
- * @see https://headlessui.com/react/menu for complete API documentation
3693
- */
3694
- declare const MenuSeparator: _headlessui_react._internal_ComponentMenuSeparator;
3695
3637
 
3696
- type DropdownClassName<T> = string | ((item: T, index: number) => string | undefined);
3697
- interface DropdownItem {
3698
- label: ReactNode | FC;
3638
+ interface MenuItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onClick"> {
3639
+ /**
3640
+ * Text label for the menu item.
3641
+ * Used as the default rendered content if no `children` is provided.
3642
+ */
3643
+ label: string;
3644
+ /**
3645
+ * Whether the menu item is disabled
3646
+ */
3699
3647
  disabled?: boolean;
3648
+ /**
3649
+ * Additional class name for the menu item
3650
+ */
3700
3651
  className?: string;
3652
+ /**
3653
+ * Callback fired when the menu item is clicked.
3654
+ * The menu will close automatically after the callback.
3655
+ */
3701
3656
  onClick?: () => void;
3657
+ /**
3658
+ * Custom content for the menu item.
3659
+ * If not provided, `label` is rendered as text.
3660
+ */
3661
+ children?: ReactNode;
3702
3662
  }
3703
- interface DropdownProps extends PropsWithChildren {
3704
- anchor?: MenuItemsProps<"button">["anchor"];
3663
+
3664
+ declare const MenuItem: {
3665
+ ({ label, disabled, className, onClick, children, ...rest }: MenuItemProps): react_jsx_runtime.JSX.Element;
3666
+ displayName: string;
3667
+ };
3668
+
3669
+ interface MenuTriggerRenderProps {
3705
3670
  /**
3706
- * Items to be displayed in the dropdown
3707
- * */
3708
- items: DropdownItem[];
3671
+ * Whether the menu is currently open
3672
+ */
3673
+ open: boolean;
3709
3674
  /**
3710
- * Additional class name for the dropdown button
3711
- * */
3712
- className?: string;
3675
+ * Open the menu
3676
+ */
3677
+ openMenu: () => void;
3713
3678
  /**
3714
- * Additional class name for the dropdown menu
3715
- * */
3716
- menuClassName?: string;
3679
+ * Close the menu
3680
+ */
3681
+ closeMenu: () => void;
3717
3682
  /**
3718
- * Icon to be displayed on the dropdown button
3719
- * If you want to hide the icon, pass `null`
3720
- * */
3721
- icon?: ReactNode | FC;
3683
+ * Toggle the menu open/closed
3684
+ */
3685
+ toggleMenu: () => void;
3722
3686
  /**
3723
- * Hide the icon on the dropdown button
3724
- * */
3725
- iconClassName?: string;
3687
+ * Whether the menu is disabled
3688
+ */
3689
+ disabled: boolean;
3690
+ }
3691
+ interface MenuTriggerProps {
3726
3692
  /**
3727
- * Hide arrow icon on the dropdown button
3728
- * */
3729
- hideArrowIcon?: boolean;
3730
- [key: `data-${string}`]: string;
3693
+ * Render function that receives menu state and controls.
3694
+ *
3695
+ * @example
3696
+ * ```tsx
3697
+ * <MenuTrigger>
3698
+ * {({ open, toggleMenu }) => (
3699
+ * <button onClick={toggleMenu}>
3700
+ * Actions {open ? '▲' : '▼'}
3701
+ * </button>
3702
+ * )}
3703
+ * </MenuTrigger>
3704
+ * ```
3705
+ */
3706
+ children: (props: MenuTriggerRenderProps) => ReactNode;
3731
3707
  }
3732
3708
 
3733
- /**
3734
- * Fast and easy dropdown component extended from `Menu` and `Button` components.
3735
- * So this won't have much customization options like the `Menu` component.
3736
- * If you think this component is not enough for your use case, you can use the `Menu` component directly.
3737
- *
3738
- * @example
3739
- *
3740
- * ```js
3741
- * import { Dropdown } from "@geckoui/geckoui";
3742
- *
3743
- * const items = [
3744
- * { label: "Item 1", onClick: () => console.log("Item 1 clicked") },
3745
- * { label: "Item 2", onClick: () => console.log("Item 2 clicked") },
3746
- * { label: "Item 3", onClick: () => console.log("Item 3 clicked") },
3747
- * ];
3748
- *
3749
- * <Dropdown items={items} />
3750
- * ```
3751
- * */
3752
- declare function Dropdown({ items, anchor, icon, className, menuClassName, iconClassName, children, hideArrowIcon, ...rest }: DropdownProps): react_jsx_runtime.JSX.Element;
3753
- declare namespace Dropdown {
3754
- var displayName: string;
3755
- }
3709
+ declare const MenuTrigger: {
3710
+ ({ children }: MenuTriggerProps): react.ReactNode;
3711
+ displayName: string;
3712
+ };
3713
+
3714
+ declare const useMenu: () => MenuContextProps;
3756
3715
 
3757
3716
  type BaseIconProps = SVGProps<SVGSVGElement>;
3758
3717
 
@@ -3825,4 +3784,4 @@ declare class FileOnlyPickerHandler extends BaseFilePickerHandler {
3825
3784
 
3826
3785
  declare const FilePicker: typeof FileOnlyPickerHandler;
3827
3786
 
3828
- export { type ActionsArgs, Alert, type AlertProps, type AlertVariantMap, BaseDateRangeInput, type BaseDateRangeInputProps, type BaseSelectProps, Button, type ButtonColorMap, type ButtonProps, type ButtonSizeMap, type ButtonVariantMap, _default as Calendar, type CalendarActiveProps, type CalendarOverload, type CalendarProps, type CalendarRangeModeProps, type CalendarRef, type CalendarSingleModeProps, CalendarType, Checkbox, type CheckboxProps, ConfirmDialog, type ConfirmDialogActionsArgs, type ConfirmDialogContentProps, type ConfirmDialogOptions, CounterInput, type CounterInputProps, type CounterInputSizeMap, type CustomSelectOptionArgs, type CustomSelectOptionBaseArgs, type DataAttributeProps, type DateFormat$1 as DateFormat, DateInput, type DateInputProps, type DateRange, DateRangeInput, type DateRangeInputProps, type DayCellRenderProps, Dialog, type DialogContentProps, type DialogOptions, Drawer, type DrawerPlacementMap, type DrawerProps, Dropdown, type DropdownClassName, type DropdownItem, type DropdownProps, FilePicker, type FilePickerFile, type FilePickerOptions, type FileSize, type FileWithPreview, type FocusedOption, GeckoUIPortal, type GeckoUIPortalProps, Input, InputError, type InputErrorProps, type InputProps, Label, type LabelProps, LoadingButton, type LoadingButtonProps, Menu, MenuButton, type MenuButtonProps, MenuHeading, MenuItem, type MenuItemProps, MenuItems, type MenuItemsProps, MenuSection, MenuSeparator, type MultiSelectProps, type MultiSelectTriggerProps, type MultiSelectTriggerRenderProps, OTPInput, type OTPInputProps, type OpenFilePickerFn, type OpenFilePickerOptions, Pagination, type PaginationProps, type RHFBaseProps, RHFCheckbox, type RHFCheckboxProps, RHFController, RHFCounterInput, type RHFCounterInputProps, RHFCurrencyInput, type RHFCurrencyInputProps, RHFDateInput, type RHFDateInputProps, RHFDateRangeInput, type RHFDateRangeInputProps, RHFError, type RHFErrorProps, type RHFErrorRenderProps, RHFFileInput, type RHFFileInputProps, RHFFilePicker, type RHFFilePickerBaseProps, type RHFFilePickerProps, type RHFFilePickerRenderProps, type RHFFilePickerRendererProps, RHFInput, RHFInputGroup, type RHFInputGroupProps, type RHFInputProps, RHFNumberInput, type RHFNumberInputProps, RHFOTPInput, type RHFOTPInputProps, RHFRadio, type RHFRadioProps, type RHFRenderArgs, RHFSelect, type RHFSelectOverload, type RHFSelectProps, RHFSwitch, type RHFSwitchProps, RHFTextarea, type RHFTextareaProps, Radio, type RadioProps, type ReactTag, Select, SelectConsumer, type SelectConsumerProps, type SelectContextProps, SelectDropdownSearch, SelectEmpty, type SelectEmptyProps, SelectOption, type SelectOptionConfig, type SelectOptionElement, type SelectOptionProps, type SelectOverload, type SelectProps, SelectTrigger, type SelectTriggerBaseRenderProps, type SelectTriggerOverload, type SelectTriggerProps, type SelectionMode, type SingleSelectProps, type SingleSelectTriggerProps, type SingleSelectTriggerRenderProps, Spinner, Switch, type SwitchProps, type SwitchSizeMap, Textarea, type TextareaProps, Tooltip, type TooltipProps, type UseFilePickerOptions, type UseFilePickerReturn, fileToUInt8Array, getDataAttributes, hasDisplayName, isAsyncFn, isTwoFileEqualByFileContent, toThousandsSeparatorFormat, useClickOutside, useEscListener, useFilePicker, usePreventDefault, useSelect };
3787
+ export { type ActionsArgs, Alert, type AlertProps, type AlertVariantMap, BaseDateRangeInput, type BaseDateRangeInputProps, type BaseSelectProps, Button, type ButtonColorMap, type ButtonProps, type ButtonSizeMap, type ButtonVariantMap, _default as Calendar, type CalendarActiveProps, type CalendarOverload, type CalendarProps, type CalendarRangeModeProps, type CalendarRef, type CalendarSingleModeProps, CalendarType, Checkbox, type CheckboxProps, ConfirmDialog, type ConfirmDialogActionsArgs, type ConfirmDialogContentProps, type ConfirmDialogOptions, CounterInput, type CounterInputProps, type CounterInputSizeMap, type CustomSelectOptionArgs, type CustomSelectOptionBaseArgs, type DataAttributeProps, type DateFormat$1 as DateFormat, DateInput, type DateInputProps, type DateRange, DateRangeInput, type DateRangeInputProps, type DayCellRenderProps, Dialog, type DialogContentProps, type DialogOptions, Drawer, type DrawerPlacementMap, type DrawerProps, FilePicker, type FilePickerFile, type FilePickerOptions, type FileSize, type FileWithPreview, type FocusedOption, GeckoUIPortal, type GeckoUIPortalProps, Input, InputError, type InputErrorProps, type InputProps, Label, type LabelProps, LoadingButton, type LoadingButtonProps, Menu, type MenuContextProps, MenuItem, type MenuItemProps, type MenuProps, MenuTrigger, type MenuTriggerProps, type MenuTriggerRenderProps, type MultiSelectProps, type MultiSelectTriggerProps, type MultiSelectTriggerRenderProps, OTPInput, type OTPInputProps, type OpenFilePickerFn, type OpenFilePickerOptions, Pagination, type PaginationProps, type RHFBaseProps, RHFCheckbox, type RHFCheckboxProps, RHFController, RHFCounterInput, type RHFCounterInputProps, RHFCurrencyInput, type RHFCurrencyInputProps, RHFDateInput, type RHFDateInputProps, RHFDateRangeInput, type RHFDateRangeInputProps, RHFError, type RHFErrorProps, type RHFErrorRenderProps, RHFFileInput, type RHFFileInputProps, RHFFilePicker, type RHFFilePickerBaseProps, type RHFFilePickerProps, type RHFFilePickerRenderProps, type RHFFilePickerRendererProps, RHFInput, RHFInputGroup, type RHFInputGroupProps, type RHFInputProps, RHFNumberInput, type RHFNumberInputProps, RHFOTPInput, type RHFOTPInputProps, RHFRadio, type RHFRadioProps, type RHFRenderArgs, RHFSelect, type RHFSelectOverload, type RHFSelectProps, RHFSwitch, type RHFSwitchProps, RHFTextarea, type RHFTextareaProps, Radio, type RadioProps, Select, SelectConsumer, type SelectConsumerProps, type SelectContextProps, SelectDropdownSearch, SelectEmpty, type SelectEmptyProps, SelectOption, type SelectOptionConfig, type SelectOptionElement, type SelectOptionProps, type SelectOverload, type SelectProps, SelectTrigger, type SelectTriggerBaseRenderProps, type SelectTriggerOverload, type SelectTriggerProps, type SelectionMode, type SingleSelectProps, type SingleSelectTriggerProps, type SingleSelectTriggerRenderProps, Spinner, Switch, type SwitchProps, type SwitchSizeMap, Textarea, type TextareaProps, Tooltip, type TooltipProps, type UseFilePickerOptions, type UseFilePickerReturn, fileToUInt8Array, getDataAttributes, hasDisplayName, isAsyncFn, isTwoFileEqualByFileContent, toThousandsSeparatorFormat, useClickOutside, useEscListener, useFilePicker, useMenu, usePreventDefault, useSelect };