@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.
- package/.turbo/turbo-build.log +21 -0
- package/dist/index.js +182 -166
- package/dist/index.umd.cjs +2 -2
- package/dist/layout/src/Page.d.ts +5 -1
- package/dist/layout/src/PageCard.d.ts +2 -0
- package/dist/layout/src/SidebarNav.d.ts +2 -1
- package/dist/layout/src/index.d.ts +1 -0
- package/package.json +8 -8
- package/src/Page.tsx +7 -2
- package/src/PageCard.tsx +12 -0
- package/src/SidebarNav.tsx +3 -2
- package/src/index.ts +9 -0
- package/vite.config.ts +3 -0
|
@@ -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
|
+
[36mvite v7.3.1 [32mbuilding client environment for production...[36m[39m
|
|
6
|
+
transforming...
|
|
7
|
+
[32m✓[39m 15 modules transformed.
|
|
8
|
+
rendering chunks...
|
|
9
|
+
[32m
|
|
10
|
+
[36m[vite:dts][32m Start generate declaration files...[39m
|
|
11
|
+
computing gzip size...
|
|
12
|
+
[2mdist/[22m[36mindex.js [39m[1m[2m13.10 kB[22m[1m[22m[2m │ gzip: 4.03 kB[22m
|
|
13
|
+
[32m[36m[vite:dts][32m Declaration files built in 17748ms.
|
|
14
|
+
[39m
|
|
15
|
+
[33mNo name was provided for external module "@object-ui/core" in "output.globals" – guessing "core".[39m
|
|
16
|
+
[33mNo name was provided for external module "react" in "output.globals" – guessing "require$$0".[39m
|
|
17
|
+
[33mNo name was provided for external module "@object-ui/components" in "output.globals" – guessing "components".[39m
|
|
18
|
+
[33mNo name was provided for external module "@object-ui/react" in "output.globals" – guessing "react".[39m
|
|
19
|
+
[33mNo name was provided for external module "react-router-dom" in "output.globals" – guessing "reactRouterDom".[39m
|
|
20
|
+
[2mdist/[22m[36mindex.umd.cjs [39m[1m[2m9.21 kB[22m[1m[22m[2m │ gzip: 3.62 kB[22m
|
|
21
|
+
[32m✓ built in 18.30s[39m
|
package/dist/index.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { ComponentRegistry as
|
|
1
|
+
import { ComponentRegistry as b } from "@object-ui/core";
|
|
2
2
|
import ae from "react";
|
|
3
|
-
import { cn as
|
|
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
|
|
7
|
-
var
|
|
6
|
+
var g = { exports: {} }, x = {};
|
|
7
|
+
var M;
|
|
8
8
|
function _e() {
|
|
9
|
-
if (
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
var
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
for (var
|
|
17
|
-
|
|
18
|
-
} else
|
|
19
|
-
return
|
|
20
|
-
$$typeof:
|
|
21
|
-
type:
|
|
22
|
-
key:
|
|
23
|
-
ref:
|
|
24
|
-
props:
|
|
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
|
|
27
|
+
return x.Fragment = u, x.jsx = c, x.jsxs = c, x;
|
|
28
28
|
}
|
|
29
|
-
var
|
|
30
|
-
var
|
|
29
|
+
var v = {};
|
|
30
|
+
var D;
|
|
31
31
|
function Ee() {
|
|
32
|
-
return
|
|
33
|
-
function
|
|
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 :
|
|
67
|
-
case
|
|
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
|
|
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
|
|
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
|
|
89
|
-
return
|
|
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
|
-
|
|
92
|
+
l
|
|
93
93
|
), u(e);
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function f(e) {
|
|
97
97
|
if (e === R) return "<>";
|
|
98
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
98
|
+
if (typeof e == "object" && e !== null && e.$$typeof === j)
|
|
99
99
|
return "<...>";
|
|
100
100
|
try {
|
|
101
|
-
var r =
|
|
101
|
+
var r = a(e);
|
|
102
102
|
return r ? "<" + r + ">" : "<...>";
|
|
103
103
|
} catch {
|
|
104
104
|
return "<...>";
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
var e =
|
|
107
|
+
function s() {
|
|
108
|
+
var e = T.A;
|
|
109
109
|
return e === null ? null : e.getOwner();
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function o() {
|
|
112
112
|
return Error("react-stack-top-frame");
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
if (
|
|
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
|
|
122
|
-
function
|
|
123
|
-
|
|
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
|
-
|
|
129
|
-
get:
|
|
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 =
|
|
135
|
-
return
|
|
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,
|
|
140
|
-
var
|
|
139
|
+
function G(e, r, n, l, E, y) {
|
|
140
|
+
var i = n.ref;
|
|
141
141
|
return e = {
|
|
142
|
-
$$typeof:
|
|
142
|
+
$$typeof: w,
|
|
143
143
|
type: e,
|
|
144
144
|
key: r,
|
|
145
|
-
props:
|
|
146
|
-
_owner:
|
|
147
|
-
}, (
|
|
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:
|
|
169
|
+
value: y
|
|
170
170
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
173
|
-
var
|
|
174
|
-
if (
|
|
175
|
-
if (
|
|
176
|
-
if (re(
|
|
177
|
-
for (
|
|
178
|
-
|
|
179
|
-
Object.freeze && Object.freeze(
|
|
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
|
|
185
|
-
if (
|
|
186
|
-
|
|
187
|
-
var
|
|
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
|
-
|
|
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
|
-
|
|
200
|
-
|
|
201
|
-
|
|
198
|
+
i,
|
|
199
|
+
p,
|
|
200
|
+
i
|
|
201
|
+
), F[i + l] = !0);
|
|
202
202
|
}
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
for (var
|
|
206
|
-
|
|
207
|
-
} else
|
|
208
|
-
return
|
|
209
|
-
|
|
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
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
229
|
+
_ = {
|
|
230
230
|
react_stack_bottom_frame: function(e) {
|
|
231
231
|
return e();
|
|
232
232
|
}
|
|
233
233
|
};
|
|
234
|
-
var
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
)(),
|
|
238
|
-
|
|
239
|
-
var
|
|
240
|
-
return
|
|
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
|
-
|
|
243
|
+
n,
|
|
244
244
|
!1,
|
|
245
|
-
|
|
246
|
-
|
|
245
|
+
l ? Error("react-stack-top-frame") : I,
|
|
246
|
+
l ? S(f(e)) : $
|
|
247
247
|
);
|
|
248
|
-
},
|
|
249
|
-
var
|
|
250
|
-
return
|
|
248
|
+
}, v.jsxs = function(e, r, n) {
|
|
249
|
+
var l = 1e4 > T.recentlyCreatedOwnerStacks++;
|
|
250
|
+
return N(
|
|
251
251
|
e,
|
|
252
252
|
r,
|
|
253
|
-
|
|
253
|
+
n,
|
|
254
254
|
!0,
|
|
255
|
-
|
|
256
|
-
|
|
255
|
+
l ? Error("react-stack-top-frame") : I,
|
|
256
|
+
l ? S(f(e)) : $
|
|
257
257
|
);
|
|
258
258
|
};
|
|
259
|
-
})()),
|
|
259
|
+
})()), v;
|
|
260
260
|
}
|
|
261
|
-
var
|
|
262
|
-
function
|
|
263
|
-
return
|
|
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 =
|
|
266
|
-
function
|
|
267
|
-
title:
|
|
265
|
+
var t = ge();
|
|
266
|
+
function A({
|
|
267
|
+
title: a,
|
|
268
268
|
description: u,
|
|
269
|
-
action:
|
|
270
|
-
className:
|
|
271
|
-
children:
|
|
272
|
-
...
|
|
269
|
+
action: c,
|
|
270
|
+
className: f,
|
|
271
|
+
children: s,
|
|
272
|
+
...o
|
|
273
273
|
}) {
|
|
274
|
-
return /* @__PURE__ */ t.jsx("div", { className:
|
|
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:
|
|
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
|
-
(
|
|
280
|
-
|
|
281
|
-
|
|
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
|
|
286
|
-
sidebar:
|
|
285
|
+
function he({
|
|
286
|
+
sidebar: a,
|
|
287
287
|
navbar: u,
|
|
288
|
-
children:
|
|
289
|
-
className:
|
|
290
|
-
defaultOpen:
|
|
288
|
+
children: c,
|
|
289
|
+
className: f,
|
|
290
|
+
defaultOpen: s = !0
|
|
291
291
|
}) {
|
|
292
|
-
return /* @__PURE__ */ t.jsxs(ne, { defaultOpen:
|
|
293
|
-
|
|
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:
|
|
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
|
|
305
|
-
function je({ schema:
|
|
306
|
-
const
|
|
307
|
-
return /* @__PURE__ */ t.jsxs(
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
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
|
|
326
|
-
const
|
|
327
|
-
return /* @__PURE__ */ t.jsx(le, { className:
|
|
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:
|
|
330
|
-
|
|
331
|
-
/* @__PURE__ */ t.jsx("span", { children:
|
|
332
|
-
] }) }) },
|
|
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
|
|
336
|
-
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
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
|
-
|
|
368
|
+
Se();
|
|
354
369
|
} catch {
|
|
355
370
|
}
|
|
356
371
|
export {
|
|
357
|
-
|
|
372
|
+
he as AppShell,
|
|
358
373
|
je as Page,
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
374
|
+
Te as PageCard,
|
|
375
|
+
A as PageHeader,
|
|
376
|
+
Oe as SidebarNav,
|
|
377
|
+
Se as registerLayout
|
|
362
378
|
};
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(
|
|
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} />`,
|
|
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;
|
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@object-ui/layout",
|
|
3
|
-
"version": "0.
|
|
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": "^
|
|
19
|
-
"react-dom": "^
|
|
18
|
+
"react": "^19.2.4",
|
|
19
|
+
"react-dom": "^19.2.4",
|
|
20
20
|
"tailwind-merge": "^2.2.1",
|
|
21
|
-
"@object-ui/components": "0.
|
|
22
|
-
"@object-ui/core": "0.
|
|
23
|
-
"@object-ui/react": "0.
|
|
24
|
-
"@object-ui/types": "0.
|
|
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": "^
|
|
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
|
|
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}
|
package/src/PageCard.tsx
ADDED
|
@@ -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
|
+
}
|
package/src/SidebarNav.tsx
CHANGED
|
@@ -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',
|