@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,25 @@
|
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { Slot as e } from "radix-ui";
|
|
3
|
+
import { forwardRef as a } from "react";
|
|
4
|
+
import { twMerge as i } from "../../lib/tailwind-merge.js";
|
|
5
|
+
const f = a(
|
|
6
|
+
({ asChild: o, className: r, ...t }, d) => {
|
|
7
|
+
const m = o ? e.Root : "div";
|
|
8
|
+
return /* @__PURE__ */ p(
|
|
9
|
+
m,
|
|
10
|
+
{
|
|
11
|
+
ref: d,
|
|
12
|
+
className: i(
|
|
13
|
+
// Apply dynamic padding utilities to all sides by default
|
|
14
|
+
"dpt dpr dpb dpl",
|
|
15
|
+
r
|
|
16
|
+
),
|
|
17
|
+
...t
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
f.displayName = "PagePadding";
|
|
23
|
+
export {
|
|
24
|
+
f as PagePadding
|
|
25
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { twMerge as i } from "../../lib/tailwind-merge.js";
|
|
4
|
+
const c = {
|
|
5
|
+
abstract: "abs",
|
|
6
|
+
apechain: "ape",
|
|
7
|
+
aptos: "apt",
|
|
8
|
+
arbitrum: "arb",
|
|
9
|
+
astar: "astr",
|
|
10
|
+
avalanche: "avax",
|
|
11
|
+
axelar: "axl",
|
|
12
|
+
base: "base",
|
|
13
|
+
berachain: "bera",
|
|
14
|
+
binance: "bnb",
|
|
15
|
+
bitcoin: "btc",
|
|
16
|
+
bitlayer: "btr",
|
|
17
|
+
bittensor: "tao",
|
|
18
|
+
bsc: "bnb",
|
|
19
|
+
bsquared: "b2",
|
|
20
|
+
casper: "cspr",
|
|
21
|
+
conflux: "cfx",
|
|
22
|
+
cronos: "cro",
|
|
23
|
+
ethereum: "eth",
|
|
24
|
+
etherlink: "xtz",
|
|
25
|
+
fraxtal: "frax",
|
|
26
|
+
gnosis: "gno",
|
|
27
|
+
hashkey: "hsk",
|
|
28
|
+
hedera: "hbar",
|
|
29
|
+
hyperliquid: "hype",
|
|
30
|
+
icp: "icp",
|
|
31
|
+
katana: "kat",
|
|
32
|
+
lisk: "lsk",
|
|
33
|
+
mantle: "mnt",
|
|
34
|
+
merlin: "merl",
|
|
35
|
+
mezo: "mezo",
|
|
36
|
+
mind: "fhe",
|
|
37
|
+
monad: "mon",
|
|
38
|
+
opbnb: "opbnb",
|
|
39
|
+
polygon: "matic",
|
|
40
|
+
provenance: "hash",
|
|
41
|
+
ronin: "ron",
|
|
42
|
+
rootstock: "rbtc",
|
|
43
|
+
saucerswap: "sauce",
|
|
44
|
+
solana: "sol",
|
|
45
|
+
somnia: "stt",
|
|
46
|
+
sonic: "s",
|
|
47
|
+
scroll: "scr",
|
|
48
|
+
stellar: "xlm",
|
|
49
|
+
superseed: "supr",
|
|
50
|
+
tron: "trx",
|
|
51
|
+
unichain: "uni",
|
|
52
|
+
wemix: "wemix",
|
|
53
|
+
worldchain: "wld",
|
|
54
|
+
xlayer: "okb",
|
|
55
|
+
zksync: "zk"
|
|
56
|
+
};
|
|
57
|
+
function n(e, r) {
|
|
58
|
+
let a = e.toLowerCase();
|
|
59
|
+
const o = c[a];
|
|
60
|
+
return o && (a = o), r === "xl" ? `${a}_square` : a;
|
|
61
|
+
}
|
|
62
|
+
const l = {
|
|
63
|
+
xs: 16,
|
|
64
|
+
// Tailwind size 4
|
|
65
|
+
sm: 24,
|
|
66
|
+
// Tailwind size 6
|
|
67
|
+
md: 32,
|
|
68
|
+
// Tailwind size 8
|
|
69
|
+
lg: 40,
|
|
70
|
+
// Tailwind size 10
|
|
71
|
+
xl: 60
|
|
72
|
+
// Tailwind size 15
|
|
73
|
+
};
|
|
74
|
+
function h({ name: e, size: r = "md", className: a, ...o }) {
|
|
75
|
+
const s = l[r];
|
|
76
|
+
return /* @__PURE__ */ t(
|
|
77
|
+
"svg",
|
|
78
|
+
{
|
|
79
|
+
...o,
|
|
80
|
+
className: i(`text-protocols-${n(e)}`, a),
|
|
81
|
+
height: s,
|
|
82
|
+
width: s,
|
|
83
|
+
children: /* @__PURE__ */ t("use", { href: `#${n(e, r)}` })
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
export {
|
|
88
|
+
h as ProtocolLogo
|
|
89
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { ScrollArea as t } from "radix-ui";
|
|
3
|
+
import "react";
|
|
4
|
+
import { twMerge as a } from "../../lib/tailwind-merge.js";
|
|
5
|
+
function l({ className: r, ...o }) {
|
|
6
|
+
return /* @__PURE__ */ e(
|
|
7
|
+
t.Root,
|
|
8
|
+
{
|
|
9
|
+
className: a(
|
|
10
|
+
"overflow-hidden",
|
|
11
|
+
// custom scrollbar styles, override by redefining these CSS variables
|
|
12
|
+
"[--scrollbar-size:--spacing(2.5)] [--thumb-color:var(--color-neutral-60)] [--thumb-hover-color:var(--color-neutral-55)] [--track-color:var(--color-transparent)] [--track-hover-color:var(--color-transparent)]",
|
|
13
|
+
r
|
|
14
|
+
),
|
|
15
|
+
...o
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
function n({ className: r, ...o }) {
|
|
20
|
+
return /* @__PURE__ */ e(t.Viewport, { className: a("", r), ...o });
|
|
21
|
+
}
|
|
22
|
+
function c({ className: r, ...o }) {
|
|
23
|
+
return /* @__PURE__ */ e(
|
|
24
|
+
t.Scrollbar,
|
|
25
|
+
{
|
|
26
|
+
className: a(
|
|
27
|
+
"flex touch-none p-[1px] transition-colors duration-150 ease-out select-none",
|
|
28
|
+
// colors
|
|
29
|
+
"bg-(--track-color) hover:bg-(--track-hover-color)",
|
|
30
|
+
// size and orientation styles
|
|
31
|
+
"data-[orientation=horizontal]:w-(--scrollbar-size) data-[orientation=horizontal]:flex-col data-[orientation=vertical]:w-(--scrollbar-size)",
|
|
32
|
+
r
|
|
33
|
+
),
|
|
34
|
+
...o
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
function i({ className: r, ...o }) {
|
|
39
|
+
return /* @__PURE__ */ e(
|
|
40
|
+
t.Thumb,
|
|
41
|
+
{
|
|
42
|
+
className: a(
|
|
43
|
+
"relative flex-1 rounded-(--scrollbar-size) transition-colors duration-150 ease-out",
|
|
44
|
+
// colors
|
|
45
|
+
"bg-(--thumb-color) hover:bg-(--thumb-hover-color)",
|
|
46
|
+
/* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
|
|
47
|
+
'before:absolute before:top-1/2 before:left-1/2 before:h-full before:min-h-[44px] before:w-full before:min-w-[44px] before:-translate-x-1/2 before:-translate-y-1/2 before:transform before:content-[""]',
|
|
48
|
+
r
|
|
49
|
+
),
|
|
50
|
+
...o
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
function s({ className: r, ...o }) {
|
|
55
|
+
return /* @__PURE__ */ e(t.Corner, { className: a("", r), ...o });
|
|
56
|
+
}
|
|
57
|
+
const h = {
|
|
58
|
+
Root: l,
|
|
59
|
+
Viewport: n,
|
|
60
|
+
Scrollbar: c,
|
|
61
|
+
Thumb: i,
|
|
62
|
+
Corner: s
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
s as Corner,
|
|
66
|
+
l as Root,
|
|
67
|
+
h as ScrollArea,
|
|
68
|
+
c as Scrollbar,
|
|
69
|
+
i as Thumb,
|
|
70
|
+
n as Viewport
|
|
71
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { twMerge as i } from "../../lib/tailwind-merge.js";
|
|
4
|
+
function o({ className: n, ...l }) {
|
|
5
|
+
return /* @__PURE__ */ r("span", { className: i("relative inline-block", n), ...l, children: [
|
|
6
|
+
/* @__PURE__ */ e("div", { className: "inline-block" }),
|
|
7
|
+
/* @__PURE__ */ e("div", { className: i("absolute inset-0 animate-pulse rounded bg-neutral-50") })
|
|
8
|
+
] });
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
o as Skeleton
|
|
12
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsxs as b, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { twMerge as l } from "../../lib/tailwind-merge.js";
|
|
4
|
+
import { DISABLE_PASSWORD_MANAGERS_ATTRIBUTES as c } from "../../utils/disable-password-managers.js";
|
|
5
|
+
const g = ({
|
|
6
|
+
variant: i = "outlined",
|
|
7
|
+
disablePasswordManagers: d,
|
|
8
|
+
rightAccessory: t,
|
|
9
|
+
errorState: o,
|
|
10
|
+
className: s,
|
|
11
|
+
containerClassName: u,
|
|
12
|
+
...r
|
|
13
|
+
}) => {
|
|
14
|
+
const e = i === "filled", n = o || r["aria-invalid"];
|
|
15
|
+
return /* @__PURE__ */ b(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
className: l(
|
|
19
|
+
// base wrapper styles:
|
|
20
|
+
"flex min-h-10 w-full flex-row items-center justify-between rounded-lg",
|
|
21
|
+
// variant-specific base:
|
|
22
|
+
e ? "bg-neutral-60" : "border-neutral-40 focus-within:border-secondary-40 border bg-transparent",
|
|
23
|
+
// error:
|
|
24
|
+
n && (e ? "" : "border-warning-50 focus-within:border-warning-50"),
|
|
25
|
+
// disabled:
|
|
26
|
+
r.disabled && "cursor-not-allowed",
|
|
27
|
+
r.disabled && (e ? "bg-neutral-55" : "border-neutral-55"),
|
|
28
|
+
u
|
|
29
|
+
),
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ a(
|
|
32
|
+
"input",
|
|
33
|
+
{
|
|
34
|
+
className: l(
|
|
35
|
+
// base input styles:
|
|
36
|
+
"tg-body placeholder-neutral-40 flex-1 bg-transparent px-3 focus:outline-none disabled:cursor-not-allowed",
|
|
37
|
+
// text color:
|
|
38
|
+
e ? "text-neutral-10 caret-secondary-40" : "",
|
|
39
|
+
// error:
|
|
40
|
+
n && e && "text-warning-50",
|
|
41
|
+
// disabled:
|
|
42
|
+
r.disabled && !e && "text-neutral-40",
|
|
43
|
+
s
|
|
44
|
+
),
|
|
45
|
+
"aria-invalid": n,
|
|
46
|
+
...d && c,
|
|
47
|
+
...r
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
t && /* @__PURE__ */ a("div", { className: "pr-4", children: t })
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
g as TextInput
|
|
57
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as i, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { Tooltip as t } from "radix-ui";
|
|
4
|
+
import "react";
|
|
5
|
+
import { twMerge as o } from "../../lib/tailwind-merge.js";
|
|
6
|
+
function w({
|
|
7
|
+
content: r,
|
|
8
|
+
color: e = "bg-neutral-80",
|
|
9
|
+
side: n = "bottom",
|
|
10
|
+
matchTriggerWidth: l,
|
|
11
|
+
open: d,
|
|
12
|
+
defaultOpen: s,
|
|
13
|
+
onOpenChange: p,
|
|
14
|
+
delayDuration: m,
|
|
15
|
+
className: g,
|
|
16
|
+
children: c,
|
|
17
|
+
...h
|
|
18
|
+
}) {
|
|
19
|
+
return /* @__PURE__ */ i(
|
|
20
|
+
t.Root,
|
|
21
|
+
{
|
|
22
|
+
open: d,
|
|
23
|
+
defaultOpen: s,
|
|
24
|
+
onOpenChange: p,
|
|
25
|
+
delayDuration: m,
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ a(t.Trigger, { className: "cursor-pointer", asChild: !0, children: c }),
|
|
28
|
+
/* @__PURE__ */ a(t.Portal, { children: /* @__PURE__ */ i(
|
|
29
|
+
t.Content,
|
|
30
|
+
{
|
|
31
|
+
className: o(
|
|
32
|
+
"tg-caption text-neutral-20 max-h-(--radix-tooltip-content-available-height) origin-(--radix-tooltip-content-transform-origin) rounded-lg p-3 text-center text-pretty shadow-md",
|
|
33
|
+
// animations
|
|
34
|
+
"data-[state=closed]:animate-tooltip-exit data-[state=delayed-open]:animate-tooltip-delayed-enter data-[state=instant-open]:animate-tooltip-enter",
|
|
35
|
+
l && "w-(--radix-tooltip-trigger-width)",
|
|
36
|
+
e,
|
|
37
|
+
g
|
|
38
|
+
),
|
|
39
|
+
side: n,
|
|
40
|
+
sideOffset: 4,
|
|
41
|
+
align: "center",
|
|
42
|
+
...h,
|
|
43
|
+
children: [
|
|
44
|
+
r,
|
|
45
|
+
/* @__PURE__ */ a(
|
|
46
|
+
t.Arrow,
|
|
47
|
+
{
|
|
48
|
+
className: o(
|
|
49
|
+
e === "bg-neutral-60" && "fill-neutral-60",
|
|
50
|
+
e === "bg-neutral-80" && "fill-neutral-80",
|
|
51
|
+
e === "bg-secondary-40" && "fill-secondary-40"
|
|
52
|
+
),
|
|
53
|
+
width: 11,
|
|
54
|
+
height: 5
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
) })
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
w as Tooltip
|
|
66
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { Tooltip as p } from "radix-ui";
|
|
4
|
+
function n({
|
|
5
|
+
children: o,
|
|
6
|
+
delayDuration: r = 300,
|
|
7
|
+
skipDelayDuration: i = 50,
|
|
8
|
+
...t
|
|
9
|
+
}) {
|
|
10
|
+
return /* @__PURE__ */ e(p.TooltipProvider, { delayDuration: r, skipDelayDuration: i, ...t, children: o });
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
n as TooltipProvider
|
|
14
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export {
|
|
3
|
-
export { Box } from './components/box/box';
|
|
4
|
-
export { Button } from './components/button/button';
|
|
5
|
-
export { ClientModal } from './components/client-modal/client-modal';
|
|
6
|
-
export { DecoratedIcon } from './components/decorated-icon/decorated-icon';
|
|
7
|
-
export { DropdownMenu, DropdownMenuItem } from './components/dropdown-menu/dropdown-menu';
|
|
8
|
-
export { ScrollArea } from './components/scroll-area/scroll-area';
|
|
9
|
-
export { Icon } from './components/icon/icon';
|
|
10
|
-
export { InputButton } from './components/input-button/input-button';
|
|
11
|
-
export { MountSvgSprite } from './components/mount-svg-sprite/mount-svg-sprite';
|
|
12
|
-
export { PagePadding } from './components/page-padding/page-padding';
|
|
13
|
-
export { ProtocolLogo } from './components/protocol-logo/protocol-logo';
|
|
14
|
-
export { Skeleton } from './components/skeleton/skeleton';
|
|
15
|
-
export { TextInput } from './components/text-input/text-input';
|
|
16
|
-
export { Tooltip } from './components/tooltip/tooltip';
|
|
17
|
-
export { TooltipProvider } from './components/tooltip-provider/tooltip-provider';
|
|
18
|
-
export { twMerge } from './lib/tailwind-merge.ts';
|
|
1
|
+
export * from './src/index'
|
|
2
|
+
export {}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AnimatedLoader as e } from "./components/animated-loader/animated-loader.js";
|
|
2
|
+
import { Badge as p } from "./components/badge/badge.js";
|
|
3
|
+
import { Box as x } from "./components/box/box.js";
|
|
4
|
+
import { Button as n } from "./components/button/button.js";
|
|
5
|
+
import { ClientModal as a } from "./components/client-modal/client-modal.js";
|
|
6
|
+
import { DecoratedIcon as i } from "./components/decorated-icon/decorated-icon.js";
|
|
7
|
+
import { DropdownMenu as g, DropdownMenuItem as c } from "./components/dropdown-menu/dropdown-menu.js";
|
|
8
|
+
import { ScrollArea as M } from "./components/scroll-area/scroll-area.js";
|
|
9
|
+
import { Icon as P } from "./components/icon/icon.js";
|
|
10
|
+
import { InputButton as w } from "./components/input-button/input-button.js";
|
|
11
|
+
import { MountSvgSprite as T } from "./components/mount-svg-sprite/mount-svg-sprite.js";
|
|
12
|
+
import { PagePadding as A } from "./components/page-padding/page-padding.js";
|
|
13
|
+
import { ProtocolLogo as k } from "./components/protocol-logo/protocol-logo.js";
|
|
14
|
+
import { Skeleton as b } from "./components/skeleton/skeleton.js";
|
|
15
|
+
import { TextInput as j } from "./components/text-input/text-input.js";
|
|
16
|
+
import { Tooltip as s } from "./components/tooltip/tooltip.js";
|
|
17
|
+
import { TooltipProvider as z } from "./components/tooltip-provider/tooltip-provider.js";
|
|
18
|
+
import { twMerge as F } from "./lib/tailwind-merge.js";
|
|
19
|
+
export {
|
|
20
|
+
e as AnimatedLoader,
|
|
21
|
+
p as Badge,
|
|
22
|
+
x as Box,
|
|
23
|
+
n as Button,
|
|
24
|
+
a as ClientModal,
|
|
25
|
+
i as DecoratedIcon,
|
|
26
|
+
g as DropdownMenu,
|
|
27
|
+
c as DropdownMenuItem,
|
|
28
|
+
P as Icon,
|
|
29
|
+
w as InputButton,
|
|
30
|
+
T as MountSvgSprite,
|
|
31
|
+
A as PagePadding,
|
|
32
|
+
k as ProtocolLogo,
|
|
33
|
+
M as ScrollArea,
|
|
34
|
+
b as Skeleton,
|
|
35
|
+
j as TextInput,
|
|
36
|
+
s as Tooltip,
|
|
37
|
+
z as TooltipProvider,
|
|
38
|
+
F as twMerge
|
|
39
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { RoundButton as s } from "./round-button.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { Icon as c } from "../components/icon/icon.js";
|
|
5
|
+
import { twMerge as f } from "../lib/tailwind-merge.js";
|
|
6
|
+
function u({ title: e, description: r, onClose: t, disabled: a, className: m, ...n }) {
|
|
7
|
+
return /* @__PURE__ */ l("div", { className: f("gap-r4 flex flex-row items-center justify-between", m), ...n, children: [
|
|
8
|
+
/* @__PURE__ */ l("div", { className: "flex flex-col gap-2", children: [
|
|
9
|
+
e && (typeof e == "string" ? /* @__PURE__ */ o("h3", { className: "tg-title-and-quote-bold", children: e }) : e),
|
|
10
|
+
r && (typeof r == "string" ? /* @__PURE__ */ o("p", { className: "tg-body text-neutral-40", children: r }) : r)
|
|
11
|
+
] }),
|
|
12
|
+
" ",
|
|
13
|
+
t && /* @__PURE__ */ o(s, { disabled: a, onClick: t, children: /* @__PURE__ */ o(c, { icon: "close", className: "size-3" }) })
|
|
14
|
+
] });
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
u as ModalHeader
|
|
18
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Box as o } from "../components/box/box.js";
|
|
4
|
+
import { twMerge as r } from "../lib/tailwind-merge.js";
|
|
5
|
+
function p({ isExiting: a, className: i, children: l, ...t }) {
|
|
6
|
+
return /* @__PURE__ */ d("div", { className: "relative z-50", children: [
|
|
7
|
+
/* @__PURE__ */ e(
|
|
8
|
+
"div",
|
|
9
|
+
{
|
|
10
|
+
className: r(
|
|
11
|
+
"animate-modal-backdrop-enter bg-neutral-60/85 fixed inset-0",
|
|
12
|
+
a && "animate-modal-backdrop-exit"
|
|
13
|
+
),
|
|
14
|
+
"aria-hidden": "true"
|
|
15
|
+
}
|
|
16
|
+
),
|
|
17
|
+
/* @__PURE__ */ e("div", { className: "fixed inset-0 overflow-y-scroll", children: /* @__PURE__ */ e("div", { className: "xs:p-4 flex min-h-full items-center justify-center p-1", children: /* @__PURE__ */ e(
|
|
18
|
+
o,
|
|
19
|
+
{
|
|
20
|
+
borderRadius: "rounded-xl",
|
|
21
|
+
padding: "p-r6",
|
|
22
|
+
className: r(
|
|
23
|
+
"animate-modal-panel-enter gap-r6 shadow-modal mx-auto flex flex-col items-stretch",
|
|
24
|
+
a && "animate-modal-panel-exit",
|
|
25
|
+
i
|
|
26
|
+
),
|
|
27
|
+
...t,
|
|
28
|
+
children: l
|
|
29
|
+
}
|
|
30
|
+
) }) })
|
|
31
|
+
] });
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
p as Modal
|
|
35
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState as u, useEffect as f } from "react";
|
|
3
|
+
import { createPortal as l } from "react-dom";
|
|
4
|
+
function i({ children: n, wrapperId: t }) {
|
|
5
|
+
const [o, r] = u(!1);
|
|
6
|
+
if (f(() => {
|
|
7
|
+
r(!0);
|
|
8
|
+
}, []), !o)
|
|
9
|
+
return null;
|
|
10
|
+
const e = document.getElementById(t);
|
|
11
|
+
if (!e)
|
|
12
|
+
throw new Error(`Element with id '${t}' not found`);
|
|
13
|
+
return l(n, e);
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
i as ReactPortal
|
|
17
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Slot as s } from "radix-ui";
|
|
3
|
+
import { forwardRef as u } from "react";
|
|
4
|
+
import { twMerge as l } from "../lib/tailwind-merge.js";
|
|
5
|
+
const a = u(
|
|
6
|
+
({ asChild: e, className: r, ...t }, n) => {
|
|
7
|
+
const o = e ? s.Root : "button";
|
|
8
|
+
return /* @__PURE__ */ i(
|
|
9
|
+
o,
|
|
10
|
+
{
|
|
11
|
+
ref: n,
|
|
12
|
+
className: l(
|
|
13
|
+
"bg-neutral-60 text-neutral-30 ring-1.5 ring-neutral-60 flex flex-none cursor-pointer items-center justify-center rounded-full text-nowrap transition ease-in-out ring-inset",
|
|
14
|
+
// size:
|
|
15
|
+
"xs:size-9 size-8 p-2",
|
|
16
|
+
// focus:
|
|
17
|
+
"focus-visible:ring-neutral-10 focus:border-none focus:outline-none focus-visible:ring-2",
|
|
18
|
+
// hover:
|
|
19
|
+
"hover:bg-neutral-60 hover:text-neutral-10 hover:ring-1.5 hover:ring-neutral-40",
|
|
20
|
+
// disabled state:
|
|
21
|
+
"disabled:bg-neutral-70 disabled:text-neutral-40 disabled:ring-neutral-60 disabled:pointer-events-none disabled:cursor-default",
|
|
22
|
+
r
|
|
23
|
+
),
|
|
24
|
+
...t
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
a.displayName = "RoundButton";
|
|
30
|
+
export {
|
|
31
|
+
a as RoundButton
|
|
32
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { extendTailwindMerge as t } from "tailwind-merge";
|
|
2
|
+
const e = t({
|
|
3
|
+
extend: {
|
|
4
|
+
classGroups: {
|
|
5
|
+
gap: ["gap-r3", "gap-r4", "gap-r5", "gap-r6"],
|
|
6
|
+
pt: ["dpt"],
|
|
7
|
+
pr: ["dpr"],
|
|
8
|
+
pb: ["dpb"],
|
|
9
|
+
pl: ["dpl"],
|
|
10
|
+
tg: [
|
|
11
|
+
"tg-display-1",
|
|
12
|
+
"tg-display-2",
|
|
13
|
+
"tg-headline-1",
|
|
14
|
+
"tg-headline-2",
|
|
15
|
+
"tg-headline-3",
|
|
16
|
+
"tg-headline-4",
|
|
17
|
+
"tg-headline-5",
|
|
18
|
+
"tg-headline-6",
|
|
19
|
+
"tg-title-and-quote-bold",
|
|
20
|
+
"tg-title-and-quote",
|
|
21
|
+
"tg-body-large-bold",
|
|
22
|
+
"tg-body-large",
|
|
23
|
+
"tg-subtitle-bold",
|
|
24
|
+
"tg-subtitle",
|
|
25
|
+
"tg-button-text",
|
|
26
|
+
"tg-button-small",
|
|
27
|
+
"tg-body-bold",
|
|
28
|
+
"tg-body",
|
|
29
|
+
"tg-link",
|
|
30
|
+
"tg-caption-bold",
|
|
31
|
+
"tg-caption",
|
|
32
|
+
"tg-tag"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
export {
|
|
38
|
+
e as twMerge
|
|
39
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { AnimatedLoader } from './components/animated-loader/animated-loader';
|
|
2
|
+
export { Badge } from './components/badge/badge';
|
|
3
|
+
export { Box } from './components/box/box';
|
|
4
|
+
export { Button } from './components/button/button';
|
|
5
|
+
export { ClientModal } from './components/client-modal/client-modal';
|
|
6
|
+
export { DecoratedIcon } from './components/decorated-icon/decorated-icon';
|
|
7
|
+
export { DropdownMenu, DropdownMenuItem } from './components/dropdown-menu/dropdown-menu';
|
|
8
|
+
export { ScrollArea } from './components/scroll-area/scroll-area';
|
|
9
|
+
export { Icon, type IconID } from './components/icon/icon';
|
|
10
|
+
export { InputButton } from './components/input-button/input-button';
|
|
11
|
+
export { MountSvgSprite } from './components/mount-svg-sprite/mount-svg-sprite';
|
|
12
|
+
export { PagePadding } from './components/page-padding/page-padding';
|
|
13
|
+
export { ProtocolLogo } from './components/protocol-logo/protocol-logo';
|
|
14
|
+
export { Skeleton } from './components/skeleton/skeleton';
|
|
15
|
+
export { TextInput } from './components/text-input/text-input';
|
|
16
|
+
export { Tooltip } from './components/tooltip/tooltip';
|
|
17
|
+
export { TooltipProvider } from './components/tooltip-provider/tooltip-provider';
|
|
18
|
+
export { twMerge } from './lib/tailwind-merge';
|
package/package.json
CHANGED
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@validationcloud/fractal-ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.
|
|
5
|
-
"module": "./dist/
|
|
4
|
+
"version": "1.40.0",
|
|
5
|
+
"module": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
|
-
"dist"
|
|
9
|
-
"README.md"
|
|
8
|
+
"dist"
|
|
10
9
|
],
|
|
11
10
|
"license": "MIT",
|
|
12
11
|
"scripts": {
|
|
13
|
-
"
|
|
14
|
-
"build": "tsc && vite build",
|
|
12
|
+
"build": "vite build",
|
|
15
13
|
"lint": "eslint",
|
|
16
|
-
"preview": "vite preview",
|
|
17
14
|
"storybook": "storybook dev -p 6006",
|
|
18
15
|
"build-storybook": "storybook build",
|
|
19
16
|
"format": "prettier --write .",
|
|
20
|
-
"typecheck": "tsc --noEmit"
|
|
17
|
+
"typecheck": "tsc -b --noEmit"
|
|
21
18
|
},
|
|
22
19
|
"exports": {
|
|
23
20
|
".": {
|
|
24
|
-
"import": "./dist/
|
|
21
|
+
"import": "./dist/index.js"
|
|
25
22
|
},
|
|
26
23
|
"./tailwind.css": "./dist/styles/tailwind.css"
|
|
27
24
|
},
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
28
26
|
"release": {
|
|
29
27
|
"branches": [
|
|
30
28
|
"main"
|
|
@@ -41,7 +39,7 @@
|
|
|
41
39
|
"tailwind-merge": "^3"
|
|
42
40
|
},
|
|
43
41
|
"devDependencies": {
|
|
44
|
-
"@eslint/js": "^9.
|
|
42
|
+
"@eslint/js": "^9.37.0",
|
|
45
43
|
"@storybook/addon-docs": "^9",
|
|
46
44
|
"@storybook/addon-onboarding": "^9",
|
|
47
45
|
"@storybook/react-vite": "^9",
|
|
@@ -50,10 +48,10 @@
|
|
|
50
48
|
"@types/node": "^24",
|
|
51
49
|
"@types/react": "^19",
|
|
52
50
|
"@types/react-dom": "^19",
|
|
53
|
-
"@vitejs/plugin-react": "^5.0.
|
|
54
|
-
"eslint": "^9.
|
|
55
|
-
"eslint-plugin-react-hooks": "^
|
|
56
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
51
|
+
"@vitejs/plugin-react": "^5.0.4",
|
|
52
|
+
"eslint": "^9.37.0",
|
|
53
|
+
"eslint-plugin-react-hooks": "^6.1.1",
|
|
54
|
+
"eslint-plugin-react-refresh": "^0.4.23",
|
|
57
55
|
"eslint-plugin-storybook": "^9",
|
|
58
56
|
"globals": "^16.4.0",
|
|
59
57
|
"postcss": "^8.5.6",
|
|
@@ -62,10 +60,10 @@
|
|
|
62
60
|
"rollup-plugin-copy": "^3.5.0",
|
|
63
61
|
"rollup-preserve-directives": "^1.1.3",
|
|
64
62
|
"storybook": "^9",
|
|
65
|
-
"tailwindcss": "^4.1.
|
|
63
|
+
"tailwindcss": "^4.1.14",
|
|
66
64
|
"typescript": "^5",
|
|
67
|
-
"typescript-eslint": "^8.
|
|
68
|
-
"vite": "^7.1.
|
|
65
|
+
"typescript-eslint": "^8.46.0",
|
|
66
|
+
"vite": "^7.1.9",
|
|
69
67
|
"vite-plugin-dts": "^4.5.4"
|
|
70
68
|
},
|
|
71
69
|
"peerDependencies": {
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { AnimatedLoader } from './animated-loader';
|
|
3
|
-
declare const meta: {
|
|
4
|
-
component: typeof AnimatedLoader;
|
|
5
|
-
};
|
|
6
|
-
export default meta;
|
|
7
|
-
type Story = StoryObj<typeof meta>;
|
|
8
|
-
export declare const Example: Story;
|