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