@object-ui/layout 0.5.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 +34 -0
- package/dist/index.js +305 -211
- package/dist/index.umd.cjs +2 -2
- package/dist/layout/src/AppShell.d.ts +24 -1
- 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 +11 -10
- package/src/AppShell.tsx +113 -4
- package/src/ResponsiveGrid.tsx +118 -0
- package/src/index.ts +20 -7
- package/src/stories/AppShell.stories.tsx +110 -0
- package/src/stories/ResponsiveGrid.stories.tsx +110 -0
package/dist/index.js
CHANGED
|
@@ -1,152 +1,152 @@
|
|
|
1
1
|
import { ComponentRegistry as b } from "@object-ui/core";
|
|
2
|
-
import ae from "react";
|
|
3
|
-
import { cn as h, SidebarProvider as ne, SidebarInset as
|
|
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
4
|
import { SchemaRenderer as be } from "@object-ui/react";
|
|
5
|
-
import { useLocation as
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
if (
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
var
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
for (var m in
|
|
17
|
-
m !== "key" && (
|
|
18
|
-
} else
|
|
19
|
-
return
|
|
20
|
-
$$typeof:
|
|
21
|
-
type:
|
|
22
|
-
key:
|
|
23
|
-
ref:
|
|
24
|
-
props:
|
|
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
|
+
$$typeof: r,
|
|
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
29
|
var v = {};
|
|
30
|
-
var
|
|
30
|
+
var W;
|
|
31
31
|
function Ee() {
|
|
32
|
-
return
|
|
33
|
-
function
|
|
32
|
+
return W || (W = 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 ===
|
|
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
|
-
case
|
|
41
|
+
case z:
|
|
42
42
|
return "Profiler";
|
|
43
|
-
case
|
|
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
|
|
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
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return
|
|
67
|
-
case
|
|
68
|
-
|
|
61
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
62
|
+
case B:
|
|
63
|
+
var o = e.render;
|
|
64
|
+
return e = e.displayName, e || (e = o.displayName || o.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
65
|
+
case K:
|
|
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
|
|
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
|
|
89
|
-
return
|
|
90
|
-
|
|
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
|
+
return i.call(
|
|
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
|
-
|
|
93
|
-
),
|
|
92
|
+
u
|
|
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
|
|
108
|
-
var e =
|
|
107
|
+
function n() {
|
|
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,
|
|
122
|
-
function
|
|
123
|
-
|
|
121
|
+
function m(e, o) {
|
|
122
|
+
function i() {
|
|
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
|
-
|
|
129
|
-
get:
|
|
128
|
+
i.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
129
|
+
get: i,
|
|
130
130
|
configurable: !0
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
-
function
|
|
134
|
-
var e =
|
|
135
|
-
return
|
|
133
|
+
function g() {
|
|
134
|
+
var e = r(this.type);
|
|
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:
|
|
145
|
-
props:
|
|
146
|
-
_owner:
|
|
147
|
-
}, (
|
|
144
|
+
key: o,
|
|
145
|
+
props: i,
|
|
146
|
+
_owner: u
|
|
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,69 +161,69 @@ function Ee() {
|
|
|
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,
|
|
168
168
|
writable: !0,
|
|
169
|
-
value:
|
|
169
|
+
value: A
|
|
170
170
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
173
|
-
var
|
|
174
|
-
if (
|
|
175
|
-
if (
|
|
176
|
-
if (
|
|
177
|
-
for (
|
|
178
|
-
|
|
179
|
-
Object.freeze && Object.freeze(
|
|
172
|
+
function p(e, o, i, u, R, A) {
|
|
173
|
+
var d = o.children;
|
|
174
|
+
if (d !== void 0)
|
|
175
|
+
if (u)
|
|
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
|
|
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
|
-
|
|
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} />
|
|
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
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
),
|
|
197
|
+
u,
|
|
198
|
+
d,
|
|
199
|
+
x,
|
|
200
|
+
d
|
|
201
|
+
), D[d + u] = !0);
|
|
202
202
|
}
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
for (var
|
|
206
|
-
|
|
207
|
-
} else
|
|
208
|
-
return
|
|
209
|
-
|
|
203
|
+
if (d = null, i !== void 0 && (t(i), d = "" + i), f(o) && (t(o.key), d = "" + o.key), "key" in o) {
|
|
204
|
+
i = {};
|
|
205
|
+
for (var C in o)
|
|
206
|
+
C !== "key" && (i[C] = o[C]);
|
|
207
|
+
} else i = o;
|
|
208
|
+
return d && m(
|
|
209
|
+
i,
|
|
210
210
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
211
|
-
),
|
|
211
|
+
), E(
|
|
212
212
|
e,
|
|
213
|
+
d,
|
|
213
214
|
i,
|
|
214
|
-
n,
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
y
|
|
215
|
+
n(),
|
|
216
|
+
R,
|
|
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
|
-
|
|
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
|
+
}
|
|
223
|
+
function w(e) {
|
|
224
|
+
return typeof e == "object" && e !== null && e.$$typeof === L;
|
|
225
225
|
}
|
|
226
|
-
var _ = ae,
|
|
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
|
_ = {
|
|
@@ -231,148 +231,242 @@ React keys must be passed directly to JSX without using spread:
|
|
|
231
231
|
return e();
|
|
232
232
|
}
|
|
233
233
|
};
|
|
234
|
-
var
|
|
234
|
+
var M, I = {}, Y = _.react_stack_bottom_frame.bind(
|
|
235
235
|
_,
|
|
236
|
-
|
|
237
|
-
)(),
|
|
238
|
-
v.Fragment =
|
|
239
|
-
var
|
|
240
|
-
return
|
|
236
|
+
s
|
|
237
|
+
)(), F = k(a(s)), D = {};
|
|
238
|
+
v.Fragment = S, v.jsx = function(e, o, i) {
|
|
239
|
+
var u = 1e4 > P.recentlyCreatedOwnerStacks++;
|
|
240
|
+
return p(
|
|
241
241
|
e,
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
o,
|
|
243
|
+
i,
|
|
244
244
|
!1,
|
|
245
|
-
|
|
246
|
-
|
|
245
|
+
u ? Error("react-stack-top-frame") : Y,
|
|
246
|
+
u ? k(a(e)) : F
|
|
247
247
|
);
|
|
248
|
-
}, v.jsxs = function(e,
|
|
249
|
-
var
|
|
250
|
-
return
|
|
248
|
+
}, v.jsxs = function(e, o, i) {
|
|
249
|
+
var u = 1e4 > P.recentlyCreatedOwnerStacks++;
|
|
250
|
+
return p(
|
|
251
251
|
e,
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
o,
|
|
253
|
+
i,
|
|
254
254
|
!0,
|
|
255
|
-
|
|
256
|
-
|
|
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
|
|
267
|
-
title:
|
|
268
|
-
description:
|
|
269
|
-
action:
|
|
270
|
-
className:
|
|
271
|
-
children:
|
|
272
|
-
...
|
|
265
|
+
var c = _e();
|
|
266
|
+
function N({
|
|
267
|
+
title: r,
|
|
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
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
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
|
+
break;
|
|
297
|
+
case a:
|
|
298
|
+
m = ((n - t) / p + 2) / 6;
|
|
299
|
+
break;
|
|
300
|
+
case n:
|
|
301
|
+
m = ((t - a) / p + 4) / 6;
|
|
302
|
+
break;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
return `${Math.round(m * 360)} ${Math.round(g * 100)}% ${Math.round(E * 100)}%`;
|
|
306
|
+
}
|
|
307
|
+
function Re(r, l) {
|
|
308
|
+
se(() => {
|
|
309
|
+
const t = document.documentElement;
|
|
310
|
+
if (r?.primaryColor) {
|
|
311
|
+
const a = U(r.primaryColor);
|
|
312
|
+
a && (t.style.setProperty("--brand-primary", r.primaryColor), t.style.setProperty("--brand-primary-hsl", a));
|
|
313
|
+
} else
|
|
314
|
+
t.style.removeProperty("--brand-primary"), t.style.removeProperty("--brand-primary-hsl");
|
|
315
|
+
if (r?.accentColor) {
|
|
316
|
+
const a = U(r.accentColor);
|
|
317
|
+
a && (t.style.setProperty("--brand-accent", r.accentColor), t.style.setProperty("--brand-accent-hsl", a));
|
|
318
|
+
} else
|
|
319
|
+
t.style.removeProperty("--brand-accent"), t.style.removeProperty("--brand-accent-hsl");
|
|
320
|
+
if (r?.favicon) {
|
|
321
|
+
const a = document.querySelector("#favicon") || document.querySelector('link[rel="icon"]');
|
|
322
|
+
a && (a.href = r.favicon);
|
|
323
|
+
}
|
|
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
|
+
};
|
|
327
|
+
}, [r?.primaryColor, r?.accentColor, r?.favicon, l]);
|
|
328
|
+
}
|
|
329
|
+
function je({
|
|
330
|
+
sidebar: r,
|
|
331
|
+
navbar: l,
|
|
332
|
+
children: t,
|
|
333
|
+
className: a,
|
|
334
|
+
defaultOpen: n = !0,
|
|
335
|
+
branding: s
|
|
291
336
|
}) {
|
|
292
|
-
return /* @__PURE__ */
|
|
293
|
-
|
|
294
|
-
/* @__PURE__ */
|
|
295
|
-
/* @__PURE__ */
|
|
296
|
-
/* @__PURE__ */
|
|
297
|
-
/* @__PURE__ */
|
|
298
|
-
|
|
337
|
+
return Re(s, s?.title), /* @__PURE__ */ c.jsxs(ne, { defaultOpen: n, children: [
|
|
338
|
+
r,
|
|
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
|
|
299
344
|
] }),
|
|
300
|
-
/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */ c.jsx("main", { className: h("flex-1 overflow-auto p-3 sm:p-4 md:p-6", a), children: t })
|
|
301
346
|
] })
|
|
302
347
|
] });
|
|
303
348
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
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";
|
|
373
|
+
}
|
|
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(
|
|
308
395
|
"div",
|
|
309
396
|
{
|
|
310
|
-
id:
|
|
311
|
-
className: h("flex flex-col h-full space-y-4",
|
|
312
|
-
style:
|
|
397
|
+
id: a || r.id,
|
|
398
|
+
className: h("flex flex-col h-full space-y-4", l),
|
|
399
|
+
style: t,
|
|
313
400
|
children: [
|
|
314
|
-
/* @__PURE__ */
|
|
315
|
-
|
|
401
|
+
/* @__PURE__ */ c.jsx(
|
|
402
|
+
N,
|
|
316
403
|
{
|
|
317
|
-
title:
|
|
318
|
-
description:
|
|
404
|
+
title: r.title,
|
|
405
|
+
description: r.description
|
|
319
406
|
}
|
|
320
407
|
),
|
|
321
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ c.jsx("div", { className: "flex-1 overflow-auto", children: s.map((f, m) => /* @__PURE__ */ c.jsx(
|
|
322
409
|
be,
|
|
323
410
|
{
|
|
324
|
-
schema:
|
|
325
|
-
...
|
|
411
|
+
schema: f,
|
|
412
|
+
...n
|
|
326
413
|
},
|
|
327
|
-
|
|
414
|
+
f?.id || m
|
|
328
415
|
)) })
|
|
329
416
|
]
|
|
330
417
|
}
|
|
331
418
|
);
|
|
332
419
|
}
|
|
333
|
-
function
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
o.icon && /* @__PURE__ */ t.jsx(o.icon, {}),
|
|
342
|
-
/* @__PURE__ */ t.jsx("span", { children: o.title })
|
|
343
|
-
] }) }) }, o.href)) }) })
|
|
420
|
+
function Ye({ items: r, title: l = "Application", className: t, collapsible: a = "icon" }) {
|
|
421
|
+
const n = ye();
|
|
422
|
+
return /* @__PURE__ */ c.jsx(ie, { className: t, collapsible: a, children: /* @__PURE__ */ c.jsx(ue, { children: /* @__PURE__ */ c.jsxs(de, { children: [
|
|
423
|
+
/* @__PURE__ */ c.jsx(fe, { children: l }),
|
|
424
|
+
/* @__PURE__ */ c.jsx(me, { children: /* @__PURE__ */ c.jsx(pe, { children: r.map((s) => /* @__PURE__ */ c.jsx(ge, { children: /* @__PURE__ */ c.jsx(xe, { asChild: !0, isActive: n.pathname === s.href, children: /* @__PURE__ */ c.jsxs(ve, { to: s.href, children: [
|
|
425
|
+
s.icon && /* @__PURE__ */ c.jsx(s.icon, {}),
|
|
426
|
+
/* @__PURE__ */ c.jsx("span", { children: s.title })
|
|
427
|
+
] }) }) }, s.href)) }) })
|
|
344
428
|
] }) }) });
|
|
345
429
|
}
|
|
346
|
-
function
|
|
347
|
-
b.register("page-header",
|
|
430
|
+
function Ne() {
|
|
431
|
+
b.register("page-header", N, {
|
|
432
|
+
namespace: "layout",
|
|
348
433
|
label: "Page Header",
|
|
349
434
|
category: "Layout",
|
|
350
435
|
inputs: [
|
|
351
436
|
{ name: "title", type: "string" },
|
|
352
437
|
{ name: "description", type: "string" }
|
|
353
438
|
]
|
|
354
|
-
}), b.register("page:header",
|
|
439
|
+
}), b.register("page:header", N, { namespace: "layout" }), b.register("page:card", Se, {
|
|
440
|
+
namespace: "layout",
|
|
355
441
|
label: "Page Card",
|
|
356
442
|
category: "Layout",
|
|
357
443
|
isContainer: !0
|
|
358
|
-
}), b.register("app-shell",
|
|
444
|
+
}), b.register("app-shell", je, {
|
|
445
|
+
namespace: "layout",
|
|
359
446
|
label: "App Shell",
|
|
360
447
|
category: "Layout"
|
|
361
|
-
}), b.register("
|
|
362
|
-
|
|
448
|
+
}), b.register("responsive-grid", Ae, {
|
|
449
|
+
namespace: "layout",
|
|
450
|
+
label: "Responsive Grid",
|
|
363
451
|
category: "Layout",
|
|
364
|
-
isContainer: !0
|
|
452
|
+
isContainer: !0,
|
|
453
|
+
inputs: [
|
|
454
|
+
{ name: "columns", type: "object" },
|
|
455
|
+
{ name: "gap", type: "number" }
|
|
456
|
+
]
|
|
365
457
|
});
|
|
366
458
|
}
|
|
367
459
|
try {
|
|
368
|
-
|
|
460
|
+
Ne();
|
|
369
461
|
} catch {
|
|
370
462
|
}
|
|
371
463
|
export {
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
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
|
|
378
472
|
};
|