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