@gtkx/react 0.1.49 → 0.1.51

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.
@@ -3,8 +3,8 @@ import type { ReactNode, Ref } from "react";
3
3
  import type * as Gdk from "@gtkx/ffi/gdk";
4
4
  import type * as Gio from "@gtkx/ffi/gio";
5
5
  import type * as Gtk from "@gtkx/ffi/gtk";
6
- import type { ColumnViewColumnProps, ColumnViewRootProps, GridChildProps, ListItemProps, ListViewRenderProps, NotebookPageProps, SlotProps } from "../types.js";
7
- export { ColumnViewColumnProps, ColumnViewRootProps, GridChildProps, ListItemProps, ListViewRenderProps, NotebookPageProps, SlotProps, };
6
+ import type { ColumnViewColumnProps, ColumnViewRootProps, GridChildProps, ListItemProps, ListViewRenderProps, MenuItemProps, MenuRootProps, MenuSectionProps, MenuSubmenuProps, NotebookPageProps, SlotProps, StackPageProps, StackRootProps } from "../types.js";
7
+ export { ColumnViewColumnProps, ColumnViewRootProps, GridChildProps, ListItemProps, ListViewRenderProps, MenuItemProps, MenuRootProps, MenuSectionProps, MenuSubmenuProps, NotebookPageProps, SlotProps, StackPageProps, StackRootProps, };
8
8
  /**
9
9
  * The base class for all widgets.
10
10
  *
@@ -5925,12 +5925,6 @@ export interface WindowControlsProps extends WidgetProps {
5925
5925
  export interface WindowHandleProps extends WidgetProps {
5926
5926
  ref?: Ref<Gtk.WindowHandle>;
5927
5927
  }
5928
- export declare const CONSTRUCTOR_PARAMS: Record<string, {
5929
- name: string;
5930
- hasDefault: boolean;
5931
- }[]>;
5932
- export declare const PROP_SETTERS: Record<string, Record<string, string>>;
5933
- export declare const SETTER_GETTERS: Record<string, Record<string, string>>;
5934
5928
  /**
5935
5929
  * The base class for all widgets.
5936
5930
  *
@@ -7071,11 +7065,20 @@ export declare const ColorChooserWidget: "ColorChooserWidget";
7071
7065
  * it gets the .color style class.
7072
7066
  */
7073
7067
  export declare const ColorDialogButton: "ColorDialogButton";
7068
+ /**
7069
+ * Props for the ColumnView.Root component with type-safe item and column rendering.
7070
+ * @typeParam T - The type of items in the column view.
7071
+ * @typeParam C - The union type of column IDs for type-safe sorting.
7072
+ */
7074
7073
  interface ColumnViewRootPropsExtended<T = unknown, C extends string = string> extends ColumnViewProps, ColumnViewRootProps<T, C> {
7075
7074
  }
7076
7075
  declare function ColumnViewRoot<T = unknown, C extends string = string>(props: ColumnViewRootPropsExtended<T, C>): import("react").ReactElement;
7076
+ /**
7077
+ * Props for ColumnView.Column with type-safe cell rendering.
7078
+ * @typeParam T - The type of items passed to the renderCell function.
7079
+ */
7077
7080
  interface ColumnViewGenericColumnProps<T> extends Omit<ColumnViewColumnProps, "renderCell"> {
7078
- /** Render function for column cells. Called with null during setup. */
7081
+ /** Render function for column cells. Called with null during setup (for loading state). */
7079
7082
  renderCell: (item: T | null) => import("react").ReactElement;
7080
7083
  }
7081
7084
  declare function ColumnViewColumn<T>(props: ColumnViewGenericColumnProps<T>): import("react").ReactElement;
@@ -7491,10 +7494,14 @@ export declare const DragIcon: "DragIcon";
7491
7494
  * creating your own `GtkWidget` subclass.
7492
7495
  */
7493
7496
  export declare const DrawingArea: "DrawingArea";
7497
+ /**
7498
+ * Props for the DropDown.Root component with type-safe item handling.
7499
+ * @typeParam T - The type of items in the dropdown.
7500
+ */
7494
7501
  interface DropDownRootProps<T> extends Omit<DropDownProps, "itemLabel" | "onSelectionChanged"> {
7495
- /** Function to convert item to display label */
7502
+ /** Function to convert an item to its display label. */
7496
7503
  itemLabel?: (item: T) => string;
7497
- /** Called when selection changes */
7504
+ /** Called when the selected item changes. */
7498
7505
  onSelectionChanged?: (item: T, index: number) => void;
7499
7506
  }
7500
7507
  declare function DropDownRoot<T>(props: DropDownRootProps<T>): import("react").ReactElement;
@@ -8517,8 +8524,12 @@ export declare const Grid: {
8517
8524
  Root: "Grid.Root";
8518
8525
  Child: "Grid.Child";
8519
8526
  };
8527
+ /**
8528
+ * Props for the GridView.Root component with type-safe item rendering.
8529
+ * @typeParam T - The type of items in the list.
8530
+ */
8520
8531
  interface GridViewRootProps<T> extends Omit<GridViewProps, "renderItem"> {
8521
- /** Render function for list items. Called with null during setup. */
8532
+ /** Render function for list items. Called with null during setup (for loading state). */
8522
8533
  renderItem: (item: T | null) => import("react").ReactElement;
8523
8534
  }
8524
8535
  declare function GridViewRoot<T>(props: GridViewRootProps<T>): import("react").ReactElement;
@@ -9295,8 +9306,12 @@ export declare const ListBox: "ListBox";
9295
9306
  * when necessary.
9296
9307
  */
9297
9308
  export declare const ListBoxRow: "ListBoxRow";
9309
+ /**
9310
+ * Props for the ListView.Root component with type-safe item rendering.
9311
+ * @typeParam T - The type of items in the list.
9312
+ */
9298
9313
  interface ListViewRootProps<T> extends Omit<ListViewProps, "renderItem"> {
9299
- /** Render function for list items. Called with null during setup. */
9314
+ /** Render function for list items. Called with null during setup (for loading state). */
9300
9315
  renderItem: (item: T | null) => import("react").ReactElement;
9301
9316
  }
9302
9317
  declare function ListViewRoot<T>(props: ListViewRootProps<T>): import("react").ReactElement;
@@ -10028,6 +10043,10 @@ export declare const Popover: {
10028
10043
  Child: "Popover.Child";
10029
10044
  DefaultWidget: "Popover.DefaultWidget";
10030
10045
  };
10046
+ declare function PopoverMenuRoot(props: MenuRootProps & PopoverMenuProps): import("react").ReactElement;
10047
+ declare function PopoverMenuItem(props: MenuItemProps): import("react").ReactElement;
10048
+ declare function PopoverMenuSection(props: MenuSectionProps): import("react").ReactElement;
10049
+ declare function PopoverMenuSubmenu(props: MenuSubmenuProps): import("react").ReactElement;
10031
10050
  /**
10032
10051
  * A subclass of `GtkPopover` that implements menu behavior.
10033
10052
  *
@@ -10146,7 +10165,12 @@ export declare const Popover: {
10146
10165
  * [enum@Gtk.AccessibleRole.checkbox] or [enum@Gtk.AccessibleRole.menu_item_radio]
10147
10166
  * roles, depending on the action they are connected to.
10148
10167
  */
10149
- export declare const PopoverMenu: "PopoverMenu";
10168
+ export declare const PopoverMenu: {
10169
+ Root: typeof PopoverMenuRoot;
10170
+ Item: typeof PopoverMenuItem;
10171
+ Section: typeof PopoverMenuSection;
10172
+ Submenu: typeof PopoverMenuSubmenu;
10173
+ };
10150
10174
  /**
10151
10175
  * Presents a horizontal bar of items that pop up menus when clicked.
10152
10176
  *
@@ -10969,6 +10993,9 @@ export declare const SpinButton: "SpinButton";
10969
10993
  * `GtkSpinner` uses the [enum@Gtk.AccessibleRole.progress_bar] role.
10970
10994
  */
10971
10995
  export declare const Spinner: "Spinner";
10996
+ declare function StackRoot(props: StackRootProps & StackProps): import("react").ReactElement;
10997
+ declare function StackPage(props: StackPageProps): import("react").ReactElement;
10998
+ declare function StackVisibleChild(props: SlotProps): import("react").ReactElement;
10972
10999
  /**
10973
11000
  * Shows one of its children at a time.
10974
11001
  *
@@ -11020,8 +11047,9 @@ export declare const Spinner: "Spinner";
11020
11047
  * pages, which are the accessible parent objects of the child widgets.
11021
11048
  */
11022
11049
  export declare const Stack: {
11023
- Root: "Stack.Root";
11024
- VisibleChild: "Stack.VisibleChild";
11050
+ Root: typeof StackRoot;
11051
+ Page: typeof StackPage;
11052
+ VisibleChild: typeof StackVisibleChild;
11025
11053
  };
11026
11054
  /**
11027
11055
  * Uses a sidebar to switch between `GtkStack` pages.
@@ -11716,6 +11744,24 @@ export declare const WindowControls: "WindowControls";
11716
11744
  * role.
11717
11745
  */
11718
11746
  export declare const WindowHandle: "WindowHandle";
11747
+ /**
11748
+ * Sets the application-wide menu bar.
11749
+ * The menu will appear in the window's title bar on supported platforms.
11750
+ * Use Menu.Item, Menu.Section, and Menu.Submenu as children.
11751
+ */
11752
+ export declare function ApplicationMenu(props: MenuRootProps): import("react").ReactElement;
11753
+ declare function MenuItem(props: MenuItemProps): import("react").ReactElement;
11754
+ declare function MenuSection(props: MenuSectionProps): import("react").ReactElement;
11755
+ declare function MenuSubmenu(props: MenuSubmenuProps): import("react").ReactElement;
11756
+ /**
11757
+ * Declarative menu builder for use with PopoverMenu and ApplicationMenu.
11758
+ * Use Menu.Item for action items, Menu.Section for groups, Menu.Submenu for nested menus.
11759
+ */
11760
+ export declare const Menu: {
11761
+ Item: typeof MenuItem;
11762
+ Section: typeof MenuSection;
11763
+ Submenu: typeof MenuSubmenu;
11764
+ };
11719
11765
  declare global {
11720
11766
  namespace React {
11721
11767
  namespace JSX {
@@ -11824,7 +11870,7 @@ declare global {
11824
11870
  "Popover.Root": PopoverProps;
11825
11871
  "Popover.Child": SlotProps;
11826
11872
  "Popover.DefaultWidget": SlotProps;
11827
- PopoverMenu: PopoverMenuProps;
11873
+ "PopoverMenu.Root": PopoverMenuProps;
11828
11874
  PopoverMenuBar: PopoverMenuBarProps;
11829
11875
  PrintUnixDialog: PrintUnixDialogProps;
11830
11876
  ProgressBar: ProgressBarProps;
@@ -11850,6 +11896,7 @@ declare global {
11850
11896
  Spinner: SpinnerProps;
11851
11897
  "Stack.Root": StackProps;
11852
11898
  "Stack.VisibleChild": SlotProps;
11899
+ "Stack.Page": StackPageProps;
11853
11900
  "StackSidebar.Root": StackSidebarProps;
11854
11901
  "StackSidebar.Stack": SlotProps;
11855
11902
  "StackSwitcher.Root": StackSwitcherProps;
@@ -11870,6 +11917,10 @@ declare global {
11870
11917
  WindowControls: WindowControlsProps;
11871
11918
  WindowHandle: WindowHandleProps;
11872
11919
  "WindowHandle.Child": SlotProps;
11920
+ "Menu.Item": MenuItemProps;
11921
+ "Menu.Section": MenuSectionProps;
11922
+ "Menu.Submenu": MenuSubmenuProps;
11923
+ ApplicationMenu: MenuRootProps;
11873
11924
  }
11874
11925
  }
11875
11926
  }