@c-rex/components 0.0.8 → 0.0.9
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/dist/autocomplete.cjs.js +215 -0
- package/dist/autocomplete.cjs.js.map +1 -0
- package/dist/autocomplete.d.cts +10 -0
- package/dist/autocomplete.d.ts +10 -0
- package/dist/autocomplete.esm.js +154 -0
- package/dist/autocomplete.esm.js.map +1 -0
- package/dist/blog-card.cjs.js +265 -0
- package/dist/blog-card.cjs.js.map +1 -0
- package/dist/blog-card.d.cts +19 -0
- package/dist/blog-card.d.ts +19 -0
- package/dist/blog-card.esm.js +192 -0
- package/dist/blog-card.esm.js.map +1 -0
- package/dist/blur-image.cjs.js +198 -0
- package/dist/blur-image.cjs.js.map +1 -0
- package/dist/blur-image.d.cts +7 -0
- package/dist/blur-image.d.ts +7 -0
- package/dist/blur-image.esm.js +125 -0
- package/dist/blur-image.esm.js.map +1 -0
- package/dist/breadcrumb.cjs.js +159 -0
- package/dist/breadcrumb.cjs.js.map +1 -0
- package/dist/breadcrumb.d.cts +10 -0
- package/dist/breadcrumb.d.ts +10 -0
- package/dist/breadcrumb.esm.js +98 -0
- package/dist/breadcrumb.esm.js.map +1 -0
- package/dist/empty.cjs.js +79 -0
- package/dist/empty.cjs.js.map +1 -0
- package/dist/empty.d.cts +5 -0
- package/dist/empty.d.ts +5 -0
- package/dist/empty.esm.js +18 -0
- package/dist/empty.esm.js.map +1 -0
- package/dist/navbar.cjs.js +134 -0
- package/dist/navbar.cjs.js.map +1 -0
- package/dist/navbar.d.cts +9 -0
- package/dist/navbar.d.ts +9 -0
- package/dist/navbar.esm.js +61 -0
- package/dist/navbar.esm.js.map +1 -0
- package/dist/providers/search-state-wrapper.cjs.js +113 -0
- package/dist/providers/search-state-wrapper.cjs.js.map +1 -0
- package/dist/providers/search-state-wrapper.d.cts +14 -0
- package/dist/providers/search-state-wrapper.d.ts +14 -0
- package/dist/providers/search-state-wrapper.esm.js +51 -0
- package/dist/providers/search-state-wrapper.esm.js.map +1 -0
- package/dist/result-list.cjs.js +321 -0
- package/dist/result-list.cjs.js.map +1 -0
- package/dist/result-list.d.cts +9 -0
- package/dist/result-list.d.ts +9 -0
- package/dist/result-list.esm.js +247 -0
- package/dist/result-list.esm.js.map +1 -0
- package/dist/result-view/blog-view.stories.cjs.js +372 -0
- package/dist/result-view/blog-view.stories.cjs.js.map +1 -0
- package/dist/result-view/blog-view.stories.d.cts +11 -0
- package/dist/result-view/blog-view.stories.d.ts +11 -0
- package/dist/result-view/blog-view.stories.esm.js +295 -0
- package/dist/result-view/blog-view.stories.esm.js.map +1 -0
- package/dist/result-view/blog.cjs.js +290 -0
- package/dist/result-view/blog.cjs.js.map +1 -0
- package/dist/result-view/blog.d.cts +9 -0
- package/dist/result-view/blog.d.ts +9 -0
- package/dist/result-view/blog.esm.js +220 -0
- package/dist/result-view/blog.esm.js.map +1 -0
- package/dist/result-view/table-view.stories.cjs.js +196 -0
- package/dist/result-view/table-view.stories.cjs.js.map +1 -0
- package/dist/result-view/table-view.stories.d.cts +11 -0
- package/dist/result-view/table-view.stories.d.ts +11 -0
- package/dist/result-view/table-view.stories.esm.js +131 -0
- package/dist/result-view/table-view.stories.esm.js.map +1 -0
- package/dist/result-view/table.cjs.js +116 -0
- package/dist/result-view/table.cjs.js.map +1 -0
- package/dist/result-view/table.d.cts +9 -0
- package/dist/result-view/table.d.ts +9 -0
- package/dist/result-view/table.esm.js +59 -0
- package/dist/result-view/table.esm.js.map +1 -0
- package/dist/sidebar.cjs.js +225 -0
- package/dist/sidebar.cjs.js.map +1 -0
- package/dist/sidebar.d.cts +12 -0
- package/dist/sidebar.d.ts +12 -0
- package/dist/sidebar.esm.js +164 -0
- package/dist/sidebar.esm.js.map +1 -0
- package/dist/stories/blog-card.stories.cjs.js +323 -0
- package/dist/stories/blog-card.stories.cjs.js.map +1 -0
- package/dist/stories/blog-card.stories.d.cts +9 -0
- package/dist/stories/blog-card.stories.d.ts +9 -0
- package/dist/stories/blog-card.stories.esm.js +242 -0
- package/dist/stories/blog-card.stories.esm.js.map +1 -0
- package/dist/stories/blur-image.stories.cjs.js +265 -0
- package/dist/stories/blur-image.stories.cjs.js.map +1 -0
- package/dist/stories/blur-image.stories.d.cts +37 -0
- package/dist/stories/blur-image.stories.d.ts +37 -0
- package/dist/stories/blur-image.stories.esm.js +180 -0
- package/dist/stories/blur-image.stories.esm.js.map +1 -0
- package/dist/stories/breadcrumb.stories.cjs.js +214 -0
- package/dist/stories/breadcrumb.stories.cjs.js.map +1 -0
- package/dist/stories/breadcrumb.stories.d.cts +9 -0
- package/dist/stories/breadcrumb.stories.d.ts +9 -0
- package/dist/stories/breadcrumb.stories.esm.js +145 -0
- package/dist/stories/breadcrumb.stories.esm.js.map +1 -0
- package/dist/stories/empty.stories.cjs.js +93 -0
- package/dist/stories/empty.stories.cjs.js.map +1 -0
- package/dist/stories/empty.stories.d.cts +13 -0
- package/dist/stories/empty.stories.d.ts +13 -0
- package/dist/stories/empty.stories.esm.js +28 -0
- package/dist/stories/empty.stories.esm.js.map +1 -0
- package/dist/stories/navbar.stories.cjs.js +151 -0
- package/dist/stories/navbar.stories.cjs.js.map +1 -0
- package/dist/stories/navbar.stories.d.cts +8 -0
- package/dist/stories/navbar.stories.d.ts +8 -0
- package/dist/stories/navbar.stories.esm.js +74 -0
- package/dist/stories/navbar.stories.esm.js.map +1 -0
- package/dist/stories/sidebar.stories.cjs.js +327 -0
- package/dist/stories/sidebar.stories.cjs.js.map +1 -0
- package/dist/stories/sidebar.stories.d.cts +30 -0
- package/dist/stories/sidebar.stories.d.ts +30 -0
- package/dist/stories/sidebar.stories.esm.js +258 -0
- package/dist/stories/sidebar.stories.esm.js.map +1 -0
- package/package.json +40 -27
- package/src/autocomplete.tsx +0 -113
- package/src/blog-card.tsx +0 -87
- package/src/blur-image.tsx +0 -23
- package/src/breadcrumb.tsx +0 -81
- package/src/empty.tsx +0 -13
- package/src/navbar.tsx +0 -66
- package/src/providers/search-state-wrapper.tsx +0 -21
- package/src/result-list.tsx +0 -16
- package/src/result-view/blog-view.stories.tsx +0 -58
- package/src/result-view/blog.tsx +0 -38
- package/src/result-view/table-view.stories.tsx +0 -55
- package/src/result-view/table.tsx +0 -65
- package/src/sidebar.tsx +0 -76
- package/src/stories/blog-card.stories.tsx +0 -46
- package/src/stories/blur-image.stories.tsx +0 -51
- package/src/stories/breadcrumb.stories.tsx +0 -52
- package/src/stories/empty.stories.tsx +0 -14
- package/src/stories/navbar.stories.tsx +0 -16
- package/src/stories/sidebar.stories.tsx +0 -94
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
function _define_property(obj, key, value) {
|
|
4
|
+
if (key in obj) {
|
|
5
|
+
Object.defineProperty(obj, key, {
|
|
6
|
+
value: value,
|
|
7
|
+
enumerable: true,
|
|
8
|
+
configurable: true,
|
|
9
|
+
writable: true
|
|
10
|
+
});
|
|
11
|
+
} else {
|
|
12
|
+
obj[key] = value;
|
|
13
|
+
}
|
|
14
|
+
return obj;
|
|
15
|
+
}
|
|
16
|
+
function _object_spread(target) {
|
|
17
|
+
for(var i = 1; i < arguments.length; i++){
|
|
18
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
19
|
+
var ownKeys = Object.keys(source);
|
|
20
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
21
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
22
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
ownKeys.forEach(function(key) {
|
|
26
|
+
_define_property(target, key, source[key]);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return target;
|
|
30
|
+
}
|
|
31
|
+
function ownKeys(object, enumerableOnly) {
|
|
32
|
+
var keys = Object.keys(object);
|
|
33
|
+
if (Object.getOwnPropertySymbols) {
|
|
34
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
35
|
+
if (enumerableOnly) {
|
|
36
|
+
symbols = symbols.filter(function(sym) {
|
|
37
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
keys.push.apply(keys, symbols);
|
|
41
|
+
}
|
|
42
|
+
return keys;
|
|
43
|
+
}
|
|
44
|
+
function _object_spread_props(target, source) {
|
|
45
|
+
source = source != null ? source : {};
|
|
46
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
47
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
48
|
+
} else {
|
|
49
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
50
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return target;
|
|
54
|
+
}
|
|
55
|
+
function _object_without_properties(source, excluded) {
|
|
56
|
+
if (source == null) return {};
|
|
57
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
58
|
+
var key, i;
|
|
59
|
+
if (Object.getOwnPropertySymbols) {
|
|
60
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
61
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
62
|
+
key = sourceSymbolKeys[i];
|
|
63
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
64
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
65
|
+
target[key] = source[key];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return target;
|
|
69
|
+
}
|
|
70
|
+
function _object_without_properties_loose(source, excluded) {
|
|
71
|
+
if (source == null) return {};
|
|
72
|
+
var target = {};
|
|
73
|
+
var sourceKeys = Object.keys(source);
|
|
74
|
+
var key, i;
|
|
75
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
76
|
+
key = sourceKeys[i];
|
|
77
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
78
|
+
target[key] = source[key];
|
|
79
|
+
}
|
|
80
|
+
return target;
|
|
81
|
+
}
|
|
82
|
+
function _type_of(obj) {
|
|
83
|
+
"@swc/helpers - typeof";
|
|
84
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
85
|
+
}
|
|
86
|
+
var __defProp = Object.defineProperty;
|
|
87
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
88
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
89
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
90
|
+
var __export = function(target, all) {
|
|
91
|
+
for(var name in all)__defProp(target, name, {
|
|
92
|
+
get: all[name],
|
|
93
|
+
enumerable: true
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
var __copyProps = function(to, from, except, desc) {
|
|
97
|
+
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
|
98
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
99
|
+
try {
|
|
100
|
+
var _loop = function() {
|
|
101
|
+
var key = _step.value;
|
|
102
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
103
|
+
get: function() {
|
|
104
|
+
return from[key];
|
|
105
|
+
},
|
|
106
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
for(var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
|
|
110
|
+
} catch (err) {
|
|
111
|
+
_didIteratorError = true;
|
|
112
|
+
_iteratorError = err;
|
|
113
|
+
} finally{
|
|
114
|
+
try {
|
|
115
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
116
|
+
_iterator.return();
|
|
117
|
+
}
|
|
118
|
+
} finally{
|
|
119
|
+
if (_didIteratorError) {
|
|
120
|
+
throw _iteratorError;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return to;
|
|
126
|
+
};
|
|
127
|
+
var __toCommonJS = function(mod) {
|
|
128
|
+
return __copyProps(__defProp({}, "__esModule", {
|
|
129
|
+
value: true
|
|
130
|
+
}), mod);
|
|
131
|
+
};
|
|
132
|
+
// src/sidebar.tsx
|
|
133
|
+
var sidebar_exports = {};
|
|
134
|
+
__export(sidebar_exports, {
|
|
135
|
+
AppSidebar: function() {
|
|
136
|
+
return AppSidebar;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
module.exports = __toCommonJS(sidebar_exports);
|
|
140
|
+
var import_sidebar = require("@c-rex/ui/sidebar");
|
|
141
|
+
var import_skeleton = require("@c-rex/ui/skeleton");
|
|
142
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
143
|
+
function AppSidebar(_param) {
|
|
144
|
+
var data = _param.data, loading = _param.loading, props = _object_without_properties(_param, [
|
|
145
|
+
"data",
|
|
146
|
+
"loading"
|
|
147
|
+
]);
|
|
148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_sidebar.Sidebar, _object_spread_props(_object_spread({
|
|
149
|
+
collapsible: "icon"
|
|
150
|
+
}, props), {
|
|
151
|
+
className: "top-20",
|
|
152
|
+
children: [
|
|
153
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sidebar.SidebarContent, {
|
|
154
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sidebar.SidebarGroup, {
|
|
155
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sidebar.SidebarMenu, {
|
|
156
|
+
className: "pt-4",
|
|
157
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
158
|
+
children: [
|
|
159
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, {
|
|
160
|
+
className: "w-auto h-10 mb-2"
|
|
161
|
+
}),
|
|
162
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, {
|
|
163
|
+
className: "w-auto h-10 mb-2"
|
|
164
|
+
}),
|
|
165
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, {
|
|
166
|
+
className: "w-auto h-10 mb-2 ml-8"
|
|
167
|
+
}),
|
|
168
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, {
|
|
169
|
+
className: "w-auto h-10 mb-2 ml-8"
|
|
170
|
+
}),
|
|
171
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, {
|
|
172
|
+
className: "w-auto h-10 mb-2 ml-8"
|
|
173
|
+
}),
|
|
174
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, {
|
|
175
|
+
className: "w-auto h-10 mb-2 ml-8"
|
|
176
|
+
}),
|
|
177
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, {
|
|
178
|
+
className: "w-auto h-10 mb-2"
|
|
179
|
+
})
|
|
180
|
+
]
|
|
181
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
182
|
+
children: data.map(function(item) {
|
|
183
|
+
var _item_children;
|
|
184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_sidebar.SidebarMenuItem, {
|
|
185
|
+
children: [
|
|
186
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sidebar.SidebarMenuButton, {
|
|
187
|
+
asChild: true,
|
|
188
|
+
isActive: item.active,
|
|
189
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
|
|
190
|
+
href: item.link,
|
|
191
|
+
title: item.label,
|
|
192
|
+
children: item.label
|
|
193
|
+
})
|
|
194
|
+
}),
|
|
195
|
+
((_item_children = item.children) === null || _item_children === void 0 ? void 0 : _item_children.length) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sidebar.SidebarMenuSub, {
|
|
196
|
+
children: item.children.map(function(item2) {
|
|
197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sidebar.SidebarMenuSubItem, {
|
|
198
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sidebar.SidebarMenuSubButton, {
|
|
199
|
+
asChild: true,
|
|
200
|
+
isActive: item2.active,
|
|
201
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
|
|
202
|
+
href: item2.link,
|
|
203
|
+
title: item2.label,
|
|
204
|
+
children: item2.label
|
|
205
|
+
})
|
|
206
|
+
})
|
|
207
|
+
}, item2.label);
|
|
208
|
+
})
|
|
209
|
+
}) : null
|
|
210
|
+
]
|
|
211
|
+
}, item.id);
|
|
212
|
+
})
|
|
213
|
+
})
|
|
214
|
+
})
|
|
215
|
+
})
|
|
216
|
+
}),
|
|
217
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sidebar.SidebarRail, {})
|
|
218
|
+
]
|
|
219
|
+
}));
|
|
220
|
+
}
|
|
221
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
222
|
+
0 && (module.exports = {
|
|
223
|
+
AppSidebar: AppSidebar
|
|
224
|
+
});
|
|
225
|
+
//# sourceMappingURL=sidebar.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/periotto/Desktop/workspace/c-rex.net-web-client-foundation/packages/components/dist/sidebar.cjs.js","../src/sidebar.tsx"],"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","sidebar_exports","AppSidebar","module","exports","import_sidebar","require","import_skeleton","import_jsx_runtime","data","loading","props","jsxs","Sidebar","collapsible","className","children","jsx","SidebarContent","SidebarGroup","SidebarMenu","Fragment","Skeleton","map","item","SidebarMenuItem","SidebarMenuButton","asChild","isActive","active","href","link","title","label","length","SidebarMenuSub","SidebarMenuSubItem","SidebarMenuSubButton","id","SidebarRail"],"mappings":"AAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAIA,YAAYC,OAAOC,cAAc;AACrC,IAAIC,mBAAmBF,OAAOG,wBAAwB;AACtD,IAAIC,oBAAoBJ,OAAOK,mBAAmB;AAClD,IAAIC,eAAeN,OAAOO,SAAS,CAACC,cAAc;AAClD,IAAIC,WAAW,SAACC,QAAQC;IACtB,IAAK,IAAIC,QAAQD,IACfZ,UAAUW,QAAQE,MAAM;QAAEC,KAAKF,GAAG,CAACC,KAAK;QAAEE,YAAY;IAAK;AAC/D;AACA,IAAIC,cAAc,SAACC,IAAIC,MAAMC,QAAQC;IACnC,IAAIF,QAAQ,CAAA,OAAOA,qCAAP,SAAOA,KAAG,MAAM,YAAY,OAAOA,SAAS,YAAY;YAC7D,kCAAA,2BAAA;;;gBAAA,IAAIG,MAAJ;gBACH,IAAI,CAACd,aAAae,IAAI,CAACL,IAAII,QAAQA,QAAQF,QACzCnB,UAAUiB,IAAII,KAAK;oBAAEP,KAAK;+BAAMI,IAAI,CAACG,IAAI;;oBAAEN,YAAY,CAAEK,CAAAA,OAAOjB,iBAAiBe,MAAMG,IAAG,KAAMD,KAAKL,UAAU;gBAAC;;YAFpH,QAAK,YAAWV,kBAAkBa,0BAA7B,SAAA,6BAAA,QAAA,yBAAA;;YAAA;YAAA;;;qBAAA,6BAAA;oBAAA;;;oBAAA;0BAAA;;;;IAGP;IACA,OAAOD;AACT;AACA,IAAIM,eAAe,SAACC;WAAQR,YAAYhB,UAAU,CAA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,MAAMN,MAAKO,IAAA;4DAAMC,OAAOR,MAAKS,KAAA;4DAC3BjB,UAAAQ,MAAKS,KAAA;wDAAA;oDACV;gDACJ,GARqBT,MAAKS,KAS9B;;wCACH,KAEL;qCAAA;gCAAA,GAtBcT,KAAKc,EAuB3B;;wBACH;oBACL;gBAER;YACJ;YAEJ,aAAA,GAAA,CAAA,GAAA9B,mBAAAS,GAAA,EAACZ,eAAAkC,WAAA,EAAA,CAAA;SAAY;;AAGzB;ADtBA,6DAA6D;AAC7D,KAAMpC,CAAAA,OAAOC,OAAO,GAAG;IACrBF,YAAAA;AACF,CAAA","sourcesContent":["\"use strict\";\n\"use client\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/sidebar.tsx\nvar sidebar_exports = {};\n__export(sidebar_exports, {\n AppSidebar: () => AppSidebar\n});\nmodule.exports = __toCommonJS(sidebar_exports);\nvar import_sidebar = require(\"@c-rex/ui/sidebar\");\nvar import_skeleton = require(\"@c-rex/ui/skeleton\");\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nfunction AppSidebar({ data, loading, ...props }) {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_sidebar.Sidebar, { collapsible: \"icon\", ...props, className: \"top-20\", children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sidebar.SidebarContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sidebar.SidebarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sidebar.SidebarMenu, { className: \"pt-4\", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: \"w-auto h-10 mb-2\" }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: \"w-auto h-10 mb-2\" }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: \"w-auto h-10 mb-2 ml-8\" }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: \"w-auto h-10 mb-2 ml-8\" }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: \"w-auto h-10 mb-2 ml-8\" }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: \"w-auto h-10 mb-2 ml-8\" }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: \"w-auto h-10 mb-2\" })\n ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: data.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_sidebar.SidebarMenuItem, { children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sidebar.SidebarMenuButton, { asChild: true, isActive: item.active, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"a\", { href: item.link, title: item.label, children: item.label }) }),\n item.children?.length ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sidebar.SidebarMenuSub, { children: item.children.map((item2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sidebar.SidebarMenuSubItem, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\n import_sidebar.SidebarMenuSubButton,\n {\n asChild: true,\n isActive: item2.active,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"a\", { href: item2.link, title: item2.label, children: item2.label })\n }\n ) }, item2.label)) }) : null\n ] }, item.id)) }) }) }) }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sidebar.SidebarRail, {})\n ] });\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n AppSidebar\n});\n","\"use client\";\n\nimport { ComponentProps } from \"react\";\nimport {\n Sidebar,\n SidebarContent,\n SidebarGroup,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarRail\n} from \"@c-rex/ui/sidebar\";\nimport { Skeleton } from \"@c-rex/ui/skeleton\";\nimport { TreeOfContent } from \"@c-rex/interfaces\";\n\ninterface SidebarProps extends ComponentProps<typeof Sidebar> {\n data: TreeOfContent[];\n loading?: boolean;\n}\n\nexport function AppSidebar({ data, loading, ...props }: SidebarProps) {\n return (\n <Sidebar collapsible=\"icon\" {...props} className=\"top-20\">\n <SidebarContent>\n <SidebarGroup>\n <SidebarMenu className=\"pt-4\">\n {loading ? (\n <>\n <Skeleton className=\"w-auto h-10 mb-2\" />\n <Skeleton className=\"w-auto h-10 mb-2\" />\n <Skeleton className=\"w-auto h-10 mb-2 ml-8\" />\n <Skeleton className=\"w-auto h-10 mb-2 ml-8\" />\n <Skeleton className=\"w-auto h-10 mb-2 ml-8\" />\n <Skeleton className=\"w-auto h-10 mb-2 ml-8\" />\n <Skeleton className=\"w-auto h-10 mb-2\" />\n </>\n ) : (\n <>\n {data.map((item) => (\n <SidebarMenuItem key={item.id}>\n <SidebarMenuButton asChild isActive={item.active}>\n <a href={item.link} title={item.label}>\n {item.label}\n </a>\n </SidebarMenuButton>\n\n {item.children?.length ? (\n <SidebarMenuSub>\n {item.children.map((item) => (\n <SidebarMenuSubItem key={item.label}>\n <SidebarMenuSubButton\n asChild\n isActive={item.active}\n >\n <a href={item.link} title={item.label}>\n {item.label}\n </a>\n </SidebarMenuSubButton>\n </SidebarMenuSubItem>\n ))}\n </SidebarMenuSub>\n ) : null}\n </SidebarMenuItem>\n ))}\n </>\n )}\n </SidebarMenu>\n </SidebarGroup>\n </SidebarContent>\n <SidebarRail />\n </Sidebar>\n );\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
import { Sidebar } from '@c-rex/ui/sidebar';
|
|
4
|
+
import { TreeOfContent } from '@c-rex/interfaces';
|
|
5
|
+
|
|
6
|
+
interface SidebarProps extends ComponentProps<typeof Sidebar> {
|
|
7
|
+
data: TreeOfContent[];
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare function AppSidebar({ data, loading, ...props }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
11
|
+
|
|
12
|
+
export { AppSidebar };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
import { Sidebar } from '@c-rex/ui/sidebar';
|
|
4
|
+
import { TreeOfContent } from '@c-rex/interfaces';
|
|
5
|
+
|
|
6
|
+
interface SidebarProps extends ComponentProps<typeof Sidebar> {
|
|
7
|
+
data: TreeOfContent[];
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare function AppSidebar({ data, loading, ...props }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
11
|
+
|
|
12
|
+
export { AppSidebar };
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function _define_property(obj, key, value) {
|
|
3
|
+
if (key in obj) {
|
|
4
|
+
Object.defineProperty(obj, key, {
|
|
5
|
+
value: value,
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
writable: true
|
|
9
|
+
});
|
|
10
|
+
} else {
|
|
11
|
+
obj[key] = value;
|
|
12
|
+
}
|
|
13
|
+
return obj;
|
|
14
|
+
}
|
|
15
|
+
function _object_spread(target) {
|
|
16
|
+
for(var i = 1; i < arguments.length; i++){
|
|
17
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
18
|
+
var ownKeys = Object.keys(source);
|
|
19
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
20
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
21
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
ownKeys.forEach(function(key) {
|
|
25
|
+
_define_property(target, key, source[key]);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return target;
|
|
29
|
+
}
|
|
30
|
+
function ownKeys(object, enumerableOnly) {
|
|
31
|
+
var keys = Object.keys(object);
|
|
32
|
+
if (Object.getOwnPropertySymbols) {
|
|
33
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
34
|
+
if (enumerableOnly) {
|
|
35
|
+
symbols = symbols.filter(function(sym) {
|
|
36
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
keys.push.apply(keys, symbols);
|
|
40
|
+
}
|
|
41
|
+
return keys;
|
|
42
|
+
}
|
|
43
|
+
function _object_spread_props(target, source) {
|
|
44
|
+
source = source != null ? source : {};
|
|
45
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
46
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
47
|
+
} else {
|
|
48
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
49
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return target;
|
|
53
|
+
}
|
|
54
|
+
function _object_without_properties(source, excluded) {
|
|
55
|
+
if (source == null) return {};
|
|
56
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
57
|
+
var key, i;
|
|
58
|
+
if (Object.getOwnPropertySymbols) {
|
|
59
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
60
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
61
|
+
key = sourceSymbolKeys[i];
|
|
62
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
63
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
64
|
+
target[key] = source[key];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return target;
|
|
68
|
+
}
|
|
69
|
+
function _object_without_properties_loose(source, excluded) {
|
|
70
|
+
if (source == null) return {};
|
|
71
|
+
var target = {};
|
|
72
|
+
var sourceKeys = Object.keys(source);
|
|
73
|
+
var key, i;
|
|
74
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
75
|
+
key = sourceKeys[i];
|
|
76
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
77
|
+
target[key] = source[key];
|
|
78
|
+
}
|
|
79
|
+
return target;
|
|
80
|
+
}
|
|
81
|
+
// src/sidebar.tsx
|
|
82
|
+
import { Sidebar, SidebarContent, SidebarGroup, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarRail } from "@c-rex/ui/sidebar";
|
|
83
|
+
import { Skeleton } from "@c-rex/ui/skeleton";
|
|
84
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
85
|
+
function AppSidebar(_param) {
|
|
86
|
+
var data = _param.data, loading = _param.loading, props = _object_without_properties(_param, [
|
|
87
|
+
"data",
|
|
88
|
+
"loading"
|
|
89
|
+
]);
|
|
90
|
+
return /* @__PURE__ */ jsxs(Sidebar, _object_spread_props(_object_spread({
|
|
91
|
+
collapsible: "icon"
|
|
92
|
+
}, props), {
|
|
93
|
+
className: "top-20",
|
|
94
|
+
children: [
|
|
95
|
+
/* @__PURE__ */ jsx(SidebarContent, {
|
|
96
|
+
children: /* @__PURE__ */ jsx(SidebarGroup, {
|
|
97
|
+
children: /* @__PURE__ */ jsx(SidebarMenu, {
|
|
98
|
+
className: "pt-4",
|
|
99
|
+
children: loading ? /* @__PURE__ */ jsxs(Fragment, {
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ jsx(Skeleton, {
|
|
102
|
+
className: "w-auto h-10 mb-2"
|
|
103
|
+
}),
|
|
104
|
+
/* @__PURE__ */ jsx(Skeleton, {
|
|
105
|
+
className: "w-auto h-10 mb-2"
|
|
106
|
+
}),
|
|
107
|
+
/* @__PURE__ */ jsx(Skeleton, {
|
|
108
|
+
className: "w-auto h-10 mb-2 ml-8"
|
|
109
|
+
}),
|
|
110
|
+
/* @__PURE__ */ jsx(Skeleton, {
|
|
111
|
+
className: "w-auto h-10 mb-2 ml-8"
|
|
112
|
+
}),
|
|
113
|
+
/* @__PURE__ */ jsx(Skeleton, {
|
|
114
|
+
className: "w-auto h-10 mb-2 ml-8"
|
|
115
|
+
}),
|
|
116
|
+
/* @__PURE__ */ jsx(Skeleton, {
|
|
117
|
+
className: "w-auto h-10 mb-2 ml-8"
|
|
118
|
+
}),
|
|
119
|
+
/* @__PURE__ */ jsx(Skeleton, {
|
|
120
|
+
className: "w-auto h-10 mb-2"
|
|
121
|
+
})
|
|
122
|
+
]
|
|
123
|
+
}) : /* @__PURE__ */ jsx(Fragment, {
|
|
124
|
+
children: data.map(function(item) {
|
|
125
|
+
var _item_children;
|
|
126
|
+
return /* @__PURE__ */ jsxs(SidebarMenuItem, {
|
|
127
|
+
children: [
|
|
128
|
+
/* @__PURE__ */ jsx(SidebarMenuButton, {
|
|
129
|
+
asChild: true,
|
|
130
|
+
isActive: item.active,
|
|
131
|
+
children: /* @__PURE__ */ jsx("a", {
|
|
132
|
+
href: item.link,
|
|
133
|
+
title: item.label,
|
|
134
|
+
children: item.label
|
|
135
|
+
})
|
|
136
|
+
}),
|
|
137
|
+
((_item_children = item.children) === null || _item_children === void 0 ? void 0 : _item_children.length) ? /* @__PURE__ */ jsx(SidebarMenuSub, {
|
|
138
|
+
children: item.children.map(function(item2) {
|
|
139
|
+
return /* @__PURE__ */ jsx(SidebarMenuSubItem, {
|
|
140
|
+
children: /* @__PURE__ */ jsx(SidebarMenuSubButton, {
|
|
141
|
+
asChild: true,
|
|
142
|
+
isActive: item2.active,
|
|
143
|
+
children: /* @__PURE__ */ jsx("a", {
|
|
144
|
+
href: item2.link,
|
|
145
|
+
title: item2.label,
|
|
146
|
+
children: item2.label
|
|
147
|
+
})
|
|
148
|
+
})
|
|
149
|
+
}, item2.label);
|
|
150
|
+
})
|
|
151
|
+
}) : null
|
|
152
|
+
]
|
|
153
|
+
}, item.id);
|
|
154
|
+
})
|
|
155
|
+
})
|
|
156
|
+
})
|
|
157
|
+
})
|
|
158
|
+
}),
|
|
159
|
+
/* @__PURE__ */ jsx(SidebarRail, {})
|
|
160
|
+
]
|
|
161
|
+
}));
|
|
162
|
+
}
|
|
163
|
+
export { AppSidebar };
|
|
164
|
+
//# sourceMappingURL=sidebar.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/periotto/Desktop/workspace/c-rex.net-web-client-foundation/packages/components/dist/sidebar.esm.js","../src/sidebar.tsx"],"names":["Sidebar","SidebarContent","SidebarGroup","SidebarMenu","SidebarMenuButton","SidebarMenuItem","SidebarMenuSub","SidebarMenuSubButton","SidebarMenuSubItem","SidebarRail","Skeleton","Fragment","jsx","jsxs","AppSidebar","data","loading","props","collapsible","className","children","map","item","asChild","isActive","active","href","link","title","label","length","id"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kBAAkB;ACClB,SACIA,OAAA,EACAC,cAAA,EACAC,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AAON,KAAKO,KAAA;gDAC3BT,UAAAE,KAAKO,KAAA;4CAAA;wCACV;wCAGHP,EAAAA,iBAAAA,KAAKF,QAAA,cAALE,qCAAAA,eAAeQ,MAAA,IACZ,aAAA,GAAAlB,IAACN,gBAAA;4CACIc,UAAAE,KAAKF,QAAA,CAASC,GAAA,CAAI,SAACC;uDAChB,aAAA,GAAAV,IAACJ,oBAAA;oDACGY,UAAA,aAAA,GAAAR,IAACL,sBAAA;wDACGgB,SAAO;wDACPC,UAAUF,MAAKG,MAAA;wDAEfL,UAAA,aAAA,GAAAR,IAAC,KAAA;4DAAEc,MAAMJ,MAAKK,IAAA;4DAAMC,OAAON,MAAKO,KAAA;4DAC3BT,UAAAE,MAAKO,KAAA;wDAAA;oDACV;gDACJ,GARqBP,MAAKO,KAS9B;;wCACH,KAEL;qCAAA;gCAAA,GAtBcP,KAAKS,EAuB3B;;wBACH;oBACL;gBAER;YACJ;YAEJ,aAAA,GAAAnB,IAACH,aAAA,CAAA;SAAY;;AAGzB;ADlCA,SACEK,UAAU,GACV","sourcesContent":["\"use client\";\n\n// src/sidebar.tsx\nimport {\n Sidebar,\n SidebarContent,\n SidebarGroup,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarRail\n} from \"@c-rex/ui/sidebar\";\nimport { Skeleton } from \"@c-rex/ui/skeleton\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nfunction AppSidebar({ data, loading, ...props }) {\n return /* @__PURE__ */ jsxs(Sidebar, { collapsible: \"icon\", ...props, className: \"top-20\", children: [\n /* @__PURE__ */ jsx(SidebarContent, { children: /* @__PURE__ */ jsx(SidebarGroup, { children: /* @__PURE__ */ jsx(SidebarMenu, { className: \"pt-4\", children: loading ? /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(Skeleton, { className: \"w-auto h-10 mb-2\" }),\n /* @__PURE__ */ jsx(Skeleton, { className: \"w-auto h-10 mb-2\" }),\n /* @__PURE__ */ jsx(Skeleton, { className: \"w-auto h-10 mb-2 ml-8\" }),\n /* @__PURE__ */ jsx(Skeleton, { className: \"w-auto h-10 mb-2 ml-8\" }),\n /* @__PURE__ */ jsx(Skeleton, { className: \"w-auto h-10 mb-2 ml-8\" }),\n /* @__PURE__ */ jsx(Skeleton, { className: \"w-auto h-10 mb-2 ml-8\" }),\n /* @__PURE__ */ jsx(Skeleton, { className: \"w-auto h-10 mb-2\" })\n ] }) : /* @__PURE__ */ jsx(Fragment, { children: data.map((item) => /* @__PURE__ */ jsxs(SidebarMenuItem, { children: [\n /* @__PURE__ */ jsx(SidebarMenuButton, { asChild: true, isActive: item.active, children: /* @__PURE__ */ jsx(\"a\", { href: item.link, title: item.label, children: item.label }) }),\n item.children?.length ? /* @__PURE__ */ jsx(SidebarMenuSub, { children: item.children.map((item2) => /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx(\n SidebarMenuSubButton,\n {\n asChild: true,\n isActive: item2.active,\n children: /* @__PURE__ */ jsx(\"a\", { href: item2.link, title: item2.label, children: item2.label })\n }\n ) }, item2.label)) }) : null\n ] }, item.id)) }) }) }) }),\n /* @__PURE__ */ jsx(SidebarRail, {})\n ] });\n}\nexport {\n AppSidebar\n};\n","\"use client\";\n\nimport { ComponentProps } from \"react\";\nimport {\n Sidebar,\n SidebarContent,\n SidebarGroup,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarRail\n} from \"@c-rex/ui/sidebar\";\nimport { Skeleton } from \"@c-rex/ui/skeleton\";\nimport { TreeOfContent } from \"@c-rex/interfaces\";\n\ninterface SidebarProps extends ComponentProps<typeof Sidebar> {\n data: TreeOfContent[];\n loading?: boolean;\n}\n\nexport function AppSidebar({ data, loading, ...props }: SidebarProps) {\n return (\n <Sidebar collapsible=\"icon\" {...props} className=\"top-20\">\n <SidebarContent>\n <SidebarGroup>\n <SidebarMenu className=\"pt-4\">\n {loading ? (\n <>\n <Skeleton className=\"w-auto h-10 mb-2\" />\n <Skeleton className=\"w-auto h-10 mb-2\" />\n <Skeleton className=\"w-auto h-10 mb-2 ml-8\" />\n <Skeleton className=\"w-auto h-10 mb-2 ml-8\" />\n <Skeleton className=\"w-auto h-10 mb-2 ml-8\" />\n <Skeleton className=\"w-auto h-10 mb-2 ml-8\" />\n <Skeleton className=\"w-auto h-10 mb-2\" />\n </>\n ) : (\n <>\n {data.map((item) => (\n <SidebarMenuItem key={item.id}>\n <SidebarMenuButton asChild isActive={item.active}>\n <a href={item.link} title={item.label}>\n {item.label}\n </a>\n </SidebarMenuButton>\n\n {item.children?.length ? (\n <SidebarMenuSub>\n {item.children.map((item) => (\n <SidebarMenuSubItem key={item.label}>\n <SidebarMenuSubButton\n asChild\n isActive={item.active}\n >\n <a href={item.link} title={item.label}>\n {item.label}\n </a>\n </SidebarMenuSubButton>\n </SidebarMenuSubItem>\n ))}\n </SidebarMenuSub>\n ) : null}\n </SidebarMenuItem>\n ))}\n </>\n )}\n </SidebarMenu>\n </SidebarGroup>\n </SidebarContent>\n <SidebarRail />\n </Sidebar>\n );\n}\n"]}
|