@gearbox-protocol/permissionless-ui 1.22.0-next.57 → 1.22.0-next.58
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),w=require("@radix-ui/react-dropdown-menu");require("react");require("@gearbox-protocol/sdk");const a=require("../../utils/cn.cjs");require("sonner");require("luxon");function h(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const i=h(w);function s({children:e,title:o,asChild:t=!1,placement:r="bottom",align:d="start",sideOffset:l=4,maxWidth:c,minWidth:u,open:p,onOpenChange:m,modal:f=!1,className:b,triggerClassName:g}){const j=a.cn("z-50 min-w-32 overflow-hidden rounded-lg border border-border bg-gray-40 p-1 text-popover-foreground shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",b);return n.jsxs(i.Root,{open:p,onOpenChange:m,modal:f,children:[n.jsx(i.Trigger,{asChild:t,className:t?void 0:a.cn("inline-flex appearance-none border-0 bg-transparent p-0 text-inherit font-inherit cursor-pointer",g),children:o}),n.jsx(i.Portal,{children:n.jsx(i.Content,{side:r,align:d,sideOffset:l,className:j,style:{maxWidth:c,minWidth:u},children:e})})]})}s.displayName="SimpleDropdown";exports.SimpleDropdown=s;
|
|
@@ -1,63 +1,64 @@
|
|
|
1
|
-
import { jsxs as h, jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsxs as h, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import * as t from "@radix-ui/react-dropdown-menu";
|
|
3
3
|
import "react";
|
|
4
4
|
import "@gearbox-protocol/sdk";
|
|
5
|
-
import { cn as
|
|
5
|
+
import { cn as r } from "../../utils/cn.js";
|
|
6
6
|
import "sonner";
|
|
7
7
|
import "luxon";
|
|
8
|
-
function
|
|
9
|
-
children:
|
|
10
|
-
title:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
function w({
|
|
9
|
+
children: a,
|
|
10
|
+
title: i,
|
|
11
|
+
asChild: o = !1,
|
|
12
|
+
placement: n = "bottom",
|
|
13
|
+
align: d = "start",
|
|
14
|
+
sideOffset: s = 4,
|
|
15
|
+
maxWidth: m,
|
|
16
|
+
minWidth: p,
|
|
17
|
+
open: l,
|
|
18
|
+
onOpenChange: f,
|
|
19
|
+
modal: c = !1,
|
|
20
|
+
className: g,
|
|
21
|
+
triggerClassName: b
|
|
21
22
|
}) {
|
|
22
|
-
const
|
|
23
|
+
const u = r(
|
|
23
24
|
"z-50 min-w-32 overflow-hidden rounded-lg border border-border bg-gray-40 p-1 text-popover-foreground shadow-lg",
|
|
24
25
|
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
25
|
-
|
|
26
|
+
g
|
|
26
27
|
);
|
|
27
28
|
return /* @__PURE__ */ h(
|
|
28
|
-
|
|
29
|
+
t.Root,
|
|
29
30
|
{
|
|
30
|
-
open:
|
|
31
|
-
onOpenChange:
|
|
32
|
-
modal:
|
|
31
|
+
open: l,
|
|
32
|
+
onOpenChange: f,
|
|
33
|
+
modal: c,
|
|
33
34
|
children: [
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
|
|
35
|
+
/* @__PURE__ */ e(
|
|
36
|
+
t.Trigger,
|
|
36
37
|
{
|
|
37
|
-
|
|
38
|
-
className: o(
|
|
38
|
+
asChild: o,
|
|
39
|
+
className: o ? void 0 : r(
|
|
39
40
|
"inline-flex appearance-none border-0 bg-transparent p-0 text-inherit font-inherit cursor-pointer",
|
|
40
|
-
|
|
41
|
+
b
|
|
41
42
|
),
|
|
42
|
-
children:
|
|
43
|
+
children: i
|
|
43
44
|
}
|
|
44
|
-
)
|
|
45
|
-
/* @__PURE__ */ t
|
|
46
|
-
|
|
45
|
+
),
|
|
46
|
+
/* @__PURE__ */ e(t.Portal, { children: /* @__PURE__ */ e(
|
|
47
|
+
t.Content,
|
|
47
48
|
{
|
|
48
|
-
side:
|
|
49
|
-
align:
|
|
50
|
-
sideOffset:
|
|
51
|
-
className:
|
|
52
|
-
style: { maxWidth:
|
|
53
|
-
children:
|
|
49
|
+
side: n,
|
|
50
|
+
align: d,
|
|
51
|
+
sideOffset: s,
|
|
52
|
+
className: u,
|
|
53
|
+
style: { maxWidth: m, minWidth: p },
|
|
54
|
+
children: a
|
|
54
55
|
}
|
|
55
56
|
) })
|
|
56
57
|
]
|
|
57
58
|
}
|
|
58
59
|
);
|
|
59
60
|
}
|
|
60
|
-
|
|
61
|
+
w.displayName = "SimpleDropdown";
|
|
61
62
|
export {
|
|
62
|
-
|
|
63
|
+
w as SimpleDropdown
|
|
63
64
|
};
|
|
@@ -1,17 +1,25 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
export type SimpleDropdownPlacement = "top" | "bottom" | "right" | "left";
|
|
3
3
|
export type SimpleDropdownAlign = "start" | "center" | "end";
|
|
4
4
|
export interface SimpleDropdownProps {
|
|
5
5
|
/**
|
|
6
6
|
* Dropdown popup content — what appears inside the floating panel.
|
|
7
7
|
*/
|
|
8
|
-
children:
|
|
8
|
+
children: ReactNode;
|
|
9
9
|
/**
|
|
10
10
|
* Trigger element — what the user clicks to reveal the dropdown.
|
|
11
11
|
*
|
|
12
12
|
* Named `title` for consistency with the `SimpleTooltip` API.
|
|
13
13
|
*/
|
|
14
|
-
title:
|
|
14
|
+
title: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* When `true`, `title` is used directly as the trigger element (Radix `asChild`).
|
|
17
|
+
* Use this when `title` is already a `<button>`, `<a>`, or another interactive
|
|
18
|
+
* component to avoid invalid nesting (`<button>` inside `<button>`).
|
|
19
|
+
*
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
asChild?: boolean;
|
|
15
23
|
/** Placement relative to the trigger element. @default "bottom" */
|
|
16
24
|
placement?: SimpleDropdownPlacement;
|
|
17
25
|
/** Alignment along the placement axis. @default "start" */
|
|
@@ -46,8 +54,8 @@ export interface SimpleDropdownProps {
|
|
|
46
54
|
*
|
|
47
55
|
* @example
|
|
48
56
|
* ```tsx
|
|
49
|
-
* // Basic dropdown
|
|
50
|
-
* <SimpleDropdown title={<
|
|
57
|
+
* // Basic dropdown — title is plain content, wrapped in a <button> automatically
|
|
58
|
+
* <SimpleDropdown title={<span>Open menu</span>} placement="bottom">
|
|
51
59
|
* <DropdownMenuItem>Item 1</DropdownMenuItem>
|
|
52
60
|
* <DropdownMenuItem>Item 2</DropdownMenuItem>
|
|
53
61
|
* </SimpleDropdown>
|
|
@@ -55,8 +63,8 @@ export interface SimpleDropdownProps {
|
|
|
55
63
|
*
|
|
56
64
|
* @example
|
|
57
65
|
* ```tsx
|
|
58
|
-
* //
|
|
59
|
-
* <SimpleDropdown title={<
|
|
66
|
+
* // Title is already a button — use asChild to avoid <button> nesting
|
|
67
|
+
* <SimpleDropdown title={<button className="btn">Toggle</button>} asChild>
|
|
60
68
|
* <div className="p-4">Any custom content here</div>
|
|
61
69
|
* </SimpleDropdown>
|
|
62
70
|
* ```
|
|
@@ -66,7 +74,7 @@ export interface SimpleDropdownProps {
|
|
|
66
74
|
* // Controlled
|
|
67
75
|
* const [open, setOpen] = useState(false);
|
|
68
76
|
* <SimpleDropdown
|
|
69
|
-
* title={<
|
|
77
|
+
* title={<span>Toggle</span>}
|
|
70
78
|
* open={open}
|
|
71
79
|
* onOpenChange={setOpen}
|
|
72
80
|
* >
|
|
@@ -74,7 +82,7 @@ export interface SimpleDropdownProps {
|
|
|
74
82
|
* </SimpleDropdown>
|
|
75
83
|
* ```
|
|
76
84
|
*/
|
|
77
|
-
export declare function SimpleDropdown({ children, title, placement, align, sideOffset, maxWidth, minWidth, open, onOpenChange, modal, className, triggerClassName, }: SimpleDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
85
|
+
export declare function SimpleDropdown({ children, title, asChild, placement, align, sideOffset, maxWidth, minWidth, open, onOpenChange, modal, className, triggerClassName, }: SimpleDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
78
86
|
export declare namespace SimpleDropdown {
|
|
79
87
|
var displayName: string;
|
|
80
88
|
}
|