Skip to content

Commit 0b8fa4a

Browse files
onlyexeptionMarina-L-Stoyanovakdinev
authored
feat: add missing igr-ts templates (#1796)
* feat: add missing igr-ts templates * feat: enhance chat component styles and add range slider tests and style * feat: add IgrSplitter and IgrThemeProvider components with styles and tests * feat: update control group for IgrChatTemplate to 'Interactions' --------- Co-authored-by: mstoyanova <mstoyanova@infragistics.com> Co-authored-by: Konstantin Dinev <kdinev@bellumgens.com>
1 parent 52bb6b9 commit 0b8fa4a

100 files changed

Lines changed: 1442 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { beforeAll, expect, test } from 'vitest';
2+
import { render } from '@testing-library/react';
3+
import $(ClassName) from './$(path)';
4+
import { setupTestMocks } from '../../setupTests';
5+
6+
beforeAll(() => {
7+
setupTestMocks();
8+
})
9+
10+
test('renders $(ClassName) component', () => {
11+
const wrapper = render(<$(ClassName) />);
12+
expect(wrapper).toBeTruthy();
13+
});
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import style from './style.module.css';
2+
import { IgrCarousel, IgrCarouselSlide } from 'igniteui-react';
3+
import 'igniteui-webcomponents/themes/light/bootstrap.css';
4+
5+
export default function $(ClassName)() {
6+
return (
7+
<div>
8+
<h1 className={style.title}>Carousel</h1>
9+
<div className={style.container}>
10+
<IgrCarousel>
11+
<IgrCarouselSlide active={true}>
12+
<h2>London</h2>
13+
<p>The capital of the United Kingdom, known for its history and landmarks.</p>
14+
</IgrCarouselSlide>
15+
<IgrCarouselSlide>
16+
<h2>Paris</h2>
17+
<p>The capital of France, famous for the Eiffel Tower and its museums.</p>
18+
</IgrCarouselSlide>
19+
<IgrCarouselSlide>
20+
<h2>Tokyo</h2>
21+
<p>The capital of Japan, a bustling metropolis blending tradition and technology.</p>
22+
</IgrCarouselSlide>
23+
</IgrCarousel>
24+
</div>
25+
</div>
26+
);
27+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
:local(.container) {
2+
padding-top: 24px;
3+
display: flex;
4+
flex-flow: row;
5+
justify-content: space-around;
6+
}
7+
:local(.title) {
8+
color: rgb(0, 153, 255);
9+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { IgniteUIForReactTemplate } from "../../../../../lib/templates/IgniteUIForReactTemplate";
2+
import { IGNITEUI_REACT_PACKAGE } from "../../constants";
3+
4+
class IgrCarouselTemplate extends IgniteUIForReactTemplate {
5+
constructor() {
6+
super(__dirname);
7+
this.components = ["Carousel"];
8+
this.controlGroup = "Layouts";
9+
this.listInComponentTemplates = true;
10+
this.id = "carousel";
11+
this.projectType = "igr-ts";
12+
this.name = "Carousel";
13+
this.description = "basic IgrCarousel";
14+
this.packages = [IGNITEUI_REACT_PACKAGE];
15+
}
16+
}
17+
module.exports = new IgrCarouselTemplate();
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { BaseComponent } from "@igniteui/cli-core";
2+
3+
class IgrCarouselComponent extends BaseComponent {
4+
constructor() {
5+
super(__dirname);
6+
this.name = "Carousel";
7+
this.group = "Layouts";
8+
this.description = `presents a set of slides by sequentially displaying one at a time`;
9+
}
10+
}
11+
module.exports = new IgrCarouselComponent();
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { beforeAll, expect, test } from 'vitest';
2+
import { render } from '@testing-library/react';
3+
import $(ClassName) from './$(path)';
4+
import { setupTestMocks } from '../../setupTests';
5+
6+
beforeAll(() => {
7+
setupTestMocks();
8+
})
9+
10+
test('renders $(ClassName) component', () => {
11+
const wrapper = render(<$(ClassName) />);
12+
expect(wrapper).toBeTruthy();
13+
});
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import style from './style.module.css';
2+
import { IgrChat } from 'igniteui-react';
3+
import 'igniteui-webcomponents/themes/light/bootstrap.css';
4+
5+
const messages = [
6+
{ id: '1', text: 'Hi! How can I help you today?', sender: 'assistant', timestamp: new Date().toISOString() },
7+
{ id: '2', text: 'Can you show me the Ignite UI for React chat component?', sender: 'user', timestamp: new Date().toISOString() },
8+
{ id: '3', text: 'Absolutely — this is it!', sender: 'assistant', timestamp: new Date().toISOString() },
9+
];
10+
11+
export default function $(ClassName)() {
12+
return (
13+
<div className={style.page}>
14+
<h1 className={style.title}>Chat</h1>
15+
<div className={style.container}>
16+
<IgrChat messages={messages} options={{ currentUserId: 'user' }} />
17+
</div>
18+
</div>
19+
);
20+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
:local(.page) {
2+
flex: 1 1 auto;
3+
width: 100%;
4+
max-width: 960px;
5+
margin: 0 auto;
6+
padding: 32px 24px 40px;
7+
box-sizing: border-box;
8+
}
9+
:local(.container) {
10+
width: 100%;
11+
}
12+
:local(.container) :global(igc-chat) {
13+
display: block;
14+
width: min(100%, 720px);
15+
height: 560px;
16+
margin: 0 auto;
17+
}
18+
:local(.title) {
19+
margin: 0 0 20px;
20+
color: rgb(0, 153, 255);
21+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { IgniteUIForReactTemplate } from "../../../../../lib/templates/IgniteUIForReactTemplate";
2+
import { IGNITEUI_REACT_PACKAGE } from "../../constants";
3+
4+
class IgrChatTemplate extends IgniteUIForReactTemplate {
5+
constructor() {
6+
super(__dirname);
7+
this.components = ["Chat"];
8+
this.controlGroup = "Interactions";
9+
this.listInComponentTemplates = true;
10+
this.id = "chat";
11+
this.projectType = "igr-ts";
12+
this.name = "Chat";
13+
this.description = "basic IgrChat";
14+
this.packages = [IGNITEUI_REACT_PACKAGE];
15+
}
16+
}
17+
module.exports = new IgrChatTemplate();
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { BaseComponent } from "@igniteui/cli-core";
2+
3+
class IgrChatComponent extends BaseComponent {
4+
constructor() {
5+
super(__dirname);
6+
this.name = "Chat";
7+
this.group = "Data Entry & Display";
8+
this.description = `a chat UI component for displaying messages, attachments and input interaction`;
9+
}
10+
}
11+
module.exports = new IgrChatComponent();

0 commit comments

Comments
 (0)