@validationcloud/fractal-ui 1.39.0 → 1.40.0
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/dist/assets/animated-loader.svg.js +4 -0
- package/dist/components/animated-loader/animated-loader.js +20 -0
- package/dist/components/badge/badge.js +31 -0
- package/dist/components/box/box.js +69 -0
- package/dist/components/button/button.js +137 -0
- package/dist/components/client-modal/client-modal.js +33 -0
- package/dist/components/decorated-icon/decorated-icon.js +30 -0
- package/dist/components/dropdown-menu/dropdown-menu.js +63 -0
- package/dist/components/icon/icon.js +8 -0
- package/dist/components/input-button/input-button.js +41 -0
- package/dist/{fractal-ui.js → components/mount-svg-sprite/mount-svg-sprite.js} +11 -795
- package/dist/components/page-padding/page-padding.js +25 -0
- package/dist/components/protocol-logo/protocol-logo.js +89 -0
- package/dist/components/scroll-area/scroll-area.js +71 -0
- package/dist/components/skeleton/skeleton.js +12 -0
- package/dist/components/text-input/text-input.js +57 -0
- package/dist/components/tooltip/tooltip.js +66 -0
- package/dist/components/tooltip-provider/tooltip-provider.js +14 -0
- package/dist/index.d.ts +2 -18
- package/dist/index.js +39 -0
- package/dist/internal/modal-header.js +18 -0
- package/dist/internal/modal.js +35 -0
- package/dist/internal/react-portal.js +17 -0
- package/dist/internal/round-button.js +32 -0
- package/dist/lib/tailwind-merge.js +39 -0
- package/dist/src/index.d.ts +18 -0
- package/dist/utils/disable-password-managers.js +10 -0
- package/package.json +15 -17
- package/dist/components/animated-loader/animated-loader.stories.d.ts +0 -8
- package/dist/components/badge/badge.stories.d.ts +0 -17
- package/dist/components/box/box.stories.d.ts +0 -19
- package/dist/components/button/button.stories.d.ts +0 -28
- package/dist/components/client-modal/client-modal.stories.d.ts +0 -8
- package/dist/components/decorated-icon/decorated-icon.stories.d.ts +0 -18
- package/dist/components/dropdown-menu/dropdown-menu.stories.d.ts +0 -10
- package/dist/components/icon/icon-showcase.stories.d.ts +0 -13
- package/dist/components/icon/icon.stories.d.ts +0 -8
- package/dist/components/input-button/input-button.stories.d.ts +0 -11
- package/dist/components/page-padding/page-padding.stories.d.ts +0 -10
- package/dist/components/protocol-logo/protocol-logo.stories.d.ts +0 -503
- package/dist/components/scroll-area/scroll-area.stories.d.ts +0 -12
- package/dist/components/skeleton/skeleton.stories.d.ts +0 -13
- package/dist/components/text-input/text-input.stories.d.ts +0 -26
- package/dist/components/tooltip/tooltip.stories.d.ts +0 -325
- package/dist/fractal-ui.d.ts +0 -2
- /package/dist/{components → src/components}/animated-loader/animated-loader.d.ts +0 -0
- /package/dist/{components → src/components}/badge/badge.d.ts +0 -0
- /package/dist/{components → src/components}/box/box.d.ts +0 -0
- /package/dist/{components → src/components}/button/button.d.ts +0 -0
- /package/dist/{components → src/components}/client-modal/client-modal.d.ts +0 -0
- /package/dist/{components → src/components}/decorated-icon/decorated-icon.d.ts +0 -0
- /package/dist/{components → src/components}/dropdown-menu/dropdown-menu.d.ts +0 -0
- /package/dist/{components → src/components}/icon/icon-ids.d.ts +0 -0
- /package/dist/{components → src/components}/icon/icon.d.ts +0 -0
- /package/dist/{components → src/components}/input-button/input-button.d.ts +0 -0
- /package/dist/{components → src/components}/mount-svg-sprite/mount-svg-sprite.d.ts +0 -0
- /package/dist/{components → src/components}/page-padding/page-padding.d.ts +0 -0
- /package/dist/{components → src/components}/protocol-logo/protocol-logo-ids.d.ts +0 -0
- /package/dist/{components → src/components}/protocol-logo/protocol-logo.d.ts +0 -0
- /package/dist/{components → src/components}/scroll-area/scroll-area.d.ts +0 -0
- /package/dist/{components → src/components}/skeleton/skeleton.d.ts +0 -0
- /package/dist/{components → src/components}/text-input/text-input.d.ts +0 -0
- /package/dist/{components → src/components}/tooltip/tooltip.d.ts +0 -0
- /package/dist/{components → src/components}/tooltip-provider/tooltip-provider.d.ts +0 -0
- /package/dist/{internal → src/internal}/modal-header.d.ts +0 -0
- /package/dist/{internal → src/internal}/modal.d.ts +0 -0
- /package/dist/{internal → src/internal}/react-portal.d.ts +0 -0
- /package/dist/{internal → src/internal}/round-button.d.ts +0 -0
- /package/dist/{lib → src/lib}/tailwind-merge.d.ts +0 -0
- /package/dist/{utils → src/utils}/disable-password-managers.d.ts +0 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const e = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20style='shape-rendering:%20auto'%20viewBox='0%200%20100%20100'%20preserveAspectRatio='xMidYMid'%20%3e%3ccircle%20cx='34'%20cy='50'%20fill='%23fff'%20r='16'%3e%3canimate%20attributeName='cx'%20repeatCount='indefinite'%20dur='0.8s'%20keyTimes='0;0.5;1'%20values='34;66;34'%20begin='-0.4s'%20/%3e%3c/circle%3e%3ccircle%20cx='66'%20cy='50'%20fill='%23D63D57'%20r='16'%3e%3canimate%20attributeName='cx'%20repeatCount='indefinite'%20dur='0.8s'%20keyTimes='0;0.5;1'%20values='34;66;34'%20begin='0s'%20/%3e%3c/circle%3e%3ccircle%20cx='34'%20cy='50'%20fill='%23fff'%20r='16'%3e%3canimate%20attributeName='cx'%20repeatCount='indefinite'%20dur='0.8s'%20keyTimes='0;0.5;1'%20values='34;66;34'%20begin='-0.4s'%20/%3e%3canimate%20attributeName='fill-opacity'%20values='0;0;1;1'%20calcMode='discrete'%20keyTimes='0;0.499;0.5;1'%20dur='0.8s'%20repeatCount='indefinite'%20/%3e%3c/circle%3e%3c/svg%3e";
|
|
2
|
+
export {
|
|
3
|
+
e as default
|
|
4
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import m from "../../assets/animated-loader.svg.js";
|
|
4
|
+
import { twMerge as e } from "../../lib/tailwind-merge.js";
|
|
5
|
+
function c({ className: r, ...o }) {
|
|
6
|
+
return /* @__PURE__ */ t(
|
|
7
|
+
"img",
|
|
8
|
+
{
|
|
9
|
+
className: e("mx-auto block", r),
|
|
10
|
+
src: m,
|
|
11
|
+
height: 150,
|
|
12
|
+
width: 150,
|
|
13
|
+
alt: "Loader",
|
|
14
|
+
...o
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
c as AnimatedLoader
|
|
20
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
3
|
+
import { Slot as d } from "radix-ui";
|
|
4
|
+
import { forwardRef as a } from "react";
|
|
5
|
+
import { twMerge as u } from "../../lib/tailwind-merge.js";
|
|
6
|
+
const m = {
|
|
7
|
+
number: "bg-success-30/10 text-success-50 border border-success-50/50",
|
|
8
|
+
success: "bg-neutral-70 text-success-30",
|
|
9
|
+
primary: "bg-secondary-30/15 text-secondary-30",
|
|
10
|
+
successInverted: "bg-success-30 text-neutral-80"
|
|
11
|
+
}, x = {
|
|
12
|
+
tag: "tg-tag px-[6px] py-[2px] rounded",
|
|
13
|
+
caption: "tg-caption px-2 py-[2px] rounded-lg",
|
|
14
|
+
bodyBold: "tg-body-bold px-[10px] py-1 rounded"
|
|
15
|
+
}, g = a(
|
|
16
|
+
({ asChild: e, color: t = "number", size: s = "tag", className: r, ...o }, c) => {
|
|
17
|
+
const n = e ? d.Root : "div";
|
|
18
|
+
return /* @__PURE__ */ p(
|
|
19
|
+
n,
|
|
20
|
+
{
|
|
21
|
+
ref: c,
|
|
22
|
+
className: u("flex items-center justify-center text-nowrap", m[t], x[s], r),
|
|
23
|
+
...o
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
g.displayName = "Badge";
|
|
29
|
+
export {
|
|
30
|
+
g as Badge
|
|
31
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx as p, jsxs as n, Fragment as w } from "react/jsx-runtime";
|
|
2
|
+
import { Slot as j } from "radix-ui";
|
|
3
|
+
import { forwardRef as B } from "react";
|
|
4
|
+
import { twMerge as s } from "../../lib/tailwind-merge.js";
|
|
5
|
+
const N = B(
|
|
6
|
+
({
|
|
7
|
+
asChild: m,
|
|
8
|
+
header: r,
|
|
9
|
+
borderColor: e,
|
|
10
|
+
borderRadius: x = "rounded-lg",
|
|
11
|
+
padding: t = "p-r6",
|
|
12
|
+
background: b = "bg-neutral-70",
|
|
13
|
+
className: f,
|
|
14
|
+
children: o,
|
|
15
|
+
...l
|
|
16
|
+
}, c) => {
|
|
17
|
+
const u = m ? j.Root : "div";
|
|
18
|
+
return /* @__PURE__ */ p(
|
|
19
|
+
u,
|
|
20
|
+
{
|
|
21
|
+
ref: c,
|
|
22
|
+
className: s(
|
|
23
|
+
// borders:
|
|
24
|
+
x,
|
|
25
|
+
e,
|
|
26
|
+
e && "border-1.5",
|
|
27
|
+
// padding:
|
|
28
|
+
t === "p-r6" && "xs:p-5 p-4 md:p-6",
|
|
29
|
+
t === "p-r4" && "xs:p-3.5 p-3 md:p-4",
|
|
30
|
+
t === "p-0" && "p-0",
|
|
31
|
+
// background:
|
|
32
|
+
b,
|
|
33
|
+
f
|
|
34
|
+
),
|
|
35
|
+
...l,
|
|
36
|
+
children: m ? o : /* @__PURE__ */ n(w, { children: [
|
|
37
|
+
r && /* @__PURE__ */ p(i, { padding: t, children: r }),
|
|
38
|
+
o
|
|
39
|
+
] })
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
N.displayName = "Box";
|
|
45
|
+
function i({ padding: m, children: r, className: e, ...x }) {
|
|
46
|
+
return /* @__PURE__ */ p(
|
|
47
|
+
"div",
|
|
48
|
+
{
|
|
49
|
+
className: s(
|
|
50
|
+
"border-b-neutral-60 flex flex-row items-center justify-between border-b",
|
|
51
|
+
// nullify outside padding with negative margin on top and side:
|
|
52
|
+
m === "p-r6" && "xs:-mx-5 xs:-mt-5 -mx-4 -mt-4 md:-mx-6 md:-mt-6",
|
|
53
|
+
m === "p-r4" && "xs:-mx-3.5 xs:-mt-3.5 -mx-3 -mt-3 md:-mx-4 md:-mt-4",
|
|
54
|
+
// add additional padding below divider:
|
|
55
|
+
m === "p-r6" && "xs:mb-5 mb-4 md:mb-6",
|
|
56
|
+
m === "p-r4" && "xs:mb-3.5 mb-3 md:mb-4",
|
|
57
|
+
m === "p-r6" && "xs:p-5 p-4 md:p-6",
|
|
58
|
+
m === "p-r4" && "xs:p-3.5 p-3 md:p-4",
|
|
59
|
+
m === "p-0" && "p-0",
|
|
60
|
+
e
|
|
61
|
+
),
|
|
62
|
+
...x,
|
|
63
|
+
children: r
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
N as Box
|
|
69
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { Slot as u } from "radix-ui";
|
|
3
|
+
import { forwardRef as b } from "react";
|
|
4
|
+
import { twMerge as g } from "../../lib/tailwind-merge.js";
|
|
5
|
+
const e = {
|
|
6
|
+
base: [
|
|
7
|
+
// Base
|
|
8
|
+
"flex cursor-pointer items-center justify-center text-nowrap text-neutral-10 ring-inset transition ease-in-out",
|
|
9
|
+
// Focus
|
|
10
|
+
"focus:border-none focus:outline-none focus-visible:ring-2 focus-visible:ring-neutral-10 focus-visible:text-neutral-10",
|
|
11
|
+
// Disabled base
|
|
12
|
+
"disabled:cursor-default disabled:hover:shadow-none"
|
|
13
|
+
],
|
|
14
|
+
variants: {
|
|
15
|
+
primary: [
|
|
16
|
+
// Base
|
|
17
|
+
"bg-primary-50",
|
|
18
|
+
// Hover
|
|
19
|
+
"hover:bg-primary-60",
|
|
20
|
+
// Focus
|
|
21
|
+
"focus-visible:ring-neutral-30",
|
|
22
|
+
// Disabled
|
|
23
|
+
"disabled:bg-neutral-50 disabled:text-neutral-30"
|
|
24
|
+
],
|
|
25
|
+
secondary: [
|
|
26
|
+
// Base
|
|
27
|
+
"bg-neutral-80 ring-1 ring-neutral-55 text-neutral-20",
|
|
28
|
+
// Hover
|
|
29
|
+
"hover:ring-1 hover:ring-neutral-60 hover:shadow-button hover:text-neutral-10",
|
|
30
|
+
// Focus
|
|
31
|
+
"focus-visible:ring-neutral-30 focus-visible:ring-1.5",
|
|
32
|
+
// Disabled
|
|
33
|
+
"disabled:bg-neutral-60 disabled:text-neutral-40 disabled:ring-neutral-60"
|
|
34
|
+
],
|
|
35
|
+
redText: [
|
|
36
|
+
// Base
|
|
37
|
+
"bg-neutral-80 text-primary-40 ring-1 ring-neutral-55",
|
|
38
|
+
// Hover
|
|
39
|
+
"hover:shadow-button hover:ring-neutral-60",
|
|
40
|
+
// Focus
|
|
41
|
+
"focus-visible:ring-neutral-30 focus-visible:ring-1.5",
|
|
42
|
+
// Disabled
|
|
43
|
+
"disabled:bg-neutral-60 disabled:text-neutral-40 disabled:ring-neutral-60"
|
|
44
|
+
],
|
|
45
|
+
warning: [
|
|
46
|
+
// Base
|
|
47
|
+
"bg-warning-50",
|
|
48
|
+
// Hover
|
|
49
|
+
"hover:bg-warning-60",
|
|
50
|
+
// Disabled
|
|
51
|
+
"disabled:bg-neutral-50 disabled:text-neutral-30"
|
|
52
|
+
],
|
|
53
|
+
info: [
|
|
54
|
+
// Base
|
|
55
|
+
"bg-secondary-40",
|
|
56
|
+
// Hover
|
|
57
|
+
"hover:bg-secondary-50",
|
|
58
|
+
// Disabled
|
|
59
|
+
"disabled:bg-neutral-50 disabled:text-neutral-30"
|
|
60
|
+
],
|
|
61
|
+
gradient: [
|
|
62
|
+
// Base
|
|
63
|
+
"bg-ctaGradient",
|
|
64
|
+
// Hover
|
|
65
|
+
"hover:bg-ctaGradientHover",
|
|
66
|
+
// Disabled
|
|
67
|
+
"disabled:bg-neutral-50 disabled:text-neutral-30"
|
|
68
|
+
],
|
|
69
|
+
light: [
|
|
70
|
+
// Base
|
|
71
|
+
"bg-neutral-10 text-neutral-60",
|
|
72
|
+
// Hover
|
|
73
|
+
"hover:text-neutral-80 hover:bg-neutral-20",
|
|
74
|
+
// Disabled
|
|
75
|
+
"disabled:bg-neutral-30 disabled:text-neutral-50",
|
|
76
|
+
// Focus
|
|
77
|
+
"focus-visible:ring-neutral-40 focus-visible:ring-1.5 focus-visible:text-neutral-60"
|
|
78
|
+
],
|
|
79
|
+
ghost: [
|
|
80
|
+
// Base
|
|
81
|
+
"inline-flex text-current bg-transparent",
|
|
82
|
+
// Hover
|
|
83
|
+
"hover:bg-neutral-30/15",
|
|
84
|
+
// Active
|
|
85
|
+
"active:bg-neutral-10/30",
|
|
86
|
+
// Disabled
|
|
87
|
+
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
88
|
+
],
|
|
89
|
+
text: [
|
|
90
|
+
// Base
|
|
91
|
+
"inline-flex text-neutral-10 bg-transparent underline decoration-neutral-10 tg-body-bold",
|
|
92
|
+
// Hover - text color change and underline color change
|
|
93
|
+
"hover:text-neutral-10/80 hover:decoration-neutral-10/60",
|
|
94
|
+
// Active state
|
|
95
|
+
"active:text-neutral-10/70 active:decoration-neutral-10/50",
|
|
96
|
+
// Disabled
|
|
97
|
+
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
sizes: {
|
|
101
|
+
xlarge: "tg-subtitle-bold min-h-12 rounded-xl px-5 py-3 md:min-h-14 md:rounded-2xl",
|
|
102
|
+
large: "tg-button-text min-h-11 rounded-lg px-5 py-3 md:min-h-12",
|
|
103
|
+
medium: "tg-button-small min-h-10 rounded-lg px-4 py-2 md:min-h-10",
|
|
104
|
+
small: "tg-caption-bold min-h-[34px] rounded-md px-4 py-1.5",
|
|
105
|
+
xsmall: "tg-tag min-h-6 rounded-sm px-2 py-1"
|
|
106
|
+
},
|
|
107
|
+
ghostSizes: {
|
|
108
|
+
xlarge: "-mx-5 -my-3 px-5 py-3",
|
|
109
|
+
large: "-mx-5 -my-3 px-5 py-3",
|
|
110
|
+
medium: "-mx-5 -my-3 px-5 py-3",
|
|
111
|
+
small: "-mx-4 -my-2 px-4 py-2",
|
|
112
|
+
xsmall: "-mx-4 -my-1.5 px-2 py-1"
|
|
113
|
+
}
|
|
114
|
+
}, m = b(
|
|
115
|
+
({ asChild: n, variant: t = "primary", size: r = "medium", className: a, children: i, ...l }, o) => {
|
|
116
|
+
const s = n ? u.Root : "button";
|
|
117
|
+
return /* @__PURE__ */ d(
|
|
118
|
+
s,
|
|
119
|
+
{
|
|
120
|
+
ref: o,
|
|
121
|
+
className: g(
|
|
122
|
+
...e.base,
|
|
123
|
+
...e.variants[t],
|
|
124
|
+
t !== "text" && e.sizes[r],
|
|
125
|
+
t === "ghost" && e.ghostSizes[r],
|
|
126
|
+
a
|
|
127
|
+
),
|
|
128
|
+
...l,
|
|
129
|
+
children: i
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
m.displayName = "Button";
|
|
135
|
+
export {
|
|
136
|
+
m as Button
|
|
137
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as t, Fragment as n, jsxs as f } from "react/jsx-runtime";
|
|
3
|
+
import { Modal as p } from "../../internal/modal.js";
|
|
4
|
+
import { ModalHeader as x } from "../../internal/modal-header.js";
|
|
5
|
+
import { ReactPortal as g } from "../../internal/react-portal.js";
|
|
6
|
+
import { useEffect as h } from "react";
|
|
7
|
+
import { useTransitionState as E } from "react-transition-state";
|
|
8
|
+
function R({
|
|
9
|
+
wrapperId: m = "client-modals",
|
|
10
|
+
isOpen: r,
|
|
11
|
+
title: o,
|
|
12
|
+
onClose: e,
|
|
13
|
+
description: u,
|
|
14
|
+
disabled: a,
|
|
15
|
+
children: l,
|
|
16
|
+
...s
|
|
17
|
+
}) {
|
|
18
|
+
const [{ status: c, isMounted: d }, i] = E({
|
|
19
|
+
timeout: 150,
|
|
20
|
+
//TODO: make the delay configurable. It should match exit animation duration.
|
|
21
|
+
mountOnEnter: !0,
|
|
22
|
+
unmountOnExit: !0
|
|
23
|
+
});
|
|
24
|
+
return h(() => {
|
|
25
|
+
i(r);
|
|
26
|
+
}, [r, i]), /* @__PURE__ */ t(n, { children: d && /* @__PURE__ */ t(n, { children: /* @__PURE__ */ t(g, { wrapperId: m, children: /* @__PURE__ */ f(p, { isExiting: c === "exiting", ...s, children: [
|
|
27
|
+
(o || e) && /* @__PURE__ */ t(x, { title: o, description: u, onClose: e, disabled: a }),
|
|
28
|
+
l
|
|
29
|
+
] }) }) }) });
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
R as ClientModal
|
|
33
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Icon as i } from "../icon/icon.js";
|
|
4
|
+
import { twMerge as s } from "../../lib/tailwind-merge.js";
|
|
5
|
+
function N({
|
|
6
|
+
background: r,
|
|
7
|
+
backgroundClassName: l,
|
|
8
|
+
symbol: o,
|
|
9
|
+
symbolClassName: a,
|
|
10
|
+
symbolScale: t = 0.55,
|
|
11
|
+
className: c,
|
|
12
|
+
...m
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ n("div", { className: s("relative", c), ...m, children: [
|
|
15
|
+
/* @__PURE__ */ e("div", { className: "absolute inset-0", children: /* @__PURE__ */ e(i, { icon: r, className: s("size-full", l) }) }),
|
|
16
|
+
/* @__PURE__ */ e(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
className: "absolute inset-0",
|
|
20
|
+
style: {
|
|
21
|
+
transform: `scale(${t})`
|
|
22
|
+
},
|
|
23
|
+
children: /* @__PURE__ */ e(i, { icon: o, className: s("size-full", a) })
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
] });
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
N as DecoratedIcon
|
|
30
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { DropdownMenu as t, ScrollArea as n } from "radix-ui";
|
|
3
|
+
import { forwardRef as h } from "react";
|
|
4
|
+
import { twMerge as d } from "../../lib/tailwind-merge.js";
|
|
5
|
+
const g = h(
|
|
6
|
+
({ className: a, baseColor: r = "bg-neutral-60", textValue: l, ...o }, i) => /* @__PURE__ */ e(
|
|
7
|
+
t.Item,
|
|
8
|
+
{
|
|
9
|
+
className: d(
|
|
10
|
+
"tg-button-small data-highlighted:text-neutral-10 flex cursor-pointer items-center truncate rounded-[10px] px-4 py-2.5 transition-colors outline-none select-none",
|
|
11
|
+
r === "bg-neutral-60" && "text-neutral-20 data-highlighted:bg-neutral-55",
|
|
12
|
+
r === "bg-neutral-80" && "text-neutral-40 data-highlighted:bg-neutral-60",
|
|
13
|
+
a
|
|
14
|
+
),
|
|
15
|
+
textValue: l,
|
|
16
|
+
...o,
|
|
17
|
+
ref: i
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
);
|
|
21
|
+
g.displayName = "DropdownMenuItem";
|
|
22
|
+
function f({
|
|
23
|
+
trigger: a,
|
|
24
|
+
baseColor: r = "bg-neutral-60",
|
|
25
|
+
children: l,
|
|
26
|
+
className: o,
|
|
27
|
+
contentClassName: i,
|
|
28
|
+
disabled: u,
|
|
29
|
+
...c
|
|
30
|
+
}) {
|
|
31
|
+
return /* @__PURE__ */ s(t.Root, { ...c, children: [
|
|
32
|
+
/* @__PURE__ */ e(t.Trigger, { className: d("", o), asChild: !0, disabled: u, children: a }),
|
|
33
|
+
/* @__PURE__ */ e(t.Portal, { children: /* @__PURE__ */ e(n.Root, { type: "hover", style: { "--scrollbar-size": "10px" }, asChild: !0, children: /* @__PURE__ */ s(
|
|
34
|
+
t.Content,
|
|
35
|
+
{
|
|
36
|
+
className: d(
|
|
37
|
+
"max-h-(--radix-dropdown-menu-content-available-height) overflow-hidden rounded-2xl shadow-[0px_8px_20px_2px_rgba(0,0,0,0.40)]",
|
|
38
|
+
r === "bg-neutral-60" && "bg-neutral-60",
|
|
39
|
+
r === "bg-neutral-80" && "bg-neutral-80",
|
|
40
|
+
i
|
|
41
|
+
),
|
|
42
|
+
align: "end",
|
|
43
|
+
sideOffset: 8,
|
|
44
|
+
collisionPadding: 8,
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ e(n.Viewport, { className: "max-h-(--radix-dropdown-menu-content-available-height) p-1.5", children: l }),
|
|
47
|
+
/* @__PURE__ */ e(
|
|
48
|
+
n.Scrollbar,
|
|
49
|
+
{
|
|
50
|
+
className: "hover:bg-neutral-60 flex w-(--scrollbar-size) touch-none px-0.5 py-4 transition-all select-none hover:px-0",
|
|
51
|
+
orientation: "vertical",
|
|
52
|
+
children: /* @__PURE__ */ e(n.Thumb, { className: "bg-neutral-10/50 hover:bg-neutral-10 flex-1 rounded-(--scrollbar-size) transition-colors" })
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
) }) })
|
|
58
|
+
] });
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
f as DropdownMenu,
|
|
62
|
+
g as DropdownMenuItem
|
|
63
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Icon as c } from "../icon/icon.js";
|
|
4
|
+
import { twMerge as r } from "../../lib/tailwind-merge.js";
|
|
5
|
+
function g({ clearIcon: o, cta: n, disabled: e, className: u, ...l }) {
|
|
6
|
+
return /* @__PURE__ */ t(
|
|
7
|
+
"button",
|
|
8
|
+
{
|
|
9
|
+
className: r(
|
|
10
|
+
"group flex h-full w-10 items-center justify-center focus:outline-none",
|
|
11
|
+
e && "pointer-events-none",
|
|
12
|
+
u
|
|
13
|
+
),
|
|
14
|
+
...l,
|
|
15
|
+
children: /* @__PURE__ */ t(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
className: r(
|
|
19
|
+
"bg-neutral-80 group-focus:ring-neutral-40 flex h-8 w-full items-center justify-center rounded-lg group-focus:ring-1",
|
|
20
|
+
n && "bg-ctaGradient hover:bg-ctaGradientHover",
|
|
21
|
+
e && "bg-neutral-55"
|
|
22
|
+
),
|
|
23
|
+
children: /* @__PURE__ */ t(
|
|
24
|
+
c,
|
|
25
|
+
{
|
|
26
|
+
icon: o ? "close" : "enter",
|
|
27
|
+
className: r(
|
|
28
|
+
"text-neutral-10 group-hover:text-neutral-40 h-3.5 w-3.5",
|
|
29
|
+
n && "group-hover:text-neutral-10",
|
|
30
|
+
e && "text-neutral-30"
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
g as InputButton
|
|
41
|
+
};
|