@matthiaskrijgsman/mat-ui 0.0.5 → 0.0.7

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 @@
1
+ export declare const ScrollbarTest: () => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import * as React from "react";
2
+ import type { TablerIcon } from "@tabler/icons-react";
2
3
  export type Variant = 'primary' | 'secondary' | 'tertiary' | 'white' | 'black' | 'transparent';
3
4
  export type Size = 'sm' | 'md' | 'lg';
4
5
  export type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
@@ -6,10 +7,12 @@ export type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
6
7
  size?: Size;
7
8
  loading?: boolean;
8
9
  children?: React.ReactNode;
10
+ Icon?: TablerIcon;
9
11
  };
10
12
  export declare const Button: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
11
13
  variant?: Variant;
12
14
  size?: Size;
13
15
  loading?: boolean;
14
16
  children?: React.ReactNode;
17
+ Icon?: TablerIcon;
15
18
  } & React.RefAttributes<HTMLButtonElement>>;
@@ -1,12 +1,14 @@
1
1
  import * as React from "react";
2
2
  import type { TablerIcon } from "@tabler/icons-react";
3
- export type PopoverButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
3
+ export type DropdownButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
4
4
  loading?: boolean;
5
5
  children?: React.ReactNode;
6
6
  Icon?: TablerIcon;
7
+ dismissOnClick?: boolean;
7
8
  };
8
- export declare const PopoverButton: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
9
+ export declare const DropdownButton: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
9
10
  loading?: boolean;
10
11
  children?: React.ReactNode;
11
12
  Icon?: TablerIcon;
13
+ dismissOnClick?: boolean;
12
14
  } & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ export type DropdownButtonGroupProps = {
3
+ label?: string;
4
+ children: React.ReactNode;
5
+ };
6
+ export declare const DropdownButtonGroup: (props: DropdownButtonGroupProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import type { Placement } from "@floating-ui/react";
3
+ export type DropdownMenuProps = {
4
+ trigger: React.ReactNode;
5
+ children?: React.ReactNode;
6
+ placement?: Placement;
7
+ minWidth?: number;
8
+ className?: string;
9
+ };
10
+ export declare const DropdownMenu: (props: DropdownMenuProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import type { Size } from "@/components/button/Button.tsx";
3
+ export type DropdownPanelProps = React.HTMLProps<HTMLDivElement> & {
4
+ children?: React.ReactNode;
5
+ className?: string;
6
+ padding?: Size;
7
+ };
8
+ export declare const DropdownPanel: (props: DropdownPanelProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export type DropdownDismissContextType = () => void;
2
+ export declare const DropdownDismissContext: import("react").Context<DropdownDismissContextType | undefined>;
3
+ export declare const useDropdownDismiss: () => {
4
+ dismiss: DropdownDismissContextType;
5
+ };
@@ -0,0 +1,37 @@
1
+ import * as React from "react";
2
+ type DragXEvent = {
3
+ /** Current pointer X (client) */
4
+ clientX: number;
5
+ /** X where the drag started */
6
+ startX: number;
7
+ /** Total horizontal movement since drag start */
8
+ totalDeltaX: number;
9
+ /** The original pointerdown event target */
10
+ target: EventTarget | null;
11
+ };
12
+ type UseDragXOptions = {
13
+ /** Called on every move with the incremental dx since the previous event */
14
+ onDelta: (dx: number, meta: DragXEvent) => void;
15
+ /** Called once when drag starts */
16
+ onDragStart?: (meta: DragXEvent) => void;
17
+ /** Called once when drag ends */
18
+ onDragEnd?: (meta: DragXEvent) => void;
19
+ /** Disable the hook */
20
+ disabled?: boolean;
21
+ /** Restrict to primary button drags (left click); default true */
22
+ primaryButtonOnly?: boolean;
23
+ /** If true, preventDefault on move to avoid scrolling during touch drags */
24
+ preventScrollOnMove?: boolean;
25
+ };
26
+ type DragBind = {
27
+ onPointerDown: (e: React.PointerEvent) => void;
28
+ /** Recommended for the handle to avoid accidental scroll during touch drags */
29
+ style?: React.CSSProperties;
30
+ /** You can also put `touchAction: "none"` in your CSS */
31
+ role?: string;
32
+ };
33
+ export declare function useDragX(options: UseDragXOptions): {
34
+ isDragging: boolean;
35
+ bind: DragBind;
36
+ };
37
+ export {};
package/dist/index.d.ts CHANGED
@@ -27,9 +27,11 @@ export { Badge } from "./components/Badge.tsx";
27
27
  export { BadgeColor } from "./components/BadgeColors.tsx";
28
28
  export { TabButtons } from "./components/TabButtons.tsx";
29
29
  export { Spinner } from "./spinner/Spinner.tsx";
30
- export { PopoverButton } from "./popover/PopoverButton.tsx";
31
- export { PopoverPanel } from "./popover/PopoverPanel.tsx";
32
- export { PopoverBase } from "./popover/PopoverBase.tsx";
30
+ export { DropdownButton } from "./components/dropdown-menu/DropdownButton.tsx";
31
+ export { DropdownButtonGroup } from "./components/dropdown-menu/DropdownButtonGroup.tsx";
32
+ export { DropdownPanel } from "./components/dropdown-menu/DropdownPanel.tsx";
33
+ export { DropdownMenu } from "./components/dropdown-menu/DropdownMenu.tsx";
33
34
  export { usePopover } from "./popover/use-popover.tsx";
35
+ export { PopoverBase } from "./popover/PopoverBase.tsx";
34
36
  export { Test } from "./components/Test.tsx";
35
37
  export * from "./types.ts";