@arcadeai/design-system 3.48.0 → 3.49.1
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/icons/fireflies.js +304 -0
- package/dist/assets/icons/insightly.js +32 -0
- package/dist/components/index.js +183 -181
- package/dist/components/ui/atoms/icons/fireflies.d.ts +4 -0
- package/dist/components/ui/atoms/icons/fireflies.d.ts.map +1 -0
- package/dist/components/ui/atoms/icons/fireflies.js +299 -0
- package/dist/components/ui/atoms/icons/index.d.ts +2 -0
- package/dist/components/ui/atoms/icons/index.d.ts.map +1 -1
- package/dist/components/ui/atoms/icons/index.js +112 -110
- package/dist/components/ui/atoms/icons/insightly.d.ts +4 -0
- package/dist/components/ui/atoms/icons/insightly.d.ts.map +1 -0
- package/dist/components/ui/atoms/icons/insightly.js +27 -0
- package/dist/components/ui/atoms/index.d.ts +0 -1
- package/dist/components/ui/atoms/index.d.ts.map +1 -1
- package/dist/components/ui/atoms/index.js +139 -138
- package/dist/components/ui/index.js +183 -181
- package/dist/components/ui/molecules/index.d.ts +2 -0
- package/dist/components/ui/molecules/index.d.ts.map +1 -1
- package/dist/components/ui/molecules/index.js +9 -8
- package/dist/components/ui/molecules/mcp-server-picker/server-card.d.ts +1 -2
- package/dist/components/ui/molecules/mcp-server-picker/server-card.d.ts.map +1 -1
- package/dist/components/ui/molecules/mcp-server-picker/server-card.js +51 -57
- package/dist/components/ui/molecules/mcp-server-picker/tool-card.d.ts +1 -6
- package/dist/components/ui/molecules/mcp-server-picker/tool-card.d.ts.map +1 -1
- package/dist/components/ui/molecules/mcp-server-picker/tool-card.js +35 -40
- package/dist/components/ui/molecules/scroll-fade-area.d.ts +26 -0
- package/dist/components/ui/molecules/scroll-fade-area.d.ts.map +1 -0
- package/dist/components/ui/molecules/scroll-fade-area.js +25 -0
- package/dist/hooks/use-scroll-fade.d.ts +7 -0
- package/dist/hooks/use-scroll-fade.d.ts.map +1 -1
- package/dist/hooks/use-scroll-fade.js +1 -0
- package/dist/main.js +189 -187
- package/dist/metadata/toolkit-icons.d.ts.map +1 -1
- package/dist/metadata/toolkit-icons.js +206 -202
- package/dist/metadata/toolkits.d.ts.map +1 -1
- package/dist/metadata/toolkits.js +26 -0
- package/package.json +2 -2
- package/dist/components/ui/atoms/unoptimized-marker.d.ts +0 -16
- package/dist/components/ui/atoms/unoptimized-marker.d.ts.map +0 -1
- package/dist/components/ui/atoms/unoptimized-marker.js +0 -20
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
import { cn as e } from "../../../../lib/utils.js";
|
|
4
4
|
import { t } from "../../../../dist-Ber_p4PA.js";
|
|
5
5
|
import { i as n, n as r, r as i, t as a } from "../../../../tooltip-34vRSwJG.js";
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import { ChevronRight as d, KeyRound as f } from "lucide-react";
|
|
6
|
+
import { McpToolkitAvatar as o } from "./toolkit-avatar.js";
|
|
7
|
+
import * as s from "react";
|
|
8
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
9
|
+
import { ChevronRight as u, KeyRound as d } from "lucide-react";
|
|
11
10
|
//#region lib/components/ui/molecules/mcp-server-picker/server-card.tsx
|
|
12
|
-
var
|
|
11
|
+
var f = t("flex items-stretch rounded-lg border transition-[background-color,border-color,box-shadow,transform] duration-[var(--duration-normal)] ease-[var(--ease-smooth)] motion-reduce:transition-colors", {
|
|
13
12
|
variants: { selectionState: {
|
|
14
13
|
selected: "border-foreground/45 bg-muted/20 shadow-[var(--shadow-card)]",
|
|
15
14
|
partial: "border-foreground/45 border-dashed bg-muted/20 shadow-[var(--shadow-card)]",
|
|
@@ -20,105 +19,100 @@ var p = t("flex items-stretch rounded-lg border transition-[background-color,bor
|
|
|
20
19
|
} },
|
|
21
20
|
defaultVariants: { selectionState: "none" }
|
|
22
21
|
});
|
|
23
|
-
function
|
|
22
|
+
function p(e, t) {
|
|
24
23
|
return t ? e === "selected" ? "setup-selected" : e === "partial" ? "setup-partial" : "setup-none" : e;
|
|
25
24
|
}
|
|
26
|
-
function
|
|
25
|
+
function m(e) {
|
|
27
26
|
return e === "selected" ? !0 : e === "partial" ? "mixed" : !1;
|
|
28
27
|
}
|
|
29
|
-
function
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
"aria-label": `${
|
|
32
|
-
"aria-pressed":
|
|
28
|
+
function h({ name: e, description: t, toolkitId: n, version: r, selectionState: i, onToggle: a }) {
|
|
29
|
+
return /* @__PURE__ */ l("button", {
|
|
30
|
+
"aria-label": `${i === "selected" ? "Remove all" : "Add all"} ${e} tools`,
|
|
31
|
+
"aria-pressed": m(i),
|
|
33
32
|
className: "flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-l-lg px-3 py-2.5 text-left transition-[background-color,color,transform] duration-[var(--duration-fast)] ease-[var(--ease-smooth)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-inset active:scale-[0.98] motion-reduce:transition-colors motion-reduce:active:scale-100",
|
|
34
|
-
onClick:
|
|
33
|
+
onClick: a,
|
|
35
34
|
title: t || void 0,
|
|
36
35
|
type: "button",
|
|
37
|
-
children: [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
className: "
|
|
45
|
-
children:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}) : null]
|
|
52
|
-
}),
|
|
53
|
-
/* @__PURE__ */ l(o, { active: i })
|
|
54
|
-
]
|
|
36
|
+
children: [/* @__PURE__ */ c(o, {
|
|
37
|
+
name: e,
|
|
38
|
+
size: "md",
|
|
39
|
+
toolkitId: n
|
|
40
|
+
}), /* @__PURE__ */ l("span", {
|
|
41
|
+
className: "flex min-w-0 flex-1 items-baseline gap-1.5",
|
|
42
|
+
children: [/* @__PURE__ */ c("span", {
|
|
43
|
+
className: "min-w-0 truncate font-medium text-base capitalize",
|
|
44
|
+
children: e
|
|
45
|
+
}), r ? /* @__PURE__ */ l("span", {
|
|
46
|
+
className: "shrink-0 font-normal text-muted-foreground text-xs tabular-nums",
|
|
47
|
+
children: ["v", r]
|
|
48
|
+
}) : null]
|
|
49
|
+
})]
|
|
55
50
|
});
|
|
56
51
|
}
|
|
57
|
-
function
|
|
58
|
-
return /* @__PURE__ */
|
|
52
|
+
function g({ name: e, toolsLabel: t, onCustomize: n }) {
|
|
53
|
+
return /* @__PURE__ */ l("button", {
|
|
59
54
|
"aria-label": `Choose individual tools for ${e}`,
|
|
60
55
|
className: "flex min-w-[5.5rem] shrink-0 cursor-pointer items-center justify-end gap-1.5 rounded-r-lg border-border/60 border-l px-2.5 text-muted-foreground text-xs transition-[background-color,color,transform] duration-[var(--duration-fast)] ease-[var(--ease-smooth)] hover:bg-muted/40 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-inset active:scale-[0.98] motion-reduce:transition-colors motion-reduce:active:scale-100",
|
|
61
56
|
"data-slot": "mcp-server-card-customize",
|
|
62
57
|
onClick: n,
|
|
63
58
|
type: "button",
|
|
64
|
-
children: [/* @__PURE__ */
|
|
59
|
+
children: [/* @__PURE__ */ c("span", {
|
|
65
60
|
className: "whitespace-nowrap tabular-nums",
|
|
66
61
|
children: t
|
|
67
|
-
}), /* @__PURE__ */
|
|
62
|
+
}), /* @__PURE__ */ c(u, {
|
|
68
63
|
"aria-hidden": !0,
|
|
69
64
|
className: "size-3 transition-transform duration-[var(--duration-fast)] ease-[var(--ease-smooth)] motion-reduce:transition-none"
|
|
70
65
|
})]
|
|
71
66
|
});
|
|
72
67
|
}
|
|
73
|
-
function
|
|
74
|
-
return /* @__PURE__ */
|
|
68
|
+
function _({ name: e, onSetup: t }) {
|
|
69
|
+
return /* @__PURE__ */ c(i, { children: /* @__PURE__ */ l(a, { children: [/* @__PURE__ */ c(n, { render: /* @__PURE__ */ c("button", {
|
|
75
70
|
"aria-label": `Set up ${e}`,
|
|
76
71
|
className: "flex shrink-0 cursor-pointer items-center justify-center border-border/60 border-l bg-warning/10 px-2.5 text-warning transition-colors duration-[var(--duration-fast)] ease-[var(--ease-smooth)] hover:bg-warning/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-inset",
|
|
77
72
|
"data-slot": "mcp-server-card-setup",
|
|
78
73
|
onClick: t,
|
|
79
74
|
type: "button",
|
|
80
|
-
children: /* @__PURE__ */
|
|
75
|
+
children: /* @__PURE__ */ c(d, {
|
|
81
76
|
"aria-hidden": !0,
|
|
82
77
|
className: "size-4"
|
|
83
78
|
})
|
|
84
|
-
}) }), /* @__PURE__ */
|
|
79
|
+
}) }), /* @__PURE__ */ l(r, {
|
|
85
80
|
className: "max-w-56 flex-col items-start gap-0.5 text-left",
|
|
86
81
|
side: "top",
|
|
87
|
-
children: [/* @__PURE__ */
|
|
82
|
+
children: [/* @__PURE__ */ c("span", {
|
|
88
83
|
className: "font-semibold",
|
|
89
84
|
children: "Setup required"
|
|
90
|
-
}), /* @__PURE__ */
|
|
85
|
+
}), /* @__PURE__ */ c("span", { children: "This server isn't ready yet. It needs some configuration before its tools work." })]
|
|
91
86
|
})] }) });
|
|
92
87
|
}
|
|
93
|
-
function
|
|
94
|
-
let
|
|
95
|
-
return /* @__PURE__ */
|
|
96
|
-
...
|
|
97
|
-
className: e(
|
|
88
|
+
function v({ name: t, description: n, toolkitId: r, version: i, toolCount: a, selectedToolCount: o = 0, selectionState: s = "none", needsSetup: u = !1, onSetup: d, onToggle: m, onCustomize: v, className: y, ...b }) {
|
|
89
|
+
let x = s === "partial" ? `${o}/${a} tools` : `${a} ${a === 1 ? "tool" : "tools"}`;
|
|
90
|
+
return /* @__PURE__ */ l("div", {
|
|
91
|
+
...b,
|
|
92
|
+
className: e(f({ selectionState: p(s, u) }), y),
|
|
98
93
|
"data-slot": "mcp-server-card",
|
|
99
|
-
"data-status":
|
|
94
|
+
"data-status": u ? "needs-setup" : s,
|
|
100
95
|
children: [
|
|
101
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ c(h, {
|
|
102
97
|
description: n,
|
|
103
|
-
isUnoptimized: c,
|
|
104
98
|
name: t,
|
|
105
|
-
onToggle:
|
|
99
|
+
onToggle: m,
|
|
106
100
|
selectionState: s,
|
|
107
101
|
toolkitId: r,
|
|
108
102
|
version: i
|
|
109
103
|
}),
|
|
110
|
-
|
|
104
|
+
u ? /* @__PURE__ */ c(_, {
|
|
111
105
|
name: t,
|
|
112
|
-
onSetup:
|
|
106
|
+
onSetup: d
|
|
113
107
|
}) : null,
|
|
114
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ c(g, {
|
|
115
109
|
name: t,
|
|
116
|
-
onCustomize:
|
|
117
|
-
toolsLabel:
|
|
110
|
+
onCustomize: v,
|
|
111
|
+
toolsLabel: x
|
|
118
112
|
})
|
|
119
113
|
]
|
|
120
114
|
});
|
|
121
115
|
}
|
|
122
|
-
var
|
|
116
|
+
var y = s.memo(v);
|
|
123
117
|
//#endregion
|
|
124
|
-
export {
|
|
118
|
+
export { y as McpServerCard, f as mcpServerCardShellVariants };
|
|
@@ -14,14 +14,9 @@ export type McpToolCardProps = {
|
|
|
14
14
|
selected?: boolean;
|
|
15
15
|
destructive?: boolean;
|
|
16
16
|
readOnly?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Tool sourced from an unoptimized toolkit. Renders a `{}` marker in the
|
|
19
|
-
* leading metadata slot.
|
|
20
|
-
*/
|
|
21
|
-
isUnoptimized?: boolean;
|
|
22
17
|
onToggle?: () => void;
|
|
23
18
|
} & Omit<React.ComponentProps<"button">, "onClick" | "onToggle" | "name">;
|
|
24
|
-
declare function McpToolCardImpl({ name, rawName, version, description, selected, destructive, readOnly,
|
|
19
|
+
declare function McpToolCardImpl({ name, rawName, version, description, selected, destructive, readOnly, onToggle, className, ...rest }: McpToolCardProps): React.JSX.Element;
|
|
25
20
|
export declare const McpToolCard: React.MemoExoticComponent<typeof McpToolCardImpl>;
|
|
26
21
|
export {};
|
|
27
22
|
//# sourceMappingURL=tool-card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-card.d.ts","sourceRoot":"","sources":["../../../../../lib/components/ui/molecules/mcp-server-picker/tool-card.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-card.d.ts","sourceRoot":"","sources":["../../../../../lib/components/ui/molecules/mcp-server-picker/tool-card.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC,CAAC;AAE1E,iBAAS,eAAe,CAAC,EACvB,IAAI,EACJ,OAAO,EACP,OAAO,EACP,WAAW,EACX,QAAgB,EAChB,WAAmB,EACnB,QAAgB,EAChB,QAAQ,EACR,SAAS,EACT,GAAG,IAAI,EACR,EAAE,gBAAgB,qBAkFlB;AAED,eAAO,MAAM,WAAW,mDAA8B,CAAC"}
|
|
@@ -2,66 +2,61 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { cn as e } from "../../../../lib/utils.js";
|
|
4
4
|
import { i as t, n, r, t as i } from "../../../../tooltip-34vRSwJG.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import { Check as l } from "lucide-react";
|
|
5
|
+
import * as a from "react";
|
|
6
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
+
import { Check as c } from "lucide-react";
|
|
9
8
|
//#region lib/components/ui/molecules/mcp-server-picker/tool-card.tsx
|
|
10
|
-
function
|
|
11
|
-
let
|
|
12
|
-
...
|
|
13
|
-
"aria-pressed":
|
|
14
|
-
className: e("flex cursor-pointer items-start gap-2.5 rounded-lg border p-3 text-left transition-[background-color,border-color,box-shadow,transform] duration-[var(--duration-normal)] ease-[var(--ease-smooth)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 active:scale-[0.98] motion-reduce:transition-colors motion-reduce:active:scale-100",
|
|
9
|
+
function l({ name: a, rawName: l, version: u, description: d, selected: f = !1, destructive: p = !1, readOnly: m = !1, onToggle: h, className: g, ..._ }) {
|
|
10
|
+
let v = /* @__PURE__ */ s("button", {
|
|
11
|
+
..._,
|
|
12
|
+
"aria-pressed": f,
|
|
13
|
+
className: e("flex cursor-pointer items-start gap-2.5 rounded-lg border p-3 text-left transition-[background-color,border-color,box-shadow,transform] duration-[var(--duration-normal)] ease-[var(--ease-smooth)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 active:scale-[0.98] motion-reduce:transition-colors motion-reduce:active:scale-100", f ? "border-foreground/45 bg-muted/20 shadow-[var(--shadow-card)]" : "border-border hover:border-foreground/40 hover:shadow-[var(--shadow-card-hover)]", g),
|
|
15
14
|
"data-slot": "mcp-tool-card",
|
|
16
|
-
"data-status":
|
|
17
|
-
onClick:
|
|
15
|
+
"data-status": f ? "selected" : "none",
|
|
16
|
+
onClick: h,
|
|
18
17
|
type: "button",
|
|
19
|
-
children: [/* @__PURE__ */
|
|
18
|
+
children: [/* @__PURE__ */ o("span", {
|
|
20
19
|
"aria-hidden": !0,
|
|
21
|
-
className: e("mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors",
|
|
22
|
-
children:
|
|
23
|
-
}), /* @__PURE__ */
|
|
20
|
+
className: e("mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors", f ? "border-primary bg-primary text-primary-foreground" : "border-input"),
|
|
21
|
+
children: f ? /* @__PURE__ */ o(c, { className: "size-3" }) : null
|
|
22
|
+
}), /* @__PURE__ */ s("span", {
|
|
24
23
|
className: "min-w-0 flex-1",
|
|
25
|
-
children: [/* @__PURE__ */
|
|
24
|
+
children: [/* @__PURE__ */ s("span", {
|
|
26
25
|
className: "flex items-start justify-between gap-3",
|
|
27
|
-
children: [/* @__PURE__ */
|
|
26
|
+
children: [/* @__PURE__ */ s("span", {
|
|
28
27
|
className: "flex min-w-0 items-baseline gap-1.5",
|
|
29
|
-
children: [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}) : null,
|
|
38
|
-
/* @__PURE__ */ s(a, { active: g })
|
|
39
|
-
]
|
|
40
|
-
}), /* @__PURE__ */ c("span", {
|
|
28
|
+
children: [/* @__PURE__ */ o("span", {
|
|
29
|
+
className: "truncate font-medium text-sm",
|
|
30
|
+
children: a
|
|
31
|
+
}), u ? /* @__PURE__ */ s("span", {
|
|
32
|
+
className: "shrink-0 font-normal text-muted-foreground text-xs tabular-nums",
|
|
33
|
+
children: ["v", u]
|
|
34
|
+
}) : null]
|
|
35
|
+
}), /* @__PURE__ */ s("span", {
|
|
41
36
|
className: "flex shrink-0 items-center gap-1.5 self-start",
|
|
42
|
-
children: [
|
|
37
|
+
children: [p ? /* @__PURE__ */ o("span", {
|
|
43
38
|
className: "ds-focus-in rounded-full bg-destructive/10 px-1.5 py-0.5 font-medium text-[10px] text-destructive uppercase tracking-wide",
|
|
44
39
|
children: "Destructive"
|
|
45
|
-
}) : null,
|
|
40
|
+
}) : null, m ? /* @__PURE__ */ o("span", {
|
|
46
41
|
className: "ds-focus-in rounded-full bg-muted px-1.5 py-0.5 font-medium text-[10px] text-muted-foreground uppercase tracking-wide",
|
|
47
42
|
children: "Read-only"
|
|
48
43
|
}) : null]
|
|
49
44
|
})]
|
|
50
|
-
}),
|
|
45
|
+
}), d ? /* @__PURE__ */ o("span", {
|
|
51
46
|
className: "mt-0.5 line-clamp-1 text-muted-foreground text-xs leading-snug",
|
|
52
|
-
children:
|
|
47
|
+
children: d
|
|
53
48
|
}) : null]
|
|
54
49
|
})]
|
|
55
50
|
});
|
|
56
|
-
return
|
|
51
|
+
return d ? /* @__PURE__ */ o(r, { children: /* @__PURE__ */ s(i, { children: [/* @__PURE__ */ o(t, { render: v }), /* @__PURE__ */ s(n, {
|
|
57
52
|
className: "max-w-xs flex-col items-start gap-0.5 text-left text-xs",
|
|
58
53
|
side: "bottom",
|
|
59
|
-
children: [
|
|
54
|
+
children: [l && l !== a ? /* @__PURE__ */ o("span", {
|
|
60
55
|
className: "font-medium",
|
|
61
|
-
children:
|
|
62
|
-
}) : null, /* @__PURE__ */
|
|
63
|
-
})] }) }) :
|
|
56
|
+
children: l
|
|
57
|
+
}) : null, /* @__PURE__ */ o("span", { children: d })]
|
|
58
|
+
})] }) }) : v;
|
|
64
59
|
}
|
|
65
|
-
var
|
|
60
|
+
var u = a.memo(l);
|
|
66
61
|
//#endregion
|
|
67
|
-
export {
|
|
62
|
+
export { u as McpToolCard };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type ScrollFadeAreaProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
/** Classes for the outer sizing context. Defaults fill a flex column. */
|
|
5
|
+
className?: string;
|
|
6
|
+
/** Classes for the inner scroll viewport (padding, child spacing). */
|
|
7
|
+
viewportClassName?: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Vertical scroll area with "there's more" affordances on whichever edge still
|
|
11
|
+
* has hidden content: a fade-to-background gradient plus a soft inset shadow.
|
|
12
|
+
* Both appear per edge and only when that edge can actually scroll.
|
|
13
|
+
*
|
|
14
|
+
* This draws gradient overlays from `useScrollFade`'s `edges` rather than
|
|
15
|
+
* spreading the hook's `maskImage` style. A mask fades content to fully
|
|
16
|
+
* transparent, which reads too strongly in dark mode; gradient overlays fade to
|
|
17
|
+
* the surface color and let us dial the intensity per theme (see the
|
|
18
|
+
* `dark:from-background/40` stops below). Horizontal scrollers that want the
|
|
19
|
+
* lighter mask treatment should consume `useScrollFade("x").style` directly.
|
|
20
|
+
*
|
|
21
|
+
* The overlays fade to the `background` token, so place this on a
|
|
22
|
+
* background-colored surface; on a `card`/`muted` surface the gradient seams.
|
|
23
|
+
* Such callers want the mask treatment instead.
|
|
24
|
+
*/
|
|
25
|
+
export declare function ScrollFadeArea({ children, className, viewportClassName, }: ScrollFadeAreaProps): import("react").JSX.Element;
|
|
26
|
+
//# sourceMappingURL=scroll-fade-area.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-fade-area.d.ts","sourceRoot":"","sources":["../../../../lib/components/ui/molecules/scroll-fade-area.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,SAAS,EACT,iBAAiB,GAClB,EAAE,mBAAmB,+BAiCrB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../../lib/utils.js";
|
|
4
|
+
import { useScrollFade as t } from "../../../hooks/use-scroll-fade.js";
|
|
5
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
6
|
+
//#region lib/components/ui/molecules/scroll-fade-area.tsx
|
|
7
|
+
function i({ children: i, className: a, viewportClassName: o }) {
|
|
8
|
+
let s = t("y"), c = [s.edges.start && "inset 0 8px 12px -10px color-mix(in oklch, var(--shadow-color) 3%, transparent)", s.edges.end && "inset 0 -12px 16px -10px color-mix(in oklch, var(--shadow-color) 6%, transparent)"].filter(Boolean).join(", ") || void 0;
|
|
9
|
+
return /* @__PURE__ */ r("div", {
|
|
10
|
+
className: e("relative min-h-0 flex-1", a),
|
|
11
|
+
children: [
|
|
12
|
+
s.edges.start ? /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-x-0 top-0 z-10 h-8 bg-gradient-to-b from-background to-transparent dark:from-background/40" }) : null,
|
|
13
|
+
s.edges.end ? /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 z-10 h-10 bg-gradient-to-t from-background to-transparent dark:from-background/40" }) : null,
|
|
14
|
+
/* @__PURE__ */ n("div", {
|
|
15
|
+
className: e("h-full overflow-y-auto transition-shadow duration-200", o),
|
|
16
|
+
onScroll: s.onScroll,
|
|
17
|
+
ref: s.ref,
|
|
18
|
+
style: { boxShadow: c },
|
|
19
|
+
children: i
|
|
20
|
+
})
|
|
21
|
+
]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { i as ScrollFadeArea };
|
|
@@ -3,10 +3,17 @@
|
|
|
3
3
|
* dynamic mask-image — a lightweight "there's more" hint with no extra DOM.
|
|
4
4
|
* Works on either axis and only fades an edge you can actually scroll toward.
|
|
5
5
|
* Attach `ref` + `onScroll` to the scrollable element and spread `style`.
|
|
6
|
+
*
|
|
7
|
+
* Also returns `edges` ({ start, end }) for callers that want to draw their own
|
|
8
|
+
* edge affordance (e.g. a shadow) only when there is hidden content.
|
|
6
9
|
*/
|
|
7
10
|
export declare function useScrollFade(axis: "x" | "y"): {
|
|
8
11
|
ref: (el: HTMLDivElement | null) => void;
|
|
9
12
|
onScroll: () => void;
|
|
13
|
+
edges: {
|
|
14
|
+
start: boolean;
|
|
15
|
+
end: boolean;
|
|
16
|
+
};
|
|
10
17
|
style: {
|
|
11
18
|
maskImage: string;
|
|
12
19
|
WebkitMaskImage: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-scroll-fade.d.ts","sourceRoot":"","sources":["../../lib/hooks/use-scroll-fade.ts"],"names":[],"mappings":"AAMA
|
|
1
|
+
{"version":3,"file":"use-scroll-fade.d.ts","sourceRoot":"","sources":["../../lib/hooks/use-scroll-fade.ts"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG;cA+CpC,cAAc,GAAG,IAAI;;;;;;;;;;EAuC7B"}
|
|
@@ -28,6 +28,7 @@ function i(i) {
|
|
|
28
28
|
return (a.start || a.end) && (p = `linear-gradient(${i === "x" ? "to right" : "to bottom"}, ${a.start ? `transparent 0, black ${r}px` : "black 0"}, ${a.end ? `black calc(100% - ${r}px), transparent 100%` : "black 100%"})`), {
|
|
29
29
|
ref: f,
|
|
30
30
|
onScroll: u,
|
|
31
|
+
edges: a,
|
|
31
32
|
style: p ? {
|
|
32
33
|
maskImage: p,
|
|
33
34
|
WebkitMaskImage: p
|