@ramme-io/ui 5.0.1 → 5.0.2
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,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as b, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import t from "react";
|
|
3
3
|
import { Prism as x } from "react-syntax-highlighter";
|
|
4
|
-
import { oneDark as
|
|
4
|
+
import { oneDark as w, oneLight as k } from "react-syntax-highlighter/dist/esm/styles/prism";
|
|
5
5
|
import { cn as C } from "../../utils/cn.js";
|
|
6
6
|
import { Icon as S } from "../ui/Icon.js";
|
|
7
7
|
function T() {
|
|
@@ -9,9 +9,9 @@ function T() {
|
|
|
9
9
|
() => typeof document < "u" && document.documentElement.classList.contains("dark")
|
|
10
10
|
);
|
|
11
11
|
return t.useEffect(() => {
|
|
12
|
-
const o = document.documentElement,
|
|
13
|
-
|
|
14
|
-
const i = new MutationObserver(
|
|
12
|
+
const o = document.documentElement, a = () => e(o.classList.contains("dark"));
|
|
13
|
+
a();
|
|
14
|
+
const i = new MutationObserver(a);
|
|
15
15
|
return i.observe(o, { attributes: !0, attributeFilter: ["class"] }), () => i.disconnect();
|
|
16
16
|
}, []), r;
|
|
17
17
|
}
|
|
@@ -24,21 +24,21 @@ async function N(r) {
|
|
|
24
24
|
const e = document.createElement("textarea");
|
|
25
25
|
e.value = r, e.setAttribute("readonly", ""), e.style.position = "fixed", e.style.opacity = "0", document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e);
|
|
26
26
|
}
|
|
27
|
-
const
|
|
27
|
+
const L = ({
|
|
28
28
|
code: r,
|
|
29
29
|
language: e = "tsx",
|
|
30
30
|
filename: o,
|
|
31
|
-
showLineNumbers:
|
|
31
|
+
showLineNumbers: a = !1,
|
|
32
32
|
highlightLines: i,
|
|
33
|
-
wrap:
|
|
33
|
+
wrap: m = !1,
|
|
34
34
|
hideCopy: v = !1,
|
|
35
35
|
className: g
|
|
36
36
|
}) => {
|
|
37
|
-
const y = T(), [
|
|
37
|
+
const y = T(), [s, p] = t.useState(!1), d = t.useRef(), f = t.useMemo(() => r.replace(/^\n+|\s+$/g, ""), [r]), u = o || e;
|
|
38
38
|
t.useEffect(() => () => clearTimeout(d.current), []);
|
|
39
39
|
const h = async () => {
|
|
40
40
|
try {
|
|
41
|
-
await N(
|
|
41
|
+
await N(f), p(!0), clearTimeout(d.current), d.current = setTimeout(() => p(!1), 2e3);
|
|
42
42
|
} catch (l) {
|
|
43
43
|
console.warn("[CodeBlock] Copy failed", l);
|
|
44
44
|
}
|
|
@@ -46,7 +46,7 @@ const B = ({
|
|
|
46
46
|
() => new Set(i ?? []),
|
|
47
47
|
[i]
|
|
48
48
|
);
|
|
49
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ b(
|
|
50
50
|
"div",
|
|
51
51
|
{
|
|
52
52
|
className: C(
|
|
@@ -54,7 +54,7 @@ const B = ({
|
|
|
54
54
|
g
|
|
55
55
|
),
|
|
56
56
|
children: [
|
|
57
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ b("div", { className: "flex items-center justify-between gap-2 border-b border-border bg-surface-muted pl-4 pr-1.5", children: [
|
|
58
58
|
/* @__PURE__ */ n("span", { className: "truncate py-2 font-mono text-2xs font-medium uppercase tracking-wider text-muted-foreground", children: u }),
|
|
59
59
|
!v && /* @__PURE__ */ n(
|
|
60
60
|
"button",
|
|
@@ -62,13 +62,13 @@ const B = ({
|
|
|
62
62
|
type: "button",
|
|
63
63
|
onClick: h,
|
|
64
64
|
className: "inline-flex min-h-11 min-w-11 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-surface-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
65
|
-
"aria-label":
|
|
65
|
+
"aria-label": s ? "Copied" : `Copy ${u} snippet to clipboard`,
|
|
66
66
|
children: /* @__PURE__ */ n(
|
|
67
67
|
S,
|
|
68
68
|
{
|
|
69
|
-
name:
|
|
69
|
+
name: s ? "check" : "copy",
|
|
70
70
|
size: 16,
|
|
71
|
-
className:
|
|
71
|
+
className: s ? "text-success" : void 0
|
|
72
72
|
}
|
|
73
73
|
)
|
|
74
74
|
}
|
|
@@ -85,8 +85,8 @@ const B = ({
|
|
|
85
85
|
x,
|
|
86
86
|
{
|
|
87
87
|
language: e,
|
|
88
|
-
style: y ?
|
|
89
|
-
showLineNumbers:
|
|
88
|
+
style: y ? w : k,
|
|
89
|
+
showLineNumbers: a,
|
|
90
90
|
wrapLines: c.size > 0,
|
|
91
91
|
lineProps: c.size > 0 ? (l) => ({
|
|
92
92
|
style: {
|
|
@@ -111,7 +111,7 @@ const B = ({
|
|
|
111
111
|
fontSize: "var(--app-step--1)",
|
|
112
112
|
lineHeight: "var(--app-leading-relaxed)",
|
|
113
113
|
tabSize: 2,
|
|
114
|
-
...
|
|
114
|
+
...m ? { whiteSpace: "pre-wrap", wordBreak: "break-word" } : {}
|
|
115
115
|
},
|
|
116
116
|
codeTagProps: {
|
|
117
117
|
style: {
|
|
@@ -120,19 +120,23 @@ const B = ({
|
|
|
120
120
|
fontFamily: "var(--app-font-mono)",
|
|
121
121
|
// Ligatures off: a tutorial shows the characters you must type,
|
|
122
122
|
// and a font that draws `=>` as one arrow misleads a beginner.
|
|
123
|
-
fontVariantLigatures: "none"
|
|
123
|
+
fontVariantLigatures: "none",
|
|
124
|
+
// Wrap has to be said here too. The theme styles the inner <code>
|
|
125
|
+
// with `white-space: pre`, which beats the <pre>'s pre-wrap above,
|
|
126
|
+
// so for as long as only the <pre> had it, `wrap` wrapped nothing.
|
|
127
|
+
...m ? { whiteSpace: "pre-wrap", wordBreak: "break-word" } : {}
|
|
124
128
|
}
|
|
125
129
|
},
|
|
126
|
-
children:
|
|
130
|
+
children: f
|
|
127
131
|
}
|
|
128
132
|
)
|
|
129
133
|
}
|
|
130
134
|
),
|
|
131
|
-
/* @__PURE__ */ n("span", { "aria-live": "polite", className: "sr-only", children:
|
|
135
|
+
/* @__PURE__ */ n("span", { "aria-live": "polite", className: "sr-only", children: s ? "Copied to clipboard" : "" })
|
|
132
136
|
]
|
|
133
137
|
}
|
|
134
138
|
);
|
|
135
139
|
};
|
|
136
140
|
export {
|
|
137
|
-
|
|
141
|
+
L as CodeBlock
|
|
138
142
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as u, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useState as m, useRef as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { useDialogFocus as
|
|
2
|
+
import { useState as m, useRef as A, useEffect as x, useCallback as E } from "react";
|
|
3
|
+
import { createPortal as S } from "react-dom";
|
|
4
|
+
import { useDialogFocus as j } from "../../lib/hooks/useDialogFocus.js";
|
|
5
5
|
import { Icon as F } from "../ui/Icon.js";
|
|
6
6
|
import { cn as y } from "../../utils/cn.js";
|
|
7
7
|
import { useBodyScrollLock as I } from "../../lib/hooks/useBodyScrollLock.js";
|
|
@@ -17,25 +17,25 @@ const Y = ({
|
|
|
17
17
|
overlayDismiss: N = !0,
|
|
18
18
|
className: D
|
|
19
19
|
}) => {
|
|
20
|
-
const [s, b] = m(!1), [g, p] = m(!1), w =
|
|
20
|
+
const [s, b] = m(!1), [g, p] = m(!1), w = A(null), [c] = m(
|
|
21
21
|
() => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches
|
|
22
22
|
), i = [...k].sort((o, a) => o - a), t = R({
|
|
23
23
|
detents: i,
|
|
24
24
|
// Under reduced motion there is no drag, so a partial height would be a
|
|
25
25
|
// height the reader can never change. Open fully instead.
|
|
26
|
-
initialDetent:
|
|
26
|
+
initialDetent: c ? i.length - 1 : f,
|
|
27
27
|
onDismiss: r,
|
|
28
|
-
reducedMotion:
|
|
28
|
+
reducedMotion: c
|
|
29
29
|
});
|
|
30
30
|
I(n), x(() => {
|
|
31
31
|
let o, a;
|
|
32
|
-
return n ? (b(!0), t.setHeight(i[
|
|
32
|
+
return n ? (b(!0), t.setHeight(i[c ? i.length - 1 : f] ?? i[0]), o = requestAnimationFrame(() => {
|
|
33
33
|
a = window.setTimeout(() => p(!0), 10);
|
|
34
34
|
})) : (p(!1), a = window.setTimeout(() => b(!1), 320)), () => {
|
|
35
35
|
cancelAnimationFrame(o), clearTimeout(a);
|
|
36
36
|
};
|
|
37
|
-
}, [n]),
|
|
38
|
-
const
|
|
37
|
+
}, [n]), j(s, w);
|
|
38
|
+
const l = E(
|
|
39
39
|
(o) => {
|
|
40
40
|
o.key === "Escape" && n && r();
|
|
41
41
|
},
|
|
@@ -43,10 +43,10 @@ const Y = ({
|
|
|
43
43
|
);
|
|
44
44
|
if (x(() => {
|
|
45
45
|
if (s)
|
|
46
|
-
return document.addEventListener("keydown",
|
|
47
|
-
}, [s,
|
|
46
|
+
return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
|
|
47
|
+
}, [s, l]), !s) return null;
|
|
48
48
|
const P = g ? 1 - t.height : 1;
|
|
49
|
-
return
|
|
49
|
+
return S(
|
|
50
50
|
/* @__PURE__ */ u(
|
|
51
51
|
"div",
|
|
52
52
|
{
|
|
@@ -126,6 +126,7 @@ const Y = ({
|
|
|
126
126
|
"div",
|
|
127
127
|
{
|
|
128
128
|
onPointerDown: t.onBodyPointerDown,
|
|
129
|
+
style: { touchAction: t.bodyTouchAction },
|
|
129
130
|
className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 pb-4",
|
|
130
131
|
children: v
|
|
131
132
|
}
|
package/dist/index.js
CHANGED
|
@@ -5,12 +5,12 @@ import { mockChartData as f, mockTableData as x } from "./data/mockData.js";
|
|
|
5
5
|
import { Loader as n } from "./blocks/ai/Loader.js";
|
|
6
6
|
import { Actions as T, Suggestion as s } from "./blocks/ai/Actions.js";
|
|
7
7
|
import { PromptInput as h } from "./blocks/ai/PromptInput.js";
|
|
8
|
-
import { Message as
|
|
8
|
+
import { Message as g } from "./blocks/ai/Message.js";
|
|
9
9
|
import { Conversation as u } from "./blocks/ai/Conversation.js";
|
|
10
10
|
import { ChatFAB as b } from "./blocks/ai/ChatFAB.js";
|
|
11
|
-
import { AIChatThread as
|
|
11
|
+
import { AIChatThread as P } from "./components/ai/AIChatThread/AIChatThread.js";
|
|
12
12
|
import { KeyInjectionOverlay as A } from "./components/ai/KeyInjectionOverlay.js";
|
|
13
|
-
import { TAY_DREAMBOAT_THEME as
|
|
13
|
+
import { TAY_DREAMBOAT_THEME as B, ThemeProvider as R, availableThemes as E, useTheme as M } from "./contexts/ThemeContext.js";
|
|
14
14
|
import { AuthLayout as y } from "./components/auth/AuthLayout.js";
|
|
15
15
|
import { LoginPage as w } from "./components/auth/LoginPage.js";
|
|
16
16
|
import { SignupPage as _ } from "./components/auth/SignupPage.js";
|
|
@@ -30,12 +30,12 @@ import { KpiGrid as xr } from "./components/data-display/KpiGrid.js";
|
|
|
30
30
|
import { StatusBadge as nr } from "./components/data-display/StatusBadge.js";
|
|
31
31
|
import { DocumentScanView as Tr } from "./components/data-display/DocumentScanView.js";
|
|
32
32
|
import { Alert as dr } from "./components/feedback/Alert.js";
|
|
33
|
-
import { EmptyState as
|
|
33
|
+
import { EmptyState as Sr } from "./components/feedback/EmptyState.js";
|
|
34
34
|
import { Skeleton as Cr } from "./components/feedback/Skeleton.js";
|
|
35
35
|
import { Plan as cr } from "./components/feedback/Plan.js";
|
|
36
36
|
import { TippyTooltip as Dr } from "./components/feedback/TippyTooltip.js";
|
|
37
|
-
import { Toast as
|
|
38
|
-
import { ToastProvider as
|
|
37
|
+
import { Toast as Ir } from "./components/feedback/Toast.js";
|
|
38
|
+
import { ToastProvider as Lr, useToast as Br } from "./components/feedback/ToastProvider.js";
|
|
39
39
|
import { Label as Er } from "./components/forms/Label.js";
|
|
40
40
|
import { ButtonGroup as vr } from "./components/forms/ButtonGroup.js";
|
|
41
41
|
import { Checkbox as Fr } from "./components/forms/Checkbox.js";
|
|
@@ -54,236 +54,237 @@ import { ToggleSwitch as to, ToggleSwitch as mo } from "./components/forms/Toggl
|
|
|
54
54
|
import { useDataFetch as ao } from "./lib/hooks/useDataFetch.js";
|
|
55
55
|
import { useChartTheme as xo } from "./lib/hooks/useChartTheme.js";
|
|
56
56
|
import { MOBILE_BREAKPOINT_PX as no, MOBILE_BREAKPOINT_QUERY as lo, useIsMobile as To, useMediaQuery as so } from "./lib/hooks/useMediaQuery.js";
|
|
57
|
-
import { useBodyScrollLock as
|
|
58
|
-
import { DISMISS_THRESHOLD as Co,
|
|
57
|
+
import { useBodyScrollLock as So } from "./lib/hooks/useBodyScrollLock.js";
|
|
58
|
+
import { DISMISS_THRESHOLD as Co, DRAG_SLOP as uo, FLICK_VELOCITY as co, settleTo as bo, useSheetGesture as Do } from "./lib/hooks/useSheetGesture.js";
|
|
59
59
|
import { useDialogFocus as Io } from "./lib/hooks/useDialogFocus.js";
|
|
60
|
-
import { CircularDial as
|
|
61
|
-
import { HardwareCommandButton as
|
|
62
|
-
import { Sparkline as
|
|
63
|
-
import { EdgeInsightTerminal as
|
|
64
|
-
import { DeviceCard as
|
|
65
|
-
import { WaterPumpControl as
|
|
66
|
-
import { TelemetryLog as
|
|
67
|
-
import { DataCard as
|
|
68
|
-
import { StateMatrix as
|
|
69
|
-
import { ConnectorOverlay as
|
|
70
|
-
import { AppShell as
|
|
71
|
-
import { SettingsContainer as
|
|
72
|
-
import { DetailDrawer as
|
|
73
|
-
import { RammeInspectorTrigger as
|
|
74
|
-
import { AboutRamme as
|
|
75
|
-
import { Header as
|
|
76
|
-
import { Toolbar as
|
|
77
|
-
import { FilterPanel as
|
|
78
|
-
import { Statusbar as
|
|
79
|
-
import { Accordion as
|
|
80
|
-
import { Card as
|
|
81
|
-
import { Drawer as
|
|
82
|
-
import { Sheet as
|
|
83
|
-
import { DefinitionDescription as
|
|
84
|
-
import { Modal as
|
|
85
|
-
import { Sidebar as
|
|
86
|
-
import { ActionBar as
|
|
87
|
-
import { PageContainer as
|
|
88
|
-
import { PageHeader as
|
|
89
|
-
import { SectionHeader as
|
|
90
|
-
import { ButtonItem as
|
|
91
|
-
import { CollectionLayout as
|
|
92
|
-
import { DenseMetricRibbon as
|
|
93
|
-
import { BreadcrumbItem as
|
|
94
|
-
import { Menu as
|
|
95
|
-
import { MobileNav as
|
|
96
|
-
import { Pagination as
|
|
97
|
-
import { Stepper as
|
|
98
|
-
import { TabPanel as
|
|
99
|
-
import { Avatar as
|
|
100
|
-
import { Badge as
|
|
101
|
-
import { Button as gt, buttonVariants as
|
|
102
|
-
import { Icon as
|
|
103
|
-
import { BrandLogo as
|
|
60
|
+
import { CircularDial as Lo } from "./components/hardware/CircularDial.js";
|
|
61
|
+
import { HardwareCommandButton as Ro } from "./components/hardware/HardwareCommandButton.js";
|
|
62
|
+
import { Sparkline as Mo } from "./components/hardware/Sparkline.js";
|
|
63
|
+
import { EdgeInsightTerminal as yo } from "./components/hardware/EdgeInsightTerminal.js";
|
|
64
|
+
import { DeviceCard as wo } from "./blocks/iot/DeviceCard.js";
|
|
65
|
+
import { WaterPumpControl as _o } from "./blocks/iot/WaterPumpControl.js";
|
|
66
|
+
import { TelemetryLog as Ho } from "./blocks/iot/TelemetryLog.js";
|
|
67
|
+
import { DataCard as Vo } from "./components/molecular/DataCard.js";
|
|
68
|
+
import { StateMatrix as No } from "./components/molecular/StateMatrix.js";
|
|
69
|
+
import { ConnectorOverlay as Yo } from "./components/molecular/ConnectorOverlay.js";
|
|
70
|
+
import { AppShell as Qo } from "./components/layout/AppShell.js";
|
|
71
|
+
import { SettingsContainer as jo } from "./components/layout/SettingsContainer.js";
|
|
72
|
+
import { DetailDrawer as qo } from "./components/layout/DetailDrawer.js";
|
|
73
|
+
import { RammeInspectorTrigger as Zo } from "./components/layout/RammeInspectorTrigger.js";
|
|
74
|
+
import { AboutRamme as re } from "./components/layout/AboutRamme.js";
|
|
75
|
+
import { Header as ee } from "./components/layout/Header.js";
|
|
76
|
+
import { Toolbar as me } from "./components/layout/Toolbar.js";
|
|
77
|
+
import { FilterPanel as ae } from "./components/layout/FilterPanel.js";
|
|
78
|
+
import { Statusbar as xe } from "./components/layout/Statusbar.js";
|
|
79
|
+
import { Accordion as ne, AccordionItem as le } from "./components/layout/Accordion.js";
|
|
80
|
+
import { Card as se, CardContent as de, CardDescription as he, CardFooter as Se, CardHeader as ge, CardLabel as Ce, CardTitle as ue } from "./components/layout/Card.js";
|
|
81
|
+
import { Drawer as be } from "./components/layout/Drawer.js";
|
|
82
|
+
import { Sheet as Pe } from "./components/layout/Sheet.js";
|
|
83
|
+
import { DefinitionDescription as Ae, DefinitionList as Le, DefinitionTerm as Be, List as Re, ListItem as Ee } from "./components/layout/List.js";
|
|
84
|
+
import { Modal as ve } from "./components/layout/Modal.js";
|
|
85
|
+
import { Sidebar as Fe } from "./components/layout/Sidebar.js";
|
|
86
|
+
import { ActionBar as Oe } from "./components/layout/ActionBar.js";
|
|
87
|
+
import { PageContainer as ke } from "./components/layout/PageContainer.js";
|
|
88
|
+
import { PageHeader as Ge } from "./components/layout/PageHeader.js";
|
|
89
|
+
import { SectionHeader as Ke } from "./components/layout/SectionHeader.js";
|
|
90
|
+
import { ButtonItem as Ue, UserNav as Ye } from "./components/layout/UserNav.js";
|
|
91
|
+
import { CollectionLayout as Qe } from "./components/layout/CollectionLayout.js";
|
|
92
|
+
import { DenseMetricRibbon as je } from "./components/layout/DenseMetricRibbon.js";
|
|
93
|
+
import { BreadcrumbItem as qe, Breadcrumbs as Je } from "./components/navigation/Breadcrumbs.js";
|
|
94
|
+
import { Menu as $e, MenuDivider as rt, MenuItem as ot } from "./components/navigation/Menu.js";
|
|
95
|
+
import { MobileNav as tt } from "./components/navigation/MobileNav.js";
|
|
96
|
+
import { Pagination as pt } from "./components/navigation/Pagination.js";
|
|
97
|
+
import { Stepper as ft } from "./components/navigation/Stepper.js";
|
|
98
|
+
import { TabPanel as it, Tabs as nt } from "./components/navigation/Tabs.js";
|
|
99
|
+
import { Avatar as Tt } from "./components/ui/Avatar.js";
|
|
100
|
+
import { Badge as dt, badgeVariants as ht } from "./components/ui/Badge.js";
|
|
101
|
+
import { Button as gt, buttonVariants as Ct } from "./components/ui/Button.js";
|
|
102
|
+
import { Icon as ct } from "./components/ui/Icon.js";
|
|
103
|
+
import { BrandLogo as Dt } from "./components/ui/BrandLogo.js";
|
|
104
104
|
import { cn as It } from "./utils/cn.js";
|
|
105
|
-
import { formatValue as
|
|
106
|
-
import { ThemeSynthesizer as
|
|
107
|
-
import { AestheticProfileGrid as
|
|
108
|
-
import { FineTuningControls as
|
|
109
|
-
import { PaletteSwatch as
|
|
110
|
-
import { ThemeSettings as
|
|
111
|
-
import { ThemeLab as
|
|
112
|
-
import { AESTHETIC_PROFILES as
|
|
113
|
-
import { THEME_TOKEN_VARS as
|
|
114
|
-
import { generateThemeFromPrompt as
|
|
115
|
-
import { TelemetryGraph as
|
|
116
|
-
import { ShowroomContainer as
|
|
117
|
-
import { ShowroomSidebar as
|
|
118
|
-
import { ShowroomCanvas as
|
|
105
|
+
import { formatValue as Lt } from "./lib/formatters.js";
|
|
106
|
+
import { ThemeSynthesizer as Rt } from "./components/theme/ThemeSynthesizer.js";
|
|
107
|
+
import { AestheticProfileGrid as Mt } from "./components/theme/AestheticProfileGrid.js";
|
|
108
|
+
import { FineTuningControls as yt } from "./components/theme/FineTuningControls.js";
|
|
109
|
+
import { PaletteSwatch as wt, ThemeLivePreview as Ot } from "./components/theme/ThemeLivePreview.js";
|
|
110
|
+
import { ThemeSettings as kt } from "./components/theme/ThemeSettings.js";
|
|
111
|
+
import { ThemeLab as Gt } from "./components/theme/ThemeLab.js";
|
|
112
|
+
import { AESTHETIC_PROFILES as Kt, generateFromProfile as Nt, generateFromPrompt as Ut, generateRandom as Yt, hslToCssString as zt, hslToRgb as Qt, hslToRgbString as Wt, lightToDark as jt, paletteToRgbVars as Xt } from "./lib/theme/ThemeGenerator.logic.js";
|
|
113
|
+
import { THEME_TOKEN_VARS as Jt, applyThemeToDom as Zt, generateRandomTheme as $t, getContrastColor as rm, hexToRgbTriplet as om, isCustomTheme as em, loadGoogleFont as tm, randomRgb as mm, tokensToVars as pm } from "./lib/theme/themeUtils.js";
|
|
114
|
+
import { generateThemeFromPrompt as fm } from "./lib/theme/themeAgent.js";
|
|
115
|
+
import { TelemetryGraph as im } from "./components/ai/TelemetryGraph/TelemetryGraph.js";
|
|
116
|
+
import { ShowroomContainer as lm } from "./components/showroom/ShowroomContainer.js";
|
|
117
|
+
import { ShowroomSidebar as sm } from "./components/showroom/ShowroomSidebar.js";
|
|
118
|
+
import { ShowroomCanvas as hm } from "./components/showroom/ShowroomCanvas.js";
|
|
119
119
|
import { SkuBadge as gm } from "./components/showroom/SkuBadge.js";
|
|
120
|
-
import { resolvePreview as
|
|
120
|
+
import { resolvePreview as um } from "./components/showroom/ShowroomRenderer.js";
|
|
121
121
|
export {
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
Kt as AESTHETIC_PROFILES,
|
|
123
|
+
P as AIChatThread,
|
|
124
124
|
p as AUTO_REGISTRY,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
re as AboutRamme,
|
|
126
|
+
ne as Accordion,
|
|
127
|
+
le as AccordionItem,
|
|
128
|
+
Oe as ActionBar,
|
|
129
129
|
T as Actions,
|
|
130
130
|
V as ActivityFeed,
|
|
131
|
-
|
|
131
|
+
Mt as AestheticProfileGrid,
|
|
132
132
|
dr as Alert,
|
|
133
|
-
|
|
133
|
+
Qo as AppShell,
|
|
134
134
|
Q as AreaChart,
|
|
135
135
|
y as AuthLayout,
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
Tt as Avatar,
|
|
137
|
+
dt as Badge,
|
|
138
138
|
j as BarChart,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
Dt as BrandLogo,
|
|
140
|
+
qe as BreadcrumbItem,
|
|
141
|
+
Je as Breadcrumbs,
|
|
142
142
|
gt as Button,
|
|
143
143
|
vr as ButtonGroup,
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
144
|
+
Ue as ButtonItem,
|
|
145
|
+
se as Card,
|
|
146
|
+
de as CardContent,
|
|
147
|
+
he as CardDescription,
|
|
148
|
+
Se as CardFooter,
|
|
149
149
|
ge as CardHeader,
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
Ce as CardLabel,
|
|
151
|
+
ue as CardTitle,
|
|
152
152
|
q as ChartWithTable,
|
|
153
153
|
b as ChatFAB,
|
|
154
154
|
Fr as Checkbox,
|
|
155
|
-
|
|
155
|
+
Lo as CircularDial,
|
|
156
156
|
mr as CodeBlock,
|
|
157
|
-
|
|
157
|
+
Qe as CollectionLayout,
|
|
158
158
|
Or as ComboBox,
|
|
159
|
-
|
|
159
|
+
Yo as ConnectorOverlay,
|
|
160
160
|
u as Conversation,
|
|
161
161
|
Co as DISMISS_THRESHOLD,
|
|
162
|
-
|
|
162
|
+
uo as DRAG_SLOP,
|
|
163
|
+
Vo as DataCard,
|
|
163
164
|
H as DataTable,
|
|
164
165
|
kr as DatePicker,
|
|
165
|
-
|
|
166
|
-
|
|
166
|
+
Ae as DefinitionDescription,
|
|
167
|
+
Le as DefinitionList,
|
|
167
168
|
Be as DefinitionTerm,
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
je as DenseMetricRibbon,
|
|
170
|
+
qo as DetailDrawer,
|
|
171
|
+
wo as DeviceCard,
|
|
171
172
|
Tr as DocumentScanView,
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
173
|
+
be as Drawer,
|
|
174
|
+
yo as EdgeInsightTerminal,
|
|
175
|
+
Sr as EmptyState,
|
|
176
|
+
co as FLICK_VELOCITY,
|
|
176
177
|
Gr as FileUpload,
|
|
177
|
-
|
|
178
|
-
|
|
178
|
+
ae as FilterPanel,
|
|
179
|
+
yt as FineTuningControls,
|
|
179
180
|
Kr as FormTemplate,
|
|
180
181
|
Y as Gallery,
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
Ro as HardwareCommandButton,
|
|
183
|
+
ee as Header,
|
|
184
|
+
ct as Icon,
|
|
184
185
|
Ur as Input,
|
|
185
186
|
A as KeyInjectionOverlay,
|
|
186
187
|
xr as KpiGrid,
|
|
187
188
|
Er as Label,
|
|
188
189
|
Z as LineChart,
|
|
189
|
-
|
|
190
|
-
|
|
190
|
+
Re as List,
|
|
191
|
+
Ee as ListItem,
|
|
191
192
|
n as Loader,
|
|
192
193
|
w as LoginPage,
|
|
193
194
|
no as MOBILE_BREAKPOINT_PX,
|
|
194
195
|
lo as MOBILE_BREAKPOINT_QUERY,
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
196
|
+
$e as Menu,
|
|
197
|
+
rt as MenuDivider,
|
|
198
|
+
ot as MenuItem,
|
|
199
|
+
g as Message,
|
|
200
|
+
tt as MobileNav,
|
|
201
|
+
ve as Modal,
|
|
201
202
|
zr as MultiSelect,
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
203
|
+
ke as PageContainer,
|
|
204
|
+
Ge as PageHeader,
|
|
205
|
+
pt as Pagination,
|
|
206
|
+
wt as PaletteSwatch,
|
|
206
207
|
rr as PieChart,
|
|
207
208
|
cr as Plan,
|
|
208
209
|
h as PromptInput,
|
|
209
210
|
Wr as Radio,
|
|
210
|
-
|
|
211
|
+
Zo as RammeInspectorTrigger,
|
|
211
212
|
er as ScatterChart,
|
|
212
213
|
Xr as SearchInput,
|
|
213
|
-
|
|
214
|
+
Ke as SectionHeader,
|
|
214
215
|
Jr as SegmentedControl,
|
|
215
216
|
$r as Select,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
217
|
+
jo as SettingsContainer,
|
|
218
|
+
Pe as Sheet,
|
|
219
|
+
hm as ShowroomCanvas,
|
|
220
|
+
lm as ShowroomContainer,
|
|
221
|
+
sm as ShowroomSidebar,
|
|
222
|
+
Fe as Sidebar,
|
|
222
223
|
_ as SignupPage,
|
|
223
224
|
Cr as Skeleton,
|
|
224
225
|
gm as SkuBadge,
|
|
225
|
-
|
|
226
|
+
Mo as Sparkline,
|
|
226
227
|
ar as StatCard,
|
|
227
|
-
|
|
228
|
+
No as StateMatrix,
|
|
228
229
|
nr as StatusBadge,
|
|
229
|
-
|
|
230
|
-
|
|
230
|
+
xe as Statusbar,
|
|
231
|
+
ft as Stepper,
|
|
231
232
|
s as Suggestion,
|
|
232
233
|
to as Switch,
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
B as TAY_DREAMBOAT_THEME,
|
|
235
|
+
Jt as THEME_TOKEN_VARS,
|
|
236
|
+
it as TabPanel,
|
|
236
237
|
N as Table,
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
nt as Tabs,
|
|
239
|
+
im as TelemetryGraph,
|
|
240
|
+
Ho as TelemetryLog,
|
|
240
241
|
oo as Textarea,
|
|
241
|
-
|
|
242
|
-
|
|
242
|
+
Gt as ThemeLab,
|
|
243
|
+
Ot as ThemeLivePreview,
|
|
243
244
|
R as ThemeProvider,
|
|
244
|
-
|
|
245
|
-
|
|
245
|
+
kt as ThemeSettings,
|
|
246
|
+
Rt as ThemeSynthesizer,
|
|
246
247
|
Dr as TippyTooltip,
|
|
247
|
-
|
|
248
|
-
|
|
248
|
+
Ir as Toast,
|
|
249
|
+
Lr as ToastProvider,
|
|
249
250
|
mo as ToggleSwitch,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
251
|
+
me as Toolbar,
|
|
252
|
+
Ye as UserNav,
|
|
253
|
+
_o as WaterPumpControl,
|
|
254
|
+
Zt as applyThemeToDom,
|
|
254
255
|
E as availableThemes,
|
|
255
|
-
|
|
256
|
-
|
|
256
|
+
ht as badgeVariants,
|
|
257
|
+
Ct as buttonVariants,
|
|
257
258
|
It as cn,
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
259
|
+
Lt as formatValue,
|
|
260
|
+
Nt as generateFromProfile,
|
|
261
|
+
Ut as generateFromPrompt,
|
|
262
|
+
Yt as generateRandom,
|
|
263
|
+
$t as generateRandomTheme,
|
|
264
|
+
fm as generateThemeFromPrompt,
|
|
265
|
+
rm as getContrastColor,
|
|
266
|
+
om as hexToRgbTriplet,
|
|
267
|
+
zt as hslToCssString,
|
|
268
|
+
Qt as hslToRgb,
|
|
269
|
+
Wt as hslToRgbString,
|
|
270
|
+
em as isCustomTheme,
|
|
271
|
+
jt as lightToDark,
|
|
272
|
+
tm as loadGoogleFont,
|
|
272
273
|
f as mockChartData,
|
|
273
274
|
x as mockTableData,
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
275
|
+
Xt as paletteToRgbVars,
|
|
276
|
+
mm as randomRgb,
|
|
277
|
+
um as resolvePreview,
|
|
278
|
+
bo as settleTo,
|
|
279
|
+
pm as tokensToVars,
|
|
280
|
+
So as useBodyScrollLock,
|
|
280
281
|
xo as useChartTheme,
|
|
281
282
|
ao as useDataFetch,
|
|
282
283
|
Io as useDialogFocus,
|
|
283
284
|
To as useIsMobile,
|
|
284
285
|
so as useMediaQuery,
|
|
285
|
-
|
|
286
|
+
Do as useSheetGesture,
|
|
286
287
|
M as useTheme,
|
|
287
|
-
|
|
288
|
+
Br as useToast,
|
|
288
289
|
t as wizardManifest
|
|
289
290
|
};
|
|
@@ -23,6 +23,13 @@
|
|
|
23
23
|
* dragging below the smallest detent dismisses, a slow drag snaps to nearest —
|
|
24
24
|
* is checkable without a browser.
|
|
25
25
|
*/
|
|
26
|
+
/**
|
|
27
|
+
* How far a finger must travel before a press on the sheet becomes a drag.
|
|
28
|
+
* Below it the press is a tap and the sheet does nothing, so the link or button
|
|
29
|
+
* under the finger gets its click. Capturing the pointer on press instead
|
|
30
|
+
* retargets that click at the sheet on some browsers.
|
|
31
|
+
*/
|
|
32
|
+
export declare const DRAG_SLOP = 8;
|
|
26
33
|
/** Pixels per millisecond past which a drag counts as a flick rather than a move. */
|
|
27
34
|
export declare const FLICK_VELOCITY = 0.5;
|
|
28
35
|
/**
|
|
@@ -67,6 +74,17 @@ export interface SheetGesture {
|
|
|
67
74
|
dragging: boolean;
|
|
68
75
|
/** True when the sheet is at its tallest detent. */
|
|
69
76
|
expanded: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* The `touch-action` the scrollable body needs. `none` while the sheet is
|
|
79
|
+
* partial, so an upward swipe grows the sheet and nothing else; `pan-y` once
|
|
80
|
+
* it is full, so the content scrolls natively.
|
|
81
|
+
*
|
|
82
|
+
* Without it the browser claims every swipe on the body for a native scroll
|
|
83
|
+
* at the same moment the sheet starts tracking the finger: the sheet grows
|
|
84
|
+
* and the list slides under it, then the browser cancels the pointer and the
|
|
85
|
+
* sheet settles wherever it was (owner's report, 2026-11-01).
|
|
86
|
+
*/
|
|
87
|
+
bodyTouchAction: 'none' | 'pan-y';
|
|
70
88
|
/** Attach to the grabber and header. */
|
|
71
89
|
onPointerDown: (e: React.PointerEvent) => void;
|
|
72
90
|
/**
|
|
@@ -1,70 +1,78 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
1
|
+
import { useState as I, useRef as u, useCallback as T, useEffect as O } from "react";
|
|
2
|
+
const R = 8, _ = 0.5, G = 0.12;
|
|
3
|
+
function k({ current: l, detents: f, velocity: a }) {
|
|
4
4
|
if (!f.length) return null;
|
|
5
|
-
const
|
|
6
|
-
if (Math.abs(a) >=
|
|
5
|
+
const o = [...f].sort((r, t) => r - t), n = o[0], c = o[o.length - 1];
|
|
6
|
+
if (Math.abs(a) >= _) {
|
|
7
7
|
if (a > 0) {
|
|
8
|
-
const
|
|
9
|
-
return
|
|
8
|
+
const t = o.filter((g) => g < l - 0.01);
|
|
9
|
+
return t.length ? t[t.length - 1] : null;
|
|
10
10
|
}
|
|
11
|
-
const r =
|
|
11
|
+
const r = o.filter((t) => t > l + 0.01);
|
|
12
12
|
return r.length ? r[0] : c;
|
|
13
13
|
}
|
|
14
|
-
return l < n -
|
|
15
|
-
(r,
|
|
14
|
+
return l < n - G ? null : o.reduce(
|
|
15
|
+
(r, t) => Math.abs(t - l) < Math.abs(r - l) ? t : r
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function K({
|
|
19
19
|
detents: l,
|
|
20
20
|
initialDetent: f = 0,
|
|
21
21
|
onDismiss: a,
|
|
22
|
-
reducedMotion:
|
|
22
|
+
reducedMotion: o = !1
|
|
23
23
|
}) {
|
|
24
|
-
const n = [...l].sort((
|
|
25
|
-
(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
const n = [...l].sort((e, s) => e - s), [c, r] = I(n[f] ?? n[0]), [t, g] = I(!1), [Y, E] = I(!1), y = u(0), x = u(0), L = u(0), S = u(0), b = u(0), d = u(null), D = u(null), h = u(0), p = T(
|
|
25
|
+
(e, s) => {
|
|
26
|
+
o || e.isPrimary && (s && c >= n[n.length - 1] - 1e-3 || (d.current = s ? e.currentTarget : null, D.current = e.currentTarget, h.current = e.pointerId, y.current = e.clientY, L.current = e.clientY, S.current = e.timeStamp, x.current = c, b.current = 0, E(!0)));
|
|
27
|
+
},
|
|
28
|
+
[c, o, n]
|
|
29
|
+
), C = T((e) => p(e, !1), [p]), A = T((e) => p(e, !0), [p]);
|
|
30
|
+
return O(() => {
|
|
31
|
+
if (!t && !Y) return;
|
|
32
|
+
const e = (i) => {
|
|
33
|
+
var P;
|
|
34
|
+
if (i.pointerId !== h.current) return;
|
|
35
|
+
const m = window.innerHeight || 1, H = i.clientY - y.current;
|
|
36
|
+
if (!t) {
|
|
37
|
+
if (Math.abs(H) < R) return;
|
|
38
|
+
try {
|
|
39
|
+
(P = D.current) == null || P.setPointerCapture(h.current);
|
|
40
|
+
} catch {
|
|
30
41
|
}
|
|
31
|
-
|
|
42
|
+
E(!1), g(!0);
|
|
32
43
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
x > 0 && (E.current = (o.clientY - w.current) / x), w.current = o.clientY, v.current = o.timeStamp;
|
|
41
|
-
let p = S.current - I / Y;
|
|
42
|
-
const m = n[n.length - 1];
|
|
43
|
-
p > m && (p = m + (p - m) * 0.25), r(Math.max(0, Math.min(p, m + 0.05))), d.current && (d.current.scrollTop = 0);
|
|
44
|
-
}, i = () => {
|
|
44
|
+
const M = i.timeStamp - S.current;
|
|
45
|
+
M > 0 && (b.current = (i.clientY - L.current) / M), L.current = i.clientY, S.current = i.timeStamp;
|
|
46
|
+
let w = x.current - H / m;
|
|
47
|
+
const v = n[n.length - 1];
|
|
48
|
+
w > v && (w = v + (w - v) * 0.25), r(Math.max(0, Math.min(w, v + 0.05))), d.current && (d.current.scrollTop = 0);
|
|
49
|
+
}, s = (i) => {
|
|
50
|
+
if (i.pointerId !== h.current || (E(!1), !t)) return;
|
|
45
51
|
g(!1);
|
|
46
|
-
const
|
|
52
|
+
const m = k({
|
|
47
53
|
current: c,
|
|
48
54
|
detents: n,
|
|
49
|
-
velocity:
|
|
55
|
+
velocity: b.current
|
|
50
56
|
});
|
|
51
|
-
|
|
57
|
+
m === null ? a() : r(m), d.current = null;
|
|
52
58
|
};
|
|
53
|
-
return window.addEventListener("pointermove",
|
|
54
|
-
window.removeEventListener("pointermove",
|
|
59
|
+
return window.addEventListener("pointermove", e), window.addEventListener("pointerup", s), window.addEventListener("pointercancel", s), () => {
|
|
60
|
+
window.removeEventListener("pointermove", e), window.removeEventListener("pointerup", s), window.removeEventListener("pointercancel", s);
|
|
55
61
|
};
|
|
56
|
-
}, [
|
|
62
|
+
}, [Y, t, c, a, n]), {
|
|
57
63
|
height: c,
|
|
58
|
-
dragging:
|
|
64
|
+
dragging: t,
|
|
59
65
|
expanded: c >= n[n.length - 1] - 1e-3,
|
|
60
|
-
|
|
61
|
-
|
|
66
|
+
bodyTouchAction: !o && c < n[n.length - 1] - 1e-3 ? "none" : "pan-y",
|
|
67
|
+
onPointerDown: C,
|
|
68
|
+
onBodyPointerDown: A,
|
|
62
69
|
setHeight: r
|
|
63
70
|
};
|
|
64
71
|
}
|
|
65
72
|
export {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
G as DISMISS_THRESHOLD,
|
|
74
|
+
R as DRAG_SLOP,
|
|
75
|
+
_ as FLICK_VELOCITY,
|
|
76
|
+
k as settleTo,
|
|
77
|
+
K as useSheetGesture
|
|
70
78
|
};
|