@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,247 @@
|
|
|
1
|
+
// src/empty.tsx
|
|
2
|
+
function _array_like_to_array(arr, len) {
|
|
3
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
4
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
5
|
+
return arr2;
|
|
6
|
+
}
|
|
7
|
+
function _array_with_holes(arr) {
|
|
8
|
+
if (Array.isArray(arr)) return arr;
|
|
9
|
+
}
|
|
10
|
+
function _define_property(obj, key, value) {
|
|
11
|
+
if (key in obj) {
|
|
12
|
+
Object.defineProperty(obj, key, {
|
|
13
|
+
value: value,
|
|
14
|
+
enumerable: true,
|
|
15
|
+
configurable: true,
|
|
16
|
+
writable: true
|
|
17
|
+
});
|
|
18
|
+
} else {
|
|
19
|
+
obj[key] = value;
|
|
20
|
+
}
|
|
21
|
+
return obj;
|
|
22
|
+
}
|
|
23
|
+
function _iterable_to_array_limit(arr, i) {
|
|
24
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
25
|
+
if (_i == null) return;
|
|
26
|
+
var _arr = [];
|
|
27
|
+
var _n = true;
|
|
28
|
+
var _d = false;
|
|
29
|
+
var _s, _e;
|
|
30
|
+
try {
|
|
31
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
32
|
+
_arr.push(_s.value);
|
|
33
|
+
if (i && _arr.length === i) break;
|
|
34
|
+
}
|
|
35
|
+
} catch (err) {
|
|
36
|
+
_d = true;
|
|
37
|
+
_e = err;
|
|
38
|
+
} finally{
|
|
39
|
+
try {
|
|
40
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
41
|
+
} finally{
|
|
42
|
+
if (_d) throw _e;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return _arr;
|
|
46
|
+
}
|
|
47
|
+
function _non_iterable_rest() {
|
|
48
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
49
|
+
}
|
|
50
|
+
function _object_spread(target) {
|
|
51
|
+
for(var i = 1; i < arguments.length; i++){
|
|
52
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
53
|
+
var ownKeys = Object.keys(source);
|
|
54
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
55
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
56
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
ownKeys.forEach(function(key) {
|
|
60
|
+
_define_property(target, key, source[key]);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return target;
|
|
64
|
+
}
|
|
65
|
+
function ownKeys(object, enumerableOnly) {
|
|
66
|
+
var keys = Object.keys(object);
|
|
67
|
+
if (Object.getOwnPropertySymbols) {
|
|
68
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
69
|
+
if (enumerableOnly) {
|
|
70
|
+
symbols = symbols.filter(function(sym) {
|
|
71
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
keys.push.apply(keys, symbols);
|
|
75
|
+
}
|
|
76
|
+
return keys;
|
|
77
|
+
}
|
|
78
|
+
function _object_spread_props(target, source) {
|
|
79
|
+
source = source != null ? source : {};
|
|
80
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
81
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
82
|
+
} else {
|
|
83
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
84
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return target;
|
|
88
|
+
}
|
|
89
|
+
function _sliced_to_array(arr, i) {
|
|
90
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
91
|
+
}
|
|
92
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
93
|
+
if (!o) return;
|
|
94
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
95
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
96
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
97
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
98
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
99
|
+
}
|
|
100
|
+
import { Alert, AlertDescription, AlertTitle } from "@c-rex/ui/alert";
|
|
101
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
102
|
+
var Empty = function() {
|
|
103
|
+
return /* @__PURE__ */ jsxs(Alert, {
|
|
104
|
+
className: "my-2",
|
|
105
|
+
children: [
|
|
106
|
+
/* @__PURE__ */ jsx(AlertTitle, {
|
|
107
|
+
children: "No results"
|
|
108
|
+
}),
|
|
109
|
+
/* @__PURE__ */ jsx(AlertDescription, {
|
|
110
|
+
children: "No data available. Please try adjusting your search or filter criteria."
|
|
111
|
+
})
|
|
112
|
+
]
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
// src/blog-card.tsx
|
|
116
|
+
import Link from "next/link";
|
|
117
|
+
// ../utils/src/classMerge.ts
|
|
118
|
+
import { clsx } from "clsx";
|
|
119
|
+
import { twMerge } from "tailwind-merge";
|
|
120
|
+
function cn() {
|
|
121
|
+
for(var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++){
|
|
122
|
+
inputs[_key] = arguments[_key];
|
|
123
|
+
}
|
|
124
|
+
return twMerge(clsx(inputs));
|
|
125
|
+
}
|
|
126
|
+
// src/blur-image.tsx
|
|
127
|
+
import { useState } from "react";
|
|
128
|
+
import Image from "next/image";
|
|
129
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
130
|
+
var BlurImage = function(props) {
|
|
131
|
+
var _useState = _sliced_to_array(useState(true), 2), isLoading = _useState[0], setLoading = _useState[1];
|
|
132
|
+
return /* @__PURE__ */ jsx2(Image, _object_spread_props(_object_spread({}, props), {
|
|
133
|
+
alt: props.alt,
|
|
134
|
+
className: cn(props.className, "duration-500 ease-in-out", isLoading ? "blur-sm" : "blur-0"),
|
|
135
|
+
onLoad: function() {
|
|
136
|
+
return setLoading(false);
|
|
137
|
+
}
|
|
138
|
+
}));
|
|
139
|
+
};
|
|
140
|
+
// src/blog-card.tsx
|
|
141
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
142
|
+
var BlogCard = function(param) {
|
|
143
|
+
var data = param.data, priority = param.priority, _param_horizontal = param.horizontal, horizontal = _param_horizontal === void 0 ? false : _param_horizontal;
|
|
144
|
+
return /* @__PURE__ */ jsxs2("article", {
|
|
145
|
+
className: cn("group relative", horizontal ? "grid grid-cols-1 gap-3 md:grid-cols-2 md:gap-6" : "flex flex-col space-y-2"),
|
|
146
|
+
children: [
|
|
147
|
+
data.image && /* @__PURE__ */ jsx3("div", {
|
|
148
|
+
className: "w-full overflow-hidden rounded-xl border",
|
|
149
|
+
children: /* @__PURE__ */ jsx3(BlurImage, {
|
|
150
|
+
alt: data.title,
|
|
151
|
+
blurDataURL: data.blurDataURL,
|
|
152
|
+
className: cn("size-full object-cover object-center", horizontal ? "lg:h-72" : null),
|
|
153
|
+
width: 800,
|
|
154
|
+
height: 400,
|
|
155
|
+
priority: priority,
|
|
156
|
+
placeholder: "blur",
|
|
157
|
+
src: data.image,
|
|
158
|
+
sizes: "(max-width: 768px) 750px, 600px"
|
|
159
|
+
})
|
|
160
|
+
}),
|
|
161
|
+
/* @__PURE__ */ jsxs2("div", {
|
|
162
|
+
className: cn("flex flex-1 flex-col", horizontal ? "justify-center" : "justify-between"),
|
|
163
|
+
children: [
|
|
164
|
+
/* @__PURE__ */ jsxs2("div", {
|
|
165
|
+
className: "w-full",
|
|
166
|
+
children: [
|
|
167
|
+
/* @__PURE__ */ jsx3("h2", {
|
|
168
|
+
className: "my-1.5 line-clamp-2 font-heading text-2xl",
|
|
169
|
+
children: data.title
|
|
170
|
+
}),
|
|
171
|
+
data.description && /* @__PURE__ */ jsx3("p", {
|
|
172
|
+
className: "line-clamp-2 text-muted-foreground",
|
|
173
|
+
children: data.description
|
|
174
|
+
})
|
|
175
|
+
]
|
|
176
|
+
}),
|
|
177
|
+
/* @__PURE__ */ jsxs2("div", {
|
|
178
|
+
className: "mt-4 flex items-center space-x-3",
|
|
179
|
+
children: [
|
|
180
|
+
/* @__PURE__ */ jsx3("div", {
|
|
181
|
+
className: "flex items-center -space-x-2",
|
|
182
|
+
children: data.authors && /* @__PURE__ */ jsx3("p", {
|
|
183
|
+
className: "text-sm text-muted-foreground",
|
|
184
|
+
children: data.authors
|
|
185
|
+
})
|
|
186
|
+
}),
|
|
187
|
+
data.date && /* @__PURE__ */ jsx3("p", {
|
|
188
|
+
className: "text-sm text-muted-foreground",
|
|
189
|
+
children: data.date
|
|
190
|
+
})
|
|
191
|
+
]
|
|
192
|
+
})
|
|
193
|
+
]
|
|
194
|
+
}),
|
|
195
|
+
/* @__PURE__ */ jsx3(Link, {
|
|
196
|
+
href: data.slug,
|
|
197
|
+
className: "absolute inset-0",
|
|
198
|
+
target: "_blank",
|
|
199
|
+
children: /* @__PURE__ */ jsx3("span", {
|
|
200
|
+
className: "sr-only",
|
|
201
|
+
children: "View Article"
|
|
202
|
+
})
|
|
203
|
+
})
|
|
204
|
+
]
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
// src/result-view/blog.tsx
|
|
208
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
209
|
+
var BlogView = function(param) {
|
|
210
|
+
var items = param.items;
|
|
211
|
+
var getTitle = function(labels) {
|
|
212
|
+
return labels.map(function(item) {
|
|
213
|
+
return item.value;
|
|
214
|
+
}).join();
|
|
215
|
+
};
|
|
216
|
+
return /* @__PURE__ */ jsx4("div", {
|
|
217
|
+
className: "grid gap-8 md:grid-cols-2 md:gap-x-6 md:gap-y-10 xl:grid-cols-3",
|
|
218
|
+
children: items.map(function(item, index) {
|
|
219
|
+
return /* @__PURE__ */ jsx4(BlogCard, {
|
|
220
|
+
data: {
|
|
221
|
+
title: getTitle(item.labels),
|
|
222
|
+
blurDataURL: "/img/blog-post-1.webp",
|
|
223
|
+
image: "/img/blog-post-1.webp",
|
|
224
|
+
description: "item.shortDescription",
|
|
225
|
+
authors: "item.authors",
|
|
226
|
+
_id: "item._id",
|
|
227
|
+
date: "item.date",
|
|
228
|
+
slug: "info/".concat(item.shortId)
|
|
229
|
+
}
|
|
230
|
+
}, index);
|
|
231
|
+
})
|
|
232
|
+
});
|
|
233
|
+
};
|
|
234
|
+
var blog_default = BlogView;
|
|
235
|
+
// src/result-list.tsx
|
|
236
|
+
import { Fragment, jsx as jsx5 } from "react/jsx-runtime";
|
|
237
|
+
var ViewComponent = blog_default;
|
|
238
|
+
var ResultList = function(param) {
|
|
239
|
+
var items = param.items;
|
|
240
|
+
return /* @__PURE__ */ jsx5(Fragment, {
|
|
241
|
+
children: items.length == 0 ? /* @__PURE__ */ jsx5(Empty, {}) : /* @__PURE__ */ jsx5(ViewComponent, {
|
|
242
|
+
items: items
|
|
243
|
+
})
|
|
244
|
+
});
|
|
245
|
+
};
|
|
246
|
+
export { ResultList };
|
|
247
|
+
//# sourceMappingURL=result-list.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/periotto/Desktop/workspace/c-rex.net-web-client-foundation/packages/components/dist/result-list.esm.js","../src/empty.tsx","../src/blog-card.tsx","../../utils/src/classMerge.ts","../src/blur-image.tsx","../src/result-view/blog.tsx","../src/result-list.tsx"],"names":["Alert","AlertDescription","AlertTitle","jsx","jsxs","Empty","className","children","Link","clsx","twMerge","cn","inputs","useState","Image","BlurImage","props","isLoading","setLoading","alt","onLoad","BlogCard","data","priority","horizontal","image","title","blurDataURL","width","height","placeholder","src","sizes","description","authors","date","href","slug","target","BlogView","items","getTitle","labels","map","item","value","join","index","_id","shortId","blog_default","Fragment","ViewComponent","ResultList","length"],"mappings":"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","sourcesContent":["// src/empty.tsx\nimport { Alert, AlertDescription, AlertTitle } from \"@c-rex/ui/alert\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nvar Empty = () => {\n return /* @__PURE__ */ jsxs(Alert, { className: \"my-2\", children: [\n /* @__PURE__ */ jsx(AlertTitle, { children: \"No results\" }),\n /* @__PURE__ */ jsx(AlertDescription, { children: \"No data available. Please try adjusting your search or filter criteria.\" })\n ] });\n};\n\n// src/blog-card.tsx\nimport Link from \"next/link\";\n\n// ../utils/src/classMerge.ts\nimport { clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\nfunction cn(...inputs) {\n return twMerge(clsx(inputs));\n}\n\n// src/blur-image.tsx\nimport { useState } from \"react\";\nimport Image from \"next/image\";\nimport { jsx as jsx2 } from \"react/jsx-runtime\";\nvar BlurImage = (props) => {\n const [isLoading, setLoading] = useState(true);\n return /* @__PURE__ */ jsx2(\n Image,\n {\n ...props,\n alt: props.alt,\n className: cn(\n props.className,\n \"duration-500 ease-in-out\",\n isLoading ? \"blur-sm\" : \"blur-0\"\n ),\n onLoad: () => setLoading(false)\n }\n );\n};\n\n// src/blog-card.tsx\nimport { jsx as jsx3, jsxs as jsxs2 } from \"react/jsx-runtime\";\nvar BlogCard = ({\n data,\n priority,\n horizontal = false\n}) => {\n return /* @__PURE__ */ jsxs2(\n \"article\",\n {\n className: cn(\n \"group relative\",\n horizontal ? \"grid grid-cols-1 gap-3 md:grid-cols-2 md:gap-6\" : \"flex flex-col space-y-2\"\n ),\n children: [\n data.image && /* @__PURE__ */ jsx3(\"div\", { className: \"w-full overflow-hidden rounded-xl border\", children: /* @__PURE__ */ jsx3(\n BlurImage,\n {\n alt: data.title,\n blurDataURL: data.blurDataURL,\n className: cn(\n \"size-full object-cover object-center\",\n horizontal ? \"lg:h-72\" : null\n ),\n width: 800,\n height: 400,\n priority,\n placeholder: \"blur\",\n src: data.image,\n sizes: \"(max-width: 768px) 750px, 600px\"\n }\n ) }),\n /* @__PURE__ */ jsxs2(\n \"div\",\n {\n className: cn(\n \"flex flex-1 flex-col\",\n horizontal ? \"justify-center\" : \"justify-between\"\n ),\n children: [\n /* @__PURE__ */ jsxs2(\"div\", { className: \"w-full\", children: [\n /* @__PURE__ */ jsx3(\"h2\", { className: \"my-1.5 line-clamp-2 font-heading text-2xl\", children: data.title }),\n data.description && /* @__PURE__ */ jsx3(\"p\", { className: \"line-clamp-2 text-muted-foreground\", children: data.description })\n ] }),\n /* @__PURE__ */ jsxs2(\"div\", { className: \"mt-4 flex items-center space-x-3\", children: [\n /* @__PURE__ */ jsx3(\"div\", { className: \"flex items-center -space-x-2\", children: data.authors && /* @__PURE__ */ jsx3(\"p\", { className: \"text-sm text-muted-foreground\", children: data.authors }) }),\n data.date && /* @__PURE__ */ jsx3(\"p\", { className: \"text-sm text-muted-foreground\", children: data.date })\n ] })\n ]\n }\n ),\n /* @__PURE__ */ jsx3(Link, { href: data.slug, className: \"absolute inset-0\", target: \"_blank\", children: /* @__PURE__ */ jsx3(\"span\", { className: \"sr-only\", children: \"View Article\" }) })\n ]\n }\n );\n};\n\n// src/result-view/blog.tsx\nimport { jsx as jsx4 } from \"react/jsx-runtime\";\nvar BlogView = ({ items }) => {\n const getTitle = (labels) => {\n return labels.map((item) => item.value).join();\n };\n return /* @__PURE__ */ jsx4(\"div\", { className: \"grid gap-8 md:grid-cols-2 md:gap-x-6 md:gap-y-10 xl:grid-cols-3\", children: items.map((item, index) => {\n return /* @__PURE__ */ jsx4(\n BlogCard,\n {\n data: {\n title: getTitle(item.labels),\n blurDataURL: \"/img/blog-post-1.webp\",\n image: \"/img/blog-post-1.webp\",\n description: \"item.shortDescription\",\n authors: \"item.authors\",\n _id: \"item._id\",\n date: \"item.date\",\n slug: `info/${item.shortId}`\n }\n },\n index\n );\n }) });\n};\nvar blog_default = BlogView;\n\n// src/result-list.tsx\nimport { Fragment, jsx as jsx5 } from \"react/jsx-runtime\";\nvar ViewComponent = blog_default;\nvar ResultList = ({ items }) => {\n return /* @__PURE__ */ jsx5(Fragment, { children: items.length == 0 ? /* @__PURE__ */ jsx5(Empty, {}) : /* @__PURE__ */ jsx5(ViewComponent, { items }) });\n};\nexport {\n ResultList\n};\n","import { FC } from \"react\";\nimport { Alert, AlertDescription, AlertTitle } from \"@c-rex/ui/alert\";\n\nexport const Empty: FC = () => {\n return (\n <Alert className=\"my-2\">\n <AlertTitle>No results</AlertTitle>\n <AlertDescription>\n No data available. Please try adjusting your search or filter criteria.\n </AlertDescription>\n </Alert>\n );\n};","import Link from \"next/link\";\nimport { cn } from \"@c-rex/utils\";\nimport { BlurImage } from \"./blur-image\";\n\n//import Author from \"./author\";\n\ninterface BlogCardProp {\n data: {\n title: string;\n blurDataURL: string;\n image: string;\n description: string;\n authors: string;\n _id: string;\n date: string;\n slug: string;\n };\n priority?: boolean;\n horizontal?: boolean;\n}\n\nexport const BlogCard = ({\n data,\n priority,\n horizontal = false,\n}: BlogCardProp) => {\n return (\n <article\n className={cn(\n \"group relative\",\n horizontal\n ? \"grid grid-cols-1 gap-3 md:grid-cols-2 md:gap-6\"\n : \"flex flex-col space-y-2\",\n )}\n >\n {data.image && (\n <div className=\"w-full overflow-hidden rounded-xl border\">\n <BlurImage\n alt={data.title}\n blurDataURL={data.blurDataURL}\n className={cn(\n \"size-full object-cover object-center\",\n horizontal ? \"lg:h-72\" : null,\n )}\n width={800}\n height={400}\n priority={priority}\n placeholder=\"blur\"\n src={data.image}\n sizes=\"(max-width: 768px) 750px, 600px\"\n />\n </div>\n )}\n <div\n className={cn(\n \"flex flex-1 flex-col\",\n horizontal ? \"justify-center\" : \"justify-between\",\n )}\n >\n <div className=\"w-full\">\n <h2 className=\"my-1.5 line-clamp-2 font-heading text-2xl\">\n {data.title}\n </h2>\n {data.description && (\n <p className=\"line-clamp-2 text-muted-foreground\">\n {data.description}\n </p>\n )}\n </div>\n <div className=\"mt-4 flex items-center space-x-3\">\n <div className=\"flex items-center -space-x-2\">\n {data.authors && (\n <p className=\"text-sm text-muted-foreground\">{data.authors}</p>\n )}\n </div>\n\n {data.date && (\n <p className=\"text-sm text-muted-foreground\">{data.date}</p>\n )}\n </div>\n </div>\n <Link href={data.slug} className=\"absolute inset-0\" target=\"_blank\">\n <span className=\"sr-only\">View Article</span>\n </Link>\n </article>\n );\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport { useState } from \"react\";\nimport type { ComponentProps } from \"react\";\nimport Image from \"next/image\";\nimport { cn } from \"@c-rex/utils\";\n\nexport const BlurImage = (props: ComponentProps<typeof Image>) => {\n const [isLoading, setLoading] = useState(true);\n\n return (\n <Image\n {...props}\n alt={props.alt}\n className={cn(\n props.className,\n \"duration-500 ease-in-out\",\n isLoading ? \"blur-sm\" : \"blur-0\",\n )}\n onLoad={() => setLoading(false)}\n />\n );\n}\n","import { FC } from \"react\";\n\nimport { BlogCard } from \"../blog-card\";\nimport { informationUnitsItems, Labels } from \"@c-rex/interfaces\";\n\ninterface BlogViewProps {\n items: informationUnitsItems[];\n}\n\nconst BlogView: FC<BlogViewProps> = ({ items }) => {\n const getTitle = (labels: Labels[]): string => {\n return labels.map((item) => item.value).join();\n };\n\n return (\n <div className=\"grid gap-8 md:grid-cols-2 md:gap-x-6 md:gap-y-10 xl:grid-cols-3\">\n {items.map((item, index) => {\n return (\n <BlogCard\n key={index}\n data={{\n title: getTitle(item.labels),\n blurDataURL: \"/img/blog-post-1.webp\",\n image: \"/img/blog-post-1.webp\",\n description: \"item.shortDescription\",\n authors: \"item.authors\",\n _id: \"item._id\",\n date: \"item.date\",\n slug: `info/${item.shortId}`,\n }}\n />\n );\n })}\n </div>\n );\n};\n\nexport default BlogView;\n","import { FC } from \"react\";\nimport { informationUnitsItems } from \"@c-rex/interfaces\";\nimport { Empty } from \"./empty\";\n//import { CUSTOMER_CONFIG } from '@/config/customerConfig';\n//import { RESULT_VIEW_OPTIONS } from '@/constants/components';\nimport BlogView from './result-view/blog';\n\nconst ViewComponent = BlogView;\n\ninterface ResultListProps {\n items: informationUnitsItems[];\n}\n\nexport const ResultList: FC<ResultListProps> = ({ items }) => {\n return <>{items.length == 0 ? <Empty /> : <ViewComponent items={items} />}</>;\n};\n"]}
|
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
function _array_like_to_array(arr, len) {
|
|
3
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
4
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
5
|
+
return arr2;
|
|
6
|
+
}
|
|
7
|
+
function _array_with_holes(arr) {
|
|
8
|
+
if (Array.isArray(arr)) return arr;
|
|
9
|
+
}
|
|
10
|
+
function _define_property(obj, key, value) {
|
|
11
|
+
if (key in obj) {
|
|
12
|
+
Object.defineProperty(obj, key, {
|
|
13
|
+
value: value,
|
|
14
|
+
enumerable: true,
|
|
15
|
+
configurable: true,
|
|
16
|
+
writable: true
|
|
17
|
+
});
|
|
18
|
+
} else {
|
|
19
|
+
obj[key] = value;
|
|
20
|
+
}
|
|
21
|
+
return obj;
|
|
22
|
+
}
|
|
23
|
+
function _iterable_to_array_limit(arr, i) {
|
|
24
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
25
|
+
if (_i == null) return;
|
|
26
|
+
var _arr = [];
|
|
27
|
+
var _n = true;
|
|
28
|
+
var _d = false;
|
|
29
|
+
var _s, _e;
|
|
30
|
+
try {
|
|
31
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
32
|
+
_arr.push(_s.value);
|
|
33
|
+
if (i && _arr.length === i) break;
|
|
34
|
+
}
|
|
35
|
+
} catch (err) {
|
|
36
|
+
_d = true;
|
|
37
|
+
_e = err;
|
|
38
|
+
} finally{
|
|
39
|
+
try {
|
|
40
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
41
|
+
} finally{
|
|
42
|
+
if (_d) throw _e;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return _arr;
|
|
46
|
+
}
|
|
47
|
+
function _non_iterable_rest() {
|
|
48
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
49
|
+
}
|
|
50
|
+
function _object_spread(target) {
|
|
51
|
+
for(var i = 1; i < arguments.length; i++){
|
|
52
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
53
|
+
var ownKeys = Object.keys(source);
|
|
54
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
55
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
56
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
ownKeys.forEach(function(key) {
|
|
60
|
+
_define_property(target, key, source[key]);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return target;
|
|
64
|
+
}
|
|
65
|
+
function ownKeys(object, enumerableOnly) {
|
|
66
|
+
var keys = Object.keys(object);
|
|
67
|
+
if (Object.getOwnPropertySymbols) {
|
|
68
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
69
|
+
if (enumerableOnly) {
|
|
70
|
+
symbols = symbols.filter(function(sym) {
|
|
71
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
keys.push.apply(keys, symbols);
|
|
75
|
+
}
|
|
76
|
+
return keys;
|
|
77
|
+
}
|
|
78
|
+
function _object_spread_props(target, source) {
|
|
79
|
+
source = source != null ? source : {};
|
|
80
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
81
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
82
|
+
} else {
|
|
83
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
84
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return target;
|
|
88
|
+
}
|
|
89
|
+
function _sliced_to_array(arr, i) {
|
|
90
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
91
|
+
}
|
|
92
|
+
function _type_of(obj) {
|
|
93
|
+
"@swc/helpers - typeof";
|
|
94
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
95
|
+
}
|
|
96
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
97
|
+
if (!o) return;
|
|
98
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
99
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
100
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
101
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
102
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
103
|
+
}
|
|
104
|
+
var __create = Object.create;
|
|
105
|
+
var __defProp = Object.defineProperty;
|
|
106
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
107
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
108
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
109
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
110
|
+
var __export = function(target, all) {
|
|
111
|
+
for(var name in all)__defProp(target, name, {
|
|
112
|
+
get: all[name],
|
|
113
|
+
enumerable: true
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
var __copyProps = function(to, from, except, desc) {
|
|
117
|
+
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
|
118
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
119
|
+
try {
|
|
120
|
+
var _loop = function() {
|
|
121
|
+
var key = _step.value;
|
|
122
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
123
|
+
get: function() {
|
|
124
|
+
return from[key];
|
|
125
|
+
},
|
|
126
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
for(var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
|
|
130
|
+
} catch (err) {
|
|
131
|
+
_didIteratorError = true;
|
|
132
|
+
_iteratorError = err;
|
|
133
|
+
} finally{
|
|
134
|
+
try {
|
|
135
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
136
|
+
_iterator.return();
|
|
137
|
+
}
|
|
138
|
+
} finally{
|
|
139
|
+
if (_didIteratorError) {
|
|
140
|
+
throw _iteratorError;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return to;
|
|
146
|
+
};
|
|
147
|
+
var __toESM = function(mod, isNodeMode, target) {
|
|
148
|
+
return target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(// If the importer is in node compatibility mode or this is not an ESM
|
|
149
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
150
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
151
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
152
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
153
|
+
value: mod,
|
|
154
|
+
enumerable: true
|
|
155
|
+
}) : target, mod);
|
|
156
|
+
};
|
|
157
|
+
var __toCommonJS = function(mod) {
|
|
158
|
+
return __copyProps(__defProp({}, "__esModule", {
|
|
159
|
+
value: true
|
|
160
|
+
}), mod);
|
|
161
|
+
};
|
|
162
|
+
// src/result-view/blog-view.stories.tsx
|
|
163
|
+
var blog_view_stories_exports = {};
|
|
164
|
+
__export(blog_view_stories_exports, {
|
|
165
|
+
Default: function() {
|
|
166
|
+
return Default;
|
|
167
|
+
},
|
|
168
|
+
default: function() {
|
|
169
|
+
return blog_view_stories_default;
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
module.exports = __toCommonJS(blog_view_stories_exports);
|
|
173
|
+
// src/blog-card.tsx
|
|
174
|
+
var import_link = __toESM(require("next/link"), 1);
|
|
175
|
+
// ../utils/src/classMerge.ts
|
|
176
|
+
var import_clsx = require("clsx");
|
|
177
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
178
|
+
function cn() {
|
|
179
|
+
for(var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++){
|
|
180
|
+
inputs[_key] = arguments[_key];
|
|
181
|
+
}
|
|
182
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
183
|
+
}
|
|
184
|
+
// src/blur-image.tsx
|
|
185
|
+
var import_react = require("react");
|
|
186
|
+
var import_image = __toESM(require("next/image"), 1);
|
|
187
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
188
|
+
var BlurImage = function(props) {
|
|
189
|
+
var _ref = _sliced_to_array((0, import_react.useState)(true), 2), isLoading = _ref[0], setLoading = _ref[1];
|
|
190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, _object_spread_props(_object_spread({}, props), {
|
|
191
|
+
alt: props.alt,
|
|
192
|
+
className: cn(props.className, "duration-500 ease-in-out", isLoading ? "blur-sm" : "blur-0"),
|
|
193
|
+
onLoad: function() {
|
|
194
|
+
return setLoading(false);
|
|
195
|
+
}
|
|
196
|
+
}));
|
|
197
|
+
};
|
|
198
|
+
// src/blog-card.tsx
|
|
199
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
200
|
+
var BlogCard = function(param) {
|
|
201
|
+
var data = param.data, priority = param.priority, _param_horizontal = param.horizontal, horizontal = _param_horizontal === void 0 ? false : _param_horizontal;
|
|
202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("article", {
|
|
203
|
+
className: cn("group relative", horizontal ? "grid grid-cols-1 gap-3 md:grid-cols-2 md:gap-6" : "flex flex-col space-y-2"),
|
|
204
|
+
children: [
|
|
205
|
+
data.image && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
206
|
+
className: "w-full overflow-hidden rounded-xl border",
|
|
207
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BlurImage, {
|
|
208
|
+
alt: data.title,
|
|
209
|
+
blurDataURL: data.blurDataURL,
|
|
210
|
+
className: cn("size-full object-cover object-center", horizontal ? "lg:h-72" : null),
|
|
211
|
+
width: 800,
|
|
212
|
+
height: 400,
|
|
213
|
+
priority: priority,
|
|
214
|
+
placeholder: "blur",
|
|
215
|
+
src: data.image,
|
|
216
|
+
sizes: "(max-width: 768px) 750px, 600px"
|
|
217
|
+
})
|
|
218
|
+
}),
|
|
219
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
220
|
+
className: cn("flex flex-1 flex-col", horizontal ? "justify-center" : "justify-between"),
|
|
221
|
+
children: [
|
|
222
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
223
|
+
className: "w-full",
|
|
224
|
+
children: [
|
|
225
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", {
|
|
226
|
+
className: "my-1.5 line-clamp-2 font-heading text-2xl",
|
|
227
|
+
children: data.title
|
|
228
|
+
}),
|
|
229
|
+
data.description && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", {
|
|
230
|
+
className: "line-clamp-2 text-muted-foreground",
|
|
231
|
+
children: data.description
|
|
232
|
+
})
|
|
233
|
+
]
|
|
234
|
+
}),
|
|
235
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
236
|
+
className: "mt-4 flex items-center space-x-3",
|
|
237
|
+
children: [
|
|
238
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
239
|
+
className: "flex items-center -space-x-2",
|
|
240
|
+
children: data.authors && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", {
|
|
241
|
+
className: "text-sm text-muted-foreground",
|
|
242
|
+
children: data.authors
|
|
243
|
+
})
|
|
244
|
+
}),
|
|
245
|
+
data.date && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", {
|
|
246
|
+
className: "text-sm text-muted-foreground",
|
|
247
|
+
children: data.date
|
|
248
|
+
})
|
|
249
|
+
]
|
|
250
|
+
})
|
|
251
|
+
]
|
|
252
|
+
}),
|
|
253
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_link.default, {
|
|
254
|
+
href: data.slug,
|
|
255
|
+
className: "absolute inset-0",
|
|
256
|
+
target: "_blank",
|
|
257
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
258
|
+
className: "sr-only",
|
|
259
|
+
children: "View Article"
|
|
260
|
+
})
|
|
261
|
+
})
|
|
262
|
+
]
|
|
263
|
+
});
|
|
264
|
+
};
|
|
265
|
+
// src/result-view/blog.tsx
|
|
266
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
267
|
+
var BlogView = function(param) {
|
|
268
|
+
var items = param.items;
|
|
269
|
+
var getTitle = function(labels) {
|
|
270
|
+
return labels.map(function(item) {
|
|
271
|
+
return item.value;
|
|
272
|
+
}).join();
|
|
273
|
+
};
|
|
274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", {
|
|
275
|
+
className: "grid gap-8 md:grid-cols-2 md:gap-x-6 md:gap-y-10 xl:grid-cols-3",
|
|
276
|
+
children: items.map(function(item, index) {
|
|
277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(BlogCard, {
|
|
278
|
+
data: {
|
|
279
|
+
title: getTitle(item.labels),
|
|
280
|
+
blurDataURL: "/img/blog-post-1.webp",
|
|
281
|
+
image: "/img/blog-post-1.webp",
|
|
282
|
+
description: "item.shortDescription",
|
|
283
|
+
authors: "item.authors",
|
|
284
|
+
_id: "item._id",
|
|
285
|
+
date: "item.date",
|
|
286
|
+
slug: "info/".concat(item.shortId)
|
|
287
|
+
}
|
|
288
|
+
}, index);
|
|
289
|
+
})
|
|
290
|
+
});
|
|
291
|
+
};
|
|
292
|
+
var blog_default = BlogView;
|
|
293
|
+
// src/result-view/blog-view.stories.tsx
|
|
294
|
+
var meta = {
|
|
295
|
+
title: "Components/ResultView/Blog",
|
|
296
|
+
component: blog_default,
|
|
297
|
+
parameters: {
|
|
298
|
+
layout: "centered"
|
|
299
|
+
},
|
|
300
|
+
tags: [
|
|
301
|
+
"autodocs"
|
|
302
|
+
]
|
|
303
|
+
};
|
|
304
|
+
var blog_view_stories_default = meta;
|
|
305
|
+
var mockItems = [
|
|
306
|
+
{
|
|
307
|
+
id: "1",
|
|
308
|
+
shortId: "doc-1",
|
|
309
|
+
labels: [
|
|
310
|
+
{
|
|
311
|
+
value: "Getting Started with C-Rex",
|
|
312
|
+
language: "en-US"
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
value: "Come\xE7ando com C-Rex",
|
|
316
|
+
language: "pt-BR"
|
|
317
|
+
}
|
|
318
|
+
],
|
|
319
|
+
languages: [
|
|
320
|
+
"pt-BR"
|
|
321
|
+
],
|
|
322
|
+
type: "document",
|
|
323
|
+
renditions: [],
|
|
324
|
+
directoryNodes: []
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
id: "2",
|
|
328
|
+
shortId: "doc-2",
|
|
329
|
+
labels: [
|
|
330
|
+
{
|
|
331
|
+
value: "Advanced Configuration Guide",
|
|
332
|
+
language: "en-US"
|
|
333
|
+
}
|
|
334
|
+
],
|
|
335
|
+
languages: [
|
|
336
|
+
"en-US"
|
|
337
|
+
],
|
|
338
|
+
type: "document",
|
|
339
|
+
renditions: [],
|
|
340
|
+
directoryNodes: []
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
id: "3",
|
|
344
|
+
shortId: "doc-3",
|
|
345
|
+
labels: [
|
|
346
|
+
{
|
|
347
|
+
value: "API Documentation",
|
|
348
|
+
language: "en-US"
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
value: "Documentation API",
|
|
352
|
+
language: "fr-FR"
|
|
353
|
+
}
|
|
354
|
+
],
|
|
355
|
+
languages: [
|
|
356
|
+
"fr-FR"
|
|
357
|
+
],
|
|
358
|
+
type: "document",
|
|
359
|
+
renditions: [],
|
|
360
|
+
directoryNodes: []
|
|
361
|
+
}
|
|
362
|
+
];
|
|
363
|
+
var Default = {
|
|
364
|
+
args: {
|
|
365
|
+
items: mockItems
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
369
|
+
0 && (module.exports = {
|
|
370
|
+
Default: Default
|
|
371
|
+
});
|
|
372
|
+
//# sourceMappingURL=blog-view.stories.cjs.js.map
|