@columenlabs/lumen-ui 0.1.133 → 0.1.134

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.
Files changed (2) hide show
  1. package/dist/settings.js +9 -1
  2. package/package.json +2 -2
package/dist/settings.js CHANGED
@@ -150,6 +150,14 @@ export function LumenSettings({ open, section, onOpen, onClose, appLabel, profil
150
150
  .map((el) => el.dataset.settingsSection ?? '');
151
151
  setFound((f) => (f.join() === ids.join() ? f : ids));
152
152
  });
153
+ // A long nav scrolls; keep the open section's row in view (Settings can open at one far down).
154
+ const navList = useRef(null);
155
+ useEffect(() => {
156
+ if (!open)
157
+ return;
158
+ const id = requestAnimationFrame(() => navList.current?.querySelector('[data-active=true]')?.scrollIntoView({ block: 'nearest' }));
159
+ return () => cancelAnimationFrame(id);
160
+ }, [open]);
153
161
  const shown = (s) => !q || found.includes(s.id);
154
162
  const go = (id) => {
155
163
  setQuery('');
@@ -177,7 +185,7 @@ export function LumenSettings({ open, section, onOpen, onClose, appLabel, profil
177
185
  e.preventDefault();
178
186
  setQuery('');
179
187
  }
180
- }, className: "flex h-[min(720px,calc(100svh-2rem))] flex-col gap-0 overflow-hidden p-0 sm:max-w-4xl md:flex-row", children: [_jsx(DialogTitle, { className: "sr-only", children: "Settings" }), _jsx(DialogDescription, { className: "sr-only", children: "Your preferences and this desk's settings." }), _jsxs("nav", { "aria-label": "Settings sections", className: "hidden w-56 shrink-0 flex-col border-r bg-sidebar py-2 md:flex", children: [_jsx("div", { className: "px-2 pt-1 pb-1", children: search }), navGroups.map((g) => (_jsxs(SidebarGroup, { className: "py-1", children: [_jsx(SidebarGroupLabel, { children: g.label }), _jsx(SidebarGroupContent, { children: _jsx(SidebarMenu, { children: g.items.map((s) => (_jsx(SidebarMenuItem, { children: _jsxs(SidebarMenuButton, { isActive: !q && s.id === current.id, className: s.sub ? 'pl-7' : undefined, onClick: () => go(s.id), children: [_jsx(s.icon, {}), _jsx("span", { children: s.title })] }) }, s.id))) }) })] }, g.label)))] }), _jsxs("div", { className: "flex flex-col gap-2 border-b p-3 pr-12 md:hidden", children: [search, !q && (_jsx(LumenSelector, { label: "Settings section", className: "w-full", groups: navGroups.map((g) => ({
188
+ }, className: "flex h-[min(720px,calc(100svh-2rem))] flex-col gap-0 overflow-hidden p-0 sm:max-w-4xl md:flex-row", children: [_jsx(DialogTitle, { className: "sr-only", children: "Settings" }), _jsx(DialogDescription, { className: "sr-only", children: "Your preferences and this desk's settings." }), _jsxs("nav", { "aria-label": "Settings sections", className: "hidden min-h-0 w-56 shrink-0 flex-col border-r bg-sidebar pt-2 md:flex", children: [_jsx("div", { className: "shrink-0 px-2 pt-1 pb-1", children: search }), _jsx("div", { ref: navList, "data-slot": "settings-nav-list", className: "flex min-h-0 flex-1 flex-col overflow-y-auto overscroll-contain pb-2 *:shrink-0", children: navGroups.map((g) => (_jsxs(SidebarGroup, { className: "py-1", children: [_jsx(SidebarGroupLabel, { children: g.label }), _jsx(SidebarGroupContent, { children: _jsx(SidebarMenu, { children: g.items.map((s) => (_jsx(SidebarMenuItem, { children: _jsxs(SidebarMenuButton, { isActive: !q && s.id === current.id, className: s.sub ? 'pl-7' : undefined, onClick: () => go(s.id), children: [_jsx(s.icon, {}), _jsx("span", { children: s.title })] }) }, s.id))) }) })] }, g.label))) })] }), _jsxs("div", { className: "flex flex-col gap-2 border-b p-3 pr-12 md:hidden", children: [search, !q && (_jsx(LumenSelector, { label: "Settings section", className: "w-full", groups: navGroups.map((g) => ({
181
189
  label: g.label,
182
190
  options: g.items.map((s) => ({
183
191
  value: s.id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@columenlabs/lumen-ui",
3
- "version": "0.1.133",
3
+ "version": "0.1.134",
4
4
  "description": "Lumen: shared React components (frame, views, widgets, charts, drawers).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -49,7 +49,7 @@
49
49
  "@codemirror/lang-javascript": "6.2.5",
50
50
  "@codemirror/lang-json": "6.0.2",
51
51
  "@codemirror/lang-sql": "6.10.0",
52
- "@columenlabs/lumen-ui-types": "0.1.133",
52
+ "@columenlabs/lumen-ui-types": "0.1.134",
53
53
  "@dnd-kit/core": "6.3.1",
54
54
  "@dnd-kit/sortable": "10.0.0",
55
55
  "@dnd-kit/utilities": "3.2.2",