@object-ui/layout 0.5.0 → 2.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @object-ui/layout@0.5.0 build /home/runner/work/objectui/objectui/packages/layout
2
+ > @object-ui/layout@2.0.0 build /home/runner/work/objectui/objectui/packages/layout
3
3
  > vite build
4
4
 
5
5
  vite v7.3.1 building client environment for production...
@@ -9,13 +9,13 @@ rendering chunks...
9
9
  
10
10
  [vite:dts] Start generate declaration files...
11
11
  computing gzip size...
12
- dist/index.js 13.10 kB │ gzip: 4.03 kB
13
- [vite:dts] Declaration files built in 17748ms.
12
+ dist/index.js 14.99 kB │ gzip: 4.61 kB
13
+ [vite:dts] Declaration files built in 21839ms.
14
14
  
15
15
  No name was provided for external module "@object-ui/core" in "output.globals" – guessing "core".
16
16
  No name was provided for external module "react" in "output.globals" – guessing "require$$0".
17
17
  No name was provided for external module "@object-ui/components" in "output.globals" – guessing "components".
18
18
  No name was provided for external module "@object-ui/react" in "output.globals" – guessing "react".
19
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
20
+ dist/index.umd.cjs 10.67 kB │ gzip: 4.12 kB
21
+ ✓ built in 23.26s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @object-ui/layout
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - b859617: Release v1.0.0 — unify all package versions to 1.0.0
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [b859617]
12
+ - @object-ui/types@2.0.0
13
+ - @object-ui/core@2.0.0
14
+ - @object-ui/react@2.0.0
15
+ - @object-ui/components@2.0.0
16
+
3
17
  ## 0.1.1
4
18
 
5
19
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1,152 +1,152 @@
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";
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) {
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
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,
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, {
20
+ $$typeof: r,
21
+ type: o,
22
22
  key: d,
23
- ref: s !== void 0 ? s : null,
24
- props: o
23
+ ref: l !== void 0 ? l : null,
24
+ props: n
25
25
  };
26
26
  }
27
- return x.Fragment = u, x.jsx = c, x.jsxs = c, x;
27
+ return x.Fragment = c, x.jsx = a, x.jsxs = a, x;
28
28
  }
29
- var v = {};
30
- var D;
31
- function Ee() {
32
- return D || (D = 1, process.env.NODE_ENV !== "production" && (function() {
33
- function a(e) {
29
+ var y = {};
30
+ var q;
31
+ function _e() {
32
+ return q || (q = 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 g:
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 t = e.render;
64
+ return e = e.displayName, e || (e = t.displayName || t.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
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;
69
69
  try {
70
- return a(e(r));
70
+ return r(e(t));
71
71
  } catch {
72
72
  }
73
73
  }
74
74
  return null;
75
75
  }
76
- function u(e) {
76
+ function c(e) {
77
77
  return "" + e;
78
78
  }
79
- function c(e) {
79
+ function a(e) {
80
80
  try {
81
- u(e);
82
- var r = !1;
81
+ c(e);
82
+ var t = !1;
83
83
  } catch {
84
- r = !0;
84
+ t = !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 (t) {
87
+ t = console;
88
+ var i = t.error, u = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
89
+ return i.call(
90
+ t,
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
+ ), c(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 o(e) {
97
+ if (e === g) return "<>";
98
+ if (typeof e == "object" && e !== null && e.$$typeof === S)
99
99
  return "<...>";
100
100
  try {
101
- var r = a(e);
102
- return r ? "<" + r + ">" : "<...>";
101
+ var t = r(e);
102
+ return t ? "<" + t + ">" : "<...>";
103
103
  } catch {
104
104
  return "<...>";
105
105
  }
106
106
  }
107
- function s() {
108
- var e = T.A;
107
+ function l() {
108
+ var e = P.A;
109
109
  return e === null ? null : e.getOwner();
110
110
  }
111
- function o() {
111
+ function n() {
112
112
  return Error("react-stack-top-frame");
113
113
  }
114
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;
115
+ if (I.call(e, "key")) {
116
+ var t = Object.getOwnPropertyDescriptor(e, "key").get;
117
+ if (t && t.isReactWarning) return !1;
118
118
  }
119
119
  return e.key !== void 0;
120
120
  }
121
- function m(e, r) {
122
- function n() {
121
+ function m(e, t) {
122
+ function i() {
123
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
- r
125
+ t
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);
133
+ function v() {
134
+ var e = r(this.type);
135
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, n, l, E, y) {
140
- var i = n.ref;
139
+ function h(e, t, i, u, _, A) {
140
+ var f = i.ref;
141
141
  return e = {
142
- $$typeof: w,
142
+ $$typeof: $,
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: t,
145
+ props: i,
146
+ _owner: u
147
+ }, (f !== void 0 ? f : null) !== null ? Object.defineProperty(e, "ref", {
148
148
  enumerable: !1,
149
- get: U
149
+ get: v
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,168 +161,216 @@ function Ee() {
161
161
  configurable: !1,
162
162
  enumerable: !1,
163
163
  writable: !0,
164
- value: E
164
+ value: _
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, t, i, u, _, A) {
173
+ var f = t.children;
174
+ if (f !== void 0)
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);
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(f);
185
+ if (I.call(t, "key")) {
186
+ f = r(e);
187
+ var b = Object.keys(t).filter(function(ae) {
188
+ return ae !== "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 < b.length ? "{key: someKey, " + b.join(": ..., ") + ": ...}" : "{key: someKey}", D[f + u] || (b = 0 < b.length ? "{" + b.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
+ f,
199
+ b,
200
+ f
201
+ ), D[f + 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 (f = null, i !== void 0 && (a(i), f = "" + i), d(t) && (a(t.key), f = "" + t.key), "key" in t) {
204
+ i = {};
205
+ for (var N in t)
206
+ N !== "key" && (i[N] = t[N]);
207
+ } else i = t;
208
+ return f && m(
209
+ i,
210
210
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
211
- ), G(
211
+ ), h(
212
212
  e,
213
+ f,
213
214
  i,
214
- n,
215
- s(),
216
- E,
217
- y
215
+ l(),
216
+ _,
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
+ 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));
222
+ }
223
+ function C(e) {
224
+ return typeof e == "object" && e !== null && e.$$typeof === $;
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 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() {
227
227
  return null;
228
228
  };
229
- _ = {
229
+ E = {
230
230
  react_stack_bottom_frame: function(e) {
231
231
  return e();
232
232
  }
233
233
  };
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(
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) {
239
+ var u = 1e4 > P.recentlyCreatedOwnerStacks++;
240
+ return p(
241
241
  e,
242
- r,
243
- n,
242
+ t,
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") : M,
246
+ u ? k(o(e)) : F
247
247
  );
248
- }, v.jsxs = function(e, r, n) {
249
- var l = 1e4 > T.recentlyCreatedOwnerStacks++;
250
- return N(
248
+ }, y.jsxs = function(e, t, i) {
249
+ var u = 1e4 > P.recentlyCreatedOwnerStacks++;
250
+ return p(
251
251
  e,
252
- r,
253
- n,
252
+ t,
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") : M,
256
+ u ? k(o(e)) : F
257
257
  );
258
258
  };
259
- })()), v;
259
+ })()), y;
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 U;
262
+ function Re() {
263
+ return U || (U = 1, process.env.NODE_ENV === "production" ? j.exports = Ee() : j.exports = _e()), 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 s = Re();
266
+ function w({
267
+ title: r,
268
+ description: c,
269
+ action: a,
270
+ className: o,
271
+ children: l,
272
+ ...n
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__ */ 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 })
278
278
  ] }),
279
- (c || s) && /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
280
- c,
281
- s
279
+ (a || l) && /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-2", children: [
280
+ a,
281
+ l
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 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;
296
+ break;
297
+ case o:
298
+ m = ((l - a) / p + 2) / 6;
299
+ break;
300
+ case l:
301
+ m = ((a - o) / p + 4) / 6;
302
+ break;
303
+ }
304
+ }
305
+ return `${Math.round(m * 360)} ${Math.round(v * 100)}% ${Math.round(h * 100)}%`;
306
+ }
307
+ function je(r, c) {
308
+ oe(() => {
309
+ const a = document.documentElement;
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));
313
+ } else
314
+ a.style.removeProperty("--brand-primary"), a.style.removeProperty("--brand-primary-hsl");
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));
318
+ } else
319
+ a.style.removeProperty("--brand-accent"), a.style.removeProperty("--brand-accent-hsl");
320
+ if (r?.favicon) {
321
+ const o = document.querySelector("#favicon") || document.querySelector('link[rel="icon"]');
322
+ o && (o.href = r.favicon);
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");
326
+ };
327
+ }, [r?.primaryColor, r?.accentColor, r?.favicon, c]);
328
+ }
329
+ function Te({
330
+ sidebar: r,
331
+ navbar: c,
332
+ children: a,
333
+ className: o,
334
+ defaultOpen: l = !0,
335
+ branding: n
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 je(n, n?.title), /* @__PURE__ */ s.jsxs(se, { defaultOpen: l, children: [
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
299
344
  ] }),
300
- /* @__PURE__ */ t.jsx("main", { className: h("flex-1 overflow-auto p-4 md:p-6", f), children: c })
345
+ /* @__PURE__ */ s.jsx("main", { className: T("flex-1 overflow-auto p-3 sm:p-4 md:p-6", o), children: a })
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 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 }) });
351
+ }
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(
308
356
  "div",
309
357
  {
310
- id: f || a.id,
311
- className: h("flex flex-col h-full space-y-4", u),
312
- style: c,
358
+ id: o || r.id,
359
+ className: T("flex flex-col h-full space-y-4", c),
360
+ style: a,
313
361
  children: [
314
- /* @__PURE__ */ t.jsx(
315
- A,
362
+ /* @__PURE__ */ s.jsx(
363
+ w,
316
364
  {
317
- title: a.title,
318
- description: a.description
365
+ title: r.title,
366
+ description: r.description
319
367
  }
320
368
  ),
321
- /* @__PURE__ */ t.jsx("div", { className: "flex-1 overflow-auto", children: o.map((d, m) => /* @__PURE__ */ t.jsx(
322
- be,
369
+ /* @__PURE__ */ s.jsx("div", { className: "flex-1 overflow-auto", children: n.map((d, m) => /* @__PURE__ */ s.jsx(
370
+ ye,
323
371
  {
324
372
  schema: d,
325
- ...s
373
+ ...l
326
374
  },
327
375
  d?.id || m
328
376
  )) })
@@ -330,49 +378,46 @@ function je({ schema: a, className: u, style: c, id: f, ...s }) {
330
378
  }
331
379
  );
332
380
  }
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)) }) })
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)) }) })
344
389
  ] }) }) });
345
390
  }
346
- function Se() {
347
- b.register("page-header", A, {
391
+ function Pe() {
392
+ R.register("page-header", w, {
393
+ namespace: "layout",
348
394
  label: "Page Header",
349
395
  category: "Layout",
350
396
  inputs: [
351
397
  { name: "title", type: "string" },
352
398
  { name: "description", type: "string" }
353
399
  ]
354
- }), b.register("page:header", A), b.register("page:card", Te, {
400
+ }), R.register("page:header", w, { namespace: "layout" }), R.register("page:card", ge, {
401
+ namespace: "layout",
355
402
  label: "Page Card",
356
403
  category: "Layout",
357
404
  isContainer: !0
358
- }), b.register("app-shell", he, {
405
+ }), R.register("app-shell", Te, {
406
+ namespace: "layout",
359
407
  label: "App Shell",
360
408
  category: "Layout"
361
- }), b.register("page", je, {
362
- label: "Standard Page",
363
- category: "Layout",
364
- isContainer: !0
365
409
  });
366
410
  }
367
411
  try {
368
- Se();
412
+ Pe();
369
413
  } catch {
370
414
  }
371
415
  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
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
378
423
  };
@@ -1,6 +1,6 @@
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:
1
+ (function(d,y){typeof exports=="object"&&typeof module<"u"?y(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"],y):(d=typeof globalThis<"u"?globalThis:d||self,y(d.ObjectUILayout={},d.core,d.require$$0,d.components,d.react,d.reactRouterDom))})(this,(function(d,y,w,m,Q,I){"use strict";var _={exports:{}},x={};var L;function K(){if(L)return x;L=1;var r=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function a(s,l,n){var p=null;if(n!==void 0&&(p=""+n),l.key!==void 0&&(p=""+l.key),"key"in l){n={};for(var b in l)b!=="key"&&(n[b]=l[b])}else n=l;return l=n.ref,{$$typeof:r,type:s,key:p,ref:l!==void 0?l:null,props:n}}return x.Fragment=c,x.jsx=a,x.jsxs=a,x}var E={};var M;function ee(){return M||(M=1,process.env.NODE_ENV!=="production"&&(function(){function r(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===be?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case P:return"Fragment";case le:return"Profiler";case se:return"StrictMode";case fe:return"Suspense";case de:return"SuspenseList";case pe: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 oe:return"Portal";case ie:return e.displayName||"Context";case ce:return(e._context.displayName||"Context")+".Consumer";case ue:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case me:return t=e.displayName||null,t!==null?t:r(e.type)||"Memo";case k:t=e._payload,e=e._init;try{return r(e(t))}catch{}}return null}function c(e){return""+e}function a(e){try{c(e);var t=!1}catch{t=!0}if(t){t=console;var i=t.error,u=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return i.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),c(e)}}function s(e){if(e===P)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===k)return"<...>";try{var t=r(e);return t?"<"+t+">":"<...>"}catch{return"<...>"}}function l(){var e=A.A;return e===null?null:e.getOwner()}function n(){return Error("react-stack-top-frame")}function p(e){if(V.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function b(e,t){function i(){z||(z=!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)",t))}i.isReactWarning=!0,Object.defineProperty(e,"key",{get:i,configurable:!0})}function R(){var e=r(this.type);return H[e]||(H[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 g(e,t,i,u,T,O){var f=i.ref;return e={$$typeof:J,type:e,key:t,props:i,_owner:u},(f!==void 0?f:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:R}):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:T}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:O}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function h(e,t,i,u,T,O){var f=t.children;if(f!==void 0)if(u)if(ye(f)){for(u=0;u<f.length;u++)W(f[u]);Object.freeze&&Object.freeze(f)}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 W(f);if(V.call(t,"key")){f=r(e);var v=Object.keys(t).filter(function(he){return he!=="key"});u=0<v.length?"{key: someKey, "+v.join(": ..., ")+": ...}":"{key: someKey}",Z[f+u]||(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} />`,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"})}));
6
+ <%s key={someKey} {...props} />`,u,f,v,f),Z[f+u]=!0)}if(f=null,i!==void 0&&(a(i),f=""+i),p(t)&&(a(t.key),f=""+t.key),"key"in t){i={};for(var C in t)C!=="key"&&(i[C]=t[C])}else i=t;return f&&b(i,typeof e=="function"?e.displayName||e.name||"Unknown":e),g(e,f,i,l(),T,O)}function W(e){G(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===k&&(e._payload.status==="fulfilled"?G(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function G(e){return typeof e=="object"&&e!==null&&e.$$typeof===J}var S=w,J=Symbol.for("react.transitional.element"),oe=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),se=Symbol.for("react.strict_mode"),le=Symbol.for("react.profiler"),ce=Symbol.for("react.consumer"),ie=Symbol.for("react.context"),ue=Symbol.for("react.forward_ref"),fe=Symbol.for("react.suspense"),de=Symbol.for("react.suspense_list"),me=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),pe=Symbol.for("react.activity"),be=Symbol.for("react.client.reference"),A=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=Object.prototype.hasOwnProperty,ye=Array.isArray,N=console.createTask?console.createTask:function(){return null};S={react_stack_bottom_frame:function(e){return e()}};var z,H={},B=S.react_stack_bottom_frame.bind(S,n)(),X=N(s(n)),Z={};E.Fragment=P,E.jsx=function(e,t,i){var u=1e4>A.recentlyCreatedOwnerStacks++;return h(e,t,i,!1,u?Error("react-stack-top-frame"):B,u?N(s(e)):X)},E.jsxs=function(e,t,i){var u=1e4>A.recentlyCreatedOwnerStacks++;return h(e,t,i,!0,u?Error("react-stack-top-frame"):B,u?N(s(e)):X)}})()),E}var Y;function re(){return Y||(Y=1,process.env.NODE_ENV==="production"?_.exports=K():_.exports=ee()),_.exports}var o=re();function j({title:r,description:c,action:a,className:s,children:l,...n}){return o.jsx("div",{className:m.cn("flex flex-col gap-4 pb-4 md:pb-8",s),...n,children:o.jsxs("div",{className:"flex items-center justify-between gap-4",children:[o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h1",{className:"text-2xl font-bold tracking-tight md:text-3xl",children:r}),c&&o.jsx("p",{className:"text-sm text-muted-foreground",children:c})]}),(a||l)&&o.jsxs("div",{className:"flex items-center gap-2",children:[a,l]})]})})}function $(r){const c=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);if(!c)return null;const a=parseInt(c[1],16)/255,s=parseInt(c[2],16)/255,l=parseInt(c[3],16)/255,n=Math.max(a,s,l),p=Math.min(a,s,l);let b=0,R=0;const g=(n+p)/2;if(n!==p){const h=n-p;switch(R=g>.5?h/(2-n-p):h/(n+p),n){case a:b=((s-l)/h+(s<l?6:0))/6;break;case s:b=((l-a)/h+2)/6;break;case l:b=((a-s)/h+4)/6;break}}return`${Math.round(b*360)} ${Math.round(R*100)}% ${Math.round(g*100)}%`}function q(r,c){w.useEffect(()=>{const a=document.documentElement;if(r?.primaryColor){const s=$(r.primaryColor);s&&(a.style.setProperty("--brand-primary",r.primaryColor),a.style.setProperty("--brand-primary-hsl",s))}else a.style.removeProperty("--brand-primary"),a.style.removeProperty("--brand-primary-hsl");if(r?.accentColor){const s=$(r.accentColor);s&&(a.style.setProperty("--brand-accent",r.accentColor),a.style.setProperty("--brand-accent-hsl",s))}else a.style.removeProperty("--brand-accent"),a.style.removeProperty("--brand-accent-hsl");if(r?.favicon){const s=document.querySelector("#favicon")||document.querySelector('link[rel="icon"]');s&&(s.href=r.favicon)}return c&&(document.title=c),()=>{a.style.removeProperty("--brand-primary"),a.style.removeProperty("--brand-primary-hsl"),a.style.removeProperty("--brand-accent"),a.style.removeProperty("--brand-accent-hsl")}},[r?.primaryColor,r?.accentColor,r?.favicon,c])}function F({sidebar:r,navbar:c,children:a,className:s,defaultOpen:l=!0,branding:n}){return q(n,n?.title),o.jsxs(m.SidebarProvider,{defaultOpen:l,children:[r,o.jsxs(m.SidebarInset,{children:[o.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:[o.jsx(m.SidebarTrigger,{className:"-ml-1"}),o.jsx("div",{className:"w-px h-4 bg-border mx-1 sm:mx-2"}),c]}),o.jsx("main",{className:m.cn("flex-1 overflow-auto p-3 sm:p-4 md:p-6",s),children:a})]})]})}function D({className:r,children:c,...a}){return o.jsx("div",{className:m.cn("rounded-xl border bg-card text-card-foreground shadow",r),...a,children:o.jsx("div",{className:"p-6",children:c})})}const te=r=>r?Array.isArray(r)?r:[r]:[];function ae({schema:r,className:c,style:a,id:s,...l}){const n=te(r.children);return o.jsxs("div",{id:s||r.id,className:m.cn("flex flex-col h-full space-y-4",c),style:a,children:[o.jsx(j,{title:r.title,description:r.description}),o.jsx("div",{className:"flex-1 overflow-auto",children:n.map((p,b)=>o.jsx(Q.SchemaRenderer,{schema:p,...l},p?.id||b))})]})}function ne({items:r,title:c="Application",className:a,collapsible:s="icon"}){const l=I.useLocation();return o.jsx(m.Sidebar,{className:a,collapsible:s,children:o.jsx(m.SidebarContent,{children:o.jsxs(m.SidebarGroup,{children:[o.jsx(m.SidebarGroupLabel,{children:c}),o.jsx(m.SidebarGroupContent,{children:o.jsx(m.SidebarMenu,{children:r.map(n=>o.jsx(m.SidebarMenuItem,{children:o.jsx(m.SidebarMenuButton,{asChild:!0,isActive:l.pathname===n.href,children:o.jsxs(I.NavLink,{to:n.href,children:[n.icon&&o.jsx(n.icon,{}),o.jsx("span",{children:n.title})]})})},n.href))})})]})})})}function U(){y.ComponentRegistry.register("page-header",j,{namespace:"layout",label:"Page Header",category:"Layout",inputs:[{name:"title",type:"string"},{name:"description",type:"string"}]}),y.ComponentRegistry.register("page:header",j,{namespace:"layout"}),y.ComponentRegistry.register("page:card",D,{namespace:"layout",label:"Page Card",category:"Layout",isContainer:!0}),y.ComponentRegistry.register("app-shell",F,{namespace:"layout",label:"App Shell",category:"Layout"})}try{U()}catch{}d.AppShell=F,d.Page=ae,d.PageCard=D,d.PageHeader=j,d.SidebarNav=ne,d.registerLayout=U,d.useAppShellBranding=q,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
@@ -1,9 +1,32 @@
1
1
  import { default as React } from 'react';
2
+ /**
3
+ * Branding configuration for the AppShell.
4
+ * Applies CSS custom properties to the document root for theme customization.
5
+ */
6
+ export interface AppShellBranding {
7
+ /** Primary brand color (hex, e.g. "#3B82F6") */
8
+ primaryColor?: string;
9
+ /** Accent brand color (hex, e.g. "#10B981") */
10
+ accentColor?: string;
11
+ /** Favicon URL — replaces the <link rel="icon"> href */
12
+ favicon?: string;
13
+ /** Logo URL — passed to sidebar/navbar via context */
14
+ logo?: string;
15
+ /** Page title suffix (sets document.title) */
16
+ title?: string;
17
+ }
2
18
  export interface AppShellProps {
3
19
  sidebar?: React.ReactNode;
4
20
  navbar?: React.ReactNode;
5
21
  children: React.ReactNode;
6
22
  className?: string;
7
23
  defaultOpen?: boolean;
24
+ /** App branding — applies CSS custom properties for theming */
25
+ branding?: AppShellBranding;
8
26
  }
9
- export declare function AppShell({ sidebar, navbar, children, className, defaultOpen, }: AppShellProps): import("react/jsx-runtime").JSX.Element;
27
+ /**
28
+ * Apply branding CSS custom properties to the document root.
29
+ * This is extracted as a standalone hook so it can be re-used independently.
30
+ */
31
+ export declare function useAppShellBranding(branding?: AppShellBranding, title?: string): void;
32
+ export declare function AppShell({ sidebar, navbar, children, className, defaultOpen, branding, }: AppShellProps): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@object-ui/layout",
3
- "version": "0.5.0",
3
+ "version": "2.0.0",
4
4
  "type": "module",
5
+ "sideEffects": false,
5
6
  "main": "dist/index.umd.cjs",
6
7
  "module": "dist/index.js",
7
8
  "types": "dist/index.d.ts",
@@ -18,10 +19,10 @@
18
19
  "react": "^19.2.4",
19
20
  "react-dom": "^19.2.4",
20
21
  "tailwind-merge": "^2.2.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"
22
+ "@object-ui/components": "2.0.0",
23
+ "@object-ui/core": "2.0.0",
24
+ "@object-ui/react": "2.0.0",
25
+ "@object-ui/types": "2.0.0"
25
26
  },
26
27
  "peerDependencies": {
27
28
  "react": "^18.0.0 || ^19.0.0",
package/src/AppShell.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { useEffect } from 'react';
2
2
  import {
3
3
  SidebarProvider,
4
4
  SidebarTrigger,
@@ -7,12 +7,117 @@ import {
7
7
  } from '@object-ui/components';
8
8
  import { cn } from '@object-ui/components';
9
9
 
10
+ /**
11
+ * Branding configuration for the AppShell.
12
+ * Applies CSS custom properties to the document root for theme customization.
13
+ */
14
+ export interface AppShellBranding {
15
+ /** Primary brand color (hex, e.g. "#3B82F6") */
16
+ primaryColor?: string;
17
+ /** Accent brand color (hex, e.g. "#10B981") */
18
+ accentColor?: string;
19
+ /** Favicon URL — replaces the <link rel="icon"> href */
20
+ favicon?: string;
21
+ /** Logo URL — passed to sidebar/navbar via context */
22
+ logo?: string;
23
+ /** Page title suffix (sets document.title) */
24
+ title?: string;
25
+ }
26
+
10
27
  export interface AppShellProps {
11
28
  sidebar?: React.ReactNode;
12
29
  navbar?: React.ReactNode; // Top navbar content
13
30
  children: React.ReactNode;
14
31
  className?: string;
15
32
  defaultOpen?: boolean;
33
+ /** App branding — applies CSS custom properties for theming */
34
+ branding?: AppShellBranding;
35
+ }
36
+
37
+ /**
38
+ * Convert a hex color (#RRGGBB) to HSL string "H S% L%"
39
+ * for use in Tailwind CSS custom properties.
40
+ */
41
+ function hexToHSL(hex: string): string | null {
42
+ const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
43
+ if (!result) return null;
44
+
45
+ const r = parseInt(result[1], 16) / 255;
46
+ const g = parseInt(result[2], 16) / 255;
47
+ const b = parseInt(result[3], 16) / 255;
48
+
49
+ const max = Math.max(r, g, b);
50
+ const min = Math.min(r, g, b);
51
+ let h = 0;
52
+ let s = 0;
53
+ const l = (max + min) / 2;
54
+
55
+ if (max !== min) {
56
+ const d = max - min;
57
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
58
+ switch (max) {
59
+ case r: h = ((g - b) / d + (g < b ? 6 : 0)) / 6; break;
60
+ case g: h = ((b - r) / d + 2) / 6; break;
61
+ case b: h = ((r - g) / d + 4) / 6; break;
62
+ }
63
+ }
64
+
65
+ return `${Math.round(h * 360)} ${Math.round(s * 100)}% ${Math.round(l * 100)}%`;
66
+ }
67
+
68
+ /**
69
+ * Apply branding CSS custom properties to the document root.
70
+ * This is extracted as a standalone hook so it can be re-used independently.
71
+ */
72
+ export function useAppShellBranding(branding?: AppShellBranding, title?: string) {
73
+ useEffect(() => {
74
+ const root = document.documentElement;
75
+
76
+ // Primary color
77
+ if (branding?.primaryColor) {
78
+ const hsl = hexToHSL(branding.primaryColor);
79
+ if (hsl) {
80
+ root.style.setProperty('--brand-primary', branding.primaryColor);
81
+ root.style.setProperty('--brand-primary-hsl', hsl);
82
+ }
83
+ } else {
84
+ root.style.removeProperty('--brand-primary');
85
+ root.style.removeProperty('--brand-primary-hsl');
86
+ }
87
+
88
+ // Accent color
89
+ if (branding?.accentColor) {
90
+ const hsl = hexToHSL(branding.accentColor);
91
+ if (hsl) {
92
+ root.style.setProperty('--brand-accent', branding.accentColor);
93
+ root.style.setProperty('--brand-accent-hsl', hsl);
94
+ }
95
+ } else {
96
+ root.style.removeProperty('--brand-accent');
97
+ root.style.removeProperty('--brand-accent-hsl');
98
+ }
99
+
100
+ // Favicon
101
+ if (branding?.favicon) {
102
+ const link = document.querySelector<HTMLLinkElement>('#favicon')
103
+ || document.querySelector<HTMLLinkElement>('link[rel="icon"]');
104
+ if (link) {
105
+ link.href = branding.favicon;
106
+ }
107
+ }
108
+
109
+ // Page title
110
+ if (title) {
111
+ document.title = title;
112
+ }
113
+
114
+ return () => {
115
+ root.style.removeProperty('--brand-primary');
116
+ root.style.removeProperty('--brand-primary-hsl');
117
+ root.style.removeProperty('--brand-accent');
118
+ root.style.removeProperty('--brand-accent-hsl');
119
+ };
120
+ }, [branding?.primaryColor, branding?.accentColor, branding?.favicon, title]);
16
121
  }
17
122
 
18
123
  export function AppShell({
@@ -21,17 +126,21 @@ export function AppShell({
21
126
  children,
22
127
  className,
23
128
  defaultOpen = true,
129
+ branding,
24
130
  }: AppShellProps) {
131
+ // Apply branding CSS custom properties
132
+ useAppShellBranding(branding, branding?.title);
133
+
25
134
  return (
26
135
  <SidebarProvider defaultOpen={defaultOpen}>
27
136
  {sidebar}
28
137
  <SidebarInset>
29
- <header className="flex h-16 shrink-0 items-center gap-2 border-b bg-background px-4">
138
+ <header className="flex h-14 sm:h-16 shrink-0 items-center gap-2 border-b bg-background px-2 sm:px-4">
30
139
  <SidebarTrigger className="-ml-1" />
31
- <div className="w-px h-4 bg-border mx-2" />
140
+ <div className="w-px h-4 bg-border mx-1 sm:mx-2" />
32
141
  {navbar}
33
142
  </header>
34
- <main className={cn("flex-1 overflow-auto p-4 md:p-6", className)}>
143
+ <main className={cn("flex-1 overflow-auto p-3 sm:p-4 md:p-6", className)}>
35
144
  {children}
36
145
  </main>
37
146
  </SidebarInset>
package/src/index.ts CHANGED
@@ -18,6 +18,7 @@ export * from './SidebarNav';
18
18
 
19
19
  export function registerLayout() {
20
20
  ComponentRegistry.register('page-header', PageHeader, {
21
+ namespace: 'layout',
21
22
  label: 'Page Header',
22
23
  category: 'Layout',
23
24
  inputs: [
@@ -27,26 +28,25 @@ export function registerLayout() {
27
28
  });
28
29
 
29
30
  // Alias for protocol compliance
30
- ComponentRegistry.register('page:header', PageHeader);
31
+ ComponentRegistry.register('page:header', PageHeader, { namespace: 'layout' });
31
32
 
32
33
  // Page Card
33
34
  ComponentRegistry.register('page:card', PageCard, {
35
+ namespace: 'layout',
34
36
  label: 'Page Card',
35
37
  category: 'Layout',
36
38
  isContainer: true
37
39
  });
38
40
 
39
41
  ComponentRegistry.register('app-shell', AppShell, {
40
- label: 'App Shell',
41
- category: 'Layout',
42
- });
43
-
44
- // Core Page Renderer
45
- ComponentRegistry.register('page', Page, {
46
- label: 'Standard Page',
42
+ namespace: 'layout',
43
+ label: 'App Shell',
47
44
  category: 'Layout',
48
- isContainer: true
49
45
  });
46
+
47
+ // NOTE: 'page' registration is handled by @object-ui/components PageRenderer.
48
+ // That renderer supports page types (record/home/app/utility), named regions,
49
+ // and PageVariablesProvider. Do NOT re-register 'page' here to avoid conflicts.
50
50
  }
51
51
 
52
52
  // Keep backward compatibility for now if called directly