@object-ui/layout 0.5.0 → 3.0.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/dist/index.js CHANGED
@@ -1,152 +1,152 @@
1
1
  import { ComponentRegistry as b } from "@object-ui/core";
2
- import ae from "react";
3
- import { cn as h, SidebarProvider as ne, SidebarInset as oe, SidebarTrigger as se, Sidebar as le, SidebarContent as ie, SidebarGroup as ce, SidebarGroupLabel as ue, SidebarGroupContent as fe, SidebarMenu as de, SidebarMenuItem as me, SidebarMenuButton as pe } from "@object-ui/components";
2
+ import ae, { useEffect as se } from "react";
3
+ import { cn as h, SidebarProvider as ne, SidebarInset as le, SidebarTrigger as ce, Sidebar as ie, SidebarContent as ue, SidebarGroup as de, SidebarGroupLabel as fe, SidebarGroupContent as me, SidebarMenu as pe, SidebarMenuItem as ge, SidebarMenuButton as xe } from "@object-ui/components";
4
4
  import { SchemaRenderer as be } from "@object-ui/react";
5
- import { useLocation as xe, NavLink as ve } from "react-router-dom";
6
- var g = { exports: {} }, x = {};
7
- var M;
8
- function _e() {
9
- if (M) return x;
10
- M = 1;
11
- var a = /* @__PURE__ */ Symbol.for("react.transitional.element"), u = /* @__PURE__ */ Symbol.for("react.fragment");
12
- function c(f, s, o) {
13
- var d = null;
14
- if (o !== void 0 && (d = "" + o), s.key !== void 0 && (d = "" + s.key), "key" in s) {
15
- o = {};
16
- for (var m in s)
17
- m !== "key" && (o[m] = s[m]);
18
- } else o = s;
19
- return s = o.ref, {
20
- $$typeof: a,
21
- type: f,
22
- key: d,
23
- ref: s !== void 0 ? s : null,
24
- props: o
5
+ import { useLocation as ye, NavLink as ve } from "react-router-dom";
6
+ var j = { exports: {} }, y = {};
7
+ var G;
8
+ function he() {
9
+ if (G) return y;
10
+ G = 1;
11
+ var r = /* @__PURE__ */ Symbol.for("react.transitional.element"), l = /* @__PURE__ */ Symbol.for("react.fragment");
12
+ function t(a, n, s) {
13
+ var f = null;
14
+ if (s !== void 0 && (f = "" + s), n.key !== void 0 && (f = "" + n.key), "key" in n) {
15
+ s = {};
16
+ for (var m in n)
17
+ m !== "key" && (s[m] = n[m]);
18
+ } else s = n;
19
+ return n = s.ref, {
20
+ $$typeof: r,
21
+ type: a,
22
+ key: f,
23
+ ref: n !== void 0 ? n : null,
24
+ props: s
25
25
  };
26
26
  }
27
- return x.Fragment = u, x.jsx = c, x.jsxs = c, x;
27
+ return y.Fragment = l, y.jsx = t, y.jsxs = t, y;
28
28
  }
29
29
  var v = {};
30
- var D;
30
+ var W;
31
31
  function Ee() {
32
- return D || (D = 1, process.env.NODE_ENV !== "production" && (function() {
33
- function a(e) {
32
+ return W || (W = 1, process.env.NODE_ENV !== "production" && (function() {
33
+ function r(e) {
34
34
  if (e == null) return null;
35
35
  if (typeof e == "function")
36
- return e.$$typeof === ee ? null : e.displayName || e.name || null;
36
+ return e.$$typeof === re ? null : e.displayName || e.name || null;
37
37
  if (typeof e == "string") return e;
38
38
  switch (e) {
39
- case R:
39
+ case S:
40
40
  return "Fragment";
41
- case V:
41
+ case z:
42
42
  return "Profiler";
43
- case J:
43
+ case V:
44
44
  return "StrictMode";
45
- case B:
46
- return "Suspense";
47
45
  case Z:
46
+ return "Suspense";
47
+ case Q:
48
48
  return "SuspenseList";
49
- case K:
49
+ case ee:
50
50
  return "Activity";
51
51
  }
52
52
  if (typeof e == "object")
53
53
  switch (typeof e.tag == "number" && console.error(
54
54
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
55
55
  ), e.$$typeof) {
56
- case q:
56
+ case J:
57
57
  return "Portal";
58
58
  case X:
59
59
  return e.displayName || "Context";
60
- case z:
61
- return (e._context.displayName || "Context") + ".Consumer";
62
60
  case H:
63
- var r = e.render;
64
- return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
65
- case Q:
66
- return r = e.displayName || null, r !== null ? r : a(e.type) || "Memo";
67
- case j:
68
- r = e._payload, e = e._init;
61
+ return (e._context.displayName || "Context") + ".Consumer";
62
+ case B:
63
+ var o = e.render;
64
+ return e = e.displayName, e || (e = o.displayName || o.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
65
+ case K:
66
+ return o = e.displayName || null, o !== null ? o : r(e.type) || "Memo";
67
+ case T:
68
+ o = e._payload, e = e._init;
69
69
  try {
70
- return a(e(r));
70
+ return r(e(o));
71
71
  } catch {
72
72
  }
73
73
  }
74
74
  return null;
75
75
  }
76
- function u(e) {
76
+ function l(e) {
77
77
  return "" + e;
78
78
  }
79
- function c(e) {
79
+ function t(e) {
80
80
  try {
81
- u(e);
82
- var r = !1;
81
+ l(e);
82
+ var o = !1;
83
83
  } catch {
84
- r = !0;
84
+ o = !0;
85
85
  }
86
- if (r) {
87
- r = console;
88
- var n = r.error, l = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
89
- return n.call(
90
- r,
86
+ if (o) {
87
+ o = console;
88
+ var i = o.error, u = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
89
+ return i.call(
90
+ o,
91
91
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
92
- l
93
- ), u(e);
92
+ u
93
+ ), l(e);
94
94
  }
95
95
  }
96
- function f(e) {
97
- if (e === R) return "<>";
98
- if (typeof e == "object" && e !== null && e.$$typeof === j)
96
+ function a(e) {
97
+ if (e === S) return "<>";
98
+ if (typeof e == "object" && e !== null && e.$$typeof === T)
99
99
  return "<...>";
100
100
  try {
101
- var r = a(e);
102
- return r ? "<" + r + ">" : "<...>";
101
+ var o = r(e);
102
+ return o ? "<" + o + ">" : "<...>";
103
103
  } catch {
104
104
  return "<...>";
105
105
  }
106
106
  }
107
- function s() {
108
- var e = T.A;
107
+ function n() {
108
+ var e = P.A;
109
109
  return e === null ? null : e.getOwner();
110
110
  }
111
- function o() {
111
+ function s() {
112
112
  return Error("react-stack-top-frame");
113
113
  }
114
- function d(e) {
115
- if (C.call(e, "key")) {
116
- var r = Object.getOwnPropertyDescriptor(e, "key").get;
117
- if (r && r.isReactWarning) return !1;
114
+ function f(e) {
115
+ if ($.call(e, "key")) {
116
+ var o = Object.getOwnPropertyDescriptor(e, "key").get;
117
+ if (o && o.isReactWarning) return !1;
118
118
  }
119
119
  return e.key !== void 0;
120
120
  }
121
- function m(e, r) {
122
- function n() {
123
- Y || (Y = !0, console.error(
121
+ function m(e, o) {
122
+ function i() {
123
+ M || (M = !0, console.error(
124
124
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
125
- r
125
+ o
126
126
  ));
127
127
  }
128
- n.isReactWarning = !0, Object.defineProperty(e, "key", {
129
- get: n,
128
+ i.isReactWarning = !0, Object.defineProperty(e, "key", {
129
+ get: i,
130
130
  configurable: !0
131
131
  });
132
132
  }
133
- function U() {
134
- var e = a(this.type);
135
- return L[e] || (L[e] = !0, console.error(
133
+ function g() {
134
+ var e = r(this.type);
135
+ return I[e] || (I[e] = !0, console.error(
136
136
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
137
137
  )), e = this.props.ref, e !== void 0 ? e : null;
138
138
  }
139
- function G(e, r, n, l, E, y) {
140
- var i = n.ref;
139
+ function E(e, o, i, u, R, A) {
140
+ var d = i.ref;
141
141
  return e = {
142
- $$typeof: w,
142
+ $$typeof: L,
143
143
  type: e,
144
- key: r,
145
- props: n,
146
- _owner: l
147
- }, (i !== void 0 ? i : null) !== null ? Object.defineProperty(e, "ref", {
144
+ key: o,
145
+ props: i,
146
+ _owner: u
147
+ }, (d !== void 0 ? d : null) !== null ? Object.defineProperty(e, "ref", {
148
148
  enumerable: !1,
149
- get: U
149
+ get: g
150
150
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
151
151
  configurable: !1,
152
152
  enumerable: !1,
@@ -161,69 +161,69 @@ function Ee() {
161
161
  configurable: !1,
162
162
  enumerable: !1,
163
163
  writable: !0,
164
- value: E
164
+ value: R
165
165
  }), Object.defineProperty(e, "_debugTask", {
166
166
  configurable: !1,
167
167
  enumerable: !1,
168
168
  writable: !0,
169
- value: y
169
+ value: A
170
170
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
171
171
  }
172
- function N(e, r, n, l, E, y) {
173
- var i = r.children;
174
- if (i !== void 0)
175
- if (l)
176
- if (re(i)) {
177
- for (l = 0; l < i.length; l++)
178
- P(i[l]);
179
- Object.freeze && Object.freeze(i);
172
+ function p(e, o, i, u, R, A) {
173
+ var d = o.children;
174
+ if (d !== void 0)
175
+ if (u)
176
+ if (te(d)) {
177
+ for (u = 0; u < d.length; u++)
178
+ O(d[u]);
179
+ Object.freeze && Object.freeze(d);
180
180
  } else
181
181
  console.error(
182
182
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
183
183
  );
184
- else P(i);
185
- if (C.call(r, "key")) {
186
- i = a(e);
187
- var p = Object.keys(r).filter(function(te) {
188
- return te !== "key";
184
+ else O(d);
185
+ if ($.call(o, "key")) {
186
+ d = r(e);
187
+ var x = Object.keys(o).filter(function(oe) {
188
+ return oe !== "key";
189
189
  });
190
- l = 0 < p.length ? "{key: someKey, " + p.join(": ..., ") + ": ...}" : "{key: someKey}", F[i + l] || (p = 0 < p.length ? "{" + p.join(": ..., ") + ": ...}" : "{}", console.error(
190
+ u = 0 < x.length ? "{key: someKey, " + x.join(": ..., ") + ": ...}" : "{key: someKey}", D[d + u] || (x = 0 < x.length ? "{" + x.join(": ..., ") + ": ...}" : "{}", console.error(
191
191
  `A props object containing a "key" prop is being spread into JSX:
192
192
  let props = %s;
193
193
  <%s {...props} />
194
194
  React keys must be passed directly to JSX without using spread:
195
195
  let props = %s;
196
196
  <%s key={someKey} {...props} />`,
197
- l,
198
- i,
199
- p,
200
- i
201
- ), F[i + l] = !0);
197
+ u,
198
+ d,
199
+ x,
200
+ d
201
+ ), D[d + u] = !0);
202
202
  }
203
- if (i = null, n !== void 0 && (c(n), i = "" + n), d(r) && (c(r.key), i = "" + r.key), "key" in r) {
204
- n = {};
205
- for (var k in r)
206
- k !== "key" && (n[k] = r[k]);
207
- } else n = r;
208
- return i && m(
209
- n,
203
+ if (d = null, i !== void 0 && (t(i), d = "" + i), f(o) && (t(o.key), d = "" + o.key), "key" in o) {
204
+ i = {};
205
+ for (var C in o)
206
+ C !== "key" && (i[C] = o[C]);
207
+ } else i = o;
208
+ return d && m(
209
+ i,
210
210
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
211
- ), G(
211
+ ), E(
212
212
  e,
213
+ d,
213
214
  i,
214
- n,
215
- s(),
216
- E,
217
- y
215
+ n(),
216
+ R,
217
+ A
218
218
  );
219
219
  }
220
- function P(e) {
221
- O(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === j && (e._payload.status === "fulfilled" ? O(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
222
- }
223
220
  function O(e) {
224
- return typeof e == "object" && e !== null && e.$$typeof === w;
221
+ w(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === T && (e._payload.status === "fulfilled" ? w(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
222
+ }
223
+ function w(e) {
224
+ return typeof e == "object" && e !== null && e.$$typeof === L;
225
225
  }
226
- var _ = ae, w = /* @__PURE__ */ Symbol.for("react.transitional.element"), q = /* @__PURE__ */ Symbol.for("react.portal"), R = /* @__PURE__ */ Symbol.for("react.fragment"), J = /* @__PURE__ */ Symbol.for("react.strict_mode"), V = /* @__PURE__ */ Symbol.for("react.profiler"), z = /* @__PURE__ */ Symbol.for("react.consumer"), X = /* @__PURE__ */ Symbol.for("react.context"), H = /* @__PURE__ */ Symbol.for("react.forward_ref"), B = /* @__PURE__ */ Symbol.for("react.suspense"), Z = /* @__PURE__ */ Symbol.for("react.suspense_list"), Q = /* @__PURE__ */ Symbol.for("react.memo"), j = /* @__PURE__ */ Symbol.for("react.lazy"), K = /* @__PURE__ */ Symbol.for("react.activity"), ee = /* @__PURE__ */ Symbol.for("react.client.reference"), T = _.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, C = Object.prototype.hasOwnProperty, re = Array.isArray, S = console.createTask ? console.createTask : function() {
226
+ var _ = ae, L = /* @__PURE__ */ Symbol.for("react.transitional.element"), J = /* @__PURE__ */ Symbol.for("react.portal"), S = /* @__PURE__ */ Symbol.for("react.fragment"), V = /* @__PURE__ */ Symbol.for("react.strict_mode"), z = /* @__PURE__ */ Symbol.for("react.profiler"), H = /* @__PURE__ */ Symbol.for("react.consumer"), X = /* @__PURE__ */ Symbol.for("react.context"), B = /* @__PURE__ */ Symbol.for("react.forward_ref"), Z = /* @__PURE__ */ Symbol.for("react.suspense"), Q = /* @__PURE__ */ Symbol.for("react.suspense_list"), K = /* @__PURE__ */ Symbol.for("react.memo"), T = /* @__PURE__ */ Symbol.for("react.lazy"), ee = /* @__PURE__ */ Symbol.for("react.activity"), re = /* @__PURE__ */ Symbol.for("react.client.reference"), P = _.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, $ = Object.prototype.hasOwnProperty, te = Array.isArray, k = console.createTask ? console.createTask : function() {
227
227
  return null;
228
228
  };
229
229
  _ = {
@@ -231,148 +231,242 @@ React keys must be passed directly to JSX without using spread:
231
231
  return e();
232
232
  }
233
233
  };
234
- var Y, L = {}, I = _.react_stack_bottom_frame.bind(
234
+ var M, I = {}, Y = _.react_stack_bottom_frame.bind(
235
235
  _,
236
- o
237
- )(), $ = S(f(o)), F = {};
238
- v.Fragment = R, v.jsx = function(e, r, n) {
239
- var l = 1e4 > T.recentlyCreatedOwnerStacks++;
240
- return N(
236
+ s
237
+ )(), F = k(a(s)), D = {};
238
+ v.Fragment = S, v.jsx = function(e, o, i) {
239
+ var u = 1e4 > P.recentlyCreatedOwnerStacks++;
240
+ return p(
241
241
  e,
242
- r,
243
- n,
242
+ o,
243
+ i,
244
244
  !1,
245
- l ? Error("react-stack-top-frame") : I,
246
- l ? S(f(e)) : $
245
+ u ? Error("react-stack-top-frame") : Y,
246
+ u ? k(a(e)) : F
247
247
  );
248
- }, v.jsxs = function(e, r, n) {
249
- var l = 1e4 > T.recentlyCreatedOwnerStacks++;
250
- return N(
248
+ }, v.jsxs = function(e, o, i) {
249
+ var u = 1e4 > P.recentlyCreatedOwnerStacks++;
250
+ return p(
251
251
  e,
252
- r,
253
- n,
252
+ o,
253
+ i,
254
254
  !0,
255
- l ? Error("react-stack-top-frame") : I,
256
- l ? S(f(e)) : $
255
+ u ? Error("react-stack-top-frame") : Y,
256
+ u ? k(a(e)) : F
257
257
  );
258
258
  };
259
259
  })()), v;
260
260
  }
261
- var W;
262
- function ge() {
263
- return W || (W = 1, process.env.NODE_ENV === "production" ? g.exports = _e() : g.exports = Ee()), g.exports;
261
+ var q;
262
+ function _e() {
263
+ return q || (q = 1, process.env.NODE_ENV === "production" ? j.exports = he() : j.exports = Ee()), j.exports;
264
264
  }
265
- var t = ge();
266
- function A({
267
- title: a,
268
- description: u,
269
- action: c,
270
- className: f,
271
- children: s,
272
- ...o
265
+ var c = _e();
266
+ function N({
267
+ title: r,
268
+ description: l,
269
+ action: t,
270
+ className: a,
271
+ children: n,
272
+ ...s
273
273
  }) {
274
- return /* @__PURE__ */ t.jsx("div", { className: h("flex flex-col gap-4 pb-4 md:pb-8", f), ...o, children: /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between gap-4", children: [
275
- /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-1", children: [
276
- /* @__PURE__ */ t.jsx("h1", { className: "text-2xl font-bold tracking-tight md:text-3xl", children: a }),
277
- u && /* @__PURE__ */ t.jsx("p", { className: "text-sm text-muted-foreground", children: u })
274
+ return /* @__PURE__ */ c.jsx("div", { className: h("flex flex-col gap-4 pb-4 md:pb-8", a), ...s, children: /* @__PURE__ */ c.jsxs("div", { className: "flex items-center justify-between gap-4", children: [
275
+ /* @__PURE__ */ c.jsxs("div", { className: "flex flex-col gap-1", children: [
276
+ /* @__PURE__ */ c.jsx("h1", { className: "text-2xl font-bold tracking-tight md:text-3xl", children: r }),
277
+ l && /* @__PURE__ */ c.jsx("p", { className: "text-sm text-muted-foreground", children: l })
278
278
  ] }),
279
- (c || s) && /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
280
- c,
281
- s
279
+ (t || n) && /* @__PURE__ */ c.jsxs("div", { className: "flex items-center gap-2", children: [
280
+ t,
281
+ n
282
282
  ] })
283
283
  ] }) });
284
284
  }
285
- function he({
286
- sidebar: a,
287
- navbar: u,
288
- children: c,
289
- className: f,
290
- defaultOpen: s = !0
285
+ function U(r) {
286
+ const l = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);
287
+ if (!l) return null;
288
+ const t = parseInt(l[1], 16) / 255, a = parseInt(l[2], 16) / 255, n = parseInt(l[3], 16) / 255, s = Math.max(t, a, n), f = Math.min(t, a, n);
289
+ let m = 0, g = 0;
290
+ const E = (s + f) / 2;
291
+ if (s !== f) {
292
+ const p = s - f;
293
+ switch (g = E > 0.5 ? p / (2 - s - f) : p / (s + f), s) {
294
+ case t:
295
+ m = ((a - n) / p + (a < n ? 6 : 0)) / 6;
296
+ break;
297
+ case a:
298
+ m = ((n - t) / p + 2) / 6;
299
+ break;
300
+ case n:
301
+ m = ((t - a) / p + 4) / 6;
302
+ break;
303
+ }
304
+ }
305
+ return `${Math.round(m * 360)} ${Math.round(g * 100)}% ${Math.round(E * 100)}%`;
306
+ }
307
+ function Re(r, l) {
308
+ se(() => {
309
+ const t = document.documentElement;
310
+ if (r?.primaryColor) {
311
+ const a = U(r.primaryColor);
312
+ a && (t.style.setProperty("--brand-primary", r.primaryColor), t.style.setProperty("--brand-primary-hsl", a));
313
+ } else
314
+ t.style.removeProperty("--brand-primary"), t.style.removeProperty("--brand-primary-hsl");
315
+ if (r?.accentColor) {
316
+ const a = U(r.accentColor);
317
+ a && (t.style.setProperty("--brand-accent", r.accentColor), t.style.setProperty("--brand-accent-hsl", a));
318
+ } else
319
+ t.style.removeProperty("--brand-accent"), t.style.removeProperty("--brand-accent-hsl");
320
+ if (r?.favicon) {
321
+ const a = document.querySelector("#favicon") || document.querySelector('link[rel="icon"]');
322
+ a && (a.href = r.favicon);
323
+ }
324
+ return l && (document.title = l), () => {
325
+ t.style.removeProperty("--brand-primary"), t.style.removeProperty("--brand-primary-hsl"), t.style.removeProperty("--brand-accent"), t.style.removeProperty("--brand-accent-hsl");
326
+ };
327
+ }, [r?.primaryColor, r?.accentColor, r?.favicon, l]);
328
+ }
329
+ function je({
330
+ sidebar: r,
331
+ navbar: l,
332
+ children: t,
333
+ className: a,
334
+ defaultOpen: n = !0,
335
+ branding: s
291
336
  }) {
292
- return /* @__PURE__ */ t.jsxs(ne, { defaultOpen: s, children: [
293
- a,
294
- /* @__PURE__ */ t.jsxs(oe, { children: [
295
- /* @__PURE__ */ t.jsxs("header", { className: "flex h-16 shrink-0 items-center gap-2 border-b bg-background px-4", children: [
296
- /* @__PURE__ */ t.jsx(se, { className: "-ml-1" }),
297
- /* @__PURE__ */ t.jsx("div", { className: "w-px h-4 bg-border mx-2" }),
298
- u
337
+ return Re(s, s?.title), /* @__PURE__ */ c.jsxs(ne, { defaultOpen: n, children: [
338
+ r,
339
+ /* @__PURE__ */ c.jsxs(le, { children: [
340
+ /* @__PURE__ */ c.jsxs("header", { className: "flex h-14 sm:h-16 shrink-0 items-center gap-2 border-b bg-background px-2 sm:px-4", children: [
341
+ /* @__PURE__ */ c.jsx(ce, { className: "-ml-1" }),
342
+ /* @__PURE__ */ c.jsx("div", { className: "w-px h-4 bg-border mx-1 sm:mx-2" }),
343
+ l
299
344
  ] }),
300
- /* @__PURE__ */ t.jsx("main", { className: h("flex-1 overflow-auto p-4 md:p-6", f), children: c })
345
+ /* @__PURE__ */ c.jsx("main", { className: h("flex-1 overflow-auto p-3 sm:p-4 md:p-6", a), children: t })
301
346
  ] })
302
347
  ] });
303
348
  }
304
- const Re = (a) => a ? Array.isArray(a) ? a : [a] : [];
305
- function je({ schema: a, className: u, style: c, id: f, ...s }) {
306
- const o = Re(a.children);
307
- return /* @__PURE__ */ t.jsxs(
349
+ function Se({ className: r, children: l, ...t }) {
350
+ return /* @__PURE__ */ c.jsx("div", { className: h("rounded-xl border bg-card text-card-foreground shadow", r), ...t, children: /* @__PURE__ */ c.jsx("div", { className: "p-6", children: l }) });
351
+ }
352
+ const Te = {
353
+ xs: { 1: "grid-cols-1", 2: "grid-cols-2", 3: "grid-cols-3", 4: "grid-cols-4", 6: "grid-cols-6", 12: "grid-cols-12" },
354
+ sm: { 1: "sm:grid-cols-1", 2: "sm:grid-cols-2", 3: "sm:grid-cols-3", 4: "sm:grid-cols-4", 6: "sm:grid-cols-6", 12: "sm:grid-cols-12" },
355
+ md: { 1: "md:grid-cols-1", 2: "md:grid-cols-2", 3: "md:grid-cols-3", 4: "md:grid-cols-4", 6: "md:grid-cols-6", 12: "md:grid-cols-12" },
356
+ lg: { 1: "lg:grid-cols-1", 2: "lg:grid-cols-2", 3: "lg:grid-cols-3", 4: "lg:grid-cols-4", 6: "lg:grid-cols-6", 12: "lg:grid-cols-12" },
357
+ xl: { 1: "xl:grid-cols-1", 2: "xl:grid-cols-2", 3: "xl:grid-cols-3", 4: "xl:grid-cols-4", 6: "xl:grid-cols-6", 12: "xl:grid-cols-12" },
358
+ "2xl": { 1: "2xl:grid-cols-1", 2: "2xl:grid-cols-2", 3: "2xl:grid-cols-3", 4: "2xl:grid-cols-4", 6: "2xl:grid-cols-6", 12: "2xl:grid-cols-12" }
359
+ };
360
+ function Pe(r) {
361
+ if (!r) return "grid-cols-1";
362
+ const l = [];
363
+ for (const [t, a] of Object.entries(r)) {
364
+ const n = Te[t];
365
+ if (n && a) {
366
+ const f = Object.keys(n).map(Number).reduce(
367
+ (m, g) => Math.abs(g - a) < Math.abs(m - a) ? g : m
368
+ );
369
+ l.push(n[f]);
370
+ }
371
+ }
372
+ return l.join(" ") || "grid-cols-1";
373
+ }
374
+ const ke = {
375
+ 0: "gap-0",
376
+ 1: "gap-1",
377
+ 2: "gap-2",
378
+ 3: "gap-3",
379
+ 4: "gap-4",
380
+ 5: "gap-5",
381
+ 6: "gap-6",
382
+ 8: "gap-8"
383
+ }, Ae = ({
384
+ columns: r,
385
+ gap: l = 4,
386
+ className: t,
387
+ children: a
388
+ }) => {
389
+ const n = Pe(r), s = typeof l == "number" ? ke[l] || `gap-${l}` : "";
390
+ return /* @__PURE__ */ c.jsx("div", { className: h("grid", n, s, t), children: a });
391
+ }, Ce = (r) => r ? Array.isArray(r) ? r : [r] : [];
392
+ function Ie({ schema: r, className: l, style: t, id: a, ...n }) {
393
+ const s = Ce(r.children);
394
+ return /* @__PURE__ */ c.jsxs(
308
395
  "div",
309
396
  {
310
- id: f || a.id,
311
- className: h("flex flex-col h-full space-y-4", u),
312
- style: c,
397
+ id: a || r.id,
398
+ className: h("flex flex-col h-full space-y-4", l),
399
+ style: t,
313
400
  children: [
314
- /* @__PURE__ */ t.jsx(
315
- A,
401
+ /* @__PURE__ */ c.jsx(
402
+ N,
316
403
  {
317
- title: a.title,
318
- description: a.description
404
+ title: r.title,
405
+ description: r.description
319
406
  }
320
407
  ),
321
- /* @__PURE__ */ t.jsx("div", { className: "flex-1 overflow-auto", children: o.map((d, m) => /* @__PURE__ */ t.jsx(
408
+ /* @__PURE__ */ c.jsx("div", { className: "flex-1 overflow-auto", children: s.map((f, m) => /* @__PURE__ */ c.jsx(
322
409
  be,
323
410
  {
324
- schema: d,
325
- ...s
411
+ schema: f,
412
+ ...n
326
413
  },
327
- d?.id || m
414
+ f?.id || m
328
415
  )) })
329
416
  ]
330
417
  }
331
418
  );
332
419
  }
333
- function Te({ className: a, children: u, ...c }) {
334
- return /* @__PURE__ */ t.jsx("div", { className: h("rounded-xl border bg-card text-card-foreground shadow", a), ...c, children: /* @__PURE__ */ t.jsx("div", { className: "p-6", children: u }) });
335
- }
336
- function Oe({ items: a, title: u = "Application", className: c, collapsible: f = "icon" }) {
337
- const s = xe();
338
- return /* @__PURE__ */ t.jsx(le, { className: c, collapsible: f, children: /* @__PURE__ */ t.jsx(ie, { children: /* @__PURE__ */ t.jsxs(ce, { children: [
339
- /* @__PURE__ */ t.jsx(ue, { children: u }),
340
- /* @__PURE__ */ t.jsx(fe, { children: /* @__PURE__ */ t.jsx(de, { children: a.map((o) => /* @__PURE__ */ t.jsx(me, { children: /* @__PURE__ */ t.jsx(pe, { asChild: !0, isActive: s.pathname === o.href, children: /* @__PURE__ */ t.jsxs(ve, { to: o.href, children: [
341
- o.icon && /* @__PURE__ */ t.jsx(o.icon, {}),
342
- /* @__PURE__ */ t.jsx("span", { children: o.title })
343
- ] }) }) }, o.href)) }) })
420
+ function Ye({ items: r, title: l = "Application", className: t, collapsible: a = "icon" }) {
421
+ const n = ye();
422
+ return /* @__PURE__ */ c.jsx(ie, { className: t, collapsible: a, children: /* @__PURE__ */ c.jsx(ue, { children: /* @__PURE__ */ c.jsxs(de, { children: [
423
+ /* @__PURE__ */ c.jsx(fe, { children: l }),
424
+ /* @__PURE__ */ c.jsx(me, { children: /* @__PURE__ */ c.jsx(pe, { children: r.map((s) => /* @__PURE__ */ c.jsx(ge, { children: /* @__PURE__ */ c.jsx(xe, { asChild: !0, isActive: n.pathname === s.href, children: /* @__PURE__ */ c.jsxs(ve, { to: s.href, children: [
425
+ s.icon && /* @__PURE__ */ c.jsx(s.icon, {}),
426
+ /* @__PURE__ */ c.jsx("span", { children: s.title })
427
+ ] }) }) }, s.href)) }) })
344
428
  ] }) }) });
345
429
  }
346
- function Se() {
347
- b.register("page-header", A, {
430
+ function Ne() {
431
+ b.register("page-header", N, {
432
+ namespace: "layout",
348
433
  label: "Page Header",
349
434
  category: "Layout",
350
435
  inputs: [
351
436
  { name: "title", type: "string" },
352
437
  { name: "description", type: "string" }
353
438
  ]
354
- }), b.register("page:header", A), b.register("page:card", Te, {
439
+ }), b.register("page:header", N, { namespace: "layout" }), b.register("page:card", Se, {
440
+ namespace: "layout",
355
441
  label: "Page Card",
356
442
  category: "Layout",
357
443
  isContainer: !0
358
- }), b.register("app-shell", he, {
444
+ }), b.register("app-shell", je, {
445
+ namespace: "layout",
359
446
  label: "App Shell",
360
447
  category: "Layout"
361
- }), b.register("page", je, {
362
- label: "Standard Page",
448
+ }), b.register("responsive-grid", Ae, {
449
+ namespace: "layout",
450
+ label: "Responsive Grid",
363
451
  category: "Layout",
364
- isContainer: !0
452
+ isContainer: !0,
453
+ inputs: [
454
+ { name: "columns", type: "object" },
455
+ { name: "gap", type: "number" }
456
+ ]
365
457
  });
366
458
  }
367
459
  try {
368
- Se();
460
+ Ne();
369
461
  } catch {
370
462
  }
371
463
  export {
372
- he as AppShell,
373
- je as Page,
374
- Te as PageCard,
375
- A as PageHeader,
376
- Oe as SidebarNav,
377
- Se as registerLayout
464
+ je as AppShell,
465
+ Ie as Page,
466
+ Se as PageCard,
467
+ N as PageHeader,
468
+ Ae as ResponsiveGrid,
469
+ Ye as SidebarNav,
470
+ Ne as registerLayout,
471
+ Re as useAppShellBranding
378
472
  };