@object-ui/layout 3.3.0 → 3.3.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/index.js CHANGED
@@ -1,17 +1,17 @@
1
1
  import { ComponentRegistry as e } from "@object-ui/core";
2
2
  import t, { createContext as n, memo as r, useCallback as i, useContext as a, useEffect as o, useLayoutEffect as s, useMemo as c, useReducer as l, useRef as u, useState as d } from "react";
3
- import { Badge as f, Collapsible as p, CollapsibleContent as m, CollapsibleTrigger as h, Input as g, Separator as _, Sidebar as v, SidebarContent as y, SidebarFooter as b, SidebarGroup as x, SidebarGroupContent as S, SidebarGroupLabel as C, SidebarHeader as w, SidebarInput as T, SidebarInset as E, SidebarMenu as D, SidebarMenuAction as ee, SidebarMenuButton as O, SidebarMenuItem as k, SidebarMenuSub as A, SidebarMenuSubButton as te, SidebarMenuSubItem as ne, SidebarProvider as j, SidebarTrigger as re, cn as M } from "@object-ui/components";
4
- import { Link as N, NavLink as ie, useLocation as P } from "react-router-dom";
3
+ import { Badge as f, Collapsible as p, CollapsibleContent as m, CollapsibleTrigger as h, Input as g, Separator as _, Sidebar as v, SidebarContent as y, SidebarFooter as b, SidebarGroup as x, SidebarGroupContent as S, SidebarGroupLabel as C, SidebarHeader as w, SidebarInput as T, SidebarInset as E, SidebarMenu as D, SidebarMenuAction as ee, SidebarMenuButton as O, SidebarMenuItem as k, SidebarMenuSub as A, SidebarMenuSubButton as te, SidebarMenuSubItem as ne, SidebarProvider as j, cn as M } from "@object-ui/components";
4
+ import { Link as N, NavLink as P, useLocation as re } from "react-router-dom";
5
5
  import * as F from "lucide-react";
6
- import { ChevronRight as ae, Search as oe } from "lucide-react";
7
- import { createPortal as I, unstable_batchedUpdates as se } from "react-dom";
8
- import { menuItemToNavigationItem as ce } from "@object-ui/types";
9
- import { SchemaRenderer as le } from "@object-ui/react";
6
+ import { ChevronRight as ie, Search as ae } from "lucide-react";
7
+ import { createPortal as I, unstable_batchedUpdates as oe } from "react-dom";
8
+ import { menuItemToNavigationItem as L } from "@object-ui/types";
9
+ import { SchemaRenderer as se } from "@object-ui/react";
10
10
  //#region \0rolldown/runtime.js
11
- var L = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), R = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
11
+ var R = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), ce = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
12
12
  if (typeof require < "u") return require.apply(this, arguments);
13
13
  throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
14
- }), ue = /* @__PURE__ */ L(((e) => {
14
+ }), z = /* @__PURE__ */ R(((e) => {
15
15
  var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
16
16
  function r(e, n, r) {
17
17
  var i = null;
@@ -26,7 +26,7 @@ var L = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), R
26
26
  };
27
27
  }
28
28
  e.Fragment = n, e.jsx = r, e.jsxs = r;
29
- })), z = /* @__PURE__ */ L(((e) => {
29
+ })), le = /* @__PURE__ */ R(((e) => {
30
30
  process.env.NODE_ENV !== "production" && (function() {
31
31
  function t(e) {
32
32
  if (e == null) return null;
@@ -157,7 +157,7 @@ var L = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), R
157
157
  var m = Object.keys(n).filter(function(e) {
158
158
  return e !== "key";
159
159
  });
160
- o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", N[p + o] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", o, p, m, p), N[p + o] = !0);
160
+ o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", P[p + o] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", o, p, m, p), P[p + o] = !0);
161
161
  }
162
162
  if (p = null, i !== void 0 && (r(i), p = "" + i), s(n) && (r(n.key), p = "" + n.key), "key" in n) for (var h in i = {}, n) h !== "key" && (i[h] = n[h]);
163
163
  else i = n;
@@ -169,41 +169,41 @@ var L = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), R
169
169
  function p(e) {
170
170
  return typeof e == "object" && !!e && e.$$typeof === h;
171
171
  }
172
- var m = R("react"), h = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), _ = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), b = Symbol.for("react.consumer"), x = Symbol.for("react.context"), S = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), D = Symbol.for("react.activity"), ee = Symbol.for("react.client.reference"), O = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, k = Object.prototype.hasOwnProperty, A = Array.isArray, te = console.createTask ? console.createTask : function() {
172
+ var m = ce("react"), h = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), _ = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), b = Symbol.for("react.consumer"), x = Symbol.for("react.context"), S = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), D = Symbol.for("react.activity"), ee = Symbol.for("react.client.reference"), O = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, k = Object.prototype.hasOwnProperty, A = Array.isArray, te = console.createTask ? console.createTask : function() {
173
173
  return null;
174
174
  };
175
175
  m = { react_stack_bottom_frame: function(e) {
176
176
  return e();
177
177
  } };
178
- var ne, j = {}, re = m.react_stack_bottom_frame.bind(m, o)(), M = te(i(o)), N = {};
178
+ var ne, j = {}, M = m.react_stack_bottom_frame.bind(m, o)(), N = te(i(o)), P = {};
179
179
  e.Fragment = _, e.jsx = function(e, t, n) {
180
180
  var r = 1e4 > O.recentlyCreatedOwnerStacks++;
181
- return d(e, t, n, !1, r ? Error("react-stack-top-frame") : re, r ? te(i(e)) : M);
181
+ return d(e, t, n, !1, r ? Error("react-stack-top-frame") : M, r ? te(i(e)) : N);
182
182
  }, e.jsxs = function(e, t, n) {
183
183
  var r = 1e4 > O.recentlyCreatedOwnerStacks++;
184
- return d(e, t, n, !0, r ? Error("react-stack-top-frame") : re, r ? te(i(e)) : M);
184
+ return d(e, t, n, !0, r ? Error("react-stack-top-frame") : M, r ? te(i(e)) : N);
185
185
  };
186
186
  })();
187
- })), B = (/* @__PURE__ */ L(((e, t) => {
188
- process.env.NODE_ENV === "production" ? t.exports = ue() : t.exports = z();
187
+ })), B = (/* @__PURE__ */ R(((e, t) => {
188
+ process.env.NODE_ENV === "production" ? t.exports = z() : t.exports = le();
189
189
  })))();
190
- function V({ title: e, description: t, action: n, className: r, children: i, ...a }) {
190
+ function ue({ title: e, description: t, action: n, className: r, children: i, ...a }) {
191
191
  return /* @__PURE__ */ (0, B.jsx)("div", {
192
192
  className: M("flex flex-col gap-4 pb-4 md:pb-8", r),
193
193
  ...a,
194
194
  children: /* @__PURE__ */ (0, B.jsxs)("div", {
195
- className: "flex items-center justify-between gap-4",
195
+ className: "flex flex-wrap items-end gap-x-4 gap-y-2",
196
196
  children: [/* @__PURE__ */ (0, B.jsxs)("div", {
197
- className: "flex flex-col gap-1",
197
+ className: "flex flex-col gap-1 min-w-0",
198
198
  children: [/* @__PURE__ */ (0, B.jsx)("h1", {
199
- className: "text-2xl font-bold tracking-tight md:text-3xl",
199
+ className: "text-2xl font-bold tracking-tight md:text-3xl truncate",
200
200
  children: e
201
201
  }), t && /* @__PURE__ */ (0, B.jsx)("p", {
202
202
  className: "text-sm text-muted-foreground",
203
203
  children: t
204
204
  })]
205
205
  }), (n || i) && /* @__PURE__ */ (0, B.jsxs)("div", {
206
- className: "flex items-center gap-2",
206
+ className: "flex items-center gap-2 ml-auto sm:ml-0",
207
207
  children: [n, i]
208
208
  })]
209
209
  })
@@ -211,7 +211,7 @@ function V({ title: e, description: t, action: n, className: r, children: i, ...
211
211
  }
212
212
  //#endregion
213
213
  //#region src/AppShell.tsx
214
- function de(e) {
214
+ function V(e) {
215
215
  let t = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
216
216
  if (!t) return null;
217
217
  let n = parseInt(t[1], 16) / 255, r = parseInt(t[2], 16) / 255, i = parseInt(t[3], 16) / 255, a = Math.max(n, r, i), o = Math.min(n, r, i), s = 0, c = 0, l = (a + o) / 2;
@@ -231,23 +231,32 @@ function de(e) {
231
231
  }
232
232
  return `${Math.round(s * 360)} ${Math.round(c * 100)}% ${Math.round(l * 100)}%`;
233
233
  }
234
+ function de(e) {
235
+ let t = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
236
+ if (!t) return "0 0% 100%";
237
+ let n = (e) => {
238
+ let t = e / 255;
239
+ return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
240
+ }, r = n(parseInt(t[1], 16)), i = n(parseInt(t[2], 16)), a = n(parseInt(t[3], 16));
241
+ return .2126 * r + .7152 * i + .0722 * a > .6 ? "222 47% 11%" : "0 0% 100%";
242
+ }
234
243
  function fe(e, t) {
235
244
  o(() => {
236
245
  let n = document.documentElement;
237
246
  if (e?.primaryColor) {
238
- let t = de(e.primaryColor);
239
- t && (n.style.setProperty("--brand-primary", e.primaryColor), n.style.setProperty("--brand-primary-hsl", t));
240
- } else n.style.removeProperty("--brand-primary"), n.style.removeProperty("--brand-primary-hsl");
247
+ let t = V(e.primaryColor);
248
+ t && (n.style.setProperty("--brand-primary", e.primaryColor), n.style.setProperty("--brand-primary-hsl", t), n.style.setProperty("--primary", t), n.style.setProperty("--primary-foreground", de(e.primaryColor)), n.style.setProperty("--ring", t), n.style.setProperty("--sidebar-primary", t), n.style.setProperty("--sidebar-ring", t));
249
+ } else n.style.removeProperty("--brand-primary"), n.style.removeProperty("--brand-primary-hsl"), n.style.removeProperty("--primary"), n.style.removeProperty("--primary-foreground"), n.style.removeProperty("--ring"), n.style.removeProperty("--sidebar-primary"), n.style.removeProperty("--sidebar-ring");
241
250
  if (e?.accentColor) {
242
- let t = de(e.accentColor);
243
- t && (n.style.setProperty("--brand-accent", e.accentColor), n.style.setProperty("--brand-accent-hsl", t));
244
- } else n.style.removeProperty("--brand-accent"), n.style.removeProperty("--brand-accent-hsl");
251
+ let t = V(e.accentColor);
252
+ t && (n.style.setProperty("--brand-accent", e.accentColor), n.style.setProperty("--brand-accent-hsl", t), n.style.setProperty("--accent", t), n.style.setProperty("--accent-foreground", de(e.accentColor)));
253
+ } else n.style.removeProperty("--brand-accent"), n.style.removeProperty("--brand-accent-hsl"), n.style.removeProperty("--accent"), n.style.removeProperty("--accent-foreground");
245
254
  if (e?.favicon) {
246
255
  let t = document.querySelector("#favicon") || document.querySelector("link[rel=\"icon\"]");
247
256
  t && (t.href = e.favicon);
248
257
  }
249
258
  return t && (document.title = t), () => {
250
- n.style.removeProperty("--brand-primary"), n.style.removeProperty("--brand-primary-hsl"), n.style.removeProperty("--brand-accent"), n.style.removeProperty("--brand-accent-hsl");
259
+ n.style.removeProperty("--brand-primary"), n.style.removeProperty("--brand-primary-hsl"), n.style.removeProperty("--brand-accent"), n.style.removeProperty("--brand-accent-hsl"), n.style.removeProperty("--primary"), n.style.removeProperty("--primary-foreground"), n.style.removeProperty("--ring"), n.style.removeProperty("--sidebar-primary"), n.style.removeProperty("--sidebar-ring"), n.style.removeProperty("--accent"), n.style.removeProperty("--accent-foreground");
251
260
  };
252
261
  }, [
253
262
  e?.primaryColor,
@@ -259,17 +268,20 @@ function fe(e, t) {
259
268
  function pe({ sidebar: e, navbar: t, children: n, className: r, defaultOpen: i = !0, branding: a }) {
260
269
  return fe(a, a?.title), /* @__PURE__ */ (0, B.jsxs)(j, {
261
270
  defaultOpen: i,
262
- children: [e, /* @__PURE__ */ (0, B.jsxs)(E, { children: [/* @__PURE__ */ (0, B.jsxs)("header", {
263
- className: "flex h-14 sm:h-16 shrink-0 items-center gap-2 border-b bg-background px-2 sm:px-4",
264
- children: [
265
- /* @__PURE__ */ (0, B.jsx)(re, { className: "-ml-1 hidden md:inline-flex" }),
266
- /* @__PURE__ */ (0, B.jsx)("div", { className: "w-px h-4 bg-border mx-1 sm:mx-2 hidden md:block" }),
267
- t
268
- ]
269
- }), /* @__PURE__ */ (0, B.jsx)("main", {
270
- className: M("flex-1 min-w-0 overflow-auto p-3 sm:p-4 md:p-6", r),
271
- children: n
272
- })] })]
271
+ className: "!flex-col",
272
+ children: [/* @__PURE__ */ (0, B.jsx)("header", {
273
+ className: "sticky top-0 z-30 flex h-14 w-full shrink-0 items-center gap-2 border-b bg-background px-2 sm:px-4",
274
+ children: t
275
+ }), /* @__PURE__ */ (0, B.jsxs)("div", {
276
+ className: "flex flex-1 min-h-0 w-full",
277
+ children: [e, /* @__PURE__ */ (0, B.jsx)(E, {
278
+ className: "min-w-0",
279
+ children: /* @__PURE__ */ (0, B.jsx)("main", {
280
+ className: M("flex-1 min-w-0 overflow-auto p-3 sm:p-4 md:p-6", r),
281
+ children: n
282
+ })
283
+ })]
284
+ })]
273
285
  });
274
286
  }
275
287
  //#endregion
@@ -1883,24 +1895,24 @@ var Kn = /* @__PURE__ */ r(function(e) {
1883
1895
  id: w,
1884
1896
  data: ee?.data ?? Mn,
1885
1897
  rect: O
1886
- }, [w, ee]), A = u(null), [te, ne] = d(null), [j, re] = d(null), M = Te(g, Object.values(g)), N = Ae("DndDescribedBy", n), ie = c(() => D.getEnabled(), [D]), P = Hn(m), { droppableRects: F, measureDroppableContainers: ae, measuringScheduled: oe } = fn(ie, {
1898
+ }, [w, ee]), A = u(null), [te, ne] = d(null), [j, M] = d(null), N = Te(g, Object.values(g)), P = Ae("DndDescribedBy", n), re = c(() => D.getEnabled(), [D]), F = Hn(m), { droppableRects: ie, measureDroppableContainers: ae, measuringScheduled: I } = fn(re, {
1887
1899
  dragging: C,
1888
1900
  dependencies: [E.x, E.y],
1889
- config: P.droppable
1890
- }), I = sn(T, w), ce = c(() => j ? Le(j) : null, [j]), le = Pe(), L = mn(I, P.draggable.measure);
1901
+ config: F.droppable
1902
+ }), L = sn(T, w), se = c(() => j ? Le(j) : null, [j]), R = Pe(), ce = mn(L, F.draggable.measure);
1891
1903
  Un({
1892
1904
  activeNode: w == null ? null : T.get(w),
1893
- config: le.layoutShiftCompensation,
1894
- initialRect: L,
1895
- measure: P.draggable.measure
1905
+ config: R.layoutShiftCompensation,
1906
+ initialRect: ce,
1907
+ measure: F.draggable.measure
1896
1908
  });
1897
- let R = vn(I, P.draggable.measure, L), ue = vn(I ? I.parentElement : null), z = u({
1909
+ let z = vn(L, F.draggable.measure, ce), le = vn(L ? L.parentElement : null), B = u({
1898
1910
  activatorEvent: null,
1899
1911
  active: null,
1900
- activeNode: I,
1912
+ activeNode: L,
1901
1913
  collisionRect: null,
1902
1914
  collisions: null,
1903
- droppableRects: F,
1915
+ droppableRects: ie,
1904
1916
  draggableNodes: T,
1905
1917
  draggingNode: null,
1906
1918
  draggingNodeRect: null,
@@ -1908,7 +1920,7 @@ var Kn = /* @__PURE__ */ r(function(e) {
1908
1920
  over: null,
1909
1921
  scrollableAncestors: [],
1910
1922
  scrollAdjustedTranslate: null
1911
- }), B = D.getNodeFor(z.current.over?.id), V = An({ measure: P.dragOverlay.measure }), de = V.nodeRef.current ?? I, fe = C ? V.rect ?? R : null, pe = !!(V.nodeRef.current && V.rect), me = yn(pe ? null : R), he = En(de ? U(de) : null), H = xn(C ? B ?? I : null), ge = On(H), _e = Vn(h, {
1923
+ }), ue = D.getNodeFor(B.current.over?.id), V = An({ measure: F.dragOverlay.measure }), de = V.nodeRef.current ?? L, fe = C ? V.rect ?? z : null, pe = !!(V.nodeRef.current && V.rect), me = yn(pe ? null : z), he = En(de ? U(de) : null), H = xn(C ? ue ?? L : null), ge = On(H), _e = Vn(h, {
1912
1924
  transform: {
1913
1925
  x: E.x - me.x,
1914
1926
  y: E.y - me.y,
@@ -1917,21 +1929,21 @@ var Kn = /* @__PURE__ */ r(function(e) {
1917
1929
  },
1918
1930
  activatorEvent: j,
1919
1931
  active: k,
1920
- activeNodeRect: R,
1921
- containerNodeRect: ue,
1932
+ activeNodeRect: z,
1933
+ containerNodeRect: le,
1922
1934
  draggingNodeRect: fe,
1923
- over: z.current.over,
1935
+ over: B.current.over,
1924
1936
  overlayNodeRect: V.rect,
1925
1937
  scrollableAncestors: H,
1926
1938
  scrollableAncestorRects: ge,
1927
1939
  windowRect: he
1928
- }), ve = ce ? Me(ce, E) : null, ye = Sn(H), be = Cn(ye), xe = Cn(ye, [R]), W = Me(_e, be), G = fe ? dt(fe, _e) : null, Se = k && G ? p({
1940
+ }), ve = se ? Me(se, E) : null, ye = Sn(H), be = Cn(ye), xe = Cn(ye, [z]), W = Me(_e, be), G = fe ? dt(fe, _e) : null, Se = k && G ? p({
1929
1941
  active: k,
1930
1942
  collisionRect: G,
1931
- droppableRects: F,
1932
- droppableContainers: ie,
1943
+ droppableRects: ie,
1944
+ droppableContainers: re,
1933
1945
  pointerCoordinates: ve
1934
- }) : null, Ce = rt(Se, "id"), [q, we] = d(null), Ee = ct(pe ? _e : Me(_e, xe), q?.rect ?? null, R), De = u(null), Oe = i((e, t) => {
1946
+ }) : null, Ce = rt(Se, "id"), [q, we] = d(null), Ee = ct(pe ? _e : Me(_e, xe), q?.rect ?? null, z), De = u(null), Oe = i((e, t) => {
1935
1947
  let { sensor: n, options: r } = t;
1936
1948
  if (A.current == null) return;
1937
1949
  let i = T.get(A.current);
@@ -1942,10 +1954,10 @@ var Kn = /* @__PURE__ */ r(function(e) {
1942
1954
  activeNode: i,
1943
1955
  event: a,
1944
1956
  options: r,
1945
- context: z,
1957
+ context: B,
1946
1958
  onAbort(e) {
1947
1959
  if (!T.get(e)) return;
1948
- let { onDragAbort: t } = M.current, n = { id: e };
1960
+ let { onDragAbort: t } = N.current, n = { id: e };
1949
1961
  t?.(n), y({
1950
1962
  type: "onDragAbort",
1951
1963
  event: n
@@ -1953,7 +1965,7 @@ var Kn = /* @__PURE__ */ r(function(e) {
1953
1965
  },
1954
1966
  onPending(e, t, n, r) {
1955
1967
  if (!T.get(e)) return;
1956
- let { onDragPending: i } = M.current, a = {
1968
+ let { onDragPending: i } = N.current, a = {
1957
1969
  id: e,
1958
1970
  constraint: t,
1959
1971
  initialCoordinates: n,
@@ -1969,7 +1981,7 @@ var Kn = /* @__PURE__ */ r(function(e) {
1969
1981
  if (t == null) return;
1970
1982
  let n = T.get(t);
1971
1983
  if (!n) return;
1972
- let { onDragStart: r } = M.current, i = {
1984
+ let { onDragStart: r } = N.current, i = {
1973
1985
  activatorEvent: a,
1974
1986
  active: {
1975
1987
  id: t,
@@ -1977,7 +1989,7 @@ var Kn = /* @__PURE__ */ r(function(e) {
1977
1989
  rect: O
1978
1990
  }
1979
1991
  };
1980
- se(() => {
1992
+ oe(() => {
1981
1993
  r?.(i), S(Gn.Initializing), v({
1982
1994
  type: J.DragStart,
1983
1995
  initialCoordinates: e,
@@ -1985,7 +1997,7 @@ var Kn = /* @__PURE__ */ r(function(e) {
1985
1997
  }), y({
1986
1998
  type: "onDragStart",
1987
1999
  event: i
1988
- }), ne(De.current), re(a);
2000
+ }), ne(De.current), M(a);
1989
2001
  });
1990
2002
  },
1991
2003
  onMove(e) {
@@ -1999,9 +2011,9 @@ var Kn = /* @__PURE__ */ r(function(e) {
1999
2011
  });
2000
2012
  function o(e) {
2001
2013
  return async function() {
2002
- let { active: t, collisions: n, over: r, scrollAdjustedTranslate: i } = z.current, o = null;
2014
+ let { active: t, collisions: n, over: r, scrollAdjustedTranslate: i } = B.current, o = null;
2003
2015
  if (t && i) {
2004
- let { cancelDrop: s } = M.current;
2016
+ let { cancelDrop: s } = N.current;
2005
2017
  o = {
2006
2018
  activatorEvent: a,
2007
2019
  active: t,
@@ -2010,11 +2022,11 @@ var Kn = /* @__PURE__ */ r(function(e) {
2010
2022
  over: r
2011
2023
  }, e === J.DragEnd && typeof s == "function" && await Promise.resolve(s(o)) && (e = J.DragCancel);
2012
2024
  }
2013
- A.current = null, se(() => {
2014
- v({ type: e }), S(Gn.Uninitialized), we(null), ne(null), re(null), De.current = null;
2025
+ A.current = null, oe(() => {
2026
+ v({ type: e }), S(Gn.Uninitialized), we(null), ne(null), M(null), De.current = null;
2015
2027
  let t = e === J.DragEnd ? "onDragEnd" : "onDragCancel";
2016
2028
  if (o) {
2017
- let e = M.current[t];
2029
+ let e = N.current[t];
2018
2030
  e?.(o), y({
2019
2031
  type: t,
2020
2032
  event: o
@@ -2030,9 +2042,9 @@ var Kn = /* @__PURE__ */ r(function(e) {
2030
2042
  e(n, t.options, o) === !0 && (i.dndKit = { capturedBy: t.sensor }, A.current = r, Oe(n, t));
2031
2043
  }, [T, Oe]));
2032
2044
  wn(f), K(() => {
2033
- R && x === Gn.Initializing && S(Gn.Initialized);
2034
- }, [R, x]), o(() => {
2035
- let { onDragMove: e } = M.current, { active: t, activatorEvent: n, collisions: r, over: i } = z.current;
2045
+ z && x === Gn.Initializing && S(Gn.Initialized);
2046
+ }, [z, x]), o(() => {
2047
+ let { onDragMove: e } = N.current, { active: t, activatorEvent: n, collisions: r, over: i } = B.current;
2036
2048
  if (!t || !n) return;
2037
2049
  let a = {
2038
2050
  active: t,
@@ -2044,16 +2056,16 @@ var Kn = /* @__PURE__ */ r(function(e) {
2044
2056
  },
2045
2057
  over: i
2046
2058
  };
2047
- se(() => {
2059
+ oe(() => {
2048
2060
  e?.(a), y({
2049
2061
  type: "onDragMove",
2050
2062
  event: a
2051
2063
  });
2052
2064
  });
2053
2065
  }, [W.x, W.y]), o(() => {
2054
- let { active: e, activatorEvent: t, collisions: n, droppableContainers: r, scrollAdjustedTranslate: i } = z.current;
2066
+ let { active: e, activatorEvent: t, collisions: n, droppableContainers: r, scrollAdjustedTranslate: i } = B.current;
2055
2067
  if (!e || A.current == null || !t || !i) return;
2056
- let { onDragOver: a } = M.current, o = r.get(Ce), s = o && o.rect.current ? {
2068
+ let { onDragOver: a } = N.current, o = r.get(Ce), s = o && o.rect.current ? {
2057
2069
  id: o.id,
2058
2070
  rect: o.rect.current,
2059
2071
  data: o.data,
@@ -2068,20 +2080,20 @@ var Kn = /* @__PURE__ */ r(function(e) {
2068
2080
  },
2069
2081
  over: s
2070
2082
  };
2071
- se(() => {
2083
+ oe(() => {
2072
2084
  we(s), a?.(c), y({
2073
2085
  type: "onDragOver",
2074
2086
  event: c
2075
2087
  });
2076
2088
  });
2077
2089
  }, [Ce]), K(() => {
2078
- z.current = {
2090
+ B.current = {
2079
2091
  activatorEvent: j,
2080
2092
  active: k,
2081
- activeNode: I,
2093
+ activeNode: L,
2082
2094
  collisionRect: G,
2083
2095
  collisions: Se,
2084
- droppableRects: F,
2096
+ droppableRects: ie,
2085
2097
  draggableNodes: T,
2086
2098
  draggingNode: de,
2087
2099
  draggingNodeRect: fe,
@@ -2095,19 +2107,19 @@ var Kn = /* @__PURE__ */ r(function(e) {
2095
2107
  };
2096
2108
  }, [
2097
2109
  k,
2098
- I,
2110
+ L,
2099
2111
  Se,
2100
2112
  G,
2101
2113
  T,
2102
2114
  de,
2103
2115
  fe,
2104
- F,
2116
+ ie,
2105
2117
  D,
2106
2118
  q,
2107
2119
  H,
2108
2120
  W
2109
2121
  ]), rn({
2110
- ...le,
2122
+ ...R,
2111
2123
  delta: E,
2112
2124
  draggingRect: G,
2113
2125
  pointerCoordinates: ve,
@@ -2116,46 +2128,46 @@ var Kn = /* @__PURE__ */ r(function(e) {
2116
2128
  });
2117
2129
  let je = c(() => ({
2118
2130
  active: k,
2119
- activeNode: I,
2120
- activeNodeRect: R,
2131
+ activeNode: L,
2132
+ activeNodeRect: z,
2121
2133
  activatorEvent: j,
2122
2134
  collisions: Se,
2123
- containerNodeRect: ue,
2135
+ containerNodeRect: le,
2124
2136
  dragOverlay: V,
2125
2137
  draggableNodes: T,
2126
2138
  droppableContainers: D,
2127
- droppableRects: F,
2139
+ droppableRects: ie,
2128
2140
  over: q,
2129
2141
  measureDroppableContainers: ae,
2130
2142
  scrollableAncestors: H,
2131
2143
  scrollableAncestorRects: ge,
2132
- measuringConfiguration: P,
2133
- measuringScheduled: oe,
2144
+ measuringConfiguration: F,
2145
+ measuringScheduled: I,
2134
2146
  windowRect: he
2135
2147
  }), [
2136
2148
  k,
2137
- I,
2138
- R,
2149
+ L,
2150
+ z,
2139
2151
  j,
2140
2152
  Se,
2141
- ue,
2153
+ le,
2142
2154
  V,
2143
2155
  T,
2144
2156
  D,
2145
- F,
2157
+ ie,
2146
2158
  q,
2147
2159
  ae,
2148
2160
  H,
2149
2161
  ge,
2150
- P,
2151
- oe,
2162
+ F,
2163
+ I,
2152
2164
  he
2153
2165
  ]), Ne = c(() => ({
2154
2166
  activatorEvent: j,
2155
2167
  activators: ke,
2156
2168
  active: k,
2157
- activeNodeRect: R,
2158
- ariaDescribedById: { draggable: N },
2169
+ activeNodeRect: z,
2170
+ ariaDescribedById: { draggable: P },
2159
2171
  dispatch: v,
2160
2172
  draggableNodes: T,
2161
2173
  over: q,
@@ -2164,16 +2176,16 @@ var Kn = /* @__PURE__ */ r(function(e) {
2164
2176
  j,
2165
2177
  ke,
2166
2178
  k,
2167
- R,
2179
+ z,
2168
2180
  v,
2169
- N,
2181
+ P,
2170
2182
  T,
2171
2183
  q,
2172
2184
  ae
2173
2185
  ]);
2174
2186
  return t.createElement(Ge.Provider, { value: b }, t.createElement(In.Provider, { value: Ne }, t.createElement(Ln.Provider, { value: je }, t.createElement(Wn.Provider, { value: Ee }, s)), t.createElement(Bn, { disabled: r?.restoreFocus === !1 })), t.createElement(Xe, {
2175
2187
  ...r,
2176
- hiddenTextDescribedById: N
2188
+ hiddenTextDescribedById: P
2177
2189
  }));
2178
2190
  function Pe() {
2179
2191
  let e = te?.autoScrollEnabled === !1, t = typeof a == "object" ? a.enabled === !1 : a === !1, n = C && !e && !t;
@@ -2459,7 +2471,7 @@ function br(e) {
2459
2471
  updateMeasurementsFor: E,
2460
2472
  ...f
2461
2473
  }
2462
- }), { active: A, activatorEvent: te, activeNodeRect: ne, attributes: j, setNodeRef: re, listeners: M, isDragging: N, over: ie, setActivatorNodeRef: P, transform: F } = Xn({
2474
+ }), { active: A, activatorEvent: te, activeNodeRect: ne, attributes: j, setNodeRef: M, listeners: N, isDragging: P, over: re, setActivatorNodeRef: F, transform: ie } = Xn({
2463
2475
  id: l,
2464
2476
  data: T,
2465
2477
  attributes: {
@@ -2467,84 +2479,84 @@ function br(e) {
2467
2479
  ...n
2468
2480
  },
2469
2481
  disabled: C.draggable
2470
- }), ae = ve(k, re), oe = !!A, I = oe && !v && rr(g) && rr(b), se = !x && N, ce = I ? (se && I ? F : null) ?? (d ?? S)({
2482
+ }), ae = ve(k, M), I = !!A, oe = I && !v && rr(g) && rr(b), L = !x && P, se = oe ? (L && oe ? ie : null) ?? (d ?? S)({
2471
2483
  rects: y,
2472
2484
  activeNodeRect: ne,
2473
2485
  activeIndex: g,
2474
2486
  overIndex: b,
2475
2487
  index: w
2476
- }) : null, le = rr(g) && rr(b) ? s({
2488
+ }) : null, R = rr(g) && rr(b) ? s({
2477
2489
  id: l,
2478
2490
  items: m,
2479
2491
  activeIndex: g,
2480
2492
  overIndex: b
2481
- }) : w, L = A?.id, R = u({
2482
- activeId: L,
2493
+ }) : w, ce = A?.id, z = u({
2494
+ activeId: ce,
2483
2495
  items: m,
2484
- newIndex: le,
2496
+ newIndex: R,
2485
2497
  containerId: h
2486
- }), ue = m !== R.current.items, z = t({
2498
+ }), le = m !== z.current.items, B = t({
2487
2499
  active: A,
2488
2500
  containerId: h,
2489
- isDragging: N,
2490
- isSorting: oe,
2501
+ isDragging: P,
2502
+ isSorting: I,
2491
2503
  id: l,
2492
2504
  index: w,
2493
2505
  items: m,
2494
- newIndex: R.current.newIndex,
2495
- previousItems: R.current.items,
2496
- previousContainerId: R.current.containerId,
2506
+ newIndex: z.current.newIndex,
2507
+ previousItems: z.current.items,
2508
+ previousContainerId: z.current.containerId,
2497
2509
  transition: p,
2498
- wasDragging: R.current.activeId != null
2499
- }), B = yr({
2500
- disabled: !z,
2510
+ wasDragging: z.current.activeId != null
2511
+ }), ue = yr({
2512
+ disabled: !B,
2501
2513
  index: w,
2502
2514
  node: ee,
2503
2515
  rect: D
2504
2516
  });
2505
2517
  return o(() => {
2506
- oe && R.current.newIndex !== le && (R.current.newIndex = le), h !== R.current.containerId && (R.current.containerId = h), m !== R.current.items && (R.current.items = m);
2518
+ I && z.current.newIndex !== R && (z.current.newIndex = R), h !== z.current.containerId && (z.current.containerId = h), m !== z.current.items && (z.current.items = m);
2507
2519
  }, [
2508
- oe,
2509
- le,
2520
+ I,
2521
+ R,
2510
2522
  h,
2511
2523
  m
2512
2524
  ]), o(() => {
2513
- if (L === R.current.activeId) return;
2514
- if (L != null && R.current.activeId == null) {
2515
- R.current.activeId = L;
2525
+ if (ce === z.current.activeId) return;
2526
+ if (ce != null && z.current.activeId == null) {
2527
+ z.current.activeId = ce;
2516
2528
  return;
2517
2529
  }
2518
2530
  let e = setTimeout(() => {
2519
- R.current.activeId = L;
2531
+ z.current.activeId = ce;
2520
2532
  }, 50);
2521
2533
  return () => clearTimeout(e);
2522
- }, [L]), {
2534
+ }, [ce]), {
2523
2535
  active: A,
2524
2536
  activeIndex: g,
2525
2537
  attributes: j,
2526
2538
  data: T,
2527
2539
  rect: D,
2528
2540
  index: w,
2529
- newIndex: le,
2541
+ newIndex: R,
2530
2542
  items: m,
2531
2543
  isOver: O,
2532
- isSorting: oe,
2533
- isDragging: N,
2534
- listeners: M,
2544
+ isSorting: I,
2545
+ isDragging: P,
2546
+ listeners: N,
2535
2547
  node: ee,
2536
2548
  overIndex: b,
2537
- over: ie,
2549
+ over: re,
2538
2550
  setNodeRef: ae,
2539
- setActivatorNodeRef: P,
2551
+ setActivatorNodeRef: F,
2540
2552
  setDroppableNodeRef: k,
2541
- setDraggableNodeRef: re,
2542
- transform: B ?? ce,
2553
+ setDraggableNodeRef: M,
2554
+ transform: ue ?? se,
2543
2555
  transition: V()
2544
2556
  };
2545
2557
  function V() {
2546
- if (B || ue && R.current.newIndex === w) return _r;
2547
- if (!(se && !Fe(te) || !p) && (oe || z)) return Re.Transition.toString({
2558
+ if (ue || le && z.current.newIndex === w) return _r;
2559
+ if (!(L && !Fe(te) || !p) && (I || B)) return Re.Transition.toString({
2548
2560
  ...p,
2549
2561
  property: gr
2550
2562
  });
@@ -2663,7 +2675,7 @@ function Ar({ item: e, basePath: t, evalVis: n, checkPerm: r, onAction: i, enabl
2663
2675
  });
2664
2676
  }
2665
2677
  function jr({ item: e, basePath: t, evalVis: n, checkPerm: r, onAction: i, enablePinning: a, onPinToggle: o, dragListeners: s, resolveObjectLabel: c, t: l }) {
2666
- let u = P(), [g, v] = d(e.defaultOpen !== !1);
2678
+ let u = re(), [g, v] = d(e.defaultOpen !== !1);
2667
2679
  if (!n(e.visible) || e.requiredPermissions?.length && !r(e.requiredPermissions)) return null;
2668
2680
  if (e.type === "separator") return /* @__PURE__ */ (0, B.jsx)(_, { className: "my-2" });
2669
2681
  if (e.type === "group") {
@@ -2841,7 +2853,7 @@ function Pr({ areas: e, activeAreaId: t, onAreaChange: n, evalVis: r, checkPerm:
2841
2853
  }) }) })] });
2842
2854
  }
2843
2855
  function Fr({ items: e, basePath: t }) {
2844
- let n = P(), r = e.filter((e) => e.type !== "group" && e.type !== "separator").slice(0, 5);
2856
+ let n = re(), r = e.filter((e) => e.type !== "group" && e.type !== "separator").slice(0, 5);
2845
2857
  return r.length === 0 ? null : /* @__PURE__ */ (0, B.jsx)("div", {
2846
2858
  className: "fixed bottom-0 left-0 right-0 z-50 flex items-center justify-around border-t bg-background/95 backdrop-blur-sm px-2 py-1 sm:hidden safe-area-bottom",
2847
2859
  role: "navigation",
@@ -2919,7 +2931,7 @@ function Ir({ schema: e, basePath: t, evalVis: n, checkPerm: r, onAction: i, sid
2919
2931
  });
2920
2932
  }
2921
2933
  function Lr({ schema: e, basePath: t = "", mobileNavMode: n = "drawer", evaluateVisibility: r, checkPermission: i, onAction: a, navbar: s, sidebarHeader: l, sidebarFooter: u, sidebarExtra: f, children: p, className: m, defaultOpen: h = !0, enableSearch: g, enablePinning: _, onPinToggle: v, enableReorder: y, onReorder: b }) {
2922
- let x = r ?? ((e) => !(e === !1 || e === "false")), S = i ?? (() => !0), C = c(() => (e.menu ?? []).map((e, t) => ce(e, t)), [e.menu]), w = e.navigation ?? C, T = e.areas ?? [], [E, D] = d(() => T.length > 0 ? T[0].id : null), ee = T.map((e) => e.id).join(",");
2934
+ let x = r ?? ((e) => !(e === !1 || e === "false")), S = i ?? (() => !0), C = c(() => (e.menu ?? []).map((e, t) => L(e, t)), [e.menu]), w = e.navigation ?? C, T = e.areas ?? [], [E, D] = d(() => T.length > 0 ? T[0].id : null), ee = T.map((e) => e.id).join(",");
2923
2935
  o(() => {
2924
2936
  T.length > 0 ? D((e) => T.some((t) => t.id === e) ? e : T[0].id) : D(null);
2925
2937
  }, [e.name, ee]);
@@ -2966,12 +2978,12 @@ function zr({ schema: e, className: t, style: n, id: r, ...i }) {
2966
2978
  id: r || e.id,
2967
2979
  className: M("flex flex-col h-full space-y-4", t),
2968
2980
  style: n,
2969
- children: [/* @__PURE__ */ (0, B.jsx)(V, {
2981
+ children: [/* @__PURE__ */ (0, B.jsx)(ue, {
2970
2982
  title: e.title,
2971
2983
  description: e.description
2972
2984
  }), /* @__PURE__ */ (0, B.jsx)("div", {
2973
2985
  className: "flex-1 overflow-auto",
2974
- children: a.map((e, t) => /* @__PURE__ */ (0, B.jsx)(le, {
2986
+ children: a.map((e, t) => /* @__PURE__ */ (0, B.jsx)(se, {
2975
2987
  schema: e,
2976
2988
  ...i
2977
2989
  }, e?.id || t))
@@ -3000,13 +3012,13 @@ function Vr({ item: e, pathname: t }) {
3000
3012
  className: "ml-auto mr-1 h-5 min-w-5 px-1 text-xs",
3001
3013
  children: e.badge
3002
3014
  }),
3003
- /* @__PURE__ */ (0, B.jsx)(ae, { className: "ml-auto h-4 w-4 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })
3015
+ /* @__PURE__ */ (0, B.jsx)(ie, { className: "ml-auto h-4 w-4 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })
3004
3016
  ]
3005
3017
  })
3006
3018
  }), /* @__PURE__ */ (0, B.jsx)(m, { children: /* @__PURE__ */ (0, B.jsx)(A, { children: e.children.map((e) => /* @__PURE__ */ (0, B.jsx)(ne, { children: /* @__PURE__ */ (0, B.jsx)(te, {
3007
3019
  asChild: !0,
3008
3020
  isActive: t === e.href,
3009
- children: /* @__PURE__ */ (0, B.jsxs)(ie, {
3021
+ children: /* @__PURE__ */ (0, B.jsxs)(P, {
3010
3022
  to: e.href,
3011
3023
  children: [
3012
3024
  e.icon && /* @__PURE__ */ (0, B.jsx)(e.icon, {}),
@@ -3023,7 +3035,7 @@ function Vr({ item: e, pathname: t }) {
3023
3035
  asChild: !0,
3024
3036
  isActive: t === e.href,
3025
3037
  tooltip: e.title,
3026
- children: /* @__PURE__ */ (0, B.jsxs)(ie, {
3038
+ children: /* @__PURE__ */ (0, B.jsxs)(P, {
3027
3039
  to: e.href,
3028
3040
  children: [
3029
3041
  e.icon && /* @__PURE__ */ (0, B.jsx)(e.icon, {}),
@@ -3038,7 +3050,7 @@ function Vr({ item: e, pathname: t }) {
3038
3050
  }) });
3039
3051
  }
3040
3052
  function Hr({ items: e, title: n = "Application", className: r, collapsible: i = "icon", searchEnabled: a = !1, searchPlaceholder: o = "Search..." }) {
3041
- let s = P(), [c, l] = t.useState(""), u = t.useMemo(() => e.length === 0 ? [] : Br(e[0]) ? e.map((e) => ({
3053
+ let s = re(), [c, l] = t.useState(""), u = t.useMemo(() => e.length === 0 ? [] : Br(e[0]) ? e.map((e) => ({
3042
3054
  groupLabel: e.label,
3043
3055
  items: e.items
3044
3056
  })) : [{ items: e }], [e]), d = t.useMemo(() => {
@@ -3056,7 +3068,7 @@ function Hr({ items: e, title: n = "Application", className: r, collapsible: i =
3056
3068
  className: "px-3 py-2",
3057
3069
  children: /* @__PURE__ */ (0, B.jsxs)("div", {
3058
3070
  className: "relative",
3059
- children: [/* @__PURE__ */ (0, B.jsx)(oe, { className: "absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ (0, B.jsx)(g, {
3071
+ children: [/* @__PURE__ */ (0, B.jsx)(ae, { className: "absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ (0, B.jsx)(g, {
3060
3072
  type: "search",
3061
3073
  placeholder: o,
3062
3074
  value: c,
@@ -3064,16 +3076,26 @@ function Hr({ items: e, title: n = "Application", className: r, collapsible: i =
3064
3076
  className: "pl-8 h-9"
3065
3077
  })]
3066
3078
  })
3067
- }), d.map((e, t) => /* @__PURE__ */ (0, B.jsxs)(x, { children: [/* @__PURE__ */ (0, B.jsx)(C, { children: e.groupLabel || n }), /* @__PURE__ */ (0, B.jsx)(S, { children: /* @__PURE__ */ (0, B.jsx)(D, { children: e.items.map((e) => /* @__PURE__ */ (0, B.jsx)(Vr, {
3068
- item: e,
3069
- pathname: s.pathname
3070
- }, e.href)) }) })] }, e.groupLabel || t))] })
3079
+ }), d.map((e, t) => /* @__PURE__ */ (0, B.jsxs)(x, { children: [
3080
+ t > 0 && /* @__PURE__ */ (0, B.jsx)("div", {
3081
+ className: "mx-3 mb-1 h-px bg-sidebar-border/60",
3082
+ "aria-hidden": !0
3083
+ }),
3084
+ /* @__PURE__ */ (0, B.jsx)(C, {
3085
+ className: "text-[10px] font-semibold uppercase tracking-wider text-sidebar-foreground/60",
3086
+ children: e.groupLabel || n
3087
+ }),
3088
+ /* @__PURE__ */ (0, B.jsx)(S, { children: /* @__PURE__ */ (0, B.jsx)(D, { children: e.items.map((e) => /* @__PURE__ */ (0, B.jsx)(Vr, {
3089
+ item: e,
3090
+ pathname: s.pathname
3091
+ }, e.href)) }) })
3092
+ ] }, e.groupLabel || t))] })
3071
3093
  });
3072
3094
  }
3073
3095
  //#endregion
3074
3096
  //#region src/index.ts
3075
3097
  function Ur() {
3076
- e.register("page-header", V, {
3098
+ e.register("page-header", ue, {
3077
3099
  namespace: "layout",
3078
3100
  label: "Page Header",
3079
3101
  category: "Layout",
@@ -3084,7 +3106,7 @@ function Ur() {
3084
3106
  name: "description",
3085
3107
  type: "string"
3086
3108
  }]
3087
- }), e.register("page:header", V, { namespace: "layout" }), e.register("page:card", me, {
3109
+ }), e.register("page:header", ue, { namespace: "layout" }), e.register("page:card", me, {
3088
3110
  namespace: "layout",
3089
3111
  label: "Page Card",
3090
3112
  category: "Layout",
@@ -3141,4 +3163,4 @@ try {
3141
3163
  Ur();
3142
3164
  } catch {}
3143
3165
  //#endregion
3144
- export { Lr as AppSchemaRenderer, pe as AppShell, Mr as NavigationRenderer, zr as Page, me as PageCard, V as PageHeader, _e as ResponsiveGrid, Hr as SidebarNav, Or as filterNavigationItems, Ur as registerLayout, Cr as resolveIcon, $ as resolveLabel, fe as useAppShellBranding };
3166
+ export { Lr as AppSchemaRenderer, pe as AppShell, Mr as NavigationRenderer, zr as Page, me as PageCard, ue as PageHeader, _e as ResponsiveGrid, Hr as SidebarNav, Or as filterNavigationItems, Ur as registerLayout, Cr as resolveIcon, $ as resolveLabel, fe as useAppShellBranding };