@trackunit/react-components 0.1.65 → 0.1.67

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.
@@ -0,0 +1,56 @@
1
+ /// <reference types="react" />
2
+ import { PopoverProps } from "./PopoverTypes";
3
+ /**
4
+ * The hook that powers the Popover component.
5
+ * It should not be used directly, but rather through the Popover component.
6
+ *
7
+ * @param {PopoverProps} options The options for the popover
8
+ * @returns {ReturnType<usePopover>} The data for the popover
9
+ */
10
+ export declare const usePopover: ({ initialOpen, placement, isModal, isOpen: controlledIsOpen, activation, onOpenStateChange: setControlledIsOpen, ...restOptions }: PopoverProps) => {
11
+ isModal: boolean | undefined;
12
+ labelId: string | undefined;
13
+ descriptionId: string | undefined;
14
+ setLabelId: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
15
+ setDescriptionId: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
16
+ customProps: {
17
+ className?: string | undefined;
18
+ dataTestId?: string | undefined;
19
+ };
20
+ placement: import("@floating-ui/react").Placement;
21
+ strategy: import("@floating-ui/react").Strategy;
22
+ middlewareData: import("@floating-ui/react").MiddlewareData;
23
+ x: number | null;
24
+ y: number | null;
25
+ update: () => void;
26
+ reference: (node: import("@floating-ui/react").ReferenceType | null) => void;
27
+ floating: (node: HTMLElement | null) => void;
28
+ positionReference: (node: import("@floating-ui/react").ReferenceType | null) => void;
29
+ context: {
30
+ placement: import("@floating-ui/react").Placement;
31
+ strategy: import("@floating-ui/react").Strategy;
32
+ x: number | null;
33
+ y: number | null;
34
+ middlewareData: import("@floating-ui/react").MiddlewareData;
35
+ update: () => void;
36
+ reference: (node: import("@floating-ui/react").ReferenceType | null) => void;
37
+ floating: (node: HTMLElement | null) => void;
38
+ isPositioned: boolean;
39
+ open: boolean;
40
+ onOpenChange: (open: boolean) => void;
41
+ events: import("@floating-ui/react").FloatingEvents;
42
+ dataRef: import("react").MutableRefObject<import("@floating-ui/react").ContextData>;
43
+ nodeId: string | undefined;
44
+ floatingId: string;
45
+ refs: import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
46
+ elements: import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
47
+ };
48
+ refs: import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
49
+ elements: import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
50
+ isPositioned: boolean;
51
+ getReferenceProps: (userProps?: import("react").HTMLProps<Element> | undefined) => Record<string, unknown>;
52
+ getFloatingProps: (userProps?: import("react").HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
53
+ getItemProps: (userProps?: import("react").HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
54
+ isOpen: boolean;
55
+ setIsOpen: (open: boolean) => void;
56
+ };
@@ -7,6 +7,8 @@ export interface SidebarItemProps extends CommonProps {
7
7
  * This is needed as it is used for the intersection observer to determine which items are visible and which are not.
8
8
  */
9
9
  id: string;
10
+ /** Optional onClick */
11
+ onClick?: () => void;
10
12
  }
11
13
  export type Breakpoints = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
12
14
  export interface SidebarProps extends CommonProps {
@@ -1,12 +0,0 @@
1
- import * as React from "react";
2
- import { CommonProps } from "../../common/CommonProps";
3
- export interface PopoverListProps extends CommonProps {
4
- children: React.ReactNode;
5
- }
6
- /**
7
- * The PopoverList component.
8
- *
9
- * @param {PopoverListProps} props - The props for the PopoverList component
10
- * @returns {JSX.Element} PopoverList component
11
- */
12
- export declare const PopoverList: ({ className, children, dataTestId }: PopoverListProps) => JSX.Element;
@@ -1,30 +0,0 @@
1
- import * as React from "react";
2
- import { CommonProps } from "../../common/CommonProps";
3
- export interface PopoverListItemProps extends CommonProps {
4
- selected?: boolean;
5
- disabled?: boolean;
6
- ariaLabel?: string;
7
- /** Optional event handler for logging etc. Important: Please use the Url prop for navigation. */
8
- onClick?: (event: React.MouseEvent<HTMLLIElement, MouseEvent>) => void;
9
- /** Navigation Url for this item */
10
- url?: string;
11
- /**
12
- * The prefix to be displayed for the list item.
13
- */
14
- prefix?: React.ReactNode;
15
- /**
16
- * The suffix to be displayed for the list item.
17
- */
18
- suffix?: React.ReactNode;
19
- /**
20
- * The child nodes.
21
- */
22
- children: React.ReactNode;
23
- }
24
- /**
25
- * The PopoverListItem component.
26
- *
27
- * @param {PopoverListItemProps} props - The props for the PopoverListItem component
28
- * @returns {JSX.Element} PopoverListItem component
29
- */
30
- export declare const PopoverListItem: ({ selected, children, disabled, ariaLabel, url, onClick, prefix, suffix, dataTestId, className, }: PopoverListItemProps) => JSX.Element;