@ramme-io/ui 4.0.1 → 4.1.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/README.md +158 -7
- package/dist/blocks/ai/Actions.js +2 -2
- package/dist/blocks/ai/PromptInput.js +6 -6
- package/dist/component-registry.js +386 -359
- package/dist/components/ai/AIChatThread/AIChatThread.js +81 -73
- package/dist/components/ai/ArchitectureReferenceCard/ArchitectureReferenceCard.d.ts +28 -0
- package/dist/components/ai/ArchitectureReferenceCard/ArchitectureReferenceCard.js +70 -0
- package/dist/components/ai/ArchitectureReferenceCard/index.d.ts +2 -0
- package/dist/components/ai/CounterpartyGraphCard/CounterpartyGraphCard.d.ts +30 -0
- package/dist/components/ai/CounterpartyGraphCard/CounterpartyGraphCard.js +82 -0
- package/dist/components/ai/CounterpartyGraphCard/index.d.ts +2 -0
- package/dist/components/ai/DivergenceMetricsCard/DivergenceMetricsCard.d.ts +29 -0
- package/dist/components/ai/DivergenceMetricsCard/DivergenceMetricsCard.js +69 -0
- package/dist/components/ai/DivergenceMetricsCard/index.d.ts +2 -0
- package/dist/components/ai/KeyInjectionOverlay.d.ts +10 -0
- package/dist/components/ai/KeyInjectionOverlay.js +11 -11
- package/dist/components/auth/AuthLayout.js +4 -4
- package/dist/components/data-display/CodeBlock.d.ts +33 -7
- package/dist/components/data-display/CodeBlock.js +134 -41
- package/dist/components/data-display/Table.js +8 -8
- package/dist/components/feedback/EmptyState.js +9 -9
- package/dist/components/feedback/ToastProvider.js +4 -4
- package/dist/components/forms/Checkbox.js +5 -5
- package/dist/components/forms/Radio.js +6 -6
- package/dist/components/forms/SegmentedControl.d.ts +1 -1
- package/dist/components/forms/SegmentedControl.js +28 -11
- package/dist/components/forms/Textarea.js +9 -9
- package/dist/components/forms/ToggleSwitch.js +9 -9
- package/dist/components/layout/AboutRamme.d.ts +8 -0
- package/dist/components/layout/Accordion.js +13 -13
- package/dist/components/layout/AppShell.js +7 -7
- package/dist/components/layout/DetailDrawer.js +2 -2
- package/dist/components/layout/Drawer.js +50 -51
- package/dist/components/layout/List.js +9 -9
- package/dist/components/layout/Modal.js +5 -5
- package/dist/components/layout/PageHeader.js +7 -7
- package/dist/components/layout/SectionHeader.js +4 -4
- package/dist/components/layout/SettingsContainer.d.ts +12 -0
- package/dist/components/layout/SettingsContainer.js +20 -18
- package/dist/components/layout/Sidebar.js +1 -1
- package/dist/components/layout/UserNav.d.ts +13 -0
- package/dist/components/layout/UserNav.js +17 -17
- package/dist/components/molecular/ConnectorOverlay.d.ts +12 -0
- package/dist/components/navigation/Breadcrumbs.js +8 -8
- package/dist/components/navigation/Menu.js +6 -6
- package/dist/components/navigation/MobileNav.js +1 -1
- package/dist/components/navigation/Pagination.js +46 -41
- package/dist/components/navigation/Stepper.js +17 -17
- package/dist/components/navigation/Tabs.js +12 -12
- package/dist/components/theme/ThemeLab.d.ts +7 -1
- package/dist/components/theme/ThemeLab.js +175 -154
- package/dist/contexts/ThemeContext.js +111 -82
- package/dist/data/mockData.d.ts +0 -3
- package/dist/index.css +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.js +203 -185
- package/dist/lib/hooks/useBodyScrollLock.d.ts +27 -0
- package/dist/lib/hooks/useBodyScrollLock.js +18 -0
- package/dist/lib/theme/themeUtils.d.ts +21 -0
- package/dist/lib/theme/themeUtils.js +31 -17
- package/dist/wizardManifest.js +234 -9
- package/package.json +2 -3
- package/src/wizardManifest.ts +234 -9
- package/tailwind.preset.js +98 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as n, jsxs as p, Fragment as b } from "react/jsx-runtime";
|
|
2
|
-
import m, { useState as v, useRef as d, useCallback as f, useEffect as
|
|
3
|
-
import { Slot as
|
|
2
|
+
import m, { useState as v, useRef as d, useCallback as f, useEffect as w } from "react";
|
|
3
|
+
import { Slot as x } from "@radix-ui/react-slot";
|
|
4
4
|
import { cn as E } from "../../utils/cn.js";
|
|
5
5
|
const y = () => /* @__PURE__ */ n("div", { className: "my-1 h-px bg-border", role: "separator" }), R = ({
|
|
6
6
|
children: s,
|
|
@@ -11,14 +11,14 @@ const y = () => /* @__PURE__ */ n("div", { className: "my-1 h-px bg-border", rol
|
|
|
11
11
|
}) => {
|
|
12
12
|
const o = E(
|
|
13
13
|
"flex items-center w-full text-left px-3 py-1.5 text-sm cursor-pointer transition-colors duration-150 ease-in-out whitespace-nowrap rounded-md",
|
|
14
|
-
"hover:bg-accent hover:text-accent-foreground text-
|
|
14
|
+
"hover:bg-accent hover:text-accent-foreground text-foreground",
|
|
15
15
|
l && "opacity-50 cursor-not-allowed"
|
|
16
16
|
), r = e && m.isValidElement(e) ? m.cloneElement(e, {
|
|
17
17
|
size: 14,
|
|
18
18
|
className: "mr-2 text-muted-foreground"
|
|
19
19
|
}) : null;
|
|
20
20
|
return /* @__PURE__ */ n(
|
|
21
|
-
t ?
|
|
21
|
+
t ? x : "button",
|
|
22
22
|
{
|
|
23
23
|
onClick: c,
|
|
24
24
|
disabled: l,
|
|
@@ -42,7 +42,7 @@ const y = () => /* @__PURE__ */ n("div", { className: "my-1 h-px bg-border", rol
|
|
|
42
42
|
}, h = f(() => t((a) => !a), []), i = f((a) => {
|
|
43
43
|
o.current && !o.current.contains(a.target) && t(!1);
|
|
44
44
|
}, []);
|
|
45
|
-
return
|
|
45
|
+
return w(() => (e ? document.addEventListener("mousedown", i) : document.removeEventListener("mousedown", i), () => {
|
|
46
46
|
document.removeEventListener("mousedown", i);
|
|
47
47
|
}), [e, i]), /* @__PURE__ */ p(
|
|
48
48
|
"div",
|
|
@@ -57,7 +57,7 @@ const y = () => /* @__PURE__ */ n("div", { className: "my-1 h-px bg-border", rol
|
|
|
57
57
|
"div",
|
|
58
58
|
{
|
|
59
59
|
onMouseEnter: u,
|
|
60
|
-
className: `origin-top-right absolute z-
|
|
60
|
+
className: `origin-top-right absolute z-popover rounded-md shadow-lg bg-card border border-border ring-1 ring-black ring-opacity-5 focus:outline-none min-w-[12rem] w-max ${(() => {
|
|
61
61
|
switch (l) {
|
|
62
62
|
case "bottom-left":
|
|
63
63
|
return "top-full left-0 mt-1";
|
|
@@ -66,7 +66,7 @@ const C = ({ tab: n, isActive: o, onTap: s }) => /* @__PURE__ */ l(
|
|
|
66
66
|
"nav",
|
|
67
67
|
{
|
|
68
68
|
className: c(
|
|
69
|
-
"fixed inset-x-0 bottom-0 z-
|
|
69
|
+
"fixed inset-x-0 bottom-0 z-nav md:hidden",
|
|
70
70
|
"border-t border-border bg-card/95 backdrop-blur-md",
|
|
71
71
|
"supports-[backdrop-filter]:bg-card/80",
|
|
72
72
|
// Safe area for notched phones (iPhone etc.)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useMemo as N, useCallback as
|
|
3
|
-
import { Button as
|
|
1
|
+
import { jsxs as u, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as N, useCallback as e } from "react";
|
|
3
|
+
import { Button as o } from "../ui/Button.js";
|
|
4
4
|
const j = ({
|
|
5
5
|
currentPage: s,
|
|
6
6
|
totalPages: l,
|
|
@@ -21,50 +21,55 @@ const j = ({
|
|
|
21
21
|
for (let f = h; f <= d; f++)
|
|
22
22
|
i.push(f);
|
|
23
23
|
return d < l && (d < l - 1 && i.push("..."), i.push(l)), i;
|
|
24
|
-
}, [s, l, c]), v =
|
|
24
|
+
}, [s, l, c]), v = e((i) => {
|
|
25
25
|
n(i);
|
|
26
|
-
}, [n]),
|
|
26
|
+
}, [n]), x = e(() => {
|
|
27
27
|
n(s - 1);
|
|
28
|
-
}, [s, n]),
|
|
28
|
+
}, [s, n]), k = e(() => {
|
|
29
29
|
n(s + 1);
|
|
30
30
|
}, [s, n]);
|
|
31
|
-
return l <= 1 ? null :
|
|
32
|
-
/*
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
disabled: s === 1,
|
|
39
|
-
iconLeft: "chevron-left",
|
|
40
|
-
children: "Previous"
|
|
41
|
-
}
|
|
42
|
-
),
|
|
43
|
-
/* @__PURE__ */ m("div", { className: "flex items-center gap-1", children: t.map(
|
|
44
|
-
(i, r) => typeof i == "number" ? /* @__PURE__ */ m(
|
|
45
|
-
e,
|
|
31
|
+
return l <= 1 ? null : (
|
|
32
|
+
/* flex-wrap so the control folds instead of overflowing. Previous + the
|
|
33
|
+
page buttons + Next is wider than a 360px viewport, and without wrapping
|
|
34
|
+
the nav painted 74px past its container on every product that paginates. */
|
|
35
|
+
/* @__PURE__ */ u("nav", { className: `flex flex-wrap items-center justify-center gap-2 ${p || ""}`, "aria-label": "Pagination", children: [
|
|
36
|
+
/* @__PURE__ */ m(
|
|
37
|
+
o,
|
|
46
38
|
{
|
|
47
|
-
variant:
|
|
39
|
+
variant: "outline",
|
|
48
40
|
size: "sm",
|
|
49
|
-
onClick:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
41
|
+
onClick: x,
|
|
42
|
+
disabled: s === 1,
|
|
43
|
+
iconLeft: "chevron-left",
|
|
44
|
+
children: "Previous"
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
/* @__PURE__ */ m("div", { className: "flex items-center gap-1", children: t.map(
|
|
48
|
+
(i, r) => typeof i == "number" ? /* @__PURE__ */ m(
|
|
49
|
+
o,
|
|
50
|
+
{
|
|
51
|
+
variant: s === i ? "primary" : "ghost",
|
|
52
|
+
size: "sm",
|
|
53
|
+
onClick: () => v(i),
|
|
54
|
+
className: "w-10",
|
|
55
|
+
children: i
|
|
56
|
+
},
|
|
57
|
+
i
|
|
58
|
+
) : /* @__PURE__ */ m("span", { className: "px-2 py-1 text-sm text-muted-foreground", children: "..." }, `ellipsis-${r}`)
|
|
59
|
+
) }),
|
|
60
|
+
/* @__PURE__ */ m(
|
|
61
|
+
o,
|
|
62
|
+
{
|
|
63
|
+
variant: "outline",
|
|
64
|
+
size: "sm",
|
|
65
|
+
onClick: k,
|
|
66
|
+
disabled: s === l,
|
|
67
|
+
iconRight: "chevron-right",
|
|
68
|
+
children: "Next"
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
] })
|
|
72
|
+
);
|
|
68
73
|
};
|
|
69
74
|
export {
|
|
70
75
|
j as Pagination
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { Icon as
|
|
4
|
-
const b = ({ steps:
|
|
5
|
-
const s =
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */
|
|
1
|
+
import { jsx as r, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import d from "react";
|
|
3
|
+
import { Icon as n } from "../ui/Icon.js";
|
|
4
|
+
const b = ({ steps: m, currentStep: t, className: o }) => /* @__PURE__ */ r("div", { className: `flex justify-between items-start ${o || ""}`, children: m.map((a, e) => {
|
|
5
|
+
const s = e < t, i = e === t, c = e > t;
|
|
6
|
+
return /* @__PURE__ */ l(d.Fragment, { children: [
|
|
7
|
+
/* @__PURE__ */ l("div", { className: "flex flex-col items-center text-center", children: [
|
|
8
|
+
/* @__PURE__ */ r(
|
|
9
9
|
"div",
|
|
10
10
|
{
|
|
11
11
|
className: `w-8 h-8 rounded-full flex items-center justify-center border-2 transition-all duration-300
|
|
12
12
|
${s ? "bg-primary border-primary text-white" : ""}
|
|
13
|
-
${
|
|
14
|
-
${
|
|
13
|
+
${i ? "bg-card border-primary text-primary" : ""}
|
|
14
|
+
${c ? "bg-card border-border text-muted-foreground" : ""}
|
|
15
15
|
`,
|
|
16
|
-
children: s ? /* @__PURE__ */
|
|
16
|
+
children: s ? /* @__PURE__ */ r(n, { name: "check", size: 16 }) : /* @__PURE__ */ r("span", { children: e + 1 })
|
|
17
17
|
}
|
|
18
18
|
),
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
|
|
19
|
+
/* @__PURE__ */ l("div", { className: "mt-2", children: [
|
|
20
|
+
/* @__PURE__ */ r("p", { className: `font-semibold text-sm ${i ? "text-primary" : "text-foreground"}`, children: a.label }),
|
|
21
|
+
a.summary && /* @__PURE__ */ r("p", { className: "text-xs text-muted-foreground mt-1", children: a.summary })
|
|
22
22
|
] })
|
|
23
23
|
] }),
|
|
24
|
-
|
|
24
|
+
e < m.length - 1 && /* @__PURE__ */ r("div", { className: "flex-1 mt-4 mx-2 h-0.5", children: /* @__PURE__ */ r(
|
|
25
25
|
"div",
|
|
26
26
|
{
|
|
27
|
-
className: `h-full w-full rounded-full transition-colors duration-300 ${
|
|
27
|
+
className: `h-full w-full rounded-full transition-colors duration-300 ${e < t ? "bg-primary" : "bg-border"}`
|
|
28
28
|
}
|
|
29
29
|
) })
|
|
30
|
-
] },
|
|
30
|
+
] }, e);
|
|
31
31
|
}) });
|
|
32
32
|
export {
|
|
33
33
|
b as Stepper
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsxs as i, jsx as
|
|
2
|
-
import p, { useMemo as
|
|
3
|
-
import { cn as
|
|
4
|
-
const k = ({ children: o }) => /* @__PURE__ */
|
|
5
|
-
const
|
|
6
|
-
return /* @__PURE__ */ i("div", { className:
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
const t = r.props.icon, u = s === "sm" ? 14 : 16,
|
|
1
|
+
import { jsxs as i, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import p, { useMemo as x, useState as g, useCallback as v } from "react";
|
|
3
|
+
import { cn as d } from "../../utils/cn.js";
|
|
4
|
+
const k = ({ children: o }) => /* @__PURE__ */ l("div", { role: "tabpanel", className: "p-4 bg-card rounded-b-lg border border-t-0 border-border", children: o }), C = ({ children: o, defaultActiveTab: e, className: a, size: s = "md" }) => {
|
|
5
|
+
const c = x(() => e || (o.length > 0 ? o[0].props.id : ""), [o, e]), [n, m] = g(c), b = v((r) => m(r), []);
|
|
6
|
+
return /* @__PURE__ */ i("div", { className: a, children: [
|
|
7
|
+
/* @__PURE__ */ l("div", { className: "flex border-b border-border mb-px", role: "tablist", children: o.map((r) => {
|
|
8
|
+
const t = r.props.icon, u = s === "sm" ? 14 : 16, f = t && p.isValidElement(t) ? p.cloneElement(t, {
|
|
9
9
|
size: u,
|
|
10
|
-
className:
|
|
10
|
+
className: d("mr-2", s === "sm" ? "mt-[1px]" : "")
|
|
11
11
|
// slight alignment tweak for smaller text
|
|
12
12
|
}) : null;
|
|
13
13
|
return /* @__PURE__ */ i(
|
|
@@ -18,13 +18,13 @@ const k = ({ children: o }) => /* @__PURE__ */ a("div", { role: "tabpanel", clas
|
|
|
18
18
|
"aria-controls": r.props.id,
|
|
19
19
|
"aria-selected": n === r.props.id,
|
|
20
20
|
onClick: () => b(r.props.id),
|
|
21
|
-
className:
|
|
22
|
-
"inline-flex items-center text-
|
|
21
|
+
className: d(
|
|
22
|
+
"inline-flex items-center text-foreground font-medium border-b-2 transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
|
|
23
23
|
s === "sm" ? "px-3 py-1.5 text-sm" : "px-4 py-2 text-lg",
|
|
24
24
|
n === r.props.id ? "border-primary" : "border-transparent hover:border-border"
|
|
25
25
|
),
|
|
26
26
|
children: [
|
|
27
|
-
|
|
27
|
+
f,
|
|
28
28
|
r.props.label
|
|
29
29
|
]
|
|
30
30
|
},
|
|
@@ -17,8 +17,14 @@ export interface ThemeLabProps {
|
|
|
17
17
|
onTokensChange: (tokens: ThemeTokensDraft) => void;
|
|
18
18
|
/** Saves activeTokens as the new master restore point. */
|
|
19
19
|
onSave: () => void;
|
|
20
|
-
/** Restores DOM and store to savedTokens. */
|
|
20
|
+
/** Restores DOM and store to savedTokens — discards edits since the last save. */
|
|
21
21
|
onRevert: () => void;
|
|
22
|
+
/**
|
|
23
|
+
* Drops the user's theme entirely so the app's own theme takes over again.
|
|
24
|
+
* Optional: a host that has no baked-in theme has nothing to reset to, and
|
|
25
|
+
* the control is hidden rather than shown doing nothing.
|
|
26
|
+
*/
|
|
27
|
+
onResetToDefault?: () => void;
|
|
22
28
|
profiles: AestheticProfile[];
|
|
23
29
|
profileIcons: Record<string, string>;
|
|
24
30
|
activeProfileId?: string;
|