@object-ui/layout 0.1.1 → 0.5.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.
@@ -0,0 +1,21 @@
1
+
2
+ > @object-ui/layout@0.5.0 build /home/runner/work/objectui/objectui/packages/layout
3
+ > vite build
4
+
5
+ vite v7.3.1 building client environment for production...
6
+ transforming...
7
+ ✓ 15 modules transformed.
8
+ rendering chunks...
9
+ 
10
+ [vite:dts] Start generate declaration files...
11
+ computing gzip size...
12
+ dist/index.js 13.10 kB │ gzip: 4.03 kB
13
+ [vite:dts] Declaration files built in 17748ms.
14
+ 
15
+ No name was provided for external module "@object-ui/core" in "output.globals" – guessing "core".
16
+ No name was provided for external module "react" in "output.globals" – guessing "require$$0".
17
+ No name was provided for external module "@object-ui/components" in "output.globals" – guessing "components".
18
+ No name was provided for external module "@object-ui/react" in "output.globals" – guessing "react".
19
+ No name was provided for external module "react-router-dom" in "output.globals" – guessing "reactRouterDom".
20
+ dist/index.umd.cjs 9.21 kB │ gzip: 3.62 kB
21
+ ✓ built in 18.30s
package/dist/index.js CHANGED
@@ -1,36 +1,36 @@
1
- import { ComponentRegistry as E } from "@object-ui/core";
1
+ import { ComponentRegistry as b } from "@object-ui/core";
2
2
  import ae from "react";
3
- import { cn as W, 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";
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";
4
4
  import { SchemaRenderer as be } from "@object-ui/react";
5
5
  import { useLocation as xe, NavLink as ve } from "react-router-dom";
6
- var h = { exports: {} }, b = {};
7
- var F;
6
+ var g = { exports: {} }, x = {};
7
+ var M;
8
8
  function _e() {
9
- if (F) return b;
10
- F = 1;
11
- var n = /* @__PURE__ */ Symbol.for("react.transitional.element"), u = /* @__PURE__ */ Symbol.for("react.fragment");
12
- function i(c, a, f) {
13
- var m = null;
14
- if (f !== void 0 && (m = "" + f), a.key !== void 0 && (m = "" + a.key), "key" in a) {
15
- f = {};
16
- for (var p in a)
17
- p !== "key" && (f[p] = a[p]);
18
- } else f = a;
19
- return a = f.ref, {
20
- $$typeof: n,
21
- type: c,
22
- key: m,
23
- ref: a !== void 0 ? a : null,
24
- props: f
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
25
25
  };
26
26
  }
27
- return b.Fragment = u, b.jsx = i, b.jsxs = i, b;
27
+ return x.Fragment = u, x.jsx = c, x.jsxs = c, x;
28
28
  }
29
- var x = {};
30
- var M;
29
+ var v = {};
30
+ var D;
31
31
  function Ee() {
32
- return M || (M = 1, process.env.NODE_ENV !== "production" && (function() {
33
- function n(e) {
32
+ return D || (D = 1, process.env.NODE_ENV !== "production" && (function() {
33
+ function a(e) {
34
34
  if (e == null) return null;
35
35
  if (typeof e == "function")
36
36
  return e.$$typeof === ee ? null : e.displayName || e.name || null;
@@ -63,11 +63,11 @@ function Ee() {
63
63
  var r = e.render;
64
64
  return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
65
65
  case Q:
66
- return r = e.displayName || null, r !== null ? r : n(e.type) || "Memo";
67
- case g:
66
+ return r = e.displayName || null, r !== null ? r : a(e.type) || "Memo";
67
+ case j:
68
68
  r = e._payload, e = e._init;
69
69
  try {
70
- return n(e(r));
70
+ return a(e(r));
71
71
  } catch {
72
72
  }
73
73
  }
@@ -76,7 +76,7 @@ function Ee() {
76
76
  function u(e) {
77
77
  return "" + e;
78
78
  }
79
- function i(e) {
79
+ function c(e) {
80
80
  try {
81
81
  u(e);
82
82
  var r = !1;
@@ -85,66 +85,66 @@ function Ee() {
85
85
  }
86
86
  if (r) {
87
87
  r = console;
88
- var o = r.error, s = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
89
- return o.call(
88
+ var n = r.error, l = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
89
+ return n.call(
90
90
  r,
91
91
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
92
- s
92
+ l
93
93
  ), u(e);
94
94
  }
95
95
  }
96
- function c(e) {
96
+ function f(e) {
97
97
  if (e === R) return "<>";
98
- if (typeof e == "object" && e !== null && e.$$typeof === g)
98
+ if (typeof e == "object" && e !== null && e.$$typeof === j)
99
99
  return "<...>";
100
100
  try {
101
- var r = n(e);
101
+ var r = a(e);
102
102
  return r ? "<" + r + ">" : "<...>";
103
103
  } catch {
104
104
  return "<...>";
105
105
  }
106
106
  }
107
- function a() {
108
- var e = j.A;
107
+ function s() {
108
+ var e = T.A;
109
109
  return e === null ? null : e.getOwner();
110
110
  }
111
- function f() {
111
+ function o() {
112
112
  return Error("react-stack-top-frame");
113
113
  }
114
- function m(e) {
115
- if (w.call(e, "key")) {
114
+ function d(e) {
115
+ if (C.call(e, "key")) {
116
116
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
117
117
  if (r && r.isReactWarning) return !1;
118
118
  }
119
119
  return e.key !== void 0;
120
120
  }
121
- function p(e, r) {
122
- function o() {
123
- C || (C = !0, console.error(
121
+ function m(e, r) {
122
+ function n() {
123
+ Y || (Y = !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
125
  r
126
126
  ));
127
127
  }
128
- o.isReactWarning = !0, Object.defineProperty(e, "key", {
129
- get: o,
128
+ n.isReactWarning = !0, Object.defineProperty(e, "key", {
129
+ get: n,
130
130
  configurable: !0
131
131
  });
132
132
  }
133
133
  function U() {
134
- var e = n(this.type);
135
- return Y[e] || (Y[e] = !0, console.error(
134
+ var e = a(this.type);
135
+ return L[e] || (L[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, o, s, _, S) {
140
- var l = o.ref;
139
+ function G(e, r, n, l, E, y) {
140
+ var i = n.ref;
141
141
  return e = {
142
- $$typeof: O,
142
+ $$typeof: w,
143
143
  type: e,
144
144
  key: r,
145
- props: o,
146
- _owner: s
147
- }, (l !== void 0 ? l : null) !== null ? Object.defineProperty(e, "ref", {
145
+ props: n,
146
+ _owner: l
147
+ }, (i !== void 0 ? i : null) !== null ? Object.defineProperty(e, "ref", {
148
148
  enumerable: !1,
149
149
  get: U
150
150
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
@@ -161,202 +161,218 @@ function Ee() {
161
161
  configurable: !1,
162
162
  enumerable: !1,
163
163
  writable: !0,
164
- value: _
164
+ value: E
165
165
  }), Object.defineProperty(e, "_debugTask", {
166
166
  configurable: !1,
167
167
  enumerable: !1,
168
168
  writable: !0,
169
- value: S
169
+ value: y
170
170
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
171
171
  }
172
- function A(e, r, o, s, _, S) {
173
- var l = r.children;
174
- if (l !== void 0)
175
- if (s)
176
- if (re(l)) {
177
- for (s = 0; s < l.length; s++)
178
- N(l[s]);
179
- Object.freeze && Object.freeze(l);
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);
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 N(l);
185
- if (w.call(r, "key")) {
186
- l = n(e);
187
- var d = Object.keys(r).filter(function(te) {
184
+ else P(i);
185
+ if (C.call(r, "key")) {
186
+ i = a(e);
187
+ var p = Object.keys(r).filter(function(te) {
188
188
  return te !== "key";
189
189
  });
190
- s = 0 < d.length ? "{key: someKey, " + d.join(": ..., ") + ": ...}" : "{key: someKey}", $[l + s] || (d = 0 < d.length ? "{" + d.join(": ..., ") + ": ...}" : "{}", console.error(
190
+ l = 0 < p.length ? "{key: someKey, " + p.join(": ..., ") + ": ...}" : "{key: someKey}", F[i + l] || (p = 0 < p.length ? "{" + p.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
- s,
198
197
  l,
199
- d,
200
- l
201
- ), $[l + s] = !0);
198
+ i,
199
+ p,
200
+ i
201
+ ), F[i + l] = !0);
202
202
  }
203
- if (l = null, o !== void 0 && (i(o), l = "" + o), m(r) && (i(r.key), l = "" + r.key), "key" in r) {
204
- o = {};
205
- for (var y in r)
206
- y !== "key" && (o[y] = r[y]);
207
- } else o = r;
208
- return l && p(
209
- o,
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,
210
210
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
211
211
  ), G(
212
212
  e,
213
- l,
214
- o,
215
- a(),
216
- _,
217
- S
213
+ i,
214
+ n,
215
+ s(),
216
+ E,
217
+ y
218
218
  );
219
219
  }
220
- function N(e) {
221
- P(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === g && (e._payload.status === "fulfilled" ? P(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
222
- }
223
220
  function P(e) {
224
- return typeof e == "object" && e !== null && e.$$typeof === O;
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));
225
222
  }
226
- var v = ae, O = /* @__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"), g = /* @__PURE__ */ Symbol.for("react.lazy"), K = /* @__PURE__ */ Symbol.for("react.activity"), ee = /* @__PURE__ */ Symbol.for("react.client.reference"), j = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, w = Object.prototype.hasOwnProperty, re = Array.isArray, T = console.createTask ? console.createTask : function() {
223
+ function O(e) {
224
+ return typeof e == "object" && e !== null && e.$$typeof === w;
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() {
227
227
  return null;
228
228
  };
229
- v = {
229
+ _ = {
230
230
  react_stack_bottom_frame: function(e) {
231
231
  return e();
232
232
  }
233
233
  };
234
- var C, Y = {}, L = v.react_stack_bottom_frame.bind(
235
- v,
236
- f
237
- )(), I = T(c(f)), $ = {};
238
- x.Fragment = R, x.jsx = function(e, r, o) {
239
- var s = 1e4 > j.recentlyCreatedOwnerStacks++;
240
- return A(
234
+ var Y, L = {}, I = _.react_stack_bottom_frame.bind(
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(
241
241
  e,
242
242
  r,
243
- o,
243
+ n,
244
244
  !1,
245
- s ? Error("react-stack-top-frame") : L,
246
- s ? T(c(e)) : I
245
+ l ? Error("react-stack-top-frame") : I,
246
+ l ? S(f(e)) : $
247
247
  );
248
- }, x.jsxs = function(e, r, o) {
249
- var s = 1e4 > j.recentlyCreatedOwnerStacks++;
250
- return A(
248
+ }, v.jsxs = function(e, r, n) {
249
+ var l = 1e4 > T.recentlyCreatedOwnerStacks++;
250
+ return N(
251
251
  e,
252
252
  r,
253
- o,
253
+ n,
254
254
  !0,
255
- s ? Error("react-stack-top-frame") : L,
256
- s ? T(c(e)) : I
255
+ l ? Error("react-stack-top-frame") : I,
256
+ l ? S(f(e)) : $
257
257
  );
258
258
  };
259
- })()), x;
259
+ })()), v;
260
260
  }
261
- var D;
262
- function he() {
263
- return D || (D = 1, process.env.NODE_ENV === "production" ? h.exports = _e() : h.exports = Ee()), h.exports;
261
+ var W;
262
+ function ge() {
263
+ return W || (W = 1, process.env.NODE_ENV === "production" ? g.exports = _e() : g.exports = Ee()), g.exports;
264
264
  }
265
- var t = he();
266
- function k({
267
- title: n,
265
+ var t = ge();
266
+ function A({
267
+ title: a,
268
268
  description: u,
269
- action: i,
270
- className: c,
271
- children: a,
272
- ...f
269
+ action: c,
270
+ className: f,
271
+ children: s,
272
+ ...o
273
273
  }) {
274
- return /* @__PURE__ */ t.jsx("div", { className: W("flex flex-col gap-4 pb-4 md:pb-8", c), ...f, children: /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between gap-4", children: [
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
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: n }),
276
+ /* @__PURE__ */ t.jsx("h1", { className: "text-2xl font-bold tracking-tight md:text-3xl", children: a }),
277
277
  u && /* @__PURE__ */ t.jsx("p", { className: "text-sm text-muted-foreground", children: u })
278
278
  ] }),
279
- (i || a) && /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
280
- i,
281
- a
279
+ (c || s) && /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
280
+ c,
281
+ s
282
282
  ] })
283
283
  ] }) });
284
284
  }
285
- function Re({
286
- sidebar: n,
285
+ function he({
286
+ sidebar: a,
287
287
  navbar: u,
288
- children: i,
289
- className: c,
290
- defaultOpen: a = !0
288
+ children: c,
289
+ className: f,
290
+ defaultOpen: s = !0
291
291
  }) {
292
- return /* @__PURE__ */ t.jsxs(ne, { defaultOpen: a, children: [
293
- n,
292
+ return /* @__PURE__ */ t.jsxs(ne, { defaultOpen: s, children: [
293
+ a,
294
294
  /* @__PURE__ */ t.jsxs(oe, { children: [
295
295
  /* @__PURE__ */ t.jsxs("header", { className: "flex h-16 shrink-0 items-center gap-2 border-b bg-background px-4", children: [
296
296
  /* @__PURE__ */ t.jsx(se, { className: "-ml-1" }),
297
297
  /* @__PURE__ */ t.jsx("div", { className: "w-px h-4 bg-border mx-2" }),
298
298
  u
299
299
  ] }),
300
- /* @__PURE__ */ t.jsx("main", { className: W("flex-1 overflow-auto p-4 md:p-6", c), children: i })
300
+ /* @__PURE__ */ t.jsx("main", { className: h("flex-1 overflow-auto p-4 md:p-6", f), children: c })
301
301
  ] })
302
302
  ] });
303
303
  }
304
- const ge = (n) => n ? Array.isArray(n) ? n : [n] : [];
305
- function je({ schema: n, ...u }) {
306
- const i = ge(n.children);
307
- return /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col h-full space-y-4", children: [
308
- /* @__PURE__ */ t.jsx(
309
- k,
310
- {
311
- title: n.title,
312
- description: n.description
313
- }
314
- ),
315
- /* @__PURE__ */ t.jsx("div", { className: "flex-1 overflow-auto", children: i.map((c, a) => /* @__PURE__ */ t.jsx(
316
- be,
317
- {
318
- schema: c,
319
- ...u
320
- },
321
- c?.id || a
322
- )) })
323
- ] });
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(
308
+ "div",
309
+ {
310
+ id: f || a.id,
311
+ className: h("flex flex-col h-full space-y-4", u),
312
+ style: c,
313
+ children: [
314
+ /* @__PURE__ */ t.jsx(
315
+ A,
316
+ {
317
+ title: a.title,
318
+ description: a.description
319
+ }
320
+ ),
321
+ /* @__PURE__ */ t.jsx("div", { className: "flex-1 overflow-auto", children: o.map((d, m) => /* @__PURE__ */ t.jsx(
322
+ be,
323
+ {
324
+ schema: d,
325
+ ...s
326
+ },
327
+ d?.id || m
328
+ )) })
329
+ ]
330
+ }
331
+ );
332
+ }
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 }) });
324
335
  }
325
- function Pe({ items: n, title: u = "Application", className: i }) {
326
- const c = xe();
327
- return /* @__PURE__ */ t.jsx(le, { className: i, children: /* @__PURE__ */ t.jsx(ie, { children: /* @__PURE__ */ t.jsxs(ce, { children: [
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: [
328
339
  /* @__PURE__ */ t.jsx(ue, { children: u }),
329
- /* @__PURE__ */ t.jsx(fe, { children: /* @__PURE__ */ t.jsx(de, { children: n.map((a) => /* @__PURE__ */ t.jsx(me, { children: /* @__PURE__ */ t.jsx(pe, { asChild: !0, isActive: c.pathname === a.href, children: /* @__PURE__ */ t.jsxs(ve, { to: a.href, children: [
330
- a.icon && /* @__PURE__ */ t.jsx(a.icon, {}),
331
- /* @__PURE__ */ t.jsx("span", { children: a.title })
332
- ] }) }) }, a.href)) }) })
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)) }) })
333
344
  ] }) }) });
334
345
  }
335
- function Te() {
336
- E.register("page-header", k, {
346
+ function Se() {
347
+ b.register("page-header", A, {
337
348
  label: "Page Header",
338
349
  category: "Layout",
339
350
  inputs: [
340
351
  { name: "title", type: "string" },
341
352
  { name: "description", type: "string" }
342
353
  ]
343
- }), E.register("page:header", k), E.register("app-shell", Re, {
354
+ }), b.register("page:header", A), b.register("page:card", Te, {
355
+ label: "Page Card",
356
+ category: "Layout",
357
+ isContainer: !0
358
+ }), b.register("app-shell", he, {
344
359
  label: "App Shell",
345
360
  category: "Layout"
346
- }), E.register("page", je, {
361
+ }), b.register("page", je, {
347
362
  label: "Standard Page",
348
363
  category: "Layout",
349
364
  isContainer: !0
350
365
  });
351
366
  }
352
367
  try {
353
- Te();
368
+ Se();
354
369
  } catch {
355
370
  }
356
371
  export {
357
- Re as AppShell,
372
+ he as AppShell,
358
373
  je as Page,
359
- k as PageHeader,
360
- Pe as SidebarNav,
361
- Te as registerLayout
374
+ Te as PageCard,
375
+ A as PageHeader,
376
+ Oe as SidebarNav,
377
+ Se as registerLayout
362
378
  };
@@ -1,6 +1,6 @@
1
- (function(l,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("@object-ui/core"),require("react"),require("@object-ui/components"),require("@object-ui/react"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","@object-ui/core","react","@object-ui/components","@object-ui/react","react-router-dom"],b):(l=typeof globalThis<"u"?globalThis:l||self,b(l.ObjectUILayout={},l.core,l.require$$0,l.components,l.react,l.reactRouterDom))})(this,(function(l,b,z,f,H,N){"use strict";var h={exports:{}},x={};var O;function X(){if(O)return x;O=1;var n=Symbol.for("react.transitional.element"),d=Symbol.for("react.fragment");function u(c,a,m){var _=null;if(m!==void 0&&(_=""+m),a.key!==void 0&&(_=""+a.key),"key"in a){m={};for(var E in a)E!=="key"&&(m[E]=a[E])}else m=a;return a=m.ref,{$$typeof:n,type:c,key:_,ref:a!==void 0?a:null,props:m}}return x.Fragment=d,x.jsx=u,x.jsxs=u,x}var v={};var w;function B(){return w||(w=1,process.env.NODE_ENV!=="production"&&(function(){function n(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===de?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case ne:return"Profiler";case ae:return"StrictMode";case le:return"Suspense";case ue:return"SuspenseList";case fe:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case te:return"Portal";case se:return e.displayName||"Context";case oe:return(e._context.displayName||"Context")+".Consumer";case ie:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ce:return r=e.displayName||null,r!==null?r:n(e.type)||"Memo";case y:r=e._payload,e=e._init;try{return n(e(r))}catch{}}return null}function d(e){return""+e}function u(e){try{d(e);var r=!1}catch{r=!0}if(r){r=console;var o=r.error,s=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return o.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",s),d(e)}}function c(e){if(e===T)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===y)return"<...>";try{var r=n(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function a(){var e=S.A;return e===null?null:e.getOwner()}function m(){return Error("react-stack-top-frame")}function _(e){if(D.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function E(e,r){function o(){U||(U=!0,console.error("%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)",r))}o.isReactWarning=!0,Object.defineProperty(e,"key",{get:o,configurable:!0})}function ee(){var e=n(this.type);return W[e]||(W[e]=!0,console.error("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.")),e=this.props.ref,e!==void 0?e:null}function re(e,r,o,s,g,A){var i=o.ref;return e={$$typeof:q,type:e,key:r,props:o,_owner:s},(i!==void 0?i:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:ee}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:g}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:A}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function $(e,r,o,s,g,A){var i=r.children;if(i!==void 0)if(s)if(me(i)){for(s=0;s<i.length;s++)M(i[s]);Object.freeze&&Object.freeze(i)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else M(i);if(D.call(r,"key")){i=n(e);var p=Object.keys(r).filter(function(be){return be!=="key"});s=0<p.length?"{key: someKey, "+p.join(": ..., ")+": ...}":"{key: someKey}",V[i+s]||(p=0<p.length?"{"+p.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ (function(u,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("@object-ui/core"),require("react"),require("@object-ui/components"),require("@object-ui/react"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","@object-ui/core","react","@object-ui/components","@object-ui/react","react-router-dom"],b):(u=typeof globalThis<"u"?globalThis:u||self,b(u.ObjectUILayout={},u.core,u.require$$0,u.components,u.react,u.reactRouterDom))})(this,(function(u,b,H,f,X,N){"use strict";var E={exports:{}},g={};var O;function B(){if(O)return g;O=1;var a=Symbol.for("react.transitional.element"),d=Symbol.for("react.fragment");function c(m,s,o){var p=null;if(o!==void 0&&(p=""+o),s.key!==void 0&&(p=""+s.key),"key"in s){o={};for(var x in s)x!=="key"&&(o[x]=s[x])}else o=s;return s=o.ref,{$$typeof:a,type:m,key:p,ref:s!==void 0?s:null,props:o}}return g.Fragment=d,g.jsx=c,g.jsxs=c,g}var _={};var w;function Z(){return w||(w=1,process.env.NODE_ENV!=="production"&&(function(){function a(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===me?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case y:return"Fragment";case oe:return"Profiler";case ne:return"StrictMode";case ue:return"Suspense";case ce:return"SuspenseList";case de:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case ae:return"Portal";case ie:return e.displayName||"Context";case se:return(e._context.displayName||"Context")+".Consumer";case le:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case fe:return r=e.displayName||null,r!==null?r:a(e.type)||"Memo";case T:r=e._payload,e=e._init;try{return a(e(r))}catch{}}return null}function d(e){return""+e}function c(e){try{d(e);var r=!1}catch{r=!0}if(r){r=console;var n=r.error,i=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",i),d(e)}}function m(e){if(e===y)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===T)return"<...>";try{var r=a(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function s(){var e=S.A;return e===null?null:e.getOwner()}function o(){return Error("react-stack-top-frame")}function p(e){if(U.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function x(e,r){function n(){W||(W=!0,console.error("%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)",r))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function re(){var e=a(this.type);return G[e]||(G[e]=!0,console.error("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.")),e=this.props.ref,e!==void 0?e:null}function te(e,r,n,i,R,P){var l=n.ref;return e={$$typeof:D,type:e,key:r,props:n,_owner:i},(l!==void 0?l:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:re}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:R}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:P}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function M(e,r,n,i,R,P){var l=r.children;if(l!==void 0)if(i)if(be(l)){for(i=0;i<l.length;i++)F(l[i]);Object.freeze&&Object.freeze(l)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else F(l);if(U.call(r,"key")){l=a(e);var v=Object.keys(r).filter(function(pe){return pe!=="key"});i=0<v.length?"{key: someKey, "+v.join(": ..., ")+": ...}":"{key: someKey}",z[l+i]||(v=0<v.length?"{"+v.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,s,i,p,i),V[i+s]=!0)}if(i=null,o!==void 0&&(u(o),i=""+o),_(r)&&(u(r.key),i=""+r.key),"key"in r){o={};for(var P in r)P!=="key"&&(o[P]=r[P])}else o=r;return i&&E(o,typeof e=="function"?e.displayName||e.name||"Unknown":e),re(e,i,o,a(),g,A)}function M(e){F(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===y&&(e._payload.status==="fulfilled"?F(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function F(e){return typeof e=="object"&&e!==null&&e.$$typeof===q}var j=z,q=Symbol.for("react.transitional.element"),te=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),ae=Symbol.for("react.strict_mode"),ne=Symbol.for("react.profiler"),oe=Symbol.for("react.consumer"),se=Symbol.for("react.context"),ie=Symbol.for("react.forward_ref"),le=Symbol.for("react.suspense"),ue=Symbol.for("react.suspense_list"),ce=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),fe=Symbol.for("react.activity"),de=Symbol.for("react.client.reference"),S=j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=Object.prototype.hasOwnProperty,me=Array.isArray,k=console.createTask?console.createTask:function(){return null};j={react_stack_bottom_frame:function(e){return e()}};var U,W={},G=j.react_stack_bottom_frame.bind(j,m)(),J=k(c(m)),V={};v.Fragment=T,v.jsx=function(e,r,o){var s=1e4>S.recentlyCreatedOwnerStacks++;return $(e,r,o,!1,s?Error("react-stack-top-frame"):G,s?k(c(e)):J)},v.jsxs=function(e,r,o){var s=1e4>S.recentlyCreatedOwnerStacks++;return $(e,r,o,!0,s?Error("react-stack-top-frame"):G,s?k(c(e)):J)}})()),v}var C;function Z(){return C||(C=1,process.env.NODE_ENV==="production"?h.exports=X():h.exports=B()),h.exports}var t=Z();function R({title:n,description:d,action:u,className:c,children:a,...m}){return t.jsx("div",{className:f.cn("flex flex-col gap-4 pb-4 md:pb-8",c),...m,children:t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("h1",{className:"text-2xl font-bold tracking-tight md:text-3xl",children:n}),d&&t.jsx("p",{className:"text-sm text-muted-foreground",children:d})]}),(u||a)&&t.jsxs("div",{className:"flex items-center gap-2",children:[u,a]})]})})}function L({sidebar:n,navbar:d,children:u,className:c,defaultOpen:a=!0}){return t.jsxs(f.SidebarProvider,{defaultOpen:a,children:[n,t.jsxs(f.SidebarInset,{children:[t.jsxs("header",{className:"flex h-16 shrink-0 items-center gap-2 border-b bg-background px-4",children:[t.jsx(f.SidebarTrigger,{className:"-ml-1"}),t.jsx("div",{className:"w-px h-4 bg-border mx-2"}),d]}),t.jsx("main",{className:f.cn("flex-1 overflow-auto p-4 md:p-6",c),children:u})]})]})}const Q=n=>n?Array.isArray(n)?n:[n]:[];function Y({schema:n,...d}){const u=Q(n.children);return t.jsxs("div",{className:"flex flex-col h-full space-y-4",children:[t.jsx(R,{title:n.title,description:n.description}),t.jsx("div",{className:"flex-1 overflow-auto",children:u.map((c,a)=>t.jsx(H.SchemaRenderer,{schema:c,...d},c?.id||a))})]})}function K({items:n,title:d="Application",className:u}){const c=N.useLocation();return t.jsx(f.Sidebar,{className:u,children:t.jsx(f.SidebarContent,{children:t.jsxs(f.SidebarGroup,{children:[t.jsx(f.SidebarGroupLabel,{children:d}),t.jsx(f.SidebarGroupContent,{children:t.jsx(f.SidebarMenu,{children:n.map(a=>t.jsx(f.SidebarMenuItem,{children:t.jsx(f.SidebarMenuButton,{asChild:!0,isActive:c.pathname===a.href,children:t.jsxs(N.NavLink,{to:a.href,children:[a.icon&&t.jsx(a.icon,{}),t.jsx("span",{children:a.title})]})})},a.href))})})]})})})}function I(){b.ComponentRegistry.register("page-header",R,{label:"Page Header",category:"Layout",inputs:[{name:"title",type:"string"},{name:"description",type:"string"}]}),b.ComponentRegistry.register("page:header",R),b.ComponentRegistry.register("app-shell",L,{label:"App Shell",category:"Layout"}),b.ComponentRegistry.register("page",Y,{label:"Standard Page",category:"Layout",isContainer:!0})}try{I()}catch{}l.AppShell=L,l.Page=Y,l.PageHeader=R,l.SidebarNav=K,l.registerLayout=I,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
6
+ <%s key={someKey} {...props} />`,i,l,v,l),z[l+i]=!0)}if(l=null,n!==void 0&&(c(n),l=""+n),p(r)&&(c(r.key),l=""+r.key),"key"in r){n={};for(var A in r)A!=="key"&&(n[A]=r[A])}else n=r;return l&&x(n,typeof e=="function"?e.displayName||e.name||"Unknown":e),te(e,l,n,s(),R,P)}function F(e){q(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===T&&(e._payload.status==="fulfilled"?q(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function q(e){return typeof e=="object"&&e!==null&&e.$$typeof===D}var j=H,D=Symbol.for("react.transitional.element"),ae=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),ne=Symbol.for("react.strict_mode"),oe=Symbol.for("react.profiler"),se=Symbol.for("react.consumer"),ie=Symbol.for("react.context"),le=Symbol.for("react.forward_ref"),ue=Symbol.for("react.suspense"),ce=Symbol.for("react.suspense_list"),fe=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),de=Symbol.for("react.activity"),me=Symbol.for("react.client.reference"),S=j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=Object.prototype.hasOwnProperty,be=Array.isArray,k=console.createTask?console.createTask:function(){return null};j={react_stack_bottom_frame:function(e){return e()}};var W,G={},J=j.react_stack_bottom_frame.bind(j,o)(),V=k(m(o)),z={};_.Fragment=y,_.jsx=function(e,r,n){var i=1e4>S.recentlyCreatedOwnerStacks++;return M(e,r,n,!1,i?Error("react-stack-top-frame"):J,i?k(m(e)):V)},_.jsxs=function(e,r,n){var i=1e4>S.recentlyCreatedOwnerStacks++;return M(e,r,n,!0,i?Error("react-stack-top-frame"):J,i?k(m(e)):V)}})()),_}var C;function Q(){return C||(C=1,process.env.NODE_ENV==="production"?E.exports=B():E.exports=Z()),E.exports}var t=Q();function h({title:a,description:d,action:c,className:m,children:s,...o}){return t.jsx("div",{className:f.cn("flex flex-col gap-4 pb-4 md:pb-8",m),...o,children:t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("h1",{className:"text-2xl font-bold tracking-tight md:text-3xl",children:a}),d&&t.jsx("p",{className:"text-sm text-muted-foreground",children:d})]}),(c||s)&&t.jsxs("div",{className:"flex items-center gap-2",children:[c,s]})]})})}function L({sidebar:a,navbar:d,children:c,className:m,defaultOpen:s=!0}){return t.jsxs(f.SidebarProvider,{defaultOpen:s,children:[a,t.jsxs(f.SidebarInset,{children:[t.jsxs("header",{className:"flex h-16 shrink-0 items-center gap-2 border-b bg-background px-4",children:[t.jsx(f.SidebarTrigger,{className:"-ml-1"}),t.jsx("div",{className:"w-px h-4 bg-border mx-2"}),d]}),t.jsx("main",{className:f.cn("flex-1 overflow-auto p-4 md:p-6",m),children:c})]})]})}const K=a=>a?Array.isArray(a)?a:[a]:[];function Y({schema:a,className:d,style:c,id:m,...s}){const o=K(a.children);return t.jsxs("div",{id:m||a.id,className:f.cn("flex flex-col h-full space-y-4",d),style:c,children:[t.jsx(h,{title:a.title,description:a.description}),t.jsx("div",{className:"flex-1 overflow-auto",children:o.map((p,x)=>t.jsx(X.SchemaRenderer,{schema:p,...s},p?.id||x))})]})}function I({className:a,children:d,...c}){return t.jsx("div",{className:f.cn("rounded-xl border bg-card text-card-foreground shadow",a),...c,children:t.jsx("div",{className:"p-6",children:d})})}function ee({items:a,title:d="Application",className:c,collapsible:m="icon"}){const s=N.useLocation();return t.jsx(f.Sidebar,{className:c,collapsible:m,children:t.jsx(f.SidebarContent,{children:t.jsxs(f.SidebarGroup,{children:[t.jsx(f.SidebarGroupLabel,{children:d}),t.jsx(f.SidebarGroupContent,{children:t.jsx(f.SidebarMenu,{children:a.map(o=>t.jsx(f.SidebarMenuItem,{children:t.jsx(f.SidebarMenuButton,{asChild:!0,isActive:s.pathname===o.href,children:t.jsxs(N.NavLink,{to:o.href,children:[o.icon&&t.jsx(o.icon,{}),t.jsx("span",{children:o.title})]})})},o.href))})})]})})})}function $(){b.ComponentRegistry.register("page-header",h,{label:"Page Header",category:"Layout",inputs:[{name:"title",type:"string"},{name:"description",type:"string"}]}),b.ComponentRegistry.register("page:header",h),b.ComponentRegistry.register("page:card",I,{label:"Page Card",category:"Layout",isContainer:!0}),b.ComponentRegistry.register("app-shell",L,{label:"App Shell",category:"Layout"}),b.ComponentRegistry.register("page",Y,{label:"Standard Page",category:"Layout",isContainer:!0})}try{$()}catch{}u.AppShell=L,u.Page=Y,u.PageCard=I,u.PageHeader=h,u.SidebarNav=ee,u.registerLayout=$,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})}));
@@ -1,4 +1,8 @@
1
+ import { default as React } from 'react';
1
2
  import { PageSchema } from '../../types/src';
2
- export declare function Page({ schema, ...props }: {
3
+ export declare function Page({ schema, className, style, id, ...props }: {
3
4
  schema: PageSchema;
5
+ className?: string;
6
+ style?: React.CSSProperties;
7
+ id?: string;
4
8
  } & any): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare function PageCard({ className, children, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
@@ -10,5 +10,6 @@ export interface SidebarNavProps {
10
10
  items: NavItem[];
11
11
  title?: string;
12
12
  className?: string;
13
+ collapsible?: "offcanvas" | "icon" | "none";
13
14
  }
14
- export declare function SidebarNav({ items, title, className }: SidebarNavProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function SidebarNav({ items, title, className, collapsible }: SidebarNavProps): import("react/jsx-runtime").JSX.Element;
@@ -5,5 +5,6 @@
5
5
  export * from './PageHeader';
6
6
  export * from './AppShell';
7
7
  export * from './Page';
8
+ export * from './PageCard';
8
9
  export * from './SidebarNav';
9
10
  export declare function registerLayout(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@object-ui/layout",
3
- "version": "0.1.1",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.umd.cjs",
6
6
  "module": "dist/index.js",
@@ -15,13 +15,13 @@
15
15
  "dependencies": {
16
16
  "clsx": "^2.1.0",
17
17
  "lucide-react": "^0.563.0",
18
- "react": "^18.2.0",
19
- "react-dom": "^18.2.0",
18
+ "react": "^19.2.4",
19
+ "react-dom": "^19.2.4",
20
20
  "tailwind-merge": "^2.2.1",
21
- "@object-ui/components": "0.3.1",
22
- "@object-ui/core": "0.3.1",
23
- "@object-ui/react": "0.3.1",
24
- "@object-ui/types": "0.3.1"
21
+ "@object-ui/components": "0.5.0",
22
+ "@object-ui/core": "0.5.0",
23
+ "@object-ui/react": "0.5.0",
24
+ "@object-ui/types": "0.5.0"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "react": "^18.0.0 || ^19.0.0",
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "devDependencies": {
32
32
  "react-router-dom": "^7.13.0",
33
- "@vitejs/plugin-react": "^4.2.1",
33
+ "@vitejs/plugin-react": "^5.1.3",
34
34
  "vite": "^7.3.1",
35
35
  "vite-plugin-dts": "^4.5.4"
36
36
  },
package/src/Page.tsx CHANGED
@@ -3,6 +3,7 @@ import React from 'react';
3
3
  import { SchemaRenderer } from '@object-ui/react';
4
4
  import { PageSchema, SchemaNode } from '@object-ui/types';
5
5
  import { PageHeader } from './PageHeader';
6
+ import { cn } from '@object-ui/components';
6
7
 
7
8
  // Helper to ensure children is always an array
8
9
  const getChildren = (children?: SchemaNode[] | SchemaNode): SchemaNode[] => {
@@ -11,11 +12,15 @@ const getChildren = (children?: SchemaNode[] | SchemaNode): SchemaNode[] => {
11
12
  return [children];
12
13
  };
13
14
 
14
- export function Page({ schema, ...props }: { schema: PageSchema } & any) {
15
+ export function Page({ schema, className, style, id, ...props }: { schema: PageSchema; className?: string; style?: React.CSSProperties; id?: string } & any) {
15
16
  const children = getChildren(schema.children);
16
17
 
17
18
  return (
18
- <div className="flex flex-col h-full space-y-4">
19
+ <div
20
+ id={id || schema.id}
21
+ className={cn("flex flex-col h-full space-y-4", className)}
22
+ style={style}
23
+ >
19
24
  <PageHeader
20
25
  title={schema.title}
21
26
  description={schema.description}
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { cn } from '@object-ui/components';
3
+
4
+ export function PageCard({ className, children, ...props }: React.HTMLAttributes<HTMLDivElement>) {
5
+ return (
6
+ <div className={cn("rounded-xl border bg-card text-card-foreground shadow", className)} {...props}>
7
+ <div className="p-6">
8
+ {children}
9
+ </div>
10
+ </div>
11
+ );
12
+ }
@@ -21,13 +21,14 @@ export interface SidebarNavProps {
21
21
  items: NavItem[];
22
22
  title?: string;
23
23
  className?: string;
24
+ collapsible?: "offcanvas" | "icon" | "none";
24
25
  }
25
26
 
26
- export function SidebarNav({ items, title = "Application", className }: SidebarNavProps) {
27
+ export function SidebarNav({ items, title = "Application", className, collapsible = "icon" }: SidebarNavProps) {
27
28
  const location = useLocation();
28
29
 
29
30
  return (
30
- <Sidebar className={className}>
31
+ <Sidebar className={className} collapsible={collapsible}>
31
32
  <SidebarContent>
32
33
  <SidebarGroup>
33
34
  <SidebarGroupLabel>{title}</SidebarGroupLabel>
package/src/index.ts CHANGED
@@ -7,11 +7,13 @@ import { ComponentRegistry } from '@object-ui/core';
7
7
  import { PageHeader } from './PageHeader';
8
8
  import { AppShell } from './AppShell';
9
9
  import { Page } from './Page';
10
+ import { PageCard } from './PageCard';
10
11
  import { SidebarNav } from './SidebarNav';
11
12
 
12
13
  export * from './PageHeader';
13
14
  export * from './AppShell';
14
15
  export * from './Page';
16
+ export * from './PageCard';
15
17
  export * from './SidebarNav';
16
18
 
17
19
  export function registerLayout() {
@@ -27,6 +29,13 @@ export function registerLayout() {
27
29
  // Alias for protocol compliance
28
30
  ComponentRegistry.register('page:header', PageHeader);
29
31
 
32
+ // Page Card
33
+ ComponentRegistry.register('page:card', PageCard, {
34
+ label: 'Page Card',
35
+ category: 'Layout',
36
+ isContainer: true
37
+ });
38
+
30
39
  ComponentRegistry.register('app-shell', AppShell, {
31
40
  label: 'App Shell',
32
41
  category: 'Layout',
package/vite.config.ts CHANGED
@@ -32,4 +32,7 @@ export default defineConfig({
32
32
  ],
33
33
  },
34
34
  },
35
+ test: {
36
+ passWithNoTests: true,
37
+ },
35
38
  });