@sellgar/kit 0.0.134 → 0.0.136

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sellgar/kit",
3
3
  "type": "module",
4
- "version": "0.0.134",
4
+ "version": "0.0.136",
5
5
  "description": "Sellgar kit",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -0,0 +1,106 @@
1
+ import { default as React } from 'react';
2
+ interface IProps {
3
+ open?: boolean;
4
+ initialOpen?: boolean;
5
+ onOpen?(): void;
6
+ onClose?(): void;
7
+ }
8
+ export declare function useDrawer({ initialOpen, open: controlledOpen, onOpen, onClose }?: IProps): {
9
+ placement: import('@floating-ui/utils').Placement;
10
+ strategy: import('@floating-ui/utils').Strategy;
11
+ middlewareData: import('@floating-ui/core').MiddlewareData;
12
+ x: number;
13
+ y: number;
14
+ isPositioned: boolean;
15
+ update: () => void;
16
+ floatingStyles: React.CSSProperties;
17
+ refs: {
18
+ reference: React.MutableRefObject<import('@floating-ui/react-dom').ReferenceType | null>;
19
+ floating: React.MutableRefObject<HTMLElement | null>;
20
+ setReference: (node: import('@floating-ui/react-dom').ReferenceType | null) => void;
21
+ setFloating: (node: HTMLElement | null) => void;
22
+ } & import('@floating-ui/react').ExtendedRefs<import('@floating-ui/react').ReferenceType>;
23
+ elements: {
24
+ reference: import('@floating-ui/react-dom').ReferenceType | null;
25
+ floating: HTMLElement | null;
26
+ } & import('@floating-ui/react').ExtendedElements<import('@floating-ui/react').ReferenceType>;
27
+ context: {
28
+ update: () => void;
29
+ placement: import('@floating-ui/utils').Placement;
30
+ strategy: import('@floating-ui/utils').Strategy;
31
+ x: number;
32
+ y: number;
33
+ middlewareData: import('@floating-ui/core').MiddlewareData;
34
+ isPositioned: boolean;
35
+ floatingStyles: React.CSSProperties;
36
+ open: boolean;
37
+ onOpenChange: (open: boolean, event?: Event, reason?: import('@floating-ui/react').OpenChangeReason) => void;
38
+ events: import('@floating-ui/react').FloatingEvents;
39
+ dataRef: React.MutableRefObject<import('@floating-ui/react').ContextData>;
40
+ nodeId: string | undefined;
41
+ floatingId: string | undefined;
42
+ refs: import('@floating-ui/react').ExtendedRefs<import('@floating-ui/react').ReferenceType>;
43
+ elements: import('@floating-ui/react').ExtendedElements<import('@floating-ui/react').ReferenceType>;
44
+ };
45
+ getReferenceProps: (userProps?: React.HTMLProps<Element>) => Record<string, unknown>;
46
+ getFloatingProps: (userProps?: React.HTMLProps<HTMLElement>) => Record<string, unknown>;
47
+ getItemProps: (userProps?: Omit<React.HTMLProps<HTMLElement>, "selected" | "active"> & {
48
+ active?: boolean;
49
+ selected?: boolean;
50
+ }) => Record<string, unknown>;
51
+ open: boolean;
52
+ onOpen: (() => void) | undefined;
53
+ onClose: (() => void) | undefined;
54
+ };
55
+ export declare const useDrawerContext: () => {
56
+ placement: import('@floating-ui/utils').Placement;
57
+ strategy: import('@floating-ui/utils').Strategy;
58
+ middlewareData: import('@floating-ui/core').MiddlewareData;
59
+ x: number;
60
+ y: number;
61
+ isPositioned: boolean;
62
+ update: () => void;
63
+ floatingStyles: React.CSSProperties;
64
+ refs: {
65
+ reference: React.MutableRefObject<import('@floating-ui/react-dom').ReferenceType | null>;
66
+ floating: React.MutableRefObject<HTMLElement | null>;
67
+ setReference: (node: import('@floating-ui/react-dom').ReferenceType | null) => void;
68
+ setFloating: (node: HTMLElement | null) => void;
69
+ } & import('@floating-ui/react').ExtendedRefs<import('@floating-ui/react').ReferenceType>;
70
+ elements: {
71
+ reference: import('@floating-ui/react-dom').ReferenceType | null;
72
+ floating: HTMLElement | null;
73
+ } & import('@floating-ui/react').ExtendedElements<import('@floating-ui/react').ReferenceType>;
74
+ context: {
75
+ update: () => void;
76
+ placement: import('@floating-ui/utils').Placement;
77
+ strategy: import('@floating-ui/utils').Strategy;
78
+ x: number;
79
+ y: number;
80
+ middlewareData: import('@floating-ui/core').MiddlewareData;
81
+ isPositioned: boolean;
82
+ floatingStyles: React.CSSProperties;
83
+ open: boolean;
84
+ onOpenChange: (open: boolean, event?: Event, reason?: import('@floating-ui/react').OpenChangeReason) => void;
85
+ events: import('@floating-ui/react').FloatingEvents;
86
+ dataRef: React.MutableRefObject<import('@floating-ui/react').ContextData>;
87
+ nodeId: string | undefined;
88
+ floatingId: string | undefined;
89
+ refs: import('@floating-ui/react').ExtendedRefs<import('@floating-ui/react').ReferenceType>;
90
+ elements: import('@floating-ui/react').ExtendedElements<import('@floating-ui/react').ReferenceType>;
91
+ };
92
+ getReferenceProps: (userProps?: React.HTMLProps<Element>) => Record<string, unknown>;
93
+ getFloatingProps: (userProps?: React.HTMLProps<HTMLElement>) => Record<string, unknown>;
94
+ getItemProps: (userProps?: Omit<React.HTMLProps<HTMLElement>, "selected" | "active"> & {
95
+ active?: boolean;
96
+ selected?: boolean;
97
+ }) => Record<string, unknown>;
98
+ open: boolean;
99
+ onOpen: (() => void) | undefined;
100
+ onClose: (() => void) | undefined;
101
+ };
102
+ export declare const Dialog: React.FC<React.PropsWithChildren<IProps>>;
103
+ export declare const DialogContent: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
104
+ export declare const DialogClose: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
105
+ export declare const Drawer: React.FC<React.PropsWithChildren<IProps>>;
106
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Drawer } from './drawer.tsx';
2
+ export { useDrawerContext } from './drawer.tsx';
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  interface IProps extends React.HTMLAttributes<HTMLDivElement> {
3
- ref?: React.RefObject<HTMLDivElement> | React.RefCallback<HTMLDivElement>;
3
+ ref?: any;
4
4
  }
5
5
  export declare const Scrollbar: React.FC<React.PropsWithChildren<IProps>>;
6
6
  export {};
package/types/index.d.ts CHANGED
@@ -5,3 +5,4 @@ export * from './subcomponents';
5
5
  export * from './components/helpers/animate';
6
6
  export * from './components/modal';
7
7
  export * from './components/table';
8
+ export * from './components/drawer';