@c-rex/components 0.0.2 → 0.0.3
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/README.md +74 -0
- package/dist/components/src/result-list.d.ts.map +1 -1
- package/dist/components/src/result-list.js +2 -3
- package/dist/components/src/result-view/blog-view.stories.d.ts +7 -0
- package/dist/components/src/result-view/blog-view.stories.d.ts.map +1 -0
- package/dist/components/src/result-view/blog-view.stories.js +58 -0
- package/dist/components/src/result-view/table-view.stories.d.ts +7 -0
- package/dist/components/src/result-view/table-view.stories.d.ts.map +1 -0
- package/dist/components/src/result-view/table-view.stories.js +55 -0
- package/dist/components/src/stories/blog-card.stories.d.ts +7 -0
- package/dist/components/src/stories/blog-card.stories.d.ts.map +1 -0
- package/dist/components/src/stories/blog-card.stories.js +42 -0
- package/dist/components/src/stories/blur-image.stories.d.ts +32 -0
- package/dist/components/src/stories/blur-image.stories.d.ts.map +1 -0
- package/dist/components/src/stories/blur-image.stories.js +47 -0
- package/dist/components/src/stories/breadcrumb.stories.d.ts +7 -0
- package/dist/components/src/stories/breadcrumb.stories.d.ts.map +1 -0
- package/dist/components/src/stories/breadcrumb.stories.js +48 -0
- package/dist/components/src/stories/empty.stories.d.ts +10 -0
- package/dist/components/src/stories/empty.stories.d.ts.map +1 -0
- package/dist/components/src/stories/empty.stories.js +11 -0
- package/dist/components/src/stories/navbar.stories.d.ts +6 -0
- package/dist/components/src/stories/navbar.stories.d.ts.map +1 -0
- package/dist/components/src/stories/navbar.stories.js +14 -0
- package/dist/components/src/stories/sidebar.stories.d.ts +24 -0
- package/dist/components/src/stories/sidebar.stories.d.ts.map +1 -0
- package/dist/components/src/stories/sidebar.stories.js +80 -0
- package/dist/components/tailwind.config.d.ts +2 -0
- package/dist/components/tailwind.config.d.ts.map +1 -0
- package/dist/components/tailwind.config.js +15 -0
- package/dist/config/src/index.d.ts +4 -0
- package/dist/config/src/index.d.ts.map +1 -0
- package/dist/config/src/index.js +67 -0
- package/package.json +32 -7
package/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# C-Rex Components
|
|
2
|
+
|
|
3
|
+
A collection of reusable React components built on top of @c-rex/ui for the C-Rex application.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Pre-built components following C-Rex design system
|
|
8
|
+
- Built with TypeScript for type safety
|
|
9
|
+
- Fully customizable and extensible
|
|
10
|
+
- Integration with C-Rex services and utilities
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
This package is part of the C-Rex monorepo and comes pre-installed. If you need to install it separately:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @c-rex/components
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Available Components
|
|
21
|
+
|
|
22
|
+
### AppSidebar
|
|
23
|
+
A navigation sidebar component that supports:
|
|
24
|
+
- Nested menu items
|
|
25
|
+
- Loading states with skeletons
|
|
26
|
+
- Active state indicators
|
|
27
|
+
- Collapsible functionality
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import { AppSidebar } from '@c-rex/components';
|
|
31
|
+
|
|
32
|
+
<AppSidebar
|
|
33
|
+
data={treeData}
|
|
34
|
+
loading={false}
|
|
35
|
+
/>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Development
|
|
39
|
+
|
|
40
|
+
### Prerequisites
|
|
41
|
+
- Node.js 18 or higher
|
|
42
|
+
- Access to @c-rex/ui package
|
|
43
|
+
- Access to @c-rex/interfaces package
|
|
44
|
+
|
|
45
|
+
### Testing
|
|
46
|
+
```bash
|
|
47
|
+
npm run test
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Storybook
|
|
51
|
+
View and interact with components in isolation:
|
|
52
|
+
```bash
|
|
53
|
+
npm run storybook
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Contributing
|
|
57
|
+
|
|
58
|
+
1. Components should be built using @c-rex/ui as the foundation
|
|
59
|
+
2. Include TypeScript types
|
|
60
|
+
3. Add Storybook stories for new components
|
|
61
|
+
4. Write unit tests for component logic
|
|
62
|
+
5. Follow the existing component patterns
|
|
63
|
+
|
|
64
|
+
## Dependencies
|
|
65
|
+
|
|
66
|
+
- @c-rex/ui: Base UI components
|
|
67
|
+
- @c-rex/interfaces: Type definitions
|
|
68
|
+
- @c-rex/services: API services
|
|
69
|
+
- React 18+
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
Internal use only - C-Rex.net
|
|
74
|
+
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result-list.d.ts","sourceRoot":"","sources":["../../../src/result-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"result-list.d.ts","sourceRoot":"","sources":["../../../src/result-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAQ1D,UAAU,eAAe;IACrB,KAAK,EAAE,qBAAqB,EAAE,CAAC;CAClC;AAED,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAE1C,CAAC"}
|
|
@@ -6,11 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.ResultList = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const empty_1 = require("./empty");
|
|
9
|
-
const table_1 = __importDefault(require("./result-view/table"));
|
|
10
9
|
//import { CUSTOMER_CONFIG } from '@/config/customerConfig';
|
|
11
10
|
//import { RESULT_VIEW_OPTIONS } from '@/constants/components';
|
|
12
|
-
|
|
13
|
-
const ViewComponent =
|
|
11
|
+
const blog_1 = __importDefault(require("./result-view/blog"));
|
|
12
|
+
const ViewComponent = blog_1.default;
|
|
14
13
|
const ResultList = ({ items }) => {
|
|
15
14
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: items.length == 0 ? (0, jsx_runtime_1.jsx)(empty_1.Empty, {}) : (0, jsx_runtime_1.jsx)(ViewComponent, { items: items }) });
|
|
16
15
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import BlogView from '../result-view/blog';
|
|
3
|
+
declare const meta: Meta<typeof BlogView>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof BlogView>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
//# sourceMappingURL=blog-view.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blog-view.stories.d.ts","sourceRoot":"","sources":["../../../../src/result-view/blog-view.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAE3C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,QAAQ,CAO/B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,QAAQ,CAAC,CAAC;AAwCvC,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Default = void 0;
|
|
7
|
+
const blog_1 = __importDefault(require("../result-view/blog"));
|
|
8
|
+
const meta = {
|
|
9
|
+
title: 'Components/ResultView/Blog',
|
|
10
|
+
component: blog_1.default,
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: 'centered',
|
|
13
|
+
},
|
|
14
|
+
tags: ['autodocs'],
|
|
15
|
+
};
|
|
16
|
+
exports.default = meta;
|
|
17
|
+
const mockItems = [
|
|
18
|
+
{
|
|
19
|
+
id: '1',
|
|
20
|
+
shortId: 'doc-1',
|
|
21
|
+
labels: [
|
|
22
|
+
{ value: 'Getting Started with C-Rex', language: 'en-US' },
|
|
23
|
+
{ value: 'Começando com C-Rex', language: 'pt-BR' }
|
|
24
|
+
],
|
|
25
|
+
languages: ['pt-BR'],
|
|
26
|
+
type: 'document',
|
|
27
|
+
renditions: [],
|
|
28
|
+
directoryNodes: []
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: '2',
|
|
32
|
+
shortId: 'doc-2',
|
|
33
|
+
labels: [
|
|
34
|
+
{ value: 'Advanced Configuration Guide', language: 'en-US' }
|
|
35
|
+
],
|
|
36
|
+
languages: ['en-US'],
|
|
37
|
+
type: 'document',
|
|
38
|
+
renditions: [],
|
|
39
|
+
directoryNodes: []
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: '3',
|
|
43
|
+
shortId: 'doc-3',
|
|
44
|
+
labels: [
|
|
45
|
+
{ value: 'API Documentation', language: 'en-US' },
|
|
46
|
+
{ value: 'Documentation API', language: 'fr-FR' }
|
|
47
|
+
],
|
|
48
|
+
languages: ['fr-FR'],
|
|
49
|
+
type: 'document',
|
|
50
|
+
renditions: [],
|
|
51
|
+
directoryNodes: []
|
|
52
|
+
}
|
|
53
|
+
];
|
|
54
|
+
exports.Default = {
|
|
55
|
+
args: {
|
|
56
|
+
items: mockItems
|
|
57
|
+
}
|
|
58
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import TableView from '../result-view/table';
|
|
3
|
+
declare const meta: Meta<typeof TableView>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof TableView>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
//# sourceMappingURL=table-view.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-view.stories.d.ts","sourceRoot":"","sources":["../../../../src/result-view/table-view.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,SAAS,MAAM,sBAAsB,CAAC;AAE7C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAOhC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAC;AAqCxC,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Default = void 0;
|
|
7
|
+
const table_1 = __importDefault(require("../result-view/table"));
|
|
8
|
+
const meta = {
|
|
9
|
+
title: 'Components/ResultView/Table',
|
|
10
|
+
component: table_1.default,
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: 'centered',
|
|
13
|
+
},
|
|
14
|
+
tags: ['autodocs'],
|
|
15
|
+
};
|
|
16
|
+
exports.default = meta;
|
|
17
|
+
const mockItems = [
|
|
18
|
+
{
|
|
19
|
+
id: '1',
|
|
20
|
+
labels: [
|
|
21
|
+
{ value: 'Installation Guide', language: 'en-US' },
|
|
22
|
+
{ value: 'Guide d\'installation', language: 'fr-FR' }
|
|
23
|
+
],
|
|
24
|
+
languages: ['fr-FR'],
|
|
25
|
+
type: 'document',
|
|
26
|
+
renditions: [],
|
|
27
|
+
directoryNodes: []
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: '2',
|
|
31
|
+
labels: [
|
|
32
|
+
{ value: 'User Manual', language: 'en-US' },
|
|
33
|
+
{ value: 'Manual del Usuario', language: 'es-ES' }
|
|
34
|
+
],
|
|
35
|
+
languages: ['es-ES'],
|
|
36
|
+
type: 'document',
|
|
37
|
+
renditions: [],
|
|
38
|
+
directoryNodes: []
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: '3',
|
|
42
|
+
labels: [
|
|
43
|
+
{ value: 'Technical Specifications', language: 'en-US' }
|
|
44
|
+
],
|
|
45
|
+
languages: ['en-US'],
|
|
46
|
+
type: 'document',
|
|
47
|
+
renditions: [],
|
|
48
|
+
directoryNodes: []
|
|
49
|
+
}
|
|
50
|
+
];
|
|
51
|
+
exports.Default = {
|
|
52
|
+
args: {
|
|
53
|
+
items: mockItems
|
|
54
|
+
}
|
|
55
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: Meta;
|
|
3
|
+
export default meta;
|
|
4
|
+
type Story = StoryObj<typeof meta>;
|
|
5
|
+
export declare const Horizontal: Story;
|
|
6
|
+
export declare const WithPriority: Story;
|
|
7
|
+
//# sourceMappingURL=blog-card.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blog-card.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/blog-card.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD,QAAA,MAAM,IAAI,EAAE,IAYqB,CAAC;AAElC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAanC,eAAO,MAAM,UAAU,EAAE,KAMxB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAM1B,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WithPriority = exports.Horizontal = void 0;
|
|
4
|
+
const blog_card_1 = require("../blog-card");
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Components/BlogCard',
|
|
7
|
+
component: blog_card_1.BlogCard,
|
|
8
|
+
tags: ['autodocs',],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered',
|
|
11
|
+
},
|
|
12
|
+
argTypes: {
|
|
13
|
+
data: { control: 'object', description: 'The data to be displayed in the card' },
|
|
14
|
+
priority: { control: 'boolean', description: 'Whether the image should be prioritized', type: 'boolean' },
|
|
15
|
+
horizontal: { control: 'boolean' },
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
exports.default = meta;
|
|
19
|
+
const mockBlogData = {
|
|
20
|
+
title: 'Getting Started with C-Rex Components',
|
|
21
|
+
blurDataURL: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==',
|
|
22
|
+
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',
|
|
23
|
+
description: 'Learn how to use C-Rex components to build modern web applications with React and Next.js.',
|
|
24
|
+
authors: 'John Doe',
|
|
25
|
+
_id: '1',
|
|
26
|
+
date: '2023-05-15',
|
|
27
|
+
slug: 'getting-started-with-c-rex-components',
|
|
28
|
+
};
|
|
29
|
+
exports.Horizontal = {
|
|
30
|
+
args: {
|
|
31
|
+
data: mockBlogData,
|
|
32
|
+
priority: false,
|
|
33
|
+
horizontal: true,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
exports.WithPriority = {
|
|
37
|
+
args: {
|
|
38
|
+
data: mockBlogData,
|
|
39
|
+
priority: true,
|
|
40
|
+
horizontal: false,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: (props: import("react").ComponentProps<typeof import("next/image").default>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
tags: string[];
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
argTypes: {
|
|
10
|
+
src: {
|
|
11
|
+
control: "text";
|
|
12
|
+
};
|
|
13
|
+
alt: {
|
|
14
|
+
control: "text";
|
|
15
|
+
};
|
|
16
|
+
width: {
|
|
17
|
+
control: "number";
|
|
18
|
+
};
|
|
19
|
+
height: {
|
|
20
|
+
control: "number";
|
|
21
|
+
};
|
|
22
|
+
className: {
|
|
23
|
+
control: "text";
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export default meta;
|
|
28
|
+
type Story = StoryObj<typeof meta>;
|
|
29
|
+
export declare const Default: Story;
|
|
30
|
+
export declare const SmallImage: Story;
|
|
31
|
+
export declare const RoundedImage: Story;
|
|
32
|
+
//# sourceMappingURL=blur-image.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blur-image.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/blur-image.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;CAcwB,CAAC;AAEnC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAQxB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAQ1B,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RoundedImage = exports.SmallImage = exports.Default = void 0;
|
|
4
|
+
const blur_image_1 = require("../blur-image");
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Components/BlurImage',
|
|
7
|
+
component: blur_image_1.BlurImage,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered',
|
|
11
|
+
},
|
|
12
|
+
argTypes: {
|
|
13
|
+
src: { control: 'text' },
|
|
14
|
+
alt: { control: 'text' },
|
|
15
|
+
width: { control: 'number' },
|
|
16
|
+
height: { control: 'number' },
|
|
17
|
+
className: { control: 'text' },
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
exports.default = meta;
|
|
21
|
+
exports.Default = {
|
|
22
|
+
args: {
|
|
23
|
+
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',
|
|
24
|
+
alt: 'Sample image with blur effect',
|
|
25
|
+
width: 400,
|
|
26
|
+
height: 300,
|
|
27
|
+
className: 'rounded-lg',
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
exports.SmallImage = {
|
|
31
|
+
args: {
|
|
32
|
+
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',
|
|
33
|
+
alt: 'Small sample image with blur effect',
|
|
34
|
+
width: 200,
|
|
35
|
+
height: 150,
|
|
36
|
+
className: 'rounded-lg',
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
exports.RoundedImage = {
|
|
40
|
+
args: {
|
|
41
|
+
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',
|
|
42
|
+
alt: 'Rounded sample image with blur effect',
|
|
43
|
+
width: 300,
|
|
44
|
+
height: 300,
|
|
45
|
+
className: 'rounded-full',
|
|
46
|
+
},
|
|
47
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: Meta;
|
|
3
|
+
export default meta;
|
|
4
|
+
type Story = StoryObj<typeof meta>;
|
|
5
|
+
export declare const Default: Story;
|
|
6
|
+
export declare const Loading: Story;
|
|
7
|
+
//# sourceMappingURL=breadcrumb.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumb.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/breadcrumb.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD,QAAA,MAAM,IAAI,EAAE,IAOI,CAAC;AAEjB,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA0BnC,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Loading = exports.Default = void 0;
|
|
4
|
+
const breadcrumb_1 = require("../breadcrumb");
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Components/Breadcrumb',
|
|
7
|
+
component: breadcrumb_1.Breadcrumb,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered',
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
exports.default = meta;
|
|
14
|
+
const mockItems = [
|
|
15
|
+
{
|
|
16
|
+
id: 'docs',
|
|
17
|
+
label: 'Documentation',
|
|
18
|
+
link: '/docs',
|
|
19
|
+
active: false,
|
|
20
|
+
children: [],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 'components',
|
|
24
|
+
label: 'Components',
|
|
25
|
+
link: '/docs/components',
|
|
26
|
+
active: false,
|
|
27
|
+
children: [],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: 'breadcrumb',
|
|
31
|
+
label: 'Breadcrumb',
|
|
32
|
+
link: '/docs/components/breadcrumb',
|
|
33
|
+
active: true,
|
|
34
|
+
children: [],
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
exports.Default = {
|
|
38
|
+
args: {
|
|
39
|
+
items: mockItems,
|
|
40
|
+
loading: false,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
exports.Loading = {
|
|
44
|
+
args: {
|
|
45
|
+
items: [],
|
|
46
|
+
loading: true,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("react").FC;
|
|
5
|
+
tags: string[];
|
|
6
|
+
};
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<typeof meta>;
|
|
9
|
+
export declare const Default: Story;
|
|
10
|
+
//# sourceMappingURL=empty.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/empty.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD,QAAA,MAAM,IAAI;;;;CAIoB,CAAC;AAE/B,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KACrB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Default = void 0;
|
|
4
|
+
const empty_1 = require("../empty");
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Components/Empty',
|
|
7
|
+
component: empty_1.Empty,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
};
|
|
10
|
+
exports.default = meta;
|
|
11
|
+
exports.Default = {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navbar.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/navbar.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD,QAAA,MAAM,IAAI,EAAE,IAOmB,CAAC;AAEhC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Default = void 0;
|
|
4
|
+
const navbar_1 = require("../navbar");
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Components/NavBar',
|
|
7
|
+
component: navbar_1.NavBar,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'padded',
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
exports.default = meta;
|
|
14
|
+
exports.Default = {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { AppSidebar } from '../sidebar';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof AppSidebar;
|
|
6
|
+
tags: string[];
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
argTypes: {
|
|
11
|
+
data: {
|
|
12
|
+
control: "object";
|
|
13
|
+
};
|
|
14
|
+
loading: {
|
|
15
|
+
control: "boolean";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
decorators: ((Story: any) => import("react/jsx-runtime").JSX.Element)[];
|
|
19
|
+
};
|
|
20
|
+
export default meta;
|
|
21
|
+
type Story = StoryObj<typeof meta>;
|
|
22
|
+
export declare const Default: Story;
|
|
23
|
+
export declare const Loading: Story;
|
|
24
|
+
//# sourceMappingURL=sidebar.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/sidebar.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxC,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;yBAYM,GAAG;CAagB,CAAC;AAEpC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAiDnC,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Loading = exports.Default = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const sidebar_1 = require("../sidebar");
|
|
6
|
+
const sidebar_2 = require("@c-rex/ui/sidebar");
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Components/Sidebar',
|
|
9
|
+
component: sidebar_1.AppSidebar,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: 'centered',
|
|
13
|
+
},
|
|
14
|
+
argTypes: {
|
|
15
|
+
data: { control: 'object' },
|
|
16
|
+
loading: { control: 'boolean' },
|
|
17
|
+
},
|
|
18
|
+
decorators: [
|
|
19
|
+
(Story) => ((0, jsx_runtime_1.jsxs)(sidebar_2.SidebarProvider, { children: [(0, jsx_runtime_1.jsx)(sidebar_2.SidebarTrigger, {}), (0, jsx_runtime_1.jsx)("div", { className: "flex", children: (0, jsx_runtime_1.jsx)(sidebar_2.SidebarInset, { children: (0, jsx_runtime_1.jsx)(Story, {}) }) })] })),
|
|
20
|
+
]
|
|
21
|
+
};
|
|
22
|
+
exports.default = meta;
|
|
23
|
+
const mockData = [
|
|
24
|
+
{
|
|
25
|
+
id: '1',
|
|
26
|
+
label: 'Getting Started',
|
|
27
|
+
link: '/docs/getting-started',
|
|
28
|
+
active: true,
|
|
29
|
+
children: [
|
|
30
|
+
{
|
|
31
|
+
id: '1-1',
|
|
32
|
+
label: 'Installation',
|
|
33
|
+
link: '/docs/getting-started/installation',
|
|
34
|
+
active: false,
|
|
35
|
+
children: [],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: '1-2',
|
|
39
|
+
label: 'Configuration',
|
|
40
|
+
link: '/docs/getting-started/configuration',
|
|
41
|
+
active: false,
|
|
42
|
+
children: [],
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: '2',
|
|
48
|
+
label: 'Components',
|
|
49
|
+
link: '/docs/components',
|
|
50
|
+
active: false,
|
|
51
|
+
children: [
|
|
52
|
+
{
|
|
53
|
+
id: '2-1',
|
|
54
|
+
label: 'Sidebar',
|
|
55
|
+
link: '/docs/components/sidebar',
|
|
56
|
+
active: false,
|
|
57
|
+
children: [],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: '2-2',
|
|
61
|
+
label: 'Navbar',
|
|
62
|
+
link: '/docs/components/navbar',
|
|
63
|
+
active: false,
|
|
64
|
+
children: [],
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
exports.Default = {
|
|
70
|
+
args: {
|
|
71
|
+
data: mockData,
|
|
72
|
+
loading: false,
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
exports.Loading = {
|
|
76
|
+
args: {
|
|
77
|
+
data: [],
|
|
78
|
+
loading: true,
|
|
79
|
+
},
|
|
80
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tailwind.config.d.ts","sourceRoot":"","sources":["../../tailwind.config.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const config_1 = __importDefault(require("@c-rex/config"));
|
|
7
|
+
module.exports = {
|
|
8
|
+
content: [
|
|
9
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
10
|
+
'./.storybook/**/*.{js,ts,jsx,tsx}',
|
|
11
|
+
'../../packages/ui/src/**/*.{js,ts,jsx,tsx}',
|
|
12
|
+
],
|
|
13
|
+
...config_1.default,
|
|
14
|
+
//safelist: ['animate-pulse'],
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../config/src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,QAAA,MAAM,cAAc,EAAE,IAAI,CAAC,MAAM,EAAE,SAAS,CA+D3C,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tailwindPreset = {
|
|
4
|
+
plugins: [require("tailwindcss-animate")],
|
|
5
|
+
theme: {
|
|
6
|
+
extend: {
|
|
7
|
+
borderRadius: {
|
|
8
|
+
lg: "var(--radius)",
|
|
9
|
+
md: "calc(var(--radius) - 2px)",
|
|
10
|
+
sm: "calc(var(--radius) - 4px)",
|
|
11
|
+
},
|
|
12
|
+
colors: {
|
|
13
|
+
background: "hsl(var(--background))",
|
|
14
|
+
foreground: "hsl(var(--foreground))",
|
|
15
|
+
card: {
|
|
16
|
+
DEFAULT: "hsl(var(--card))",
|
|
17
|
+
foreground: "hsl(var(--card-foreground))",
|
|
18
|
+
},
|
|
19
|
+
popover: {
|
|
20
|
+
DEFAULT: "hsl(var(--popover))",
|
|
21
|
+
foreground: "hsl(var(--popover-foreground))",
|
|
22
|
+
},
|
|
23
|
+
primary: {
|
|
24
|
+
DEFAULT: "hsl(var(--primary))",
|
|
25
|
+
foreground: "hsl(var(--primary-foreground))",
|
|
26
|
+
},
|
|
27
|
+
secondary: {
|
|
28
|
+
DEFAULT: "hsl(var(--secondary))",
|
|
29
|
+
foreground: "hsl(var(--secondary-foreground))",
|
|
30
|
+
},
|
|
31
|
+
muted: {
|
|
32
|
+
DEFAULT: "hsl(var(--muted))",
|
|
33
|
+
foreground: "hsl(var(--muted-foreground))",
|
|
34
|
+
},
|
|
35
|
+
accent: {
|
|
36
|
+
DEFAULT: "hsl(var(--accent))",
|
|
37
|
+
foreground: "hsl(var(--accent-foreground))",
|
|
38
|
+
},
|
|
39
|
+
destructive: {
|
|
40
|
+
DEFAULT: "hsl(var(--destructive))",
|
|
41
|
+
foreground: "hsl(var(--destructive-foreground))",
|
|
42
|
+
},
|
|
43
|
+
border: "hsl(var(--border))",
|
|
44
|
+
input: "hsl(var(--input))",
|
|
45
|
+
ring: "hsl(var(--ring))",
|
|
46
|
+
chart: {
|
|
47
|
+
"1": "hsl(var(--chart-1))",
|
|
48
|
+
"2": "hsl(var(--chart-2))",
|
|
49
|
+
"3": "hsl(var(--chart-3))",
|
|
50
|
+
"4": "hsl(var(--chart-4))",
|
|
51
|
+
"5": "hsl(var(--chart-5))",
|
|
52
|
+
},
|
|
53
|
+
sidebar: {
|
|
54
|
+
DEFAULT: "hsl(var(--sidebar-background))",
|
|
55
|
+
foreground: "hsl(var(--sidebar-foreground))",
|
|
56
|
+
primary: "hsl(var(--sidebar-primary))",
|
|
57
|
+
"primary-foreground": "hsl(var(--sidebar-primary-foreground))",
|
|
58
|
+
accent: "hsl(var(--sidebar-accent))",
|
|
59
|
+
"accent-foreground": "hsl(var(--sidebar-accent-foreground))",
|
|
60
|
+
border: "hsl(var(--sidebar-border))",
|
|
61
|
+
ring: "hsl(var(--sidebar-ring))",
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
exports.default = tailwindPreset;
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c-rex/components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
7
10
|
"exports": {
|
|
8
11
|
"./autocomplete": {
|
|
9
12
|
"types": "./src/autocomplete.tsx",
|
|
@@ -53,26 +56,48 @@
|
|
|
53
56
|
},
|
|
54
57
|
"scripts": {
|
|
55
58
|
"dev": "tsc --watch",
|
|
56
|
-
"build": "tsc"
|
|
59
|
+
"build": "tsc",
|
|
60
|
+
"storybook": "storybook dev -p 6006",
|
|
61
|
+
"build-storybook": "storybook build"
|
|
57
62
|
},
|
|
58
63
|
"devDependencies": {
|
|
59
64
|
"@c-rex/eslint-config": "*",
|
|
60
65
|
"@c-rex/typescript-config": "*",
|
|
66
|
+
"@chromatic-com/storybook": "^3.2.6",
|
|
67
|
+
"@storybook/addon-essentials": "^8.6.12",
|
|
68
|
+
"@storybook/addon-onboarding": "^8.6.12",
|
|
69
|
+
"@storybook/blocks": "^8.6.12",
|
|
70
|
+
"@storybook/nextjs": "^8.6.12",
|
|
71
|
+
"@storybook/react": "^8.6.12",
|
|
72
|
+
"@storybook/test": "^8.6.12",
|
|
61
73
|
"@turbo/gen": "^2.4.4",
|
|
62
74
|
"@types/node": "^22.13.10",
|
|
63
75
|
"@types/react": "19.0.10",
|
|
64
76
|
"@types/react-dom": "19.0.4",
|
|
77
|
+
"autoprefixer": "^10.4.21",
|
|
65
78
|
"eslint": "^9.23.0",
|
|
79
|
+
"eslint-plugin-storybook": "^0.12.0",
|
|
80
|
+
"postcss": "^8.5.3",
|
|
81
|
+
"storybook": "^8.6.12",
|
|
82
|
+
"style-loader": "^4.0.0",
|
|
83
|
+
"tailwindcss": "^3.4.17",
|
|
66
84
|
"typescript": "latest"
|
|
67
85
|
},
|
|
68
86
|
"dependencies": {
|
|
87
|
+
"@c-rex/contexts": "*",
|
|
88
|
+
"@c-rex/interfaces": "*",
|
|
89
|
+
"@c-rex/services": "*",
|
|
90
|
+
"@c-rex/ui": "*",
|
|
91
|
+
"@c-rex/utils": "*",
|
|
92
|
+
"@c-rex/config": "*",
|
|
69
93
|
"next": "^14",
|
|
70
94
|
"react": "^18",
|
|
71
95
|
"react-dom": "^18",
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
"
|
|
76
|
-
|
|
96
|
+
"tailwindcss-animate": "^1.0.7"
|
|
97
|
+
},
|
|
98
|
+
"eslintConfig": {
|
|
99
|
+
"extends": [
|
|
100
|
+
"plugin:storybook/recommended"
|
|
101
|
+
]
|
|
77
102
|
}
|
|
78
103
|
}
|