@c-rex/components 0.0.6 → 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/{components/src/blog-card.d.ts → blog-card.d.cts} +5 -3
- package/dist/{src/blog-card.d.ts → blog-card.d.ts} +5 -3
- 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/{components/src/providers/search-state-wrapper.d.ts → providers/search-state-wrapper.d.cts} +5 -4
- package/dist/{src/providers → providers}/search-state-wrapper.d.ts +5 -4
- 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/{components/src/stories → stories}/blur-image.stories.d.ts +12 -7
- 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 +30 -18
- package/dist/components/src/autocomplete.d.ts +0 -8
- package/dist/components/src/autocomplete.d.ts.map +0 -1
- package/dist/components/src/autocomplete.js +0 -36
- package/dist/components/src/blog-card.d.ts.map +0 -1
- package/dist/components/src/blog-card.js +0 -16
- package/dist/components/src/blur-image.d.ts +0 -4
- package/dist/components/src/blur-image.d.ts.map +0 -1
- package/dist/components/src/blur-image.js +0 -16
- package/dist/components/src/breadcrumb.d.ts +0 -9
- package/dist/components/src/breadcrumb.d.ts.map +0 -1
- package/dist/components/src/breadcrumb.js +0 -33
- package/dist/components/src/empty.d.ts +0 -3
- package/dist/components/src/empty.d.ts.map +0 -1
- package/dist/components/src/empty.js +0 -9
- package/dist/components/src/navbar.d.ts +0 -8
- package/dist/components/src/navbar.d.ts.map +0 -1
- package/dist/components/src/navbar.js +0 -14
- package/dist/components/src/providers/search-state-wrapper.d.ts.map +0 -1
- package/dist/components/src/providers/search-state-wrapper.js +0 -10
- package/dist/components/src/result-list.d.ts +0 -8
- package/dist/components/src/result-list.d.ts.map +0 -1
- package/dist/components/src/result-list.js +0 -16
- package/dist/components/src/result-view/blog-view.stories.d.ts +0 -7
- package/dist/components/src/result-view/blog-view.stories.d.ts.map +0 -1
- package/dist/components/src/result-view/blog-view.stories.js +0 -58
- package/dist/components/src/result-view/blog.d.ts +0 -8
- package/dist/components/src/result-view/blog.d.ts.map +0 -1
- package/dist/components/src/result-view/blog.js +0 -22
- package/dist/components/src/result-view/table-view.stories.d.ts +0 -7
- package/dist/components/src/result-view/table-view.stories.d.ts.map +0 -1
- package/dist/components/src/result-view/table-view.stories.js +0 -55
- package/dist/components/src/result-view/table.d.ts +0 -8
- package/dist/components/src/result-view/table.d.ts.map +0 -1
- package/dist/components/src/result-view/table.js +0 -26
- package/dist/components/src/sidebar.d.ts +0 -10
- package/dist/components/src/sidebar.d.ts.map +0 -1
- package/dist/components/src/sidebar.js +0 -10
- package/dist/components/src/stories/blog-card.stories.d.ts +0 -7
- package/dist/components/src/stories/blog-card.stories.d.ts.map +0 -1
- package/dist/components/src/stories/blog-card.stories.js +0 -42
- package/dist/components/src/stories/blur-image.stories.d.ts.map +0 -1
- package/dist/components/src/stories/blur-image.stories.js +0 -47
- package/dist/components/src/stories/breadcrumb.stories.d.ts +0 -7
- package/dist/components/src/stories/breadcrumb.stories.d.ts.map +0 -1
- package/dist/components/src/stories/breadcrumb.stories.js +0 -48
- package/dist/components/src/stories/empty.stories.d.ts +0 -10
- package/dist/components/src/stories/empty.stories.d.ts.map +0 -1
- package/dist/components/src/stories/empty.stories.js +0 -11
- package/dist/components/src/stories/navbar.stories.d.ts +0 -6
- package/dist/components/src/stories/navbar.stories.d.ts.map +0 -1
- package/dist/components/src/stories/navbar.stories.js +0 -14
- package/dist/components/src/stories/sidebar.stories.d.ts +0 -24
- package/dist/components/src/stories/sidebar.stories.d.ts.map +0 -1
- package/dist/components/src/stories/sidebar.stories.js +0 -80
- package/dist/components/tailwind.config.d.ts +0 -2
- package/dist/components/tailwind.config.d.ts.map +0 -1
- package/dist/components/tailwind.config.js +0 -15
- package/dist/config/src/index.d.ts +0 -4
- package/dist/config/src/index.d.ts.map +0 -1
- package/dist/config/src/index.js +0 -67
- package/dist/constants/src/index.d.ts +0 -17
- package/dist/constants/src/index.d.ts.map +0 -1
- package/dist/constants/src/index.js +0 -30
- package/dist/contexts/src/index.d.ts +0 -15
- package/dist/contexts/src/index.d.ts.map +0 -1
- package/dist/contexts/src/index.js +0 -18
- package/dist/interfaces/src/common.d.ts +0 -36
- package/dist/interfaces/src/common.d.ts.map +0 -1
- package/dist/interfaces/src/common.js +0 -2
- package/dist/interfaces/src/config.d.ts +0 -26
- package/dist/interfaces/src/config.d.ts.map +0 -1
- package/dist/interfaces/src/config.js +0 -2
- package/dist/interfaces/src/directoryNodes.d.ts +0 -8
- package/dist/interfaces/src/directoryNodes.d.ts.map +0 -1
- package/dist/interfaces/src/directoryNodes.js +0 -2
- package/dist/interfaces/src/documentTypes.d.ts +0 -7
- package/dist/interfaces/src/documentTypes.d.ts.map +0 -1
- package/dist/interfaces/src/documentTypes.js +0 -2
- package/dist/interfaces/src/index.d.ts +0 -7
- package/dist/interfaces/src/index.d.ts.map +0 -1
- package/dist/interfaces/src/index.js +0 -22
- package/dist/interfaces/src/informationUnits.d.ts +0 -53
- package/dist/interfaces/src/informationUnits.d.ts.map +0 -1
- package/dist/interfaces/src/informationUnits.js +0 -2
- package/dist/interfaces/src/treeOfContent.d.ts +0 -8
- package/dist/interfaces/src/treeOfContent.d.ts.map +0 -1
- package/dist/interfaces/src/treeOfContent.js +0 -2
- package/dist/src/autocomplete.d.ts +0 -8
- package/dist/src/autocomplete.d.ts.map +0 -1
- package/dist/src/blog-card.d.ts.map +0 -1
- package/dist/src/blur-image.d.ts +0 -4
- package/dist/src/blur-image.d.ts.map +0 -1
- package/dist/src/breadcrumb.d.ts +0 -9
- package/dist/src/breadcrumb.d.ts.map +0 -1
- package/dist/src/empty.d.ts +0 -3
- package/dist/src/empty.d.ts.map +0 -1
- package/dist/src/navbar.d.ts +0 -8
- package/dist/src/navbar.d.ts.map +0 -1
- package/dist/src/providers/search-state-wrapper.d.ts.map +0 -1
- package/dist/src/result-list.d.ts +0 -8
- package/dist/src/result-list.d.ts.map +0 -1
- package/dist/src/result-view/blog.d.ts +0 -8
- package/dist/src/result-view/blog.d.ts.map +0 -1
- package/dist/src/result-view/table.d.ts +0 -8
- package/dist/src/result-view/table.d.ts.map +0 -1
- package/dist/src/sidebar.d.ts +0 -10
- package/dist/src/sidebar.d.ts.map +0 -1
- package/dist/tailwind.config.d.ts +0 -2
- package/dist/tailwind.config.d.ts.map +0 -1
- package/dist/types/src/index.d.ts +0 -8
- package/dist/types/src/index.d.ts.map +0 -1
- package/dist/types/src/index.js +0 -2
- package/dist/utils/src/breadcrumbs.d.ts +0 -3
- package/dist/utils/src/breadcrumbs.d.ts.map +0 -1
- package/dist/utils/src/breadcrumbs.js +0 -14
- package/dist/utils/src/classMerge.d.ts +0 -3
- package/dist/utils/src/classMerge.d.ts.map +0 -1
- package/dist/utils/src/classMerge.js +0 -8
- package/dist/utils/src/index.d.ts +0 -5
- package/dist/utils/src/index.d.ts.map +0 -1
- package/dist/utils/src/index.js +0 -20
- package/dist/utils/src/treeOfContent.d.ts +0 -2
- package/dist/utils/src/treeOfContent.d.ts.map +0 -1
- package/dist/utils/src/treeOfContent.js +0 -85
- package/dist/utils/src/utils.d.ts +0 -8
- package/dist/utils/src/utils.d.ts.map +0 -1
- package/dist/utils/src/utils.js +0 -37
- 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
package/src/result-list.tsx
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
import { informationUnitsItems } from "@c-rex/interfaces";
|
|
3
|
-
import { Empty } from "./empty";
|
|
4
|
-
//import { CUSTOMER_CONFIG } from '@/config/customerConfig';
|
|
5
|
-
//import { RESULT_VIEW_OPTIONS } from '@/constants/components';
|
|
6
|
-
import BlogView from './result-view/blog';
|
|
7
|
-
|
|
8
|
-
const ViewComponent = BlogView;
|
|
9
|
-
|
|
10
|
-
interface ResultListProps {
|
|
11
|
-
items: informationUnitsItems[];
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const ResultList: FC<ResultListProps> = ({ items }) => {
|
|
15
|
-
return <>{items.length == 0 ? <Empty /> : <ViewComponent items={items} />}</>;
|
|
16
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import BlogView from '../result-view/blog';
|
|
3
|
-
|
|
4
|
-
const meta: Meta<typeof BlogView> = {
|
|
5
|
-
title: 'Components/ResultView/Blog',
|
|
6
|
-
component: BlogView,
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: 'centered',
|
|
9
|
-
},
|
|
10
|
-
tags: ['autodocs'],
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export default meta;
|
|
14
|
-
type Story = StoryObj<typeof BlogView>;
|
|
15
|
-
|
|
16
|
-
const mockItems = [
|
|
17
|
-
{
|
|
18
|
-
id: '1',
|
|
19
|
-
shortId: 'doc-1',
|
|
20
|
-
labels: [
|
|
21
|
-
{ value: 'Getting Started with C-Rex', language: 'en-US' },
|
|
22
|
-
{ value: 'Começando com C-Rex', language: 'pt-BR' }
|
|
23
|
-
],
|
|
24
|
-
languages: ['pt-BR'],
|
|
25
|
-
type: 'document',
|
|
26
|
-
renditions: [],
|
|
27
|
-
directoryNodes: []
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
id: '2',
|
|
31
|
-
shortId: 'doc-2',
|
|
32
|
-
labels: [
|
|
33
|
-
{ value: 'Advanced Configuration Guide', language: 'en-US' }
|
|
34
|
-
],
|
|
35
|
-
languages: ['en-US'],
|
|
36
|
-
type: 'document',
|
|
37
|
-
renditions: [],
|
|
38
|
-
directoryNodes: []
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
id: '3',
|
|
42
|
-
shortId: 'doc-3',
|
|
43
|
-
labels: [
|
|
44
|
-
{ value: 'API Documentation', language: 'en-US' },
|
|
45
|
-
{ value: 'Documentation API', language: 'fr-FR' }
|
|
46
|
-
],
|
|
47
|
-
languages: ['fr-FR'],
|
|
48
|
-
type: 'document',
|
|
49
|
-
renditions: [],
|
|
50
|
-
directoryNodes: []
|
|
51
|
-
}
|
|
52
|
-
];
|
|
53
|
-
|
|
54
|
-
export const Default: Story = {
|
|
55
|
-
args: {
|
|
56
|
-
items: mockItems as any
|
|
57
|
-
}
|
|
58
|
-
};
|
package/src/result-view/blog.tsx
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
|
|
3
|
-
import { BlogCard } from "../blog-card";
|
|
4
|
-
import { informationUnitsItems, Labels } from "@c-rex/interfaces";
|
|
5
|
-
|
|
6
|
-
interface BlogViewProps {
|
|
7
|
-
items: informationUnitsItems[];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const BlogView: FC<BlogViewProps> = ({ items }) => {
|
|
11
|
-
const getTitle = (labels: Labels[]): string => {
|
|
12
|
-
return labels.map((item) => item.value).join();
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<div className="grid gap-8 md:grid-cols-2 md:gap-x-6 md:gap-y-10 xl:grid-cols-3">
|
|
17
|
-
{items.map((item, index) => {
|
|
18
|
-
return (
|
|
19
|
-
<BlogCard
|
|
20
|
-
key={index}
|
|
21
|
-
data={{
|
|
22
|
-
title: getTitle(item.labels),
|
|
23
|
-
blurDataURL: "/img/blog-post-1.webp",
|
|
24
|
-
image: "/img/blog-post-1.webp",
|
|
25
|
-
description: "item.shortDescription",
|
|
26
|
-
authors: "item.authors",
|
|
27
|
-
_id: "item._id",
|
|
28
|
-
date: "item.date",
|
|
29
|
-
slug: `info/${item.shortId}`,
|
|
30
|
-
}}
|
|
31
|
-
/>
|
|
32
|
-
);
|
|
33
|
-
})}
|
|
34
|
-
</div>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export default BlogView;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import TableView from '../result-view/table';
|
|
3
|
-
|
|
4
|
-
const meta: Meta<typeof TableView> = {
|
|
5
|
-
title: 'Components/ResultView/Table',
|
|
6
|
-
component: TableView,
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: 'centered',
|
|
9
|
-
},
|
|
10
|
-
tags: ['autodocs'],
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export default meta;
|
|
14
|
-
type Story = StoryObj<typeof TableView>;
|
|
15
|
-
|
|
16
|
-
const mockItems = [
|
|
17
|
-
{
|
|
18
|
-
id: '1',
|
|
19
|
-
labels: [
|
|
20
|
-
{ value: 'Installation Guide', language: 'en-US' },
|
|
21
|
-
{ value: 'Guide d\'installation', language: 'fr-FR' }
|
|
22
|
-
],
|
|
23
|
-
languages: ['fr-FR'],
|
|
24
|
-
type: 'document',
|
|
25
|
-
renditions: [],
|
|
26
|
-
directoryNodes: []
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
id: '2',
|
|
30
|
-
labels: [
|
|
31
|
-
{ value: 'User Manual', language: 'en-US' },
|
|
32
|
-
{ value: 'Manual del Usuario', language: 'es-ES' }
|
|
33
|
-
],
|
|
34
|
-
languages: ['es-ES'],
|
|
35
|
-
type: 'document',
|
|
36
|
-
renditions: [],
|
|
37
|
-
directoryNodes: []
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
id: '3',
|
|
41
|
-
labels: [
|
|
42
|
-
{ value: 'Technical Specifications', language: 'en-US' }
|
|
43
|
-
],
|
|
44
|
-
languages: ['en-US'],
|
|
45
|
-
type: 'document',
|
|
46
|
-
renditions: [],
|
|
47
|
-
directoryNodes: []
|
|
48
|
-
}
|
|
49
|
-
];
|
|
50
|
-
|
|
51
|
-
export const Default: Story = {
|
|
52
|
-
args: {
|
|
53
|
-
items: mockItems as any
|
|
54
|
-
}
|
|
55
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { FC, ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
Table,
|
|
5
|
-
TableBody,
|
|
6
|
-
TableCell,
|
|
7
|
-
TableHeader,
|
|
8
|
-
TableRow,
|
|
9
|
-
} from "@c-rex/ui/table";
|
|
10
|
-
import { informationUnitsItems, Labels } from "@c-rex/interfaces";
|
|
11
|
-
//import { getFlagIcon } from '@c-rex/utils/index';
|
|
12
|
-
|
|
13
|
-
interface TableViewProps {
|
|
14
|
-
items: informationUnitsItems[];
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const TableView: FC<TableViewProps> = ({ items }) => {
|
|
18
|
-
const getTitle = (labels: Labels[]): string => {
|
|
19
|
-
return labels.map((item) => item.value).join();
|
|
20
|
-
};
|
|
21
|
-
const getIcons = (languages: string[]): ReactNode[] => {
|
|
22
|
-
return languages.map((lang, index) => {
|
|
23
|
-
const aux = lang.split("-")[1];
|
|
24
|
-
|
|
25
|
-
/*
|
|
26
|
-
const FlagIcon = getFlagIcon(aux);
|
|
27
|
-
|
|
28
|
-
return FlagIcon && (
|
|
29
|
-
<div key={index} style={{ width: 36 }} className="border me-3">
|
|
30
|
-
<FlagIcon />
|
|
31
|
-
</div>
|
|
32
|
-
)
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<div key={index} style={{ width: 36 }} className="border me-3">
|
|
37
|
-
{aux}
|
|
38
|
-
</div>
|
|
39
|
-
);
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<div className="rounded-md border">
|
|
45
|
-
<Table>
|
|
46
|
-
<TableHeader>
|
|
47
|
-
<TableRow>
|
|
48
|
-
<TableCell>Title</TableCell>
|
|
49
|
-
<TableCell>Country</TableCell>
|
|
50
|
-
</TableRow>
|
|
51
|
-
</TableHeader>
|
|
52
|
-
<TableBody>
|
|
53
|
-
{items.map((item, index) => (
|
|
54
|
-
<TableRow key={index}>
|
|
55
|
-
<TableCell>{getTitle(item.labels)}</TableCell>
|
|
56
|
-
<TableCell>{getIcons(item.languages)}</TableCell>
|
|
57
|
-
</TableRow>
|
|
58
|
-
))}
|
|
59
|
-
</TableBody>
|
|
60
|
-
</Table>
|
|
61
|
-
</div>
|
|
62
|
-
);
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export default TableView;
|
package/src/sidebar.tsx
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { ComponentProps } from "react";
|
|
4
|
-
import {
|
|
5
|
-
Sidebar,
|
|
6
|
-
SidebarContent,
|
|
7
|
-
SidebarGroup,
|
|
8
|
-
SidebarMenu,
|
|
9
|
-
SidebarMenuButton,
|
|
10
|
-
SidebarMenuItem,
|
|
11
|
-
SidebarMenuSub,
|
|
12
|
-
SidebarMenuSubButton,
|
|
13
|
-
SidebarMenuSubItem,
|
|
14
|
-
SidebarRail
|
|
15
|
-
} from "@c-rex/ui/sidebar";
|
|
16
|
-
import { Skeleton } from "@c-rex/ui/skeleton";
|
|
17
|
-
import { TreeOfContent } from "@c-rex/interfaces";
|
|
18
|
-
|
|
19
|
-
interface SidebarProps extends ComponentProps<typeof Sidebar> {
|
|
20
|
-
data: TreeOfContent[];
|
|
21
|
-
loading?: boolean;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function AppSidebar({ data, loading, ...props }: SidebarProps) {
|
|
25
|
-
return (
|
|
26
|
-
<Sidebar collapsible="icon" {...props} className="top-20">
|
|
27
|
-
<SidebarContent>
|
|
28
|
-
<SidebarGroup>
|
|
29
|
-
<SidebarMenu className="pt-4">
|
|
30
|
-
{loading ? (
|
|
31
|
-
<>
|
|
32
|
-
<Skeleton className="w-auto h-10 mb-2" />
|
|
33
|
-
<Skeleton className="w-auto h-10 mb-2" />
|
|
34
|
-
<Skeleton className="w-auto h-10 mb-2 ml-8" />
|
|
35
|
-
<Skeleton className="w-auto h-10 mb-2 ml-8" />
|
|
36
|
-
<Skeleton className="w-auto h-10 mb-2 ml-8" />
|
|
37
|
-
<Skeleton className="w-auto h-10 mb-2 ml-8" />
|
|
38
|
-
<Skeleton className="w-auto h-10 mb-2" />
|
|
39
|
-
</>
|
|
40
|
-
) : (
|
|
41
|
-
<>
|
|
42
|
-
{data.map((item) => (
|
|
43
|
-
<SidebarMenuItem key={item.id}>
|
|
44
|
-
<SidebarMenuButton asChild isActive={item.active}>
|
|
45
|
-
<a href={item.link} title={item.label}>
|
|
46
|
-
{item.label}
|
|
47
|
-
</a>
|
|
48
|
-
</SidebarMenuButton>
|
|
49
|
-
|
|
50
|
-
{item.children?.length ? (
|
|
51
|
-
<SidebarMenuSub>
|
|
52
|
-
{item.children.map((item) => (
|
|
53
|
-
<SidebarMenuSubItem key={item.label}>
|
|
54
|
-
<SidebarMenuSubButton
|
|
55
|
-
asChild
|
|
56
|
-
isActive={item.active}
|
|
57
|
-
>
|
|
58
|
-
<a href={item.link} title={item.label}>
|
|
59
|
-
{item.label}
|
|
60
|
-
</a>
|
|
61
|
-
</SidebarMenuSubButton>
|
|
62
|
-
</SidebarMenuSubItem>
|
|
63
|
-
))}
|
|
64
|
-
</SidebarMenuSub>
|
|
65
|
-
) : null}
|
|
66
|
-
</SidebarMenuItem>
|
|
67
|
-
))}
|
|
68
|
-
</>
|
|
69
|
-
)}
|
|
70
|
-
</SidebarMenu>
|
|
71
|
-
</SidebarGroup>
|
|
72
|
-
</SidebarContent>
|
|
73
|
-
<SidebarRail />
|
|
74
|
-
</Sidebar>
|
|
75
|
-
);
|
|
76
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { BlogCard } from '../blog-card';
|
|
3
|
-
|
|
4
|
-
const meta: Meta = {
|
|
5
|
-
title: 'Components/BlogCard',
|
|
6
|
-
component: BlogCard,
|
|
7
|
-
tags: ['autodocs',],
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: 'centered',
|
|
10
|
-
},
|
|
11
|
-
argTypes: {
|
|
12
|
-
data: { control: 'object', description: 'The data to be displayed in the card' },
|
|
13
|
-
priority: { control: 'boolean', description: 'Whether the image should be prioritized', type: 'boolean' },
|
|
14
|
-
horizontal: { control: 'boolean' },
|
|
15
|
-
},
|
|
16
|
-
} satisfies Meta<typeof BlogCard>;
|
|
17
|
-
|
|
18
|
-
export default meta;
|
|
19
|
-
type Story = StoryObj<typeof meta>;
|
|
20
|
-
|
|
21
|
-
const mockBlogData = {
|
|
22
|
-
title: 'Getting Started with C-Rex Components',
|
|
23
|
-
blurDataURL: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==',
|
|
24
|
-
image: 'https://images.pexels.com/photos/31712301/pexels-photo-31712301/free-photo-of-scenic-cycling-tour-in-andernach-fields.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',
|
|
25
|
-
description: 'Learn how to use C-Rex components to build modern web applications with React and Next.js.',
|
|
26
|
-
authors: 'John Doe',
|
|
27
|
-
_id: '1',
|
|
28
|
-
date: '2023-05-15',
|
|
29
|
-
slug: 'getting-started-with-c-rex-components',
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const Horizontal: Story = {
|
|
33
|
-
args: {
|
|
34
|
-
data: mockBlogData,
|
|
35
|
-
priority: false,
|
|
36
|
-
horizontal: true,
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const WithPriority: Story = {
|
|
41
|
-
args: {
|
|
42
|
-
data: mockBlogData,
|
|
43
|
-
priority: true,
|
|
44
|
-
horizontal: false,
|
|
45
|
-
},
|
|
46
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { BlurImage } from '../blur-image';
|
|
3
|
-
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Components/BlurImage',
|
|
6
|
-
component: BlurImage,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: 'centered',
|
|
10
|
-
},
|
|
11
|
-
argTypes: {
|
|
12
|
-
src: { control: 'text' },
|
|
13
|
-
alt: { control: 'text' },
|
|
14
|
-
width: { control: 'number' },
|
|
15
|
-
height: { control: 'number' },
|
|
16
|
-
className: { control: 'text' },
|
|
17
|
-
},
|
|
18
|
-
} satisfies Meta<typeof BlurImage>;
|
|
19
|
-
|
|
20
|
-
export default meta;
|
|
21
|
-
type Story = StoryObj<typeof meta>;
|
|
22
|
-
|
|
23
|
-
export const Default: Story = {
|
|
24
|
-
args: {
|
|
25
|
-
src: 'https://images.pexels.com/photos/31712301/pexels-photo-31712301/free-photo-of-scenic-cycling-tour-in-andernach-fields.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',
|
|
26
|
-
alt: 'Sample image with blur effect',
|
|
27
|
-
width: 400,
|
|
28
|
-
height: 300,
|
|
29
|
-
className: 'rounded-lg',
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const SmallImage: Story = {
|
|
34
|
-
args: {
|
|
35
|
-
src: 'https://images.pexels.com/photos/31712301/pexels-photo-31712301/free-photo-of-scenic-cycling-tour-in-andernach-fields.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',
|
|
36
|
-
alt: 'Small sample image with blur effect',
|
|
37
|
-
width: 200,
|
|
38
|
-
height: 150,
|
|
39
|
-
className: 'rounded-lg',
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export const RoundedImage: Story = {
|
|
44
|
-
args: {
|
|
45
|
-
src: 'https://images.pexels.com/photos/31712301/pexels-photo-31712301/free-photo-of-scenic-cycling-tour-in-andernach-fields.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',
|
|
46
|
-
alt: 'Rounded sample image with blur effect',
|
|
47
|
-
width: 300,
|
|
48
|
-
height: 300,
|
|
49
|
-
className: 'rounded-full',
|
|
50
|
-
},
|
|
51
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Breadcrumb } from '../breadcrumb';
|
|
3
|
-
|
|
4
|
-
const meta: Meta = {
|
|
5
|
-
title: 'Components/Breadcrumb',
|
|
6
|
-
component: Breadcrumb,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: 'centered',
|
|
10
|
-
}
|
|
11
|
-
} satisfies Meta;
|
|
12
|
-
|
|
13
|
-
export default meta;
|
|
14
|
-
type Story = StoryObj<typeof meta>;
|
|
15
|
-
|
|
16
|
-
const mockItems = [
|
|
17
|
-
{
|
|
18
|
-
id: 'docs',
|
|
19
|
-
label: 'Documentation',
|
|
20
|
-
link: '/docs',
|
|
21
|
-
active: false,
|
|
22
|
-
children: [],
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
id: 'components',
|
|
26
|
-
label: 'Components',
|
|
27
|
-
link: '/docs/components',
|
|
28
|
-
active: false,
|
|
29
|
-
children: [],
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
id: 'breadcrumb',
|
|
33
|
-
label: 'Breadcrumb',
|
|
34
|
-
link: '/docs/components/breadcrumb',
|
|
35
|
-
active: true,
|
|
36
|
-
children: [],
|
|
37
|
-
},
|
|
38
|
-
];
|
|
39
|
-
|
|
40
|
-
export const Default: Story = {
|
|
41
|
-
args: {
|
|
42
|
-
items: mockItems,
|
|
43
|
-
loading: false,
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const Loading: Story = {
|
|
48
|
-
args: {
|
|
49
|
-
items: [],
|
|
50
|
-
loading: true,
|
|
51
|
-
},
|
|
52
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Empty } from '../empty';
|
|
3
|
-
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Components/Empty',
|
|
6
|
-
component: Empty,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
} satisfies Meta<typeof Empty>;
|
|
9
|
-
|
|
10
|
-
export default meta;
|
|
11
|
-
type Story = StoryObj<typeof meta>;
|
|
12
|
-
|
|
13
|
-
export const Default: Story = {
|
|
14
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { NavBar } from '../navbar';
|
|
3
|
-
|
|
4
|
-
const meta: Meta = {
|
|
5
|
-
title: 'Components/NavBar',
|
|
6
|
-
component: NavBar,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: 'padded',
|
|
10
|
-
},
|
|
11
|
-
} satisfies Meta<typeof NavBar>;
|
|
12
|
-
|
|
13
|
-
export default meta;
|
|
14
|
-
type Story = StoryObj<typeof meta>;
|
|
15
|
-
|
|
16
|
-
export const Default: Story = {}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { AppSidebar } from '../sidebar';
|
|
3
|
-
import { SidebarInset, SidebarProvider, SidebarTrigger } from "@c-rex/ui/sidebar";
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'Components/Sidebar',
|
|
7
|
-
component: AppSidebar,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: 'centered',
|
|
11
|
-
},
|
|
12
|
-
argTypes: {
|
|
13
|
-
data: { control: 'object' },
|
|
14
|
-
loading: { control: 'boolean' },
|
|
15
|
-
},
|
|
16
|
-
decorators: [
|
|
17
|
-
(Story: any) => (
|
|
18
|
-
<SidebarProvider>
|
|
19
|
-
<SidebarTrigger />
|
|
20
|
-
|
|
21
|
-
<div className="flex">
|
|
22
|
-
<SidebarInset>
|
|
23
|
-
<Story />
|
|
24
|
-
</SidebarInset>
|
|
25
|
-
</div>
|
|
26
|
-
</SidebarProvider>
|
|
27
|
-
|
|
28
|
-
),
|
|
29
|
-
]
|
|
30
|
-
} satisfies Meta<typeof AppSidebar>;
|
|
31
|
-
|
|
32
|
-
export default meta;
|
|
33
|
-
type Story = StoryObj<typeof meta>;
|
|
34
|
-
|
|
35
|
-
const mockData = [
|
|
36
|
-
{
|
|
37
|
-
id: '1',
|
|
38
|
-
label: 'Getting Started',
|
|
39
|
-
link: '/docs/getting-started',
|
|
40
|
-
active: true,
|
|
41
|
-
children: [
|
|
42
|
-
{
|
|
43
|
-
id: '1-1',
|
|
44
|
-
label: 'Installation',
|
|
45
|
-
link: '/docs/getting-started/installation',
|
|
46
|
-
active: false,
|
|
47
|
-
children: [],
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
id: '1-2',
|
|
51
|
-
label: 'Configuration',
|
|
52
|
-
link: '/docs/getting-started/configuration',
|
|
53
|
-
active: false,
|
|
54
|
-
children: [],
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
id: '2',
|
|
60
|
-
label: 'Components',
|
|
61
|
-
link: '/docs/components',
|
|
62
|
-
active: false,
|
|
63
|
-
children: [
|
|
64
|
-
{
|
|
65
|
-
id: '2-1',
|
|
66
|
-
label: 'Sidebar',
|
|
67
|
-
link: '/docs/components/sidebar',
|
|
68
|
-
active: false,
|
|
69
|
-
children: [],
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
id: '2-2',
|
|
73
|
-
label: 'Navbar',
|
|
74
|
-
link: '/docs/components/navbar',
|
|
75
|
-
active: false,
|
|
76
|
-
children: [],
|
|
77
|
-
},
|
|
78
|
-
],
|
|
79
|
-
},
|
|
80
|
-
];
|
|
81
|
-
|
|
82
|
-
export const Default: Story = {
|
|
83
|
-
args: {
|
|
84
|
-
data: mockData,
|
|
85
|
-
loading: false,
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
export const Loading: Story = {
|
|
90
|
-
args: {
|
|
91
|
-
data: [],
|
|
92
|
-
loading: true,
|
|
93
|
-
},
|
|
94
|
-
};
|